[FREETYPE]
authorAmine Khaldi <amine.khaldi@reactos.org>
Thu, 19 Sep 2013 23:11:29 +0000 (23:11 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Thu, 19 Sep 2013 23:11:29 +0000 (23:11 +0000)
* Sync to 2.5.0. Brought to you by zehnvor.
[FTFD]
* Add version information to build.

svn path=/trunk/; revision=60227

383 files changed:
reactos/lib/3rdparty/freetype/CMakeLists.txt
reactos/lib/3rdparty/freetype/ChangeLog
reactos/lib/3rdparty/freetype/ChangeLog.20 [deleted file]
reactos/lib/3rdparty/freetype/ChangeLog.21 [deleted file]
reactos/lib/3rdparty/freetype/ChangeLog.22 [deleted file]
reactos/lib/3rdparty/freetype/ChangeLog.23 [deleted file]
reactos/lib/3rdparty/freetype/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/Jamrules [deleted file]
reactos/lib/3rdparty/freetype/Makefile [deleted file]
reactos/lib/3rdparty/freetype/README
reactos/lib/3rdparty/freetype/README.ROS [deleted file]
reactos/lib/3rdparty/freetype/README.git [deleted file]
reactos/lib/3rdparty/freetype/autogen.sh
reactos/lib/3rdparty/freetype/configure
reactos/lib/3rdparty/freetype/devel/ftoption.h [deleted file]
reactos/lib/3rdparty/freetype/freetype.rc
reactos/lib/3rdparty/freetype/include/freetype/config/ftconfig.h
reactos/lib/3rdparty/freetype/include/freetype/config/ftheader.h
reactos/lib/3rdparty/freetype/include/freetype/config/ftoption.h
reactos/lib/3rdparty/freetype/include/freetype/config/ftstdlib.h
reactos/lib/3rdparty/freetype/include/freetype/freetype.h
reactos/lib/3rdparty/freetype/include/freetype/ftadvanc.h
reactos/lib/3rdparty/freetype/include/freetype/ftautoh.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/include/freetype/ftbbox.h
reactos/lib/3rdparty/freetype/include/freetype/ftbitmap.h
reactos/lib/3rdparty/freetype/include/freetype/ftbzip2.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/include/freetype/ftcache.h
reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/include/freetype/ftchapters.h
reactos/lib/3rdparty/freetype/include/freetype/fterrdef.h
reactos/lib/3rdparty/freetype/include/freetype/fterrors.h
reactos/lib/3rdparty/freetype/include/freetype/ftgasp.h
reactos/lib/3rdparty/freetype/include/freetype/ftglyph.h
reactos/lib/3rdparty/freetype/include/freetype/ftimage.h
reactos/lib/3rdparty/freetype/include/freetype/ftlcdfil.h
reactos/lib/3rdparty/freetype/include/freetype/ftmodapi.h
reactos/lib/3rdparty/freetype/include/freetype/ftmoderr.h
reactos/lib/3rdparty/freetype/include/freetype/ftoutln.h
reactos/lib/3rdparty/freetype/include/freetype/ftrender.h
reactos/lib/3rdparty/freetype/include/freetype/ftstroke.h
reactos/lib/3rdparty/freetype/include/freetype/ftsynth.h
reactos/lib/3rdparty/freetype/include/freetype/fttrigon.h
reactos/lib/3rdparty/freetype/include/freetype/ftttdrv.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/include/freetype/fttypes.h
reactos/lib/3rdparty/freetype/include/freetype/internal/autohint.h
reactos/lib/3rdparty/freetype/include/freetype/internal/ftcalc.h
reactos/lib/3rdparty/freetype/include/freetype/internal/ftdebug.h
reactos/lib/3rdparty/freetype/include/freetype/internal/ftdriver.h
reactos/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h
reactos/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h
reactos/lib/3rdparty/freetype/include/freetype/internal/ftpic.h
reactos/lib/3rdparty/freetype/include/freetype/internal/ftrfork.h
reactos/lib/3rdparty/freetype/include/freetype/internal/ftserv.h
reactos/lib/3rdparty/freetype/include/freetype/internal/ftstream.h
reactos/lib/3rdparty/freetype/include/freetype/internal/fttrace.h
reactos/lib/3rdparty/freetype/include/freetype/internal/ftvalid.h
reactos/lib/3rdparty/freetype/include/freetype/internal/internal.h
reactos/lib/3rdparty/freetype/include/freetype/internal/pcftypes.h [deleted file]
reactos/lib/3rdparty/freetype/include/freetype/internal/psaux.h
reactos/lib/3rdparty/freetype/include/freetype/internal/pshints.h
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svbdf.h
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svcid.h
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svgldict.h
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svmm.h
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpostnm.h
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svprop.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpscmap.h
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svsfnt.h
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svttcmap.h
reactos/lib/3rdparty/freetype/include/freetype/internal/services/svttglyf.h
reactos/lib/3rdparty/freetype/include/freetype/internal/sfnt.h
reactos/lib/3rdparty/freetype/include/freetype/internal/t1types.h
reactos/lib/3rdparty/freetype/include/freetype/internal/tttypes.h
reactos/lib/3rdparty/freetype/include/freetype/t1tables.h
reactos/lib/3rdparty/freetype/include/freetype/ttnameid.h
reactos/lib/3rdparty/freetype/include/freetype/tttables.h
reactos/lib/3rdparty/freetype/include/freetype/tttags.h
reactos/lib/3rdparty/freetype/modules.cfg
reactos/lib/3rdparty/freetype/objs/README [deleted file]
reactos/lib/3rdparty/freetype/src/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/autofit/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/autofit/afangles.c
reactos/lib/3rdparty/freetype/src/autofit/afcjk.c
reactos/lib/3rdparty/freetype/src/autofit/afcjk.h
reactos/lib/3rdparty/freetype/src/autofit/afdummy.c
reactos/lib/3rdparty/freetype/src/autofit/afdummy.h
reactos/lib/3rdparty/freetype/src/autofit/aferrors.h
reactos/lib/3rdparty/freetype/src/autofit/afglobal.c
reactos/lib/3rdparty/freetype/src/autofit/afglobal.h
reactos/lib/3rdparty/freetype/src/autofit/afhints.c
reactos/lib/3rdparty/freetype/src/autofit/afhints.h
reactos/lib/3rdparty/freetype/src/autofit/afindic.c
reactos/lib/3rdparty/freetype/src/autofit/afindic.h
reactos/lib/3rdparty/freetype/src/autofit/aflatin.c
reactos/lib/3rdparty/freetype/src/autofit/aflatin.h
reactos/lib/3rdparty/freetype/src/autofit/aflatin2.c
reactos/lib/3rdparty/freetype/src/autofit/aflatin2.h
reactos/lib/3rdparty/freetype/src/autofit/afloader.c
reactos/lib/3rdparty/freetype/src/autofit/afloader.h
reactos/lib/3rdparty/freetype/src/autofit/afmodule.c
reactos/lib/3rdparty/freetype/src/autofit/afmodule.h
reactos/lib/3rdparty/freetype/src/autofit/afpic.c
reactos/lib/3rdparty/freetype/src/autofit/afpic.h
reactos/lib/3rdparty/freetype/src/autofit/aftypes.h
reactos/lib/3rdparty/freetype/src/autofit/afwarp.c
reactos/lib/3rdparty/freetype/src/autofit/autofit.c
reactos/lib/3rdparty/freetype/src/autofit/rules.mk
reactos/lib/3rdparty/freetype/src/base/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/base/basepic.c
reactos/lib/3rdparty/freetype/src/base/basepic.h
reactos/lib/3rdparty/freetype/src/base/ftadvanc.c
reactos/lib/3rdparty/freetype/src/base/ftbase.c
reactos/lib/3rdparty/freetype/src/base/ftbase.h
reactos/lib/3rdparty/freetype/src/base/ftbbox.c
reactos/lib/3rdparty/freetype/src/base/ftbdf.c
reactos/lib/3rdparty/freetype/src/base/ftbitmap.c
reactos/lib/3rdparty/freetype/src/base/ftcalc.c
reactos/lib/3rdparty/freetype/src/base/ftcid.c
reactos/lib/3rdparty/freetype/src/base/ftdbgmem.c
reactos/lib/3rdparty/freetype/src/base/ftdebug.c
reactos/lib/3rdparty/freetype/src/base/ftgloadr.c
reactos/lib/3rdparty/freetype/src/base/ftglyph.c
reactos/lib/3rdparty/freetype/src/base/ftgxval.c
reactos/lib/3rdparty/freetype/src/base/ftinit.c
reactos/lib/3rdparty/freetype/src/base/ftlcdfil.c
reactos/lib/3rdparty/freetype/src/base/ftmac.c
reactos/lib/3rdparty/freetype/src/base/ftmm.c
reactos/lib/3rdparty/freetype/src/base/ftnames.c [deleted file]
reactos/lib/3rdparty/freetype/src/base/ftobjs.c
reactos/lib/3rdparty/freetype/src/base/ftotval.c
reactos/lib/3rdparty/freetype/src/base/ftoutln.c
reactos/lib/3rdparty/freetype/src/base/ftpatent.c
reactos/lib/3rdparty/freetype/src/base/ftpfr.c
reactos/lib/3rdparty/freetype/src/base/ftpic.c
reactos/lib/3rdparty/freetype/src/base/ftrfork.c
reactos/lib/3rdparty/freetype/src/base/ftsnames.c
reactos/lib/3rdparty/freetype/src/base/ftstream.c
reactos/lib/3rdparty/freetype/src/base/ftstroke.c
reactos/lib/3rdparty/freetype/src/base/ftsynth.c
reactos/lib/3rdparty/freetype/src/base/ftsystem.c
reactos/lib/3rdparty/freetype/src/base/fttrigon.c
reactos/lib/3rdparty/freetype/src/base/fttype1.c
reactos/lib/3rdparty/freetype/src/base/ftutil.c
reactos/lib/3rdparty/freetype/src/base/ftwinfnt.c
reactos/lib/3rdparty/freetype/src/base/md5.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/base/md5.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/base/rules.mk
reactos/lib/3rdparty/freetype/src/bdf/README
reactos/lib/3rdparty/freetype/src/bdf/bdf.h
reactos/lib/3rdparty/freetype/src/bdf/bdfdrivr.c
reactos/lib/3rdparty/freetype/src/bdf/bdfdrivr.h
reactos/lib/3rdparty/freetype/src/bdf/bdferror.h
reactos/lib/3rdparty/freetype/src/bdf/bdflib.c
reactos/lib/3rdparty/freetype/src/bzip2/Jamfile [moved from reactos/lib/3rdparty/freetype/src/lzw/Jamfile with 61% similarity]
reactos/lib/3rdparty/freetype/src/bzip2/ftbzip2.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/bzip2/rules.mk [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cache/ftcbasic.c
reactos/lib/3rdparty/freetype/src/cache/ftccache.c
reactos/lib/3rdparty/freetype/src/cache/ftccache.h
reactos/lib/3rdparty/freetype/src/cache/ftccback.h
reactos/lib/3rdparty/freetype/src/cache/ftccmap.c
reactos/lib/3rdparty/freetype/src/cache/ftcerror.h
reactos/lib/3rdparty/freetype/src/cache/ftcglyph.c
reactos/lib/3rdparty/freetype/src/cache/ftcglyph.h
reactos/lib/3rdparty/freetype/src/cache/ftcmanag.c
reactos/lib/3rdparty/freetype/src/cache/ftcmanag.h
reactos/lib/3rdparty/freetype/src/cache/ftcmru.c
reactos/lib/3rdparty/freetype/src/cache/ftcmru.h
reactos/lib/3rdparty/freetype/src/cache/ftcsbits.c
reactos/lib/3rdparty/freetype/src/cache/ftcsbits.h
reactos/lib/3rdparty/freetype/src/cff/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/cff/cf2arrst.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2arrst.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2blues.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2blues.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2error.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2error.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2fixed.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2font.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2font.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2ft.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2ft.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2glue.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2hints.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2hints.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2intrp.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2intrp.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2read.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2read.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2stack.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2stack.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cf2types.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/cff/cff.c
reactos/lib/3rdparty/freetype/src/cff/cffcmap.c
reactos/lib/3rdparty/freetype/src/cff/cffdrivr.c
reactos/lib/3rdparty/freetype/src/cff/cfferrs.h
reactos/lib/3rdparty/freetype/src/cff/cffgload.c
reactos/lib/3rdparty/freetype/src/cff/cffgload.h
reactos/lib/3rdparty/freetype/src/cff/cffload.c
reactos/lib/3rdparty/freetype/src/cff/cffload.h
reactos/lib/3rdparty/freetype/src/cff/cffobjs.c
reactos/lib/3rdparty/freetype/src/cff/cffobjs.h
reactos/lib/3rdparty/freetype/src/cff/cffparse.c
reactos/lib/3rdparty/freetype/src/cff/cffparse.h
reactos/lib/3rdparty/freetype/src/cff/cffpic.c
reactos/lib/3rdparty/freetype/src/cff/cffpic.h
reactos/lib/3rdparty/freetype/src/cff/cfftoken.h
reactos/lib/3rdparty/freetype/src/cff/cfftypes.h
reactos/lib/3rdparty/freetype/src/cff/rules.mk
reactos/lib/3rdparty/freetype/src/cid/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/cid/ciderrs.h
reactos/lib/3rdparty/freetype/src/cid/cidgload.c
reactos/lib/3rdparty/freetype/src/cid/cidload.c
reactos/lib/3rdparty/freetype/src/cid/cidobjs.c
reactos/lib/3rdparty/freetype/src/cid/cidparse.c
reactos/lib/3rdparty/freetype/src/cid/cidriver.c
reactos/lib/3rdparty/freetype/src/cid/cidriver.h
reactos/lib/3rdparty/freetype/src/gxvalid/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/gxvalid/gxvcommn.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvcommn.h
reactos/lib/3rdparty/freetype/src/gxvalid/gxverror.h
reactos/lib/3rdparty/freetype/src/gxvalid/gxvfeat.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvjust.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvkern.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmod.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmod.h
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmort.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmort0.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmort1.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmort2.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmort5.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmorx.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmorx0.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmorx1.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmorx2.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvmorx5.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvprop.c
reactos/lib/3rdparty/freetype/src/gxvalid/gxvtrak.c
reactos/lib/3rdparty/freetype/src/gzip/ftgzip.c
reactos/lib/3rdparty/freetype/src/lzw/ftlzw.c
reactos/lib/3rdparty/freetype/src/lzw/ftzopen.c
reactos/lib/3rdparty/freetype/src/otvalid/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/otvalid/otverror.h
reactos/lib/3rdparty/freetype/src/otvalid/otvmod.c
reactos/lib/3rdparty/freetype/src/otvalid/otvmod.h
reactos/lib/3rdparty/freetype/src/pcf/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/pcf/README
reactos/lib/3rdparty/freetype/src/pcf/pcf.h
reactos/lib/3rdparty/freetype/src/pcf/pcfdrivr.c
reactos/lib/3rdparty/freetype/src/pcf/pcfdrivr.h
reactos/lib/3rdparty/freetype/src/pcf/pcferror.h
reactos/lib/3rdparty/freetype/src/pcf/pcfread.c
reactos/lib/3rdparty/freetype/src/pfr/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/pfr/pfrcmap.c
reactos/lib/3rdparty/freetype/src/pfr/pfrdrivr.c
reactos/lib/3rdparty/freetype/src/pfr/pfrdrivr.h
reactos/lib/3rdparty/freetype/src/pfr/pfrerror.h
reactos/lib/3rdparty/freetype/src/pfr/pfrgload.c
reactos/lib/3rdparty/freetype/src/pfr/pfrload.c
reactos/lib/3rdparty/freetype/src/pfr/pfrobjs.c
reactos/lib/3rdparty/freetype/src/pfr/pfrsbit.c
reactos/lib/3rdparty/freetype/src/psaux/afmparse.c
reactos/lib/3rdparty/freetype/src/psaux/psauxerr.h
reactos/lib/3rdparty/freetype/src/psaux/psauxmod.c
reactos/lib/3rdparty/freetype/src/psaux/psauxmod.h
reactos/lib/3rdparty/freetype/src/psaux/psconv.c
reactos/lib/3rdparty/freetype/src/psaux/psconv.h
reactos/lib/3rdparty/freetype/src/psaux/psobjs.c
reactos/lib/3rdparty/freetype/src/psaux/t1cmap.c
reactos/lib/3rdparty/freetype/src/psaux/t1decode.c
reactos/lib/3rdparty/freetype/src/pshinter/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/pshinter/pshalgo.c
reactos/lib/3rdparty/freetype/src/pshinter/pshalgo.h
reactos/lib/3rdparty/freetype/src/pshinter/pshglob.c
reactos/lib/3rdparty/freetype/src/pshinter/pshmod.c
reactos/lib/3rdparty/freetype/src/pshinter/pshnterr.h
reactos/lib/3rdparty/freetype/src/pshinter/pshpic.c
reactos/lib/3rdparty/freetype/src/pshinter/pshpic.h
reactos/lib/3rdparty/freetype/src/pshinter/pshrec.c
reactos/lib/3rdparty/freetype/src/pshinter/rules.mk
reactos/lib/3rdparty/freetype/src/psnames/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/psnames/psmodule.c
reactos/lib/3rdparty/freetype/src/psnames/psnamerr.h
reactos/lib/3rdparty/freetype/src/psnames/pspic.c
reactos/lib/3rdparty/freetype/src/psnames/pspic.h
reactos/lib/3rdparty/freetype/src/psnames/pstables.h
reactos/lib/3rdparty/freetype/src/psnames/rules.mk
reactos/lib/3rdparty/freetype/src/raster/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/raster/ftmisc.h
reactos/lib/3rdparty/freetype/src/raster/ftraster.c
reactos/lib/3rdparty/freetype/src/raster/ftrend1.c
reactos/lib/3rdparty/freetype/src/raster/rasterrs.h
reactos/lib/3rdparty/freetype/src/raster/rastpic.c
reactos/lib/3rdparty/freetype/src/raster/rastpic.h
reactos/lib/3rdparty/freetype/src/raster/rules.mk
reactos/lib/3rdparty/freetype/src/sfnt/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/sfnt/pngshim.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/sfnt/pngshim.h [moved from reactos/lib/3rdparty/freetype/devel/ft2build.h with 50% similarity]
reactos/lib/3rdparty/freetype/src/sfnt/rules.mk
reactos/lib/3rdparty/freetype/src/sfnt/sfdriver.c
reactos/lib/3rdparty/freetype/src/sfnt/sferrors.h
reactos/lib/3rdparty/freetype/src/sfnt/sfnt.c
reactos/lib/3rdparty/freetype/src/sfnt/sfntpic.c
reactos/lib/3rdparty/freetype/src/sfnt/sfntpic.h
reactos/lib/3rdparty/freetype/src/sfnt/sfobjs.c
reactos/lib/3rdparty/freetype/src/sfnt/ttbdf.c
reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.c
reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.h
reactos/lib/3rdparty/freetype/src/sfnt/ttcmapc.h
reactos/lib/3rdparty/freetype/src/sfnt/ttkern.c
reactos/lib/3rdparty/freetype/src/sfnt/ttload.c
reactos/lib/3rdparty/freetype/src/sfnt/ttmtx.c
reactos/lib/3rdparty/freetype/src/sfnt/ttpost.c
reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.c
reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.h
reactos/lib/3rdparty/freetype/src/sfnt/ttsbit0.c [deleted file]
reactos/lib/3rdparty/freetype/src/smooth/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/smooth/ftgrays.c
reactos/lib/3rdparty/freetype/src/smooth/ftsmerrs.h
reactos/lib/3rdparty/freetype/src/smooth/ftsmooth.c
reactos/lib/3rdparty/freetype/src/smooth/ftspic.c
reactos/lib/3rdparty/freetype/src/smooth/ftspic.h
reactos/lib/3rdparty/freetype/src/smooth/rules.mk
reactos/lib/3rdparty/freetype/src/tools/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/tools/apinames.c
reactos/lib/3rdparty/freetype/src/tools/cordic.py
reactos/lib/3rdparty/freetype/src/tools/docmaker/content.py
reactos/lib/3rdparty/freetype/src/tools/docmaker/sources.py
reactos/lib/3rdparty/freetype/src/tools/docmaker/tohtml.py
reactos/lib/3rdparty/freetype/src/tools/ftrandom/README
reactos/lib/3rdparty/freetype/src/tools/ftrandom/ftrandom.c
reactos/lib/3rdparty/freetype/src/tools/glnames.py
reactos/lib/3rdparty/freetype/src/tools/test_afm.c
reactos/lib/3rdparty/freetype/src/tools/test_bbox.c
reactos/lib/3rdparty/freetype/src/tools/test_trig.c
reactos/lib/3rdparty/freetype/src/truetype/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/truetype/rules.mk
reactos/lib/3rdparty/freetype/src/truetype/truetype.c
reactos/lib/3rdparty/freetype/src/truetype/ttdriver.c
reactos/lib/3rdparty/freetype/src/truetype/tterrors.h
reactos/lib/3rdparty/freetype/src/truetype/ttgload.c
reactos/lib/3rdparty/freetype/src/truetype/ttgload.c.old [deleted file]
reactos/lib/3rdparty/freetype/src/truetype/ttgload.h
reactos/lib/3rdparty/freetype/src/truetype/ttgxvar.c
reactos/lib/3rdparty/freetype/src/truetype/ttinterp.c
reactos/lib/3rdparty/freetype/src/truetype/ttinterp.h
reactos/lib/3rdparty/freetype/src/truetype/ttobjs.c
reactos/lib/3rdparty/freetype/src/truetype/ttobjs.h
reactos/lib/3rdparty/freetype/src/truetype/ttpic.c
reactos/lib/3rdparty/freetype/src/truetype/ttpic.h
reactos/lib/3rdparty/freetype/src/truetype/ttpload.c
reactos/lib/3rdparty/freetype/src/truetype/ttsubpix.c [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/truetype/ttsubpix.h [new file with mode: 0644]
reactos/lib/3rdparty/freetype/src/type1/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/type1/t1afm.c
reactos/lib/3rdparty/freetype/src/type1/t1driver.c
reactos/lib/3rdparty/freetype/src/type1/t1driver.h
reactos/lib/3rdparty/freetype/src/type1/t1errors.h
reactos/lib/3rdparty/freetype/src/type1/t1gload.c
reactos/lib/3rdparty/freetype/src/type1/t1gload.h
reactos/lib/3rdparty/freetype/src/type1/t1load.c
reactos/lib/3rdparty/freetype/src/type1/t1objs.c
reactos/lib/3rdparty/freetype/src/type1/t1objs.h
reactos/lib/3rdparty/freetype/src/type1/t1parse.c
reactos/lib/3rdparty/freetype/src/type1/t1tokens.h
reactos/lib/3rdparty/freetype/src/type42/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/type42/t42drivr.c
reactos/lib/3rdparty/freetype/src/type42/t42drivr.h
reactos/lib/3rdparty/freetype/src/type42/t42error.h
reactos/lib/3rdparty/freetype/src/type42/t42objs.c
reactos/lib/3rdparty/freetype/src/type42/t42objs.h
reactos/lib/3rdparty/freetype/src/type42/t42parse.c
reactos/lib/3rdparty/freetype/src/winfonts/Jamfile [deleted file]
reactos/lib/3rdparty/freetype/src/winfonts/fnterrs.h
reactos/lib/3rdparty/freetype/src/winfonts/winfnt.c
reactos/lib/3rdparty/freetype/src/winfonts/winfnt.h
reactos/lib/3rdparty/freetype/version.sed [deleted file]
reactos/media/doc/3rd Party Files.txt
reactos/win32ss/drivers/font/ftfd/CMakeLists.txt
reactos/win32ss/drivers/font/ftfd/freetype.def
reactos/win32ss/drivers/font/ftfd/freetype.rc
reactos/win32ss/drivers/font/ftfd/ftfd.spec

index c14870d..f4389b1 100644 (file)
@@ -28,6 +28,7 @@ list(APPEND SOURCE
   src/base/ftwinfnt.c
   src/base/ftxf86.c
   src/bdf/bdf.c
   src/base/ftwinfnt.c
   src/base/ftxf86.c
   src/bdf/bdf.c
+  src/bzip2/ftbzip2.c
   src/cache/ftcache.c
   src/cff/cff.c
   src/cid/type1cid.c
   src/cache/ftcache.c
   src/cff/cff.c
   src/cid/type1cid.c
index b7aea52..5cda57a 100644 (file)
+2013-06-19  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.5.0.1 released.
+       ===========================
+
+
+       Tag sources with `VER-2-5-0-1'.
+
+       * include/freetype/config/ftoption.h: Undefine
+       CFF_CONFIG_OPTION_OLD_ENGINE.
+       * devel/ftoption.h: Define CFF_CONFIG_OPTION_OLD_ENGINE.
+
+2013-06-19  Werner Lemberg  <wl@gnu.org>
+
+       * builds/unix/install.mk (install): Don't create `cache' directory.
+
+       Found by Peter Breitenlohner <peb@mppmu.mpg.de>.
+
+2013-06-19  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.5.0 released.
+       =========================
+
+
+       Tag sources with `VER-2-5-0'.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.5.0.
+
+       * 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/vc2010/freetype.vcxproj, builds/win32/vc2010/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.4.12/2.5.0/, s/2412/250/.
+
+       * include/freetype/freetype.h (FREETYPE_MINOR): Set to 5.
+       (FREETYPE_PATCH): Set to 0.
+
+       * builds/unix/configure.raw (version_info): Set to 16:2:10.
+
+       * src/base/ftobjs.c (FT_Open_Face): Pacify compiler.
+       * src/truetype/ttinterp.c (Ins_MSIRP, Ins_MIRP): Ditto.
+
+2013-06-18  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #39269.
+
+       * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Free memory in
+       case of reacollocation failures.
+
+2013-06-18  Andrew Church  <achurch+savannah@achurch.org>
+
+       Fix Savannah bug #39266.
+
+       If memory allocations fail at certain points while opening a font,
+       FreeType can either crash due to a NULL dereference or leak memory.
+
+       * include/freetype/internal/ftobjs.c (FT_Face_InternalRec,
+       FT_LibraryRec): Make `refcount' a signed integer.  If, for example,
+       FT_Open_Face() fails in a memory allocation before the face's
+       reference count is set to 1, a subsequent `FT_Done_Library' call
+       would otherwise loop over `FT_Done_Face' 2^32 times before freeing
+       the face.
+
+       * src/base/ftobjs.c (open_face): Initialize `stream' and friends
+       earlier.
+       (FT_Open_Face) <Fail>: Behave correctly if `node' is NULL.
+       (FT_Destroy_Module) <Fail>: Check that `renderer_clazz' is valid.
+
+2013-06-14  Werner Lemberg  <wl@gnu.org>
+
+       * src/smooth/ftgrays.c One final pragma to silence 64-bit MSVC.
+
+2013-06-06  Dave Arnold  <darnold@adobe.com>
+           Werner Lemberg  <wl@gnu.org>
+
+       [cff] Add code to Adobe's engine to handle ppem > 2000.
+
+       * src/cff/cffgload.c (cff_slot_load): If we get
+       FT_Err_Glyph_Too_Big, retry unhinted and scale up later on.
+
+2013-06-12  Werner Lemberg  <wl@gnu.org>
+
+       Another try on pragmas.
+
+       * include/freetype/internal/ftdebug.h: Move pragmas to...
+       * include/freetype/internal/internal.h: ... this file since it gets
+       included by all source files.
+       * include/freetype/internal/ftserv.h: Remove pragma which has no
+       effect.
+
+2013-06-12  Werner Lemberg  <wl@gnu.org>
+
+       * include/freetype/internal/ftdebug.h: Disable MSVC warning C4127.
+
+       This partially undoes commit 3f6e0e0c.
+
+2013-06-12  Werner Lemberg  <wl@gnu.org>
+
+       More compiler warning fixes.
+
+       */*: Use cast to `FT_Bool' (or `Bool') where appropriate.
+
+2013-06-10  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Improve handling of broken sbit advance widths.
+
+       * src/truetype/ttgload.c (TT_Load_Glyph): Use the glyph's (scaled)
+       `linearHoriAdvance' if the sbit's `horiAdvance' value is zero.
+
+       Cf. font `Fixedsys Excelsior' v3.01 (FSEX300.ttf), glyph A, 16ppem.
+
+2013-06-10  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt] Improve embedded bitmap tracing.
+
+       * src/base/ftobjs.c (FT_Request_Size): Move trace message regarding
+       bitmap strike match to...
+       (FT_Match_Size): This function.
+
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics,
+       tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned,
+       tt_sbit_decoder_load_compound, tt_sbit_decoder_load_png,
+       tt_sbit_decoder_load_image): Decorate with tracing messages.
+
+2013-06-10  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #39160.
+
+       * src/truetype/ttinterp.c (Ins_SDPVTL): Set projection vector too
+       for the degenerate case.
+
+2013-06-09  David Turner  <digit@google.com>
+
+       * src/cache/ftcmanag.c (FTC_Manager_Reset): Add missing cache flush.
+
+       This code, present since eight(!) years in the unused `CACHE'
+       branch, has been forgotten to apply to the master branch.  It's
+       really amazing that noone has ever complained since
+       `FTC_Manager_Reset' is pretty useless without flushing the cache.
+
+2013-06-07  Werner Lemberg  <wl@gnu.org>
+
+       Add and improve pragmas for MSVC compiler.
+
+       * include/freetype/internal/ftdebug.h: Remove pragmas.
+       * include/freetype/internal/ftserv.h: Use push and pop for pragmas.
+       * include/freetype/internal/ftvalid.h: Handle warning C4324.
+       * src/base/ftobjs.c: Use push and pop for pragmas.
+       * src/gzip/ftgzip.c: Handle warning C4244.
+
+2013-06-07  Werner Lemberg  <wl@gnu.org>
+
+       [cff] s/cf2_getGlyphWidth/cf2_getGlyphOutline/.
+
+       * src/cff/cf2font.c, src/cff/cf2font.h, src/cff/cf2ft.c: Do it.
+
+2013-06-06  Dave Arnold  <darnold@adobe.com>
+
+       [cff] Add early exit feature for width-only calls.
+
+       This is for `FT_Get_Advance'.
+
+       There are 7 places where the spec says the width can be defined:
+
+         hstem/hstemhm
+         vstem/vstemhm
+         cntrmask/hintmask
+         hmoveto
+         vmoveto
+         rmoveto
+         endchar
+
+       * src/cff/cf2intrp.c (cf2_doStems): Exit early for width-only calls,
+       if possible.
+
+       (cf2_interpT2CharString) <cf2_cmdHSTEM>, <cf2_cmdVSTEM>,
+       <cf2_cmdVMOVETO>, <cf2_cmdENDCHAR>, <cf2_cmdHINTMASK>,
+       <cf2_cmdRMOVETO>, <cf2_cmdHMOVETO>: Exit early for width-only calls.
+
+2013-06-06  Werner Lemberg  <wl@gnu.org>
+
+       Next round of compiler fixes.
+
+       * builds/win32/ftdebug.c, builds/wince/ftdebug.c (ft_debug_init):
+       Add proper cast.
+
+       * include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Fix
+       cast.
+       * include/freetype/internal/ftstream.h: Decorate stream and frame
+       macros with `FT_Long' and `FT_ULong' as appropriate.
+
+       * src/base/ftrfork.c (raccess_guess_darwin_hfsplus,
+       raccess_guess_darwin_newvfs): Use cast.
+
+       * src/bdf/bdflib.c (_bdf_set_default_spacing): Use cast.
+
+       * src/cache/ftcmanag.c (FTC_Manager_Check): Fix cast.
+       * src/cache/ftcmanag.h (FTC_ManagerRec): Ditto.
+
+       * src/cff/cf2arrst.c (cf2_arrstack_setNum_Elements): Use cast.
+       * src/cff/cf2ft.c (cf2_freeSeacComponent): Ditto.
+       * src/cff/cffobjs.c (remove_subset_prefix, remove_style): Ditto.
+
+       * src/cid/cidparse.c (cid_parser_new): Use cast.
+
+       * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Use cast.
+
+       * src/psaux/psobjs.c (reallocate_t1_table): Fix argument type.
+
+       * src/raster/ftraster.c (ft_black_reset): Use cast.
+
+       * src/truetype/ttgxvar.c (FT_Stream_FTell): Use cast.
+       (ALL_POINTS): Fix cast.
+
+       * src/type1/t1driver.c (t1_ps_get_font_value): Add casts.
+       * src/type1/t1parse.c (T1_Get_Private_Dict): Add cast.
+
+2013-06-05  Dave Arnold  <darnold@adobe.com>
+
+       Fix more MSVC Win32 compiler warnings.
+
+       * src/base/ftobjs.c: Fix typo in MS pragma.
+
+       * src/base/bdflib.c (_bdf_set_default_spacing, _bdf_add_property):
+       `lineno' is only used in debug mode.
+
+       * src/cff/cf2ft.c (cf2_builder_moveTo): `params' is only used in
+       debug mode.
+
+2013-06-05  Werner Lemberg  <wl@gnu.org>
+
+       Fix compiler warnings.
+
+       * include/freetype/internal/ftmemory.h: Decorate memory allocation
+       macros with `FT_Long' where appropriate.
+       Remove duplicate of FT_MEM_QRENEW_ARRAY definition.
+
+       * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use
+       cast.
+
+       * src/base/ftobjs.c: Add warning disabling pragma for MSVC while
+       including `md5.c'.
+
+       * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdESC>: Add
+       cast.
+
+       * src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Fix casts.
+       (tt_sbit_decoder_load_bitmap): Beautification.
+
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Initialize
+       variables (earlier).
+
+       * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Pacify compiler.
+
+       * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use unsigned constants
+       where appropriate.
+
+       * src/type1/t1load.c (T1_Get_MM_Var): Ditto.
+
+2013-06-04  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cf2font.c (cf2_getGlyphWidth): Initialize `advWidth'.
+
+       Problem reported by Ingmar Sittl <ingmar.sittl@elektrobit.com>.
+
+2013-06-04  Werner Lemberg  <wl@gnu.org>
+
+       Apply fixes for cppcheck nitpicks.
+
+         http://cppcheck.sourceforge.net/
+
+       The call was (from the top-level of the FreeType tree):
+
+         cppcheck --force \
+                  --enable=all \
+                  -I include \
+                  -I include/freetype/ \
+                  -I include/freetype/config/ \
+                  -I include/freetype/internal/ \
+                  . &> cppcheck.log
+
+       Note that the current version heavily chokes on FreeType, delivering
+       many wrong results.  I will report those issues to the cppcheck team
+       so that a newer version gives improved results hopefully.
+
+       */* Improve variable scopes.
+       */* Remove redundant initializations which get overwritten.
+
+       * src/base/ftmac.c ,builds/mac/ftmac.c (count_faces_scalable):
+       Remove unused variable.
+
+       * src/base/ftdbgmem.c (ft_mem_table_destroy): `table' can't be zero.
+
+       * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt1_entry_validate):
+       Remove functionless code.
+
+       * src/tools/ftrandom.c (main): Fix memory leak.
+
+2013-06-03  Werner Lemberg  <wl@gnu.org>
+
+       Add CFF_CONFIG_OPTION_OLD_ENGINE configuration option.
+
+       This controls whether the old FreeType CFF engine gets compiled into
+       FreeType.  It is now disabled by default.
+
+       * devel/ftoption.h, include/freetype/config/ftoption.h
+       (CFF_CONFIG_OPTION_OLD_ENGINE): New macro.
+
+       * src/cff/cffdrivr.c (cff_property_set), src/cff/cffgload.c
+       (CFF_Operator, cff_argument_counts, cff_builder_add_point,
+       cff_operator_seac, cff_decoder_parse_charstrings, cff_slot_load),
+       src/cff/cffgload.h, src/cff/cffobjs.c (cff_driver_init): Use
+       CFF_CONFIG_OPTION_OLD_ENGINE to guard the affected code.
+
+       * docs/CHANGES: Updated.
+
+2013-06-02  Werner Lemberg  <wl@gnu.org>
+
+       Fix PNG library handling.
+
+       * builds/unix/configure.raw: Don't use LIBPNG_LIBS but
+       LIBPNG_LDFLAGS.
+
+2013-05-23  Behdad Esfahbod  <behdad@google.com>
+
+       Add support for color embedded bitmaps (eg. color emoji).
+
+       A new load flag, FT_LOAD_COLOR, makes FreeType load color
+       embedded-bitmaps, following this draft specification
+
+         https://color-emoji.googlecode.com/git/specification/v1.html
+
+       which defines two new SFNT tables, `CBDT' and `CBLC' (named and
+       modeled after `EBDT' and `EBLC', respectively).  The color bitmaps
+       are stored in the new FT_PIXEL_MODE_BGRA format to represent BGRA
+       pre-multiplied sRGB images.  If PNG support is available, PNG color
+       images as defined in the same proposed specification are supported
+       also.
+
+       Note that color bitmaps are converted to grayscale if client didn't
+       ask for color.
+
+       * builds/unix/configure.raw: Search for libpng.
+       Add `--without-png' option.
+
+       * devel/ftoption.h, include/freetype/config/ftoption.h
+       (FT_CONFIG_OPTION_USE_PNG): New macro.
+
+       * include/freetype/freetype.h (FT_LOAD_COLOR): New load flag.
+
+       * include/freetype/ftimage.h (FT_Pixel_Mode): Add
+       `FT_PIXEL_MODE_BGRA'.
+
+       * include/freetype/tttags.h (TTAG_CBDT, TTAG_CBLC): New tags.
+
+       * src/base/ftbitmap.c (FT_Bitmap_Embolden): Updated.
+       (ft_gray_for_premultiplied_srgb_bgra): New function.
+       (FT_Bitmap_Convert): Handle FT_PIXEL_MODE_BGRA.
+
+       * src/sfnt/pngshim.c, src/sfnt/pngshim.h: New files.
+
+       * src/sfnt/sfnt.c: Include `pngshim.c'.
+
+       * src/sfnt/ttsbit.c: Include FT_BITMAP_H and `pngshim.h'
+       (tt_face_load_eblc): Load `CBLC'.
+       (tt_sbit_decoder_init): Load `CBDT'.
+       (tt_sbit_decoder_alloc_bitmap): Pass load flags to select between
+       color and grayscale bitmaps.
+       Set `num_grays'.  This is used by `ftview' to choose the blending
+       algorithm.
+       (tt_sbit_decoder_load_byte_aligned,
+       tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_compound,
+       tt_sbit_decoder_load_image): Pass load flag.
+       s/write/pwrite/.
+       Don't call `tt_sbit_decoder_alloc_bitmap'.
+       Updated.
+       (tt_sbit_decoder_load_png) [FT_CONFIG_OPTION_USE_PNG]: New function.
+       (tt_sbit_decoder_load_bitmap): Pass load flag.
+       Handle new glyph formats 17, 18, and 19.
+       Call `tt_sbit_decoder_alloc_bitmap'.
+       Flatten color bitmaps if necessary.
+       (tt_face_load_sbit_image): Updated.
+
+       * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `pngshim.c'.
+
+       * docs/CHANGES: Updated.
+
+2013-05-24  Guenter  <info@gknw.net>
+
+       Apply Savannah patch #8055.
+
+       Make `apinames' create an import file for NetWare.
+
+       * src/tools/apinames.c (PROGRAM_VERSION): Set to 0.2.
+       (OutputFormat): Add `OUTPUT_NETWARE_IMP'.
+       (names_dump): Handle it.
+       (usage): Updated.
+       (main): Handle new command line flag `-wN'.
+
+2013-05-23  Behdad Esfahbod  <behdad@behdad.org>
+
+       Compilation fix.
+
+       * src/truetype/ttinterp.c (TT_RunIns)
+       [!TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Make it work.
+
+2013-05-22  Infinality  <infinality@infinality.net>
+
+       [truetype] Formatting and an additional subpixel tweak.
+
+       * src/truetype/ttinterp.c (Ins_SHPIX): Formatting fix.
+       * src/truetype/ttsubpix.c (SKIP_NONPIXEL_Y_MOVES_Rules):
+       Revert previous modification for Verdana clones.
+
+2013-05-22  Infinality  <infinality@infinality.net>
+
+       [truetype] Adjust subpixel zp2 moves and tweak rules.
+
+       These modifications fix thin diagonal stems in some legacy fonts.
+
+       * src/truetype/ttinterp.c (Direct_Move_X): Remove unused macro.
+       (Move_Zp2_Point): Don't always disable x moves for subpixel rendering.
+       (Ins_SHP): Disable x moves here for subpixel rendering.
+       (Ins_SHPIX): Only disable x moves in compatibility mode.
+       Split out zp2 move reversals and reorder conditional respectively.
+
+       * src/truetype/ttsubpix.c (SKIP_NONPIXEL_Y_MOVES_Rules): Fix oversight.
+       Only adjust Verdana clones for 17 ppem.
+       (SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions): Add Courier New.
+       (ALWAYS_SKIP_DELTAP_Rules): Found additional cases for Arial `s'.
+
+2013-05-20  Infinality  <infinality@infinality.net>
+
+       [truetype] Simplify and improve subpixel function detection.
+
+       Some small enhancements have allowed the removal of many macros and
+       the simplification of existing rules in `ttsubpix.c'.
+
+       * src/truetype/ttsubpix.h (SPH_TWEAK_ALLOW_X_DMOVEX,
+       SPH_TWEAK_ALLOW_X_MOVE_ZP2,
+       SPH_TWEAK_DELTAP_SKIP_EXAGGERATED_VALUES,
+       SPH_TWEAK_SKIP_INLINE_DELTAS, SPH_TWEAK_MIRP_CVT_ZERO): Removed.
+       (SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP): New rule macro.
+
+       * src/truetype/ttsubpix.c: Updated affected rules.
+
+       * src/truetype/ttinterp.c (Direct_Move_X): Updated.
+       (INS_FDEF): Add additional function detection.
+       (INS_ENDF): Set runtime flag.
+       (Ins_CALL): Skip the call under certain conditions.
+       Remove bad code.
+       (Ins_LOOPCALL): Skip the call under certain conditions.
+       Remove bad code.
+       (Move_Zp2_Point): Updated.
+       (Ins_SHPIX): Updated.
+       Skip the move under some situations.
+       (Ins_MIAP): Improve conditions.
+       (Ins_MIRP): Updated.
+       (Ins_DELTAP): Skip move under certain conditions.
+       Simplify conditions.
+       (TT_RunIns): Updated.
+       Add code to handle new function detection.
+       Trace messages.
+
+2013-05-17  Werner Lemberg  <wl@gnu.org>
+
+       Update more FT_Err_XXX macros using FT_ERR and FT_THROW;
+
+       * builds/amiga/src/base/ftsystem.c, builds/mac/ftmac.c,
+       builds/unix/ftsystem.c, builds/vms/ftsystem.c: Do it.
+
+2013-05-15  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Add `interpreter-version' property.
+
+       This makes the option TT_CONFIG_OPTION_SUBPIXEL_HINTING controllable
+       at runtime.
+
+       * include/freetype/ftttdrv.h: New file.
+
+       * include/freetype/config/ftheader.h (FT_TRUETYPE_DRIVER_H): New
+       macro.
+
+       * src/truetype/ttdriver.c: Include FT_TRUETYPE_DRIVER_H.
+       (tt_property_set, tt_property_get): Fill templates.
+
+       * src/truetype/ttobjs.h (TT_DriverRec): Add `interpreter_version'
+       member.
+       Remove unused `extension_component' member.
+
+       * src/truetype/ttgload.c: Include FT_TRUETYPE_DRIVER_H.
+       (tt_get_metrics, TT_Hint_Glyph, TT_Process_Simple_Glyph,
+       compute_glyph_metrics, tt_loader_init): Use `interpreter_version'.
+
+       * src/truetype/ttinterp.c: Include FT_TRUETYPE_DRIVER_H.
+       (SUBPIXEL_HINTING): New macro to check `interpreter_version' flag.
+       Update all affected functions to use it.
+       Use TT_INTERPRETER_VERSION_XXX where appropriate.
+
+       * src/truetype/ttobjs.c: Include FT_TRUETYPE_DRIVER_H.
+       (tt_driver_init): Initialize `interpreter_version'.
+
+       * src/truetype/ttsubpix.c: Include FT_TRUETYPE_DRIVER_H.
+       Use TT_INTERPRETER_VERSION_XXX where appropriate.
+
+2013-05-13  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Avoid empty source file.
+
+       * src/truetype/ttsubpix.c [!TT_CONFIG_OPTION_SUBPIXEL_HINTING]:
+       Provide dummy typedef.
+
+2013-05-13  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cf2font.c (cf2_getGlyphWidth): Fix uninitialized variable.
+
+       Fix suggested by Vaibhav Nagarnaik <vnagarnaik@gmail.com>.
+
+2013-05-13  Brian Nixon  <bnixon@yahoo.com>
+
+       Fix Savannah bug #38970.
+
+       * src/base/ftdebug.c, builds/win32/ftdebug.c,
+       builds/wince/ftdebug.c, builds/amiga/src/base/ftdebug.c
+       (ft_debug_init): Don't read past the environment variable FT2_DEBUG.
+
+2013-05-12  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Add framework for TrueType properties.
+
+       * src/truetype/ttdrivr.c: Include FT_SERVICE_PROPERTIES_H.
+       (tt_property_set, tt_property_get): New functions, still empty.
+       Define `tt_service_properties' service.
+       Update `tt_services'.
+
+       * src/truetype/ttpic.h: Include FT_SERVICE_PROPERTIES_H.
+       (TT_SERVICE_PROPERTIES_GET): New macro.
+       (TTModulePIC): Add `tt_service_properties'.
+
+2013-05-12  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #38967.
+
+       * src/base/ftcalc.c (FT_DivFix) [FT_LONG64]: Fix cast.
+
+2013-05-12  Werner Lemberg  <wl@gnu.org>
+
+       Introduce unsigned 64bit type (if available).
+
+       * include/freetype/config/ftconfig.h: Define FT_UINT64 if available.
+       [FT_LONG64]: Provide FT_UInt64.
+
+       * builds/unix/ftconfig.in: Synchronized.
+
+2013-05-12  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #38968.
+
+       * include/freetype/ftmodapi.h: Add `FT_EXPORT' to
+       FT_Property_{Set,Get}.
+       * src/base/ftobjs.c: Add `FT_EXPORT_DEF' to
+       FT_Property_{Set,Get}.
+
+2013-05-10  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt] Clean up bitmap code.
+
+       * src/sfnt/ttsbit.c: Deleted.
+       * src/sfnt/ttsbit0.c: Renamed to `ttsbit.c'. 
+       * rules.mk (SFNT_DRV_H): Updated.
+
+2013-05-10  Werner Lemberg  <wl@gnu.org>
+
+       */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code.
+
+2013-05-08  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.12 released.
+       ==========================
+
+
+       Tag sources with `VER-2-4-12'.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.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/vc2010/freetype.vcxproj, builds/win32/vc2010/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.4.11/2.4.12/, s/2411/2412/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 12.
+
+       * builds/unix/configure.raw (version_info): Set to 16:1:10.
+
+2013-05-08  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2013-05-08  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Typo.
+
+2013-05-05  Werner Lemberg  <wl@gnu.org>
+
+       Synchronize `ftconfig.h'.
+
+       * builds/unix/ftconfig.in: Updated.
+
+2013-05-05  Werner Lemberg  <wl@gnu.org>
+
+       Fix compilation with C++.
+
+       * src/base/md5.c (body): Use proper cast.
+
+2013-05-05  Werner Lemberg  <wl@gnu.org>
+
+       Fix 64bit compilation issues.
+
+       * include/freetype/config/ftconfig.h [FT_LONG64]: Typedef
+       `FT_Int64' here.
+
+       * src/base/ftcalc.c: Remove typedef of `FT_Int64'.
+       (FT_DivFix): Fix cast.
+       * src/base/fttrigon.c: Remove typedef of `FT_Int64'.
+
+2013-05-05  Werner Lemberg  <wl@gnu.org>
+
+       [raster] Fix clang issues.
+
+       Fix suggested by <octoploid@yandex.com>.
+
+       * src/raster/ftraster.c (ULong): New typedef.
+       (SCALED): Add proper cast.
+
+2013-05-04  Werner Lemberg  <wl@gnu.org>
+
+       Fix clang fixes.
+
+       * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate): Use
+       correct types.
+
+       * src/cff/cf2intrp.c (cf2_interpT2CharString) <default>: Force
+       unsigned for computations.
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Ditto.
+       * src/cff/cffparse.c (cff_parse_integer): Ditto.
+
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto.
+
+2013-05-04  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Make Adobe CFF engine work correctly on 64bit hosts.
+
+       Reported by numerous people on the `freetype-devel' list.  Without
+       this fix, glyphs aren't properly aligned on a common baseline.
+
+       On 64bit systems, `FT_Pos' expands to `long int', having a width of
+       64bit.  `CF2_Fixed' expands to `int' which is normally 32bit wide on
+       64bit hosts also.  Wrong casts filled up the blues arrays with
+       incorrect values.  Note that all blues values are accessed with the
+       `cf2_blueToFixed' macro which handles the 64bit to 32bit conversion.
+
+       * src/cff/cf2ft.h (cf2_getBlueValues, cf2_getOtherBlues,
+       cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Use `FT_Pos' for
+       `data', not `CF2_Fixed'.
+       * src/cff/cf2ft.c (cf2_getBlueValues, cf2_getOtherBlues,
+       cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Updated.
+       * src/cff/cf2blues.c (cf2_blues_init): Updated.
+
+2013-05-04  Werner Lemberg  <wl@gnu.org>
+
+       More fixes for clang's `sanitize' feature.
+
+       * src/base/ftcalc.c (FT_DivFix): Use unsigned values for
+       computations which use the left shift operator and convert to signed
+       as the last step.
+       * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate,
+       FT_Vector_Length, FT_Vector_Polarize): Ditto.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Simplify.
+       * src/cff/cffload.c (cff_subfont_load): Fix constant.
+       * src/cff/cffparse.c (cff_parse_integer, cff_parse_real, do_fixed,
+       cff_parse_fixed_dynamic): Use unsigned values for computations which
+       use the left shift operator and convert to signed as the last step.
+
+       * src/cid/cidload.c (cid_get_offset): Ditto.
+
+       * src/psaux/psconv.c (PS_Conv_ToFixed): Ditto.
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto.
+
+       * src/truetype/ttinterp.c (TT_MulFix14, TT_DotFix14): Ditto.
+
+2013-05-04  Werner Lemberg  <wl@gnu.org>
+
+       Fix errors reported by clang's `sanitize' feature.
+
+       * include/freetype/internal/ftstream.h: Simplify and fix integer
+       extraction macros.
+       (FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32,
+       FT_INT8_I32, FT_INT8_U32): Removed.
+       (FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE,
+       FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for
+       computations and convert to signed as the last step.
+
+       * src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt,
+       cf2_fracToFixed): Avoid shifts of negative values.
+       (cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed,
+       unused.
+
+       * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR,
+       default>: Use unsigned values for computations and convert to signed
+       as the last step.
+       Use proper types in tracing messages.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned
+       values for computation of operands and convert to signed as the last
+       step.
+       Use proper type in tracing message.
+
+2013-05-03  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cf2blues.c: Remove dead code.
+
+2013-05-02  Chris Liddell  <chris.liddell@artifex.com>
+
+       * src/cff/cffgload.c: Include FT_CFF_DRIVER_H.
+
+2013-04-27  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+       * README: Improved.
+
+2013-04-13  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Add a new Type 2 interpreter and hinter.
+
+       This work, written by Dave Arnold <darnold@adobe.com> and fully
+       integrated into FreeType by me, is a donation by Adobe in
+       collaboration with Google.  It is vastly superior to the old CFF
+       engine, and it will replace it soon.  Right now, it is still off by
+       default, and you have to explicitly select it using the new
+       `hinting-engine' property of the cff driver.
+
+       For convenience, (most of) the new files are committed separately.
+
+       * include/freetype/config/ftheader.h (FT_CFF_DRIVER_H): New macro.
+       * include/freetype/ftcffdrv.h: New file to access CFF driver
+       properties.
+       * include/freetype/fterrdef.h (FT_Err_Glyph_Too_Big): New error
+       code.
+       * include/freetype/internal/fttrace.h: Add `cf2blues', `cf2hints',
+       and `cf2interp'.
+
+       * src/cff/cffgload.h (CFF_SubFont): New member `current_subfont'.
+       * src/cff/cffobjs.h (CFF_DriverRec): New members `hinting_engine'
+       and `no_stem_darkening'.
+       * src/cff/cfftypes.h (CFF_FontRec): New member `cf2_instance'.
+
+       * src/cff/cff.c: Include new files.
+       * src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle
+       `hinting-engine' and `no-stem-darkening' properties (only the Adobe
+       engine listens to them).
+       * src/cff/cffgload.c: Include `cf2ft.h'.
+       (cff_decoder_prepare): Initialize `current_subfont'.
+       (cff_build_add_point): Handle Adobe engine which uses 16.16
+       coordinates.
+       (cff_slot_load): Handle FT_LOAD_NO_SCALE and FT_LOAD_NO_HINTING
+       separately.
+       Choose rendering engine based on `hinting_engine' property.
+       * src/cff/cffload.c (cff_font_done): Call finalizer of the Adobe
+       engine.
+       * src/cff/cffobjs.c: Include FT_CFF_DRIVER_H.
+       (cff_driver_init): Set default property values.
+
+       * src/cff/rules.mk (CFF_DRV_SRC, CFF_DRV_H): Add new files.
+
+       * src/cff/cf2*.*: New files, containing the Adobe engine.
+
+2013-04-12  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Minor code administration issues.
+
+       * src/cff/cffgload.c (check_points): Rename to...
+       (cff_check_points): ...this and make it FT_LOCAL.
+       (cff_builder_add_point, cff_builder_add_point1,
+       cff_builder_start_point, cff_builder_close_contour,
+       cff_lookup_glyph_by_stdcharcode, cff_get_glyph_data,
+       cff_free_glyph_data): Make them FT_LOCAL.
+
+       * src/cff/cffgload.h: Updated.
+
+2013-04-12  Werner Lemberg  <wl@gnu.org>
+
+       Add output bitmap checksums.
+
+       Use `FT2_DEBUG=bitmap:3' for tracing.
+
+       * src/base/md5.c, src/base/md5.h: New files, taken from
+
+         http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
+
+       * include/freetype/internal/fttrace.h: Add `bitmap'.
+
+       * src/base/ftobjs.c [FT_DEBUG_LEVEL_TRACE]: Include `md5.c'
+
+       (FT_Render_Glyph_Internal) [FT_DEBUG_LEVEL_TRACE]: For tracing,
+       convert resulting bitmap to a uniform format and compute a checksum.
+       Use `bitmap' category for the tracing message.
+
+       * src/base/rules.mk (BASE_H): Updated.
+
+       * docs/LICENSE.TXT: Updated.
+
+2013-04-12  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Add framework for CFF properties.
+
+       * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC7):
+       New macro.
+
+       * src/cff/cffdrivr.c: Include FT_SERVICE_PROPERTIES_H.
+       (cff_property_set, cff_property_get): New functions, still empty.
+       Define `cff_service_properties' service.
+       Update `cff_services'.
+
+       * src/cff/cffpic.h: Include FT_SERVICE_PROPERTIES_H.
+       (CFF_SERVICE_PROPERTIES_GET): New macro.
+       (CffModulePIC): Add `cff_service_properties'.
+
+2013-04-03  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #38589.
+
+       * src/bdf/bdflib.c (_bdf_readstream): Thinko.
+
+2013-03-31  Werner Lemberg  <wl@gnu.org>
+
+       * configure: Use egrep, not grep.
+
+       Problem reported Mojca Miklavec <mojca.miklavec.lists@gmail.com>.
+
+2013-03-29  Werner Lemberg  <wl@gnu.org>
+
+       * include/freetype/ftlcdfil.h: Add description of color filtering.
+
+       Based on a contribution from Antti S. Lankila <alankila@bel.fi>
+       (Savannah bug #38607).
+
+2013-03-23  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Minor.
+
+       * src/autofit/afmodule.c (af_property_set): Typo.
+       (af_autofitter_init, af_autofitter_done): Use cast.
+
+2013-03-21  Werner Lemberg  <wl@gnu.org>
+
+       * configure: Automatically test for `gmake' also.
+
+       Suggested by Mojca Miklavec <mojca.miklavec.lists@gmail.com>.
+
+2013-03-21  Peter Breitenlohner  <peb@mppmu.mpg.de>
+
+       Respect CONFIG_SHELL from the environment.
+
+       Some large packages using FreeType have to use a broken (deficient)
+       /bin/sh.  The configure scripts (as generated by Autoconf) are
+       clever enough to find a better shell and put that one into the
+       environment variable CONFIG_SHELL.  If that environment variable is
+       already set the script skips the test and assumes to be already
+       running under a good shell.
+
+       * builds/unix/detect.mk: Honour CONFIG_SHELL.
+       * builds/unix/unix-def.in (SHELL): Define.
+
+2013-03-21  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah patch #7971.
+
+       * configure: Handle MAKE environment variable also.
+
+2013-03-17  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #38538.
+
+       * builds/amiga/src/base/ftdebug.c, builds/win32/ftdebug.c,
+       builds/wince/ftdebug.c (FT_Throw): Add function.
+
+2013-03-17  Werner Lemberg  <wl@gnu.org>
+
+       [raster] Remove dead code.
+
+       * src/raster/rastpic.c (ft_raster1_renderer_class_pic_init)
+       src/smooth/ftspic.c (ft_smooth_renderer_class_pic_init): Do it.
+
+2013-03-17  Werner Lemberg  <wl@gnu.org>
+
+       * src/pshinter/pshpic.h (GET_PIC): Use correct container.
+
+2013-03-15  Werner Lemberg  <wl@gnu.org>
+
+       * include/freetype/ftmoderr.h: Fix commit from 2013-03-11.
+
+       The previous version was not backwards compatible.  Reported by
+       Behdad.
+
+2013-03-14  Werner Lemberg  <wl@gnu.org>
+
+       */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate.
+
+       FT_Err_XXX and friends are no longer directly used in the source
+       code.
+
+2013-03-14  Werner Lemberg  <wl@gnu.org>
+
+       New error management macros.
+
+       * include/freetype/fterrors.h (FT_ERR_XCAT, FT_ERR_CAT): Move to...
+       * include/freetype/fttypes.h: ... this file.
+       (FT_ERR, FT_ERR_EQ, FT_ERR_NEQ, FT_MODERR_EQ, FT_MODERR_NEQ): New
+       macros.
+
+       * include/freetype/freetype.h: Updated.
+
+2013-03-14  Werner Lemberg  <wl@gnu.org>
+
+       */*: Use FT_Err_Ok only.
+
+       This is a purely mechanical conversion.
+
+2013-03-14  Werner Lemberg  <wl@gnu.org>
+
+       */*: Use `FT_THROW'.
+
+       This is essentially a mechanical conversion, adding inclusion of
+       `FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for
+       stand-alone compiling modes of the rasterizer modules.
+
+       To convert the remaining occurrences of FT_Err_XXX and friends it is
+       necessary to rewrite the code.  Note, however, that it doesn't harm
+       if some cases are not handled since FT_THROW is a no-op.
+
+2013-03-13  Werner Lemberg  <wl@gnu.org>
+
+       Introduce `FT_THROW' macro.
+
+       The idea is to replace code like
+
+         return FT_Err_Foo_Bar;
+
+       or
+
+         return CFF_Err_Foo_Bar;
+
+       with
+
+         return FT_THROW( Foo_Bar );
+
+       The FT_THROW macro has two functions:
+
+         . It hides the module specific prefix.
+
+         . In debug mode, it calls the empty function `FT_Throw' which can
+           be thus used to set a breakpoint.
+
+       * include/freetype/internal/ftdebug.h (FT_THROW): New macro.
+       (FT_Throw): New prototype.
+       * src/base/ftdebug.c (FT_Throw): New function.
+
+2013-03-12  Werner Lemberg  <wl@gnu.org>
+
+       Remove `FT_KEEP_ERR_PREFIX'.
+
+       The idea is to always have FT_ERR_PREFIX available internally.
+
+       * include/freetype/fterrors.h: Use FT2_BUILD_LIBRARY to guard
+       undefinition of FT_ERR_PREFIX
+
+       * src/gxvalid/gxverror.h, src/otvalid/otverror.h,
+       src/sfnt/sferrors.h: Updated.
+
+2013-03-11  Werner Lemberg  <wl@gnu.org>
+
+       [gxvalid] Fix module error.
+
+       * src/gxvalid/gxverror.h (FT_ERR_BASE): Define as
+       FT_Mod_Err_GXvalid.
+       * include/freetype/ftmoderr.h: Add module error for `GXvalid'.
+
+2013-03-11  Werner Lemberg  <wl@gnu.org>
+
+       Always use module related error codes.
+
+       * src/cff/cffobjs.c (cff_face_init), src/type1/t1objs.c
+       (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Use
+       `FT_ERROR_BASE'.
+
+       * src/type1/t1load.c (parse_encoding): Use
+       T1_Err_Unknown_File_Format.
+
+2013-03-08  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Set `linear{Hori,Vert}Advance' for embedded bitmaps also.
+
+       Problem reported by Khaled Hosny <khaledhosny@eglug.org>.
+
+       * src/cff/cffgload.c (cff_slot_load): Implement it.
+
+2013-02-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Fix commit ab02d9e8.
+
+       * src/base/ftbbox.c (BBox_Cubic_Check): Change scaling to msb of 22.
+
+2013-02-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] New bisecting BBox_Cubic_Check (disabled).
+
+       * src/base/ftbbox.c (BBox_Cubic_Check): New bisecting algorithm
+       for extremum search built around simple condition that defines
+       which half contains the extremum.
+
+2013-02-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [tools] Update BBox testing tool.
+
+       * src/tools/test_bbox.c: Add another cubic outline with exact BBox.
+       (REPEAT): Increase the number of benchmarking cycles.
+       (profile_outline): Tweak output formatting.
+
+2013-02-02  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #38235.
+
+       * builds/unix/configure.raw: Don't generate `freetype-config' and
+       `freetype.pc'.
+
+       * builds/unix/unix-def.in (FT2_EXTRA_LIBS, LIBBZ2, LIBZ,
+       build_libtool_libs, ft_version): New variables to be substituted.
+       (freetype-config, freetype.pc): New rules to generate those files.
+
+       * builds/unix/freetype-config.in: Remove code for handling `rpath'.
+       The use of $rpath has been accidentally removed in a patch from
+       2009-12-22, and apparently noone has missed it since.
+       Use `%' instead of `@' as a variable substitution marker.
+       Use quotes.
+
+       * builds/unix/freetype.in: Use `%' instead of `@' as a variable
+       substitution marker.
+       Use quotes.
+
+2013-02-07  Werner Lemberg  <wl@gnu.org>
+
+       * src/truetype/ttobjs.c (tt_size_run_prep): Reset more GS variables.
+
+       BTW, Greg agrees that the OpenType specification is missing the list
+       of GS variables which will always be reset to the default values
+       after the `prep' table has been executed.
+
+2013-02-06  Werner Lemberg  <wl@gnu.org>
+
+       * src/truetype/ttobjs.c (tt_size_run_prep): Reset reference points.
+
+       Up to now, we simply took a snapshot of the Graphics State after the
+       `prep' table has been executed, and right before a glyph's bytecode
+       was run it got reloaded.  However, as Greg Hitchcock has told us in
+       private communication, reference points get reset to zero in the MS
+       rasterizer and we follow in due course.  While reasonable, this is
+       undocumented behaviour.
+
+       Most notably, this fixes the rendering of Arial's `x' glyph in
+       subpixel hinting mode.
+
+2013-02-05  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] A better fix for Savannah bug #38211.
+
+       * src/truetype/ttinterp.c (Ins_IP): Implement identical behaviour to
+       MS rasterizer if rp1 == rp2 (confirmed by Greg Hitchcock).
+
+2013-02-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [pcf] Streamline parsing of PCF encoding table.
+
+       * src/pcf/pcfread.c (pcf_get_encodings): Use simpler double for-loop.
+       Reallocate array instead of using temporary storage.
+
+2013-02-01  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #38227.
+
+       * builds/unix/freetype-config.in: Set LC_ALL.
+
+2013-02-01  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #38221.
+
+       This complements commit 83c0ebab.
+
+       * src/base/ftcalc.c (FT_MulDiv_No_Round): Don't enclose with
+       `TT_USE_BYTECODE_INTERPRETER'.
+
+2013-02-01  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix Savannah bug #38211.
+
+       * src/truetype/ttinterp.c (Ins_IP): Make FreeType behave identical
+       to other interpreters if rp1 == rp2 (which is invalid).
+
+2013-01-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Small optimization of BBox calculation.
+
+       * src/base/ftbbox.c (BBox_Cubic_Check): Use FT_MSB function in
+       scaling algorithm.
+
+2013-01-26  Infinality  <infinality@infinality.net>
+
+       [truetype] Minor formatting fix.
+
+       * src/truetype/ttinterp.c: Updated.
+       (DO_RS): Fix indentation.
+
+2013-01-26  Infinality  <infinality@infinality.net>
+
+       [truetype] Fix rasterizer_version logic in sph.
+
+       * src/truetype/ttsubpix.c: Updated.
+       (ALWAYS_SKIP_DELTAP_Rules): Remove rule for Trebuchet MS.
+       (sph_set_tweaks): Fix `rasterizer_version' logic.
+
+2013-01-26  Infinality  <infinality@infinality.net>
+
+       [truetype] Align more to ClearType whitepaper for sph.
+
+       * include/freetype/internal/tttypes.h (TT_FaceRec): Add flags
+       for detected opcode patterns and compatibility mode.
+
+       * src/truetype/ttgload.c (tt_loader_init): Complete conditional.
+
+       * src/truetype/ttinterp.c: Updated.
+       Remove SPH_DEBUG and replace with FT_TRACE7.
+       (DO_RS): More conditions.
+       (Ins_FDEF): Add more opcode detection patterns.
+       More specific conditions when flagging an fdef.
+       Make compatibility mode only turn on when delta fdefs are found.
+       (Ins_CALL, Ins_LOOPCALL): Set flags for currently executed fdef.
+       (Ins_SHPIX): Remove logic to handle ttfautohinted fonts.
+       Simplify conditionals where possible.
+       Use `&' instead of `%' operator for dumb compilers.
+       (Ins_MIAP): Adjust twilight zone conditional.
+       Ensure `ignore_x_mode' is on when testing sph conditionals.
+       (Ins_MIRP): Ensure `ignore_x_mode' is on when testing sph
+       conditionals.
+       Do cvt cutin always when `ignore_x_mode' is active.
+       Remove test for ttfautohinted fonts.
+       (Ins_DELTAP): Ensure `ignore_x_mode' is on when testing sph
+       conditionals.
+       Do cvt cutin always when `ignore_x_mode' is active.
+       Remove test for ttfautohinted fonts.
+       Use `&' instead of `%' operator for dumb compilers.
+       (Ins_GETINFO): Remove SPH_DEBUG and replace with FT_TRACE7.
+
+       * src/truetype/ttinterp.h: Updated.
+       (TT_ExecContextRec): Remove compatibility_mode variable.
+       Add variable to indicate when executing in special fdefs for sph.
+
+       * src/truetype/ttobjs.h: Updated.
+       (TT_DefRecord): Add flags to identify special fdefs for sph.
+       (TT_SizeRec): Remove unnecessary ttfautohinted variable.
+
+       * src/truetype/ttsubpix.c: Updated.
+       (COMPATIBILITY_MODE_Rules): Remove all.  Auto-detected now.
+       (PIXEL_HINTING_Rules): Remove all.  Unnecessary after fixes.
+       (SKIP_NONPIXEL_Y_MOVES_Rules): Remove Ubuntu.
+       (SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions): Add Arial Bold `N'.
+       (SKIP_OFFPIXEL_Y_MOVES_Rules): Remove all.  Happens automatically
+       now.
+       (ROUND_NONPIXEL_Y_MOVES_Rules): Remove Ubuntu.
+       (ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions): Remove all.
+       (NORMAL_ROUND_Rules): Remove Verdana.
+       (NO_DELTAP_AFTER_IUP_Rules): Remove all.
+       (sph_set_tweaks): Performance fix.  Don't run prep always.
+       Adjust conditional for sph_compatibility_mode.
+
+       * src/truetype/ttsubpix.h: Add new fdef flags for sph.
+
+2013-01-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Fix broken emboldening at small sizes.
+
+       * src/base/ftoutln.c (FT_Outline_EmboldenXY): Do not attempt to
+       normalize zero-length vectors.
+
+2013-01-25  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #38167.
+
+       This fixes commit 83c0ebab from 2012-06-27.
+
+       * src/truetype/ttinterp.h:
+       s/TT_CONFIG_OPTION_BYTECODE_INTERPRETER/TT_USE_BYTECODE_INTERPRETER/.
+
+2013-01-25  Xi Wang  <xi.wang@gmail.com>
+
+       [sfnt] Fix broken pointer overflow checks.
+
+       Many compilers such as gcc and clang optimize away pointer overflow
+       checks `p + n < p', because pointer overflow is undefined behavior.
+       Use a safe form `n > p_limit - p' instead.
+
+       Also avoid possible integer overflow issues, for example, using
+       `num_glyphs > ( p_limit - p ) / 2' rather than `num_glyphs * 2'
+       given a large `num_glyphs'.
+
+       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Implement it.
+
+2013-01-25  Werner Lemberg  <wl@gnu.org>
+
+       [base] Fix `make multi'.
+
+       * src/base/ftoutln.c, src/base/fttrigon.c: Include
+       FT_INTERNAL_CALC_H.
+
+2013-01-25  David 'Digit' Turner  <digit@google.com>
+
+       [truetype] Fix C++ compilation.
+
+       * src/truetype/ttsubpix.h: Updated.
+       (SPH_X_SCALING_RULES_SIZE): Moved and renamed to...
+       * src/truetype/ttsubpix.c (X_SCALING_RULES_SIZE): This.
+       (sph_X_SCALING_Rules): Removed.
+       (scale_test_tweak): Make function static.
+       (sph_test_tweak_x_scaling): New function.
+
+       * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Updated.
+
+2013-01-23  Werner Lemberg  <wl@gnu.org>
+
+       [base] Make `FT_Hypot' really internal.
+
+       * include/freetype/fttrigon.h (FT_Hypot): Move to...
+       * include/freetype/internal/ftcalc.h: This file.
+
+       * src/base/fttrigon.c (FT_Hypot): Move to...
+       * src/base/ftcalc.c: This file.
+       Include FT_TRIGONOMETRY_H.
+
+       * src/truetype/ttgload.c: Don't include FT_TRIGONOMETRY_H.
+
+2013-01-23  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Revert change from 2013-01-22.
+
+       FreeType's `height' value is the baseline-to-baseline distance...
+
+       * src/truetype/ttobjs.c (tt_size_reset): Undo.
+
+2013-01-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base, truetype] New internal `FT_Hypot' function.
+
+       * include/freetype/fttrigon.h (FT_Hypot): Declare it.
+       * src/base/fttrigon.c (FT_Hypot): Define it.
+       * src/truetype/ttgload.c (TT_Process_Composite_Component): Use it
+       instead of explicit expressions.
+       * src/truetype/ttinterp.c (Current_Ratio, Normalize): Use it instead
+       of TT_VecLen.
+       (TT_VecLen): Removed.
+
+2013-01-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Fix integer overflow.
+
+       * src/base/ftoutln.c (FT_Outline_EmboldenXY): Normalize incoming and
+       outgoing vectors and use fixed point arithmetic.
+
+2013-01-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Fix integer overflow.
+
+       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Scale the
+       coordinates down to avoid overflow.
+
+2013-01-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Split out MSB function.
+
+       * src/base/fttrigon.c (ft_trig_prenorm): Borrow from here.
+       * include/freetype/internal/ftcalc.h (FT_MSB): Declare here.
+       * src/base/ftcalc.c (FT_MSB): Define here.
+
+2013-01-22  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix font height.
+
+       * src/truetype/ttobjs.c (tt_size_reset): The Windows rendering
+       engine uses rounded values of the ascender and descender to compute
+       the TrueType font height.
+
+2013-01-16  Behdad Esfahbod  <behdad@behdad.org>
+
+       [sfnt] Fix optimized sbit loader.
+
+       It was not taking bit_depth into consideration when blitting!
+
+       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_byte_aligned,
+       * tt_sbit_decoder_load_bit_aligned): Handle bit
+       depth.
+
+2013-01-16  David 'Digit' Turner  <digit@google.com>
+
+       [truetype] Improve sub-pixel code.
+
+       This patches fixes many issues with the ttsubpix implementation.
+
+       1. Data tables are defined, instead of declared, in the header, and
+          thus copied into each source file that includes it.
+
+       2. These tables were defined as global, mutable, visible variables,
+          and thus costing private RAM to every process that loads the
+          library (> 50 KB / process, this is huge!).
+
+          Additionally, this also made the library export the symbols
+          completely needlessly.
+
+       3. Missing `sph_' and `SPH_' prefixes to some of the definitions.
+
+       Note that this doesn't try to fix the incredibly inefficient storage
+       format for the data tables used by the code.  This one will require
+       another pass in the future.
+
+       * src/truetype/ttinterp.h (MAX_NAME_SIZE, MAX_CLASS_MEMBERS):
+       Renamed to...
+       (SPH_MAX_NAME_SIZE, SPH_MAX_CLASS_MEMBERS): This.
+       Update all users.
+
+       (SPH_TweakRule, SPH_ScaleRule): Decorate with `const' where
+       appropriate.
+
+       (Font_Class): Rename to...
+       (SPH_Font_Class): This.  Decorate with `const' where appropriate.
+       
+       * src/truetype/ttsubpix.h (scale_test_tweak, sph_test_tweak):
+       Decorate arguments with `const' where appropriate.
+
+       Move font tweaking tables to...
+
+       * src/truetype/ttsubpic.c: This file and decorate them with `static'
+       and `const' where appropriate.
+
+       (X_SCALING_Rules, X_SCALING_RULES_SIZE): Renamed to...
+       (spu_X_SCALING_Rules, SPH_X_SCALING_RULES_SIZE): This.
+       Update all users.
+
+2013-01-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [truetype] Improve accuracy of normalization of short vectors.
+
+       Unit vector components are stored as 2.14 fixed-point numbers. In
+       order to calculate all 14 bits accurately, a short vector to be
+       normalized has to be upscaled to at least 14 bits before its length
+       is calculated. This has been safe since accurate CORDIC algorithms
+       were adopted.
+
+       * src/truetype/ttinterp.c (Normalize): Scale short vectors by 0x4000.
+
+2013-01-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [truetype] Kill very old vector normalization hacks.
+
+       Back in the days, vector length calculations were not very accurate
+       and the vector normalization function, Normalize, had to meticulously
+       correct the errors for long vectors [commit b7ef2b096867]. It was no
+       longer necessary after accurate CORDIC algorithms were adopted, but
+       the code remained. It is time to kill it.
+
+       * src/truetype/ttinterp.c (Normalize): Remove error compensation.
+       (TT_VecLen): Remove any mention of old less accurate implementation.
+
+2013-01-11  Werner Lemberg  <wl@gnu.org>
+
+       Disable FT_CONFIG_OPTION_OLD_INTERNALS.
+
+       After the next release we are going to remove the code completely.
+
+       * devel/ftoption.h, include/freetype/config/ftoption.h
+       (FT_CONFIG_OPTION_OLD_INTERNALS): Comment out.
+       * docs/CHANGES: Document it.
+
+2013-01-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Update the overflow protection bit.
+
+       The recent optimizations of CORDIC iterations drastically reduce the
+       expansion factor.  Vector components with MSB of 29 are now safe
+       from overflow.
+
+       * src/base/fttrigon.c (FT_TRIG_SAFE_MSB): New macro.
+       (ft_trig_prenorm): Use it and remove dead code.
+
+2013-01-09  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base, pshinter] Use FT_ABS, FT_MIN, and FT_MAX for readability.
+
+       * src/base/ftbbox.c: Updated.
+       * src/base/ftobjs.c: Updated.
+       * src/base/fttrigon.c: Updated.
+       * src/pshinter/pshalgo.c: Updated.
+       * src/pshinter/pshrec.c: Updated.
+
+2013-01-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Clean up trigonometric core.
+
+       * src/base/fttrigon.c: Document the algorithm in a large comment.
+       (FT_TRIG_COSCALE): Remove macro.
+       (FT_Tan: Use `FT_TRIG_SCALE' instead.
+       (FT_Cos, FT_Vector_Unit): Ditto and round the return values.
+
+2013-01-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Use rounding in CORDIC iterations.
+
+       * src/base/fttrigon.c (ft_trig_pseudo_rotate,
+       ft_trig_pseudo_polarize): Improve accuracy by rounding.
+
+2013-01-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Reduce trigonometric algorithms.
+
+       After we get within 45 degrees by means of true 90-degree rotations,
+       we can remove initial 45-degree CORDIC iteration and start from
+       atan(1/2) pseudorotation, reducing expansion factor thereby.
+
+       * src/base/fttrigon.c (FT_TRIG_SCALE, FT_TRIG_COSCALE): Update macros.
+       (ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Update.
+
+       * src/tools/cordic.py: Bring up to date with trigonometric core.
+
+       * docs/CHANGES: Old typo.
+
+2013-01-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       * src/pshinter/pshalgo.h: Remove unused code.
+
+2012-12-27  Werner Lemberg  <wl@gnu.org>
+
+       * src/truetype/ttgload.c (tt_loader_init): Add more tracing.
+
+2012-12-23  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Fix handling of /FontBBox in MM fonts.
+       Problem reported by Del Merritt <del@alum.mit.edu>
+
+       If we have
+
+         /FontBBox { { 11 12 13 14 15 16 17 18 }
+                     { 21 22 23 24 25 26 27 28 }
+                     { 31 32 33 34 35 36 37 38 }
+                     { 41 42 43 44 45 46 47 48 } }
+
+       in the /Blend dictionary,  then the first BBox is { 11 21 31 41 },
+       the second { 12 22 32 42 }, etc.
+
+       * include/freetype/internal/psaux.h (T1_FieldType): Add
+       `T1_FIELD_TYPE_MM_BBOX' (for temporary use).
+
+       * src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_MM_BBOX>:
+       Implement it.
+
+2012-12-21  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       * src/tools/cordic.py: Bring up to date with trigonometric core.
+
+2012-12-21  Werner Lemberg  <wl@gnu.org>
+
+       Check parameters of `FT_Outline_New'.
+       Problem reported by Robin Watts <robin.watts@artifex.com>.
+
+       * src/base/ftoutln.c (FT_Outline_New_Internal): Ensure that
+       `numContours' and `numPoints' fit into FT_Outline's `n_points' and
+       `n_contours', respectively.
+
+2012-12-20  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.11 released.
+       ==========================
+
+
+       Tag sources with `VER-2-4-11'.
+
+       * docs/CHANGES, docs/release: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.11.
+
+       * 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/vc2010/freetype.vcxproj, builds/win32/vc2010/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.4.10/2.4.11/, s/2410/2411/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 11.
+
+       * builds/unix/configure.raw (version_info): Set to 16:0:10.
+
+       * builds/toplevel.mk (dist): Don't include `.mailmap'.
+
+2012-12-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Improve trigonometric core.
+
+       FreeType used to rely on a 24-step iteration CORDIC algorithm to
+       calculate trigonometric functions and rotate vectors. It turns out
+       that once the vector is in the right half-plane, the initial rotation
+       by 63 degrees is not necessary. The algorithm is perfectly capable
+       to converge to any angle starting from the second 45 degree rotation.
+       This patch removes the first rotation and makes it a 23-step CORDIC
+       algorithm.
+
+       * src/base/fttrigon.c (FT_TRIG_SCALE, FT_TRIG_COSCALE): Update macro
+       values.
+       (ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Remove initial
+       rotation.
+
+2012-12-19  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftobjs.c (ft_property_do): Fix compiler warning.
+
+2012-12-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       * src/base/ftrfork.c (FT_Raccess_Guess): Switch to FT_Int counters.
+
+2012-12-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Clean up trigonometric core.
+
+       * src/base/fttrrigon.c (ft_trig_pseudo_polarize): Align algorithm
+       with `ft_trig_pseudo_rotate'.
+
+2012-12-18  Infinality  <infinality@infinality.net>
+
+       [truetype] Minor performance enhancement.
+
+       * src/truetype/ttgload.c: (TT_Process_Simple_Glyph): Use FT_MulFix
+       instead of FT_MulDiv.
+
+2012-12-17  Infinality  <infinality@infinality.net>
+
+       [truetype] Remove unusued code and variables.
+
+       * src/truetype/ttinterp.c: Updated.
+       (Ins_FDEF): Remove opcode patterns that are not being used.
+
+2012-12-16  Werner Lemberg  <wl@gnu.org>
+
+       Various compiler warning fixes.
+
+       * include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Use
+       `logical not' operator instead of negation.  The idea is that `~'
+       returns exactly the data type enforced by the cast to a pointer (be
+       it 32bit or 64bit or whatever), while a negative integer has not
+       this flexibility.
+       * src/cache/ftccmap.c (FTC_CMAP_UNKNOWN): Ditto.
+       * src/truetype/ttgxvar.c (ALL_POINTS, TT_Get_MM_Var): Ditto.
+       * src/type/t1load.c (T1_Get_MM_Var): Ditto.
+       (parse_blend_axis_types): Use cast.
+       * src/bdf/bdflib.c (_bdf_readstream): Use cast.
+
+2012-12-16  Infinality  <infinality@infinality.net>
+
+       [truetype] Remove unusued code and variables.  Add minor fixes.
+
+       * src/truetype/ttsubpix.h: Updated.
+       (SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions): Add Trebuchet MS.
+       (ALLOW_X_DMOVEX_Rules): Remove Arial characters.
+       (ALLOW_X_DMOVE_Rules): Remove Arial characters.
+       (RASTERIZER_35_Rules): Verdana no longer needs to be here.
+       (SKIP_IUP_Rules): Formatting fix.
+       (DELTAP_SKIP_EXAGGERATED_VALUES_Rules): Remove Segoe UI.
+       (COMPATIBLE_WIDTHS_Rules): Add Monaco and Trebuchet MS.
+       (X_SCALING_Rules): Add misc. corrective fixes.
+
+       * src/truetype/ttgload.c: (TT_Process_Simple_Glyph): Adjust correction
+       factor for emboldening during scaling.
+
+       * src/truetype/ttinterp.h: Updated.
+       (TT_ExecContextRec): Remove unused variables.
+
+       * src/truetype/ttobjs.h: Updated.
+       (TT_SizeRec): Add ttfautohinted variable.
+
+       * src/truetype/ttinterp.c: Updated.
+       (Ins_FDEF): Rework code to fix bugs and add more detection.
+       (Ins_CALL): Remove unused code.
+       (Ins_LOOPCALL): Remove unused code.
+       (TT_RunIns): Remove unusued code.
+       (Ins_SHPIX): Add logic to handle ttfautohinted fonts.
+       (Ins_MIRP): Don't round x in cut-in calculation.  Add logic to handle
+       ttfautohinted fonts.
+
+2012-12-16  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt] Fix Savannah bug #37936.
+
+       * src/sfnt/ttload.c (tt_face_load_gasp): Avoid memory leak.
+
+2012-12-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Fix 11-year old bug.
+
+       Since the initial commit (ebe85f59) the value of FT_TRIG_SCALE has
+       always been slightly less than the correct value, which has been
+       given in the comment as a hexadecimal. As a result, vector lengths
+       were underestimated and rotated vectors were shortened.
+
+       * src/base/fttrigon.c (FT_TRIG_SCALE): Fix macro value.
+
+2012-12-15  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #37907.
+
+       * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Normalize
+       negative second parameter of `ENCODING' field also.
+
+2012-12-15  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #37906.
+
+       * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Use correct array
+       size for checking `glyph_enc'.
+
+2012-12-15  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #37905.
+
+       * src/bdf/bdflib.c (_bdf_parse_start) <STARTPROPERTIES>: Reset
+       `props_size' to zero in case of allocation error; this value gets
+       used in a loop in `bdf_free_font'.
+
+2012-12-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [truetype] Scale F_dot_P down.
+
+       The dot product between freeVector and projVector or cosine of
+       the angle between these FT_F2Dot14 unit vectors used to be scaled up
+       by 4 and routinely occupied 32 bits in an FT_Long field F_dot_P.
+       This patch scales the value down by 2^14 instead, which simplifies
+       its use throughout the bytecode interpreter.
+
+       This does not lead to the loss of precision because the lower bits
+       are unreliable anyway. Consider two unit vectors (1,0) and (.6,.8)
+       for which the true value of F_dot_P is .6 * 0x40000000 = 0x26666666.
+       These vectors are stored as (0x4000,0) and (0x2666,0x3333) after
+       rounding and F_dot_P is assigned 0x26660000. The lower bits were
+       already lost while rounding the unit vector components.
+
+       Besides code simplification, this change can lead to better
+       performance when FT_MulDiv with the scaled-down F_dot_P is less
+       likely to use the costly 64-bit path. We are not changing the type
+       of F_dot_P to FT_F2Dot14 at this point.
+
+       * src/truetype/ttinterp.c (Compute_Funcs): Scale F_dot_P down by 14
+       bits and modify its use accordingly.
+       (Direct_Move, Direct_Move_Orig, Compute_Point_Displacement): Modify
+       the use of F_dot_P field.
+       * src/truetype/ttobjs.c (tt_size_run_fpgm): Change arbitrary
+       assignment of F_dot_P to its theoretical maximum in case we decide
+       to scale back its type later.
+
+2012-12-09  Johnson Y. Yan  <yinsen_yan@foxitsoftware.com>
+
+       [type1] Another fix for 2012-09-17 commit.
+
+       * src/type1/t1parse.c (T1_Get_Private_Dict) <found>: Correctly set
+       `limit' value.
+
+2012-12-06  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [truetype] Tweak the previous commit.
+
+       * src/truetype/ttinterp.c (Current_Ratio): Put unit vector
+       components as the second TT_MulFix14 arguments. This is required
+       on 16-bit systems.
+
+2012-12-06  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [truetype] Microoptimizations in bytecode interpreter.
+
+       * src/truetype/ttinterp.c (TT_DivFix14): New macro.
+       (Normalize): Use it here.
+       (Current_Ratio): Use TT_MulFix14 instead of FT_MulDiv.
+       (Ins_SHPIX): Cancel out two TT_MulFix14 calls.
+
+2012-12-05  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [truetype] Cosmetic improvement in bytecode interpreter.
+
+       * src/truetype/ttinterp.c: Use explicit calls to FT_MulDiv,
+       FT_MulFix, and FT_DivFix instead of macros.
+
+2012-12-03  John Tytgat  <John.Tytgat@esko.com>
+
+       [pshinter] Clamp BlueScale value.
+
+       This is Savannah bug #37856.
+
+       * src/pshinter/pshglob.c (psh_calc_max_height): New function.
+       (psh_globals_new): Use it to limit BlueScale value to
+       `1 / max_of_blue_zone_heights'.
+
+2012-12-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [truetype, type1] Revise the use of FT_MulDiv.
+
+       * src/truetype/ttgxvar.c: Updated.
+       * src/truetype/ttobjs.c: Updated.
+       * src/type1/t1load.c: Updated.
+
+2012-11-30  Werner Lemberg  <wl@gnu.org>
+
+       [configure] Preserve customized `ftoption.h'.
+
+       Problem reported by Del Merritt <del@alum.mit.edu>.
+
+       * builds/unix/configure.raw <cpp computation of bit length>: Don't
+       remove existing FreeType configuration files.
+
+2012-11-29  John Tytgat  <John.Tytgat@esko.com>
+
+       [type1] Fix Savannah bug #37831.
+
+       The bug report also contains a patch.
+
+       * src/type1/t1parse.c (T1_Get_Private_Dict) <found>: Really fix
+       change from 2012-09-17.
+
+2012-11-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [truetype] Fix formatting and typo.
+
+2012-11-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [cid, type1, type42] Clean up units_per_EM calculations.
+
+       * src/cid/cidload.c (cid_parse_font_matrix): Updated.
+       * src/type1/t1load.c (t1_parse_font_matrix): Updated.
+       * src/type42/t42parse.c (t42_parse_font_matrix): Updated.
+
+2012-11-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [ftstroke] Minor improvement.
+
+       * src/base/ftstroke.c: Replace nested FT_DivFix and FT_MulFix with
+       FT_MulDiv.
+
+2012-11-17  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/fttrigon.c (ft_trig_downscale): Make 64bit version work.
+
+2012-11-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Fix integer overflows in dd5718c7d67a.
+
+       * src/base/ftoutln.c (FT_Outline_EmboldenXY): Use FT_MulDiv.
+
+2012-11-15  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Trace stem widths.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_widths): Add some
+       FT_TRACE calls.
+
+2012-11-13  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Add support for OpenType Collections (OTC).
+
+       * src/cff/cffload.c (cff_font_load): Separate subfont and face
+       index handling to load both pure CFFs with multiple subfonts and
+       OTCs (with multiple faces where each face holds exactly one
+       subfont).
+       * src/cff/cffobjs.c (cff_face_init): Updated.
+
+2012-11-12  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Minor improvement.
+
+       * src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Fix
+       loop.
+
+2012-11-10  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve tracing.
+
+       * src/autofit/aflatin.c (af_latin_hint_edges)
+       [FT_DEBUG_LEVEL_TRACE]: Count number of actions and emit something
+       if there weren't any.
+
+2012-11-04  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Fortify emboldening code against egregious distortions.
+
+       * src/base/ftoutln.c (FT_Outline_EmboldenXY): Threshold emboldening
+       strength when it leads to segment collapse.
+
+2012-11-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [base] Clean up emboldening code and improve comments there.
+
+       * src/base/ftoutln.c (FT_Outline_EmboldenXY): Replace sequential
+       calls to FT_MulFix and FT_DivFix with FT_MulDiv.
+       Mention that bisectors are used to figure out the shift direction.
+
+2012-10-24  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Add standard character to `AF_ScriptClassRec' structure.
+
+       * src/autofit/aftypes.h (AF_ScriptClassRec): Add `standard_char'
+       member.
+       (AF_DEFINE_SCRIPT_CLASS): Updated.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_widths): Use it.
+       (af_latin_metrics_init, af_latin_script_class): Updated.
+
+       * src/autofit/aflatin.c (af_latin2_metrics_init_widths): Use it.
+       (af_latin2_metrics_init, af_latin2_script_class): Updated.
+
+       * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Use it.
+       (af_cjk_metrics_init, af_cjk_script_class): Updated.
+
+       * src/autofit/afindic.c (af_indic_metrics_init,
+       af_indic_script_class): Updated.
+
+       * src/autofit/afcjk.h, src/autofit/aflatin.h: Updated.
+
+       * src/autofit/afdummy.c: Updated.
+
+2012-10-24  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Only use Unicode CMap.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init): Implement it, to be
+       in sync with `af_face_globals_compute_script_coverage'.
+
+2012-10-21  Werner Lemberg  <wl@gnu.org>
+
+       [psaux] Improve parsing of invalid numbers.
+
+       * src/psaux/psconv.c (PS_Conv_Strtol): Always parse complete number,
+       even in case of overflow.
+       (PS_Conv_ToInt): Only increase cursor if parsing was successful.
+       (PS_Conv_ToFixed): Ditto.
+       Trace underflow and data error.
+
+2012-10-21  Werner Lemberg  <wl@gnu.org>
+
+       [smooth] Improve tracing.
+
+       * src/smooth/ftgrays.c (gray_sweep): Trace last sweep line of
+       current band also.
+
+2012-10-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [truetype] Cheaper way to threshold angles between vectors.
+
+       * src/truetype/ttinterp.c (Ins_ISECT): Thresholding tangent is a lot
+       cheaper than thresholding sine.
+
+2012-10-20  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Improve parsing of invalid real numbers.
+
+       * src/cff/cffparse.c (cff_parse_real): Always parse complete number,
+       even in case of overflow or underflow.
+       Also trace one more underflow.
+
+2012-10-20  Andreas Pehnack  <andreas.pehnack@me.com>
+
+       [sfnt] Load pure CFF fonts wrapped in SFNT container.
+
+       Such fonts only have a `cmap' and a `CFF' table.
+
+       * src/sfnt/ttload.c (tt_face_load_font_dir): Don't call
+       `check_table_dir' if font signature is `OTTO'.
+
+2012-10-20  Werner Lemberg  <wl@gnu.org>
+
+       [psaux] Fix some value overflows and improve tracing.
+
+       * src/psaux/psconv.c: Include FT_INTERNAL_DEBUG_H.
+       (FT_COMPONENT): Define.
+       (PS_Conv_Strtol): Return FT_Long.
+       Handle bad data and overflow.
+       Emit some tracing messages in case of error.
+       (PS_Conv_ToInt): Return FT_Long.
+       (PS_Conv_ToFixed): Updated.
+       * src/psaux/psconv.h: Updated.
+
+       * include/freetype/internal/fttrace.h: Add `psconv'.
+
+2012-10-20  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Fix `make multi CC=c++'.
+
+       * src/autofit/aflatin.c, src/autofit/aflatin2.c: Include
+       `afglobal.h'.
+       * src/autofit/afloader.c: Fix order of header files.
+       * src/autofit/afmodule.c: Include `afglobal.h' and `aferrors.h'.
+
+2012-10-19  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Fix more value errors and improve tracing.
+
+       * src/cff/cffparse.c (cff_parse_integer): Emit tracing message in
+       case of error.
+       (cff_parse_real): Handle and trace overflow, underflow, and bad data
+       consistently.
+       (do_fixed): New helper function, handling and tracing overflow.
+       (cff_parse_fixed, cff_parse_fixed_scaled): Use `do_fixed'.
+
+2012-10-17  Werner Lemberg  <wl@gnu.org>
+
+       [psaux] Fix some value overflows.
+
+       * src/psaux/psconv.c (PS_Conv_ToFixed): Implement it.
+
+2012-10-17  Bram Tassyns  <BramT@enfocus.com>
+
+       [cff] Fix value overflow.
+
+       * src/cff/cffparse.c (cff_parse_fixed_scaled): Implement it.
+
+2012-10-17  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix Savannah bug #37572.
+
+       * src/truetype/ttinterp.c (Ins_ISECT): Use angle between vectors to
+       avoid grazing intersections.  The previous threshold was too coarse,
+       incorrectly rejecting short but valid vectors.
+
+2012-09-30  Gilles Espinasse  <g.esp@free.fr>
+
+       Remove useless `rm' detection.
+
+       `rm -f' is directly used in the `configure' script created by
+       autoconf, thus no availability test is necessary.
+
+       * builds/unix/configure.raw (RMF): Remove test.
+       * builds/unix/unix-def.in (DELETE): Updated.
+
+2012-09-29  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Minor optimization.
+
+       * src/autofit/afglobals.c (af_face_globals_compute_script_coverage):
+       Add loop condition.
+
+2012-09-29  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Fix thinko.
+
+       * src/autofit/aftypes.h (AF_SCRIPT):
+       s/AF_SCRIPT_NONE/AF_SCRIPT_DUMMY/.  We already use `AF_SCRIPT_NONE'
+       as a bit mask.
+
+       * src/autofit/afdummy.c: Updated.
+
+2012-09-18  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Implement `increase-x-height' property.
+
+       * include/freetype/ftautoh.h (FT_Prop_IncreaseXHeight): New
+       structure.
+
+       * include/autofit/afmodule.c (af_property_get_face_globals): New
+       function, re-using code from `af_property_get'.
+       (af_property_set, af_property_get): Handle `increase-x-height'.
+       Updated.
+
+2012-09-18  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Implement Infinality's `increase glyph heights'.
+
+       This is an improved version of a similar fix contained in the
+       so-called `Infinality patch', taken from
+
+         http://www.infinality.net/fedora/linux/zips/freetype-infinality-2.4.10-20120616_01-x86_64.tar.bz2
+
+       which addresses various enhancements of the auto-hinter.  Without
+       properties to control a module's metadata it wasn't possible to
+       adapt the patches because everything was originally controlled by
+       environment variables which I consider not suitable in general.
+
+       A patch to control `increase_x_height' follows.
+
+       * src/autofit/afglobal.h (AF_PROP_INCREASE_X_HEIGHT_MIN,
+       AF_PROP_INCREASE_X_HEIGHT_MAX): New macros.
+       (AF_FaceGlobalsRec): Add `increase_x_height' member.
+       * src/autofit/afglobal.c (af_face_globals_new): Initialize it.
+
+       * src/autofit/aflatin.c (af_latin_metrics_scale_dim),
+       * src/autofit/aflatin2.c (af_latin2_metrics_scale_dim): Implement
+       handling of `increase_x_height'.
+
+2012-09-18  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Add hierarchical property access to some structures.
+
+       * src/autofit/afglobal.h: Include `afmodule.h'.
+       (AF_FaceGlobalsRec): Add `module' member.
+       (AF_FaceGlobals): Typedef moved to...
+       * src/autofit/aftypes.h: Here.
+       (AF_ScriptMetricsRec): Add `globals' member.
+
+       * src/autofit/afglobal.c (af_face_globals_new,
+       af_face_globals_compute_script_coverage,
+       af_face_globals_get_metrics): Updated.
+
+       * src/autofit/afloader.c (af_loader_reset), src/autofit/afmodule.c
+       (af_property_get): Updated.
+
+2012-09-17  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Fix Savannah bug #37350.
+
+       * src/type1/t1parse.c (T1_Get_Private_Dict) <found>: Check for ASCII
+       storage only if we actually have at least four bytes.
+
+2012-09-15  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Implement `fallback-script' property.
+
+       * src/autofit/afglobal.c: s/default_script/fallback_script/.
+       * src/autofit/afglobal.h: s/AF_SCRIPT_DEFAULT/AF_SCRIPT_FALLBACK/.
+
+       * src/autofit/afmodule.c: s/default_script/fallback_script/.
+       (af_property_set, af_property_get): Implement `fallback-script'.
+       * src/autofit/afmodule.h: s/default_script/fallback_script/.
+
+       * include/freetype/ftautoh.h: Document it.
+
+2012-09-15  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Correct previous Unicode 6.1.0 change.
+
+       The auto-hinter's latin module only handles latin ligatures in the
+       `Alphabetical Presentation Forms' block.
+
+       * src/autofit/aflatin.c (af_latin_uniranges): Fix it.
+
+2012-09-15  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/afmodule.c: s/FT_Err_/AF_Err_/.
+
+2012-09-15  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Make default script a global property.
+
+       * src/autofit/afmodule.h (AF_ModuleRec): Add `default_script' field.
+
+       * src/autofit/afglobal.c (af_face_globals_compute_script_coverage,
+       af_face_globals_new), src/autofit/afloader.c (af_loader_reset),
+       src/autofit/afmodule.c (af_property_get) <glyph-to-script-map>,
+       af_autofitter_init:
+       Handle default script.
+
+       * src/autofit/afglobal.h: Updated.
+
+2012-09-15  Werner Lemberg  <wl@gnu.org>
+
+       Use `FT_Module' instead of `FT_Library' argument in property funcs.
+
+       This internal change simplifies access to global module data.
+
+       * include/freetype/internal/services/svprop.h
+       (FT_Properties_SetFunc, FT_Properties_GetFunc): Change accordingly.
+
+       * src/base/ftobjs.c (ft_property_do), src/autofit/afmodule.c
+       (af_property_set, af_property_get): Updated.
+
+2012-09-14  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Update to Unicode 6.1.0.
+
+       * src/autofit/afcjk.c (af_cjk_uniranges), src/autofit/aflatin.c
+       (af_latin_uniranges): Add and fix ranges.
+
+2012-09-14  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Pass `AF_Module' instead of `AF_Loader'.
+
+       We want to access the (not yet existing) module's global data later
+       on.
+
+       * src/autofit/afloader.c: Include `afmodule.h'.
+       (af_loader_init, af_loader_reset, af_loader_done,
+       af_loader_load_glyph): Change accordingly.
+       * src/autofit/afmodule.c (AF_ModuleRec): Move to `afmodule.h'.
+       Updated.
+
+       * src/autofit/afmodule.h: Include `afloader.h'.
+       (AF_ModuleRec): Define here.
+       * src/autofit/afloader.h (AF_Module): Define here.
+       Updated.
+
+2012-09-14  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Fix `make multi'.
+
+       * include/freetype/internal/fttrace.h: Add `afmodule'.
+       * src/autofit/afmodule.c: Include FT_INTERNAL_DEBUG_H.
+       (FT_COMPONENT): Define.
+
+2012-09-14  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/afmodule.c: s/FT_Autofitter/AF_Module/.
+
+2012-09-12  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Minor reorganization.
+
+       * src/autofit/afglobal.c (AF_SCRIPT_LIST_DEFAULT,
+       AF_SCRIPT_LIST_NONE, AF_DIGIT): Move to...
+       * src/autofit/afglobal.h (AF_SCRIPT_DEFAULT, AF_SCRIPT_LIST_NONE,
+       AF_DIGIT): This and update code.
+
+2012-09-01  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Implement `glyph-to-script-map' property.
+
+       * include/freetype/ftautoh.h: New public header file.
+       * include/freetype/config/ftheader.h (FT_AUTOHINTER_H): New macro.
+
+       * src/autofit/afglobal.c (AF_FaceGlobalsRec): Move structure to...
+       * src/autofit/afglobal.h: This header file.
+       * src/autofit/afmodule.c: Include FT_AUTOHINTER_H.
+       (af_property_get): Handle `glyph-to-script-map'.
+
+2012-08-31  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Implement properties service framework.
+
+       No properties are added yet.
+
+       * src/autofit/afmodule.c: Include FT_SERVICE_PROPERTIES_H.
+       (af_property_set, af_property_get): New dummy functions.
+       (af_service_properties, af_services, af_get_interface): Provide
+       service setup.
+       (autofit_moduleclass): Add service interface.
+
+       * src/autofit/afpic.c: Add necessary forward declarations.
+       (autofit_module_class_pic_init): Add code for service addition.
+       (autofit_module_pic_free): Add code for service removal.
+       * src/autofit/afpic.h (AF_SERVICES_GET, AF_SERVICE_PROPERTIES_GET):
+       New macros which provide necessary syntactical sugar for PIC
+       support.
+
+2012-08-30  Werner Lemberg  <wl@gnu.org>
+
+       Implement properties to control FreeType modules.
+
+       * include/freetype/fterrdef.h (FT_Err_Missing_Property): New error
+       code.
+       * include/freetype/ftmodapi.h (FT_Property_Set, FT_Property_Get):
+       New API.
+
+       * include/freetype/internal/services/svprop.h: New file.
+       * include/freetype/internal/ftserv.h (FT_SERVICE_PROPERTIES_H): New
+       macro.
+
+       * src/base/ftobjs.c: Include FT_SERVICE_PROPERTIES_H.
+       (ft_property_do, FT_Property_Set, FT_Property_Get): New functions.
+
+2012-08-29  Werner Lemberg  <wl@gnu.org>
+
+       [docmaker] Allow `-' in tags and identifiers.
+
+       * src/tools/docmaker/content.py (re_identifier),
+       src/tools/docmaker/sources.py (re_markup_tag1, re_markup_tag2,
+       re_crossref): Add `-' in patterns.
+
+2012-08-27  Werner Lemberg  <wl@gnu.org>
+
+       [FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings.
+
+       * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER),
+       include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
+       FT_DEFINE_MODULE), include/freetype/internal/ftserv.h
+       (FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2,
+       FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4,
+       FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6),
+       src/autofit/afpic.c (autofit_module_class_pic_init),
+       src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c
+       (ft_create_default_module_classes), src/cff/cffparse.c
+       (FT_Create_Class_cff_field_handlers), src/cff/cffpic.c
+       (cff_driver_class_pic_init), src/pshinter/pshpic.c
+       (pshinter_module_class_pic_init), src/psnames/pspic.c
+       (psnames_module_class_pic_init), src/raster/rastpic.c
+       (ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c
+       (sfnt_module_class_pic_init), src/sfnt/ttcmap.c
+       (FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c
+       (ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c
+       (tt_driver_class_pic_init): Initialize allocation variable.
+
+2012-08-27  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix compilation warning.
+
+       * src/truetype/ttgload.c (IS_HINTED): Move macro to...
+       * src/truetype/ttobjs.h: This header file.
+
+2012-08-27  Werner Lemberg  <wl@gnu.org>
+
+       [autofit, cff, pshinter, psnames] More renamings for orthogonality.
+
+       * src/autofit/afmodule.c, src/autofit/afpic.h:
+       s/AF_AUTOFITTER_/AF_/.
+
+       * src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffparse.c,
+       src/cff/cffpic.h: s/FT_CFF_/CFF_/.
+
+       * src/pshinter/pshmod.c, src/pshinter/pshpic.h:
+       s/FT_PSHINTER_/PSHINTER_/.
+
+       * src/psnames/psmodule.c, src/psnames/pspic.h:
+       s/FT_PSCMAPS/PSCMAPS_/.
+
+2012-08-27  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt, truetype] More renamings for orthogonality.
+
+       * src/sfnt/sfdriver.c, src/sfnt/sfntpic.h, src/sfnt/ttcmap.c,
+       src/truetype/ttdriver.c, src/truetype/ttpic.h: s/FT_SFNT_/SFNT_/,
+       s/FT_TT_/TT_/, s/GET_CMAP_INFO_GET/CMAP_INFO_GET/.
+
+2012-08-27  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Some macro and variable renamings for orthogonality.
+
+       * include/freetype/internal/autohint.h, src/base/ftobjs.c,
+       src/autofit/afmodule.c, src/autofit/afpic.c, src/autofit/afpic.h:
+       s/SERVICE/INTERFACE/, s/service/interface/, s/Service/Interface/.
+
+2012-08-26  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #37178.
+
+       * src/base/ftobjs.c (FT_Open_Face): Initialize `error' with
+       `FT_Err_Missing_Module' before loop to indicate `no valid drivers'.
+
+2012-08-17  Werner Lemberg  <wl@gnu.org>
+
+       * src/base/ftsynth.c (FT_GlyphSlot_Oblique): Fix shear angle.
+
+       The old value was far too large (more than 20°).  The new one
+       corresponds to 12°, quite common in typography.
+
+2012-08-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [smooth] Fix Savannah bug #37017.
+
+       * src/smooth/ftgrays.c (gray_render_cubic): Use a different set of
+       checks when detecting super curvy splines to be split.
+
+2012-08-05  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve recognition of flat segments.
+
+       Problem reported by Brad Dunzer <BDunzer@extensis.com>.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues): We have
+       a flat segment if the horizontal distance of best on-points is
+       larger than a given threshold.
+
+2012-08-05  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Variable renamings.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Replace
+       `glyph' with `outline'.
+       s/best_first/best_contour_first/.
+       s/best_last/best_contour_last/.
+
+2012-07-31  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Fix Savannah bug #37000.
+
+       * src/type1/t1load.c (parse_encoding): Fix order of checks.
+
+2012-07-17  Werner Lemberg  <wl@gnu.org>
+
+       [psaux] Fix Savannah bug #36833.
+
+       * src/psaux/t1decode.c (t1operator_seac): `seac' is not a valid
+       operator if we want metrics only.
+
+2012-07-16  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Fix Savannah bug #36832.
+
+       * src/type1/t1load.c (parse_charstrings): Reject negative number of
+       glyphs.
+
+2012-07-13  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Fix Savannah bug #36829.
+
+       * src/type1/t1load.c (parse_encoding): Check cursor position after
+       call to T1_Skip_PS_Token.
+
+2012-07-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       Revert the last commit 45337b07.
+
+       * src/base/ftstroke.c (FT_Stroker_New): Revert the previous change.
+
+2012-07-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [ftstroke] Fix uninitialized return value.
+
+       * src/base/ftstroke.c (FT_Stroker_New): Return FT_Err_Ok instead.
+
+2012-07-11  Werner Lemberg  <wl@gnu.org>
+
+       [smooth] Avoid memory leak in case of failure.
+
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use flags to
+       indicate what to clean up after finishing the function, with and
+       without errors.
+
+2012-07-09  Werner Lemberg  <wl@gnu.org>
+
+       Fix compilation with MSVC 5.0.
+
+       Problem reported by Peter Breitenlohner and Akira Kakuto.
+
+       * include/freetype/config/ftstdlib.h (ft_setjmp): Updated.
+       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove cast.
+
+2012-07-09  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve debugging messages; do some code cleanup.
+
+       * src/autofit/aflatin.c (af_latin_align_linked_edge,
+       af_latin_hint_edges): Synchronize with formatting used in the
+       ttfautohint project.
+
+2012-07-07  Gilles Espinasse  <g.esp@free.fr>
+
+       Fix strict-aliasing warning.
+
+       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Avoid double cast.
+
+2012-07-07  Dave Thomas  <dave.thomas@metaforic.com>
+
+       [ARM] Fix FT_MulFix_arm.
+
+       * include/freetype/config/ftconfig.h (FT_MulFix_arm) [__arm__]:
+       Avoid ADDS instruction to clobber condition codes.
+
+2012-07-06  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Do some code cleanup.
+
+       * src/autofit/afglobal.c (af_face_globals_new): Simplify.
+
+       * src/autofit/afhints.c: Use `FT_TRACE7' instead of `printf'
+       everywhere.
+       (FT_COMPONENT): New macro.
+       (af_glyph_hints_done): Simplify.
+
+       * include/freetype/internal/fttrace.h: Updated.
+
+2012-07-05  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve output of debugging information.
+
+       * src/autofit/afhints.c (af_glyph_hints_dump_segments): Print more
+       data; report no data.
+       (af_glyph_hints_dump_edges): Report no data.
+
+2012-07-04  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Fix Savannah bug #36091.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues),
+       src/autofit/aflatin2.c (af_latin2_metrics_init_blues): Change the
+       constraint for testing round vs. flat segment: Accept either a
+       small distance or a small angle.
+
+2012-07-04  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Beautify blue zone tracing.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues),
+       src/autofit/aflatin2.c (af_latin2_metrics_init_blues): Implement it.
+
+2012-07-03  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Quantize stem widths.
+
+       * src/autofit/afangles.c (af_sort_widths): Rename to...
+       (af_sort_and_quantize_widths): This.
+       Add code to avoid stem widths which are almost identical.
+       * src/autofit/aftypes.h, src/autofit/aflatin.c, src/autofit/afcjk.c:
+       Updated.
+
+2012-07-03  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Minor speed-up.
+
+       * src/autofit/afangles (af_sort_pos, af_sort_widths): Don't swap
+       elements if they are equal.
+
+2012-06-30  Gilles Espinasse  <g.esp@free.fr>
+
+       Fix `checking if gcc static flag -static works' test.
+
+       On my linux build tree, I receive yes answer in in every package I
+       build except freetype for this test checking if gcc static flag
+       `-static' works
+
+       On freetype, no is received, unless bzip2 and zlib are disabled using
+
+         ./configure --without-bzip2 --without-zlib
+
+       The reason is that bzip2 and zlib tests add `-lz' and `-lbz2' to
+       LDFLAGS and this broke static flag test.
+
+       * builds/unix/configure.raw: Update CFLAGS and LDFLAGS only after
+       LT_INIT has run.
+
+2012-06-28  Infinality  <infinality@infinality.net>
+
+       [truetype] Fix various artifacts.
+
+       Verdana was broken in the original Infinality commit.  Also
+       includes other minor fixes.
+
+       * src/truetype/ttsubpix.h: Updated.  Removed unused macros.
+       (RASTERIZER_35_Rules): Add Verdana.
+       (SKIP_NONPIXEL_Y_MOVES_Rules): Add Tahoma `s'.
+       (MIRP_CVT_ZERO_Rules): Remove Verdana.
+       (ALWAYS_SKIP_DELTAP_Rules): Add Russian char 0x438.
+       (COMPATIBLE_WIDTHS_Rules): Rearrange some rules.
+       (X_SCALING_Rules): Adjust Verdana `a' at 12 and 13 ppem.
+
+       * src/truetype/ttsubpix.c: Updated.
+       (sph_set_tweaks): Re-execute fpgm always.
+
+2012-06-28  Gilles Espinasse  <g.esp@free.fr>
+
+       Fix CFLAGS and LDFLAGS share configure test.
+
+       * builds/unix/configure.raw: Fix typo.
+
+2012-06-28  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Set the `subpixel_positioned' flag unconditionally.
+
+       This is how the code currently behaves.
+
+       * src/truetype/ttgload.c (tt_loader_init): Do it.
+
+2012-06-27  Werner Lemberg  <wl@gnu.org>
+
+       Fix conditional compilation.
+
+       * src/base/basepic.c: Use FT_CONFIG_OPTION_MAC_FONTS.
+
+2012-06-27  Werner Lemberg  <wl@gnu.org>
+
+       Fix conditional compilation.
+
+       * include/freetype/internal/ftcalc.h (FT_MulDiv_No_Round): Don't
+       enclose with `TT_USE_BYTECODE_INTERPRETER'; we now need the function
+       elsewhere also.
+
+       * src/autofit/afcjk.h: Use AF_CONFIG_OPTION_CJK.
+
+       * src/truetype/ttgload.c (tt_loader_init): Fix compiler warning.
+
+       * src/truetype/ttinterp.c (Ins_MSIRP): Fix compiler warning.
+
+       * src/truetype/ttinterp.h: Use
+       TT_CONFIG_OPTION_BYTECODE_INTERPRETER.
+
+2012-06-26  Infinality  <infinality@infinality.net>
+
+       [truetype] Remove unused rounding functionality.
+
+       The subpixel hinting patch contained the concept of an adjustable
+       number of gridlines per pixel.  This is no longer used due to x
+       being completely ignored instead.  This will return some of the
+       code to its existing state prior to the original Infinality
+       commit.
+
+       * include/freetype/internal/ftobjs.h (FT_PIX_FLOOR_GRID,
+       FT_PIX_ROUND_GRID, FT_PIX_CEIL_GRID): Removed.
+
+       * src/truetype/ttinterp.c: Updated.
+       (Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid,
+       Round_Up_To_Grid, Round_To_Double_Grid, Round_Super, Round_Super_45,
+       SetSuperRound): Remove parameter to handle the number of grid lines per
+       pixel.
+       (SET_SuperRound, ROUND_None, CUR_Func_round): Updated.
+       (DO_SROUND, DOS45ROUND, DO_ODD, DO_EVEN): Updated.
+       (DO_ROUND, DO_NROUND): Updated.
+       (Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP,
+       Ins_MDRP, Ins_MIRP): Perform Round_None instead of calling a modified
+       rounding function.  Remove gridlines_per_pixel.  Create a local
+       variable to store control value cutin. Simplify the conditional for
+       ignore_x_mode.  Adjust rounding calls to pass only two values.
+
+2012-06-25  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Fix Savannah bug #36705.
+
+       Handle numbers like 2.001 correctly.
+
+       * src/cff/cffparse.c (cff_parse_real): Avoid negative values for
+       `shift'.
+
+2012-06-18  Infinality  <infinality@infinality.net>
+
+       [truetype] Support subpixel hinting.
+
+       This is the large, famous `Infinality' patch to support ClearType
+       bytecode which has been available from
+       http://www.infinality.net/blog/ for some time, and which has been
+       refined over the last years.  While still experimental, it is now
+       mature enough to be included directly into FreeType.
+
+       Most of the code is based on the ClearType whitepaper written by
+       Greg Hitchcock
+
+         http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
+
+       which gives a detailed overview of the necessary changes to the
+       Microsoft rasterizer so that older fonts are supported.  However, a
+       lot of details are still missing, and this patches provides a
+       framework to easily handle rendering issues down to the glyph level
+       of certain fonts.
+
+       Note that ClearType support is not completely implemented!  In
+       particular, full support for the options `compatible_widths',
+       `symmetrical_smoothing, and `bgr' (via the GETINFO bytecode
+       instruction) is missing.
+
+       * src/truetype/ttsubpix.c: New file, providing code to handle
+       `tweaks', this is, rules for certain glyphs in certain fonts
+       (including wildcards) which need a special treatment.
+
+       * src/truetype/ttsubpix.h: New file, holding the tweaking rules.
+
+       * include/freetype/config/ftoption.h, src/devel/ftoption.h
+       (TT_CONFIG_OPTION_SUBPIXEL_HINTING): New macro.
+
+       * include/freetype/internal/ftobjs.h (FT_PIX_FLOOR_GRID,
+       FT_PIX_ROUND_GRID, FT_PIX_CEIL_GRID): New macros.
+
+       * src/truetype/truetype.c [TT_USE_BYTECODE_INTERPRETER]: Include
+       `ttsubpix.c'.
+
+       * src/truetype/ttgload.c: Include `ttsubpix.h'.
+       [All changes below are guarded by TT_CONFIG_OPTION_SUBPIXEL_HINTING.]
+
+       (tt_get_metrics): Set tweak flags.
+       (TT_Hint_Glyph): Call `FT_Outline_EmboldenXY' if necessary.
+       (TT_Process_Simple_Glyph): Compensate emboldening if necessary.
+       (compute_glyph_metrics): Handle `compatible widths' option.
+       (tt_loader_init): Handle ClearType GETINFO information bits.
+
+       * src/truetype/rules.mk (TT_DRC_SRC): Updated.
+
+       * src/truetype/ttinterp.c: Include `ttsubpix.h'.
+       [Where necessary, changes below are guarded by
+       TT_CONFIG_OPTION_SUBPIXEL_HINTING.]
+
+       (Direct_Move, Direct_Move_X): Extended.
+       (Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid,
+       Round_Up_To_Grid, Round_To_Double_Grid, Round_Super, Round_Super_45,
+       SetSuperRound): Add parameter to handle the number of grid lines per
+       pixel.
+       (SET_SuperRound, ROUND_None, CUR_Func_round): Updated.
+       (DO_SROUND, DOS45ROUND, DO_ODD, DO_EVEN): Updated.
+       (DO_ROUND, DO_NROUND): Updated.
+       (DO_RS): Take care of `Typeman' bytecode patterns.
+       (Ins_FDEF): Add some debugging code.  Commented out.
+       (Ins_ENDF): Restore state.
+       (Ins_CALL, Ins_LOOPCALL): Handle inline delta functions.
+       (Ins_MD): Handle `Vacuform' rounds.
+       (Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP,
+       Ins_MDRP, Ins_MIRP): Handle tweaks.
+       (Ins_ALIGNRP): Add tweak guard.
+       (Ins_IUP, Ins_DELTAP): Handle tweaks.
+       (Ins_GETINFO): Handle new ClearType bits.
+       (TT_RunIns): Handle tweaks.
+
+       * src/truetype/ttinterp.h: Updated.
+       (SPH_TweakRule, SPH_ScaleRule): New structures for tweaks.
+       (TT_ExecContextRec): Add members for subpixel hinting support.
+
+       * src/truetype/ttobjs.h (TT_DefRecord): Add `inline_delta' member.
+
+2012-06-15  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.10 released.
+       =========================
+
+
+       Tag sources with `VER-2-4-10'.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.10.
+
+       * 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/vc2010/freetype.vcxproj, builds/win32/vc2010/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.4.9/2.4.10/, s/249/2410/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.
+
+       * builds/unix/configure.raw (version_info): Set to 15:0:9.
+
+2012-06-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing.
+
+       * docs/CHANGES: Updated.
+
+2012-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       * builds/exports.mk: Add CCexe_CFLAGS and CCexe_LDFLAGS.
+
+       to pass special compiler/linker flags under cross development.
+       Suggested by Savannah bug #36367.
+
+       ChangeLog on 2010-07-15 saying as they were removed was wrong
+       for the official trunk of FreeType2.  This commit is the first
+       introduction of them.
+
+2012-06-14  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2012-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [truetype] Add new versions of NEC FA family to tricky font list.
+
+       NEC FA family dated in 1996 have different checksum.
+       Reported by Johnson Y. Yan <yinsen_yan@foxitsoftware.com>; see
+
+         http://lists.gnu.org/archive/html/freetype-devel/2012-06/msg00023.html
+
+       * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): 4 sets
+       of fpgm & prep table checksums for FA-Gothic, FA-Minchou,
+       FA-RoundedGothicM, FA-RoundedGothicB are added.  The family
+       names in sample PDF are truncated, thus the list of the
+       family names in tt_check_trickyness_family() is not updated yet.
+
+2012-06-06  Werner Lemberg  <wl@gnu.org>
+
+       [ftraster] Fix rounding issue causing visual artifacts.
+
+       Problem reported by jola <hans-jochen.lau@lhsystems.com>; see
+
+         http://lists.gnu.org/archive/html/freetype-devel/2012-05/msg00036.html
+
+       * src/raster/ftraster.c (SMulDiv_No_Round): New macro.
+       (Line_Up): Use it.
+       * src/raster/ftmisc.h (FT_MulDiv_No_Round): Copied from `ftcalc.c'.
+
+2012-05-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Simplify.
+
+       We now use the cross product of the direction vectors to compute the
+       outline's orientation.
+
+2012-05-28  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2012-05-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       New function FT_Outline_EmboldenXY.
+
+       * include/freetype/ftoutln.h (FT_Outline_EmboldenXY): Define it.
+
+       * src/base/ftoutln.c (FT_Outline_EmboldenXY): Implement it, using a
+       simplified embolding algorithm.
+       (FT_Outline_Embolden): Make it a special case of
+       `FT_Outline_EmboldenXY'
+
+2012-05-07  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Fix Savannah bug #36386.
+
+       * src/type1/t1load.c (t1_load_keyword): Ignore keyword if context is
+       not valid.
+
+2012-04-07  Werner Lemberg  <wl@gnu.org>
+
+       Remove compiler warning.
+
+       * src/truetype/ttgload.c (TT_Load_Glyph)
+       [!TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Access `glyph->face' directly.
+
+2012-03-28  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Properly copy scaler flags to script metrics object.
+
+       Without this patch, only the dummy and cjk autohinter modules get
+       them (since they copy the whole scaler object).
+
+       * src/autofit/aflatin.c (af_latin_metrics_scale),
+       src/autofit/aflatin2.c (af_latin2_metrics_scale): Implement it.
+
+2012-03-22  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [bdflib] Remove redundant macro.
+
+       * src/bdf/bdflib.c (isdigok): Remove and replace with sbitset, which
+       is exactly the same.
+
+2012-03-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [configure] Fix Savannah bug #35644.
+
+       * builds/unix/configure.raw: Check `-ansi' flag works even if gcc
+       is used.  Bionic libc headers for Android lose the consistency
+       when they are parsed with __STDC_VERSION__ older than 199901L or
+       __STRICT_ANSI__.
+
+2012-03-20  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Improvement to Savannah bug #35656.
+
+       * src/bdf/bdflib.c (isdigok): Add cast, as suggested in report.
+
+2012-03-17  Chris Liddell  <chris.liddell@artifex.com>
+
+       [type1] Fix Savannah bug #35847.
+
+       * src/type1/t1load.c (parse_subrs): Fix the loop exit condition;
+       we want to exit when we have run out of data.
+
+2012-03-16  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Really fix Savannah bug #35658.
+
+       * src/bdf/bdflib.c (_bdf_list_split): Add one more `field' initializer.
+
+2012-03-14  Yann Droneaud  <yann@droneaud.fr>
+
+       [sfnt] Make arrays static like all others.
+
+       * src/sfnt/ttload.c (tt_face_load_maxp, tt_face_load_os2),
+       src/sfnt/ttmtx.c (tt_face_load_hhea): Add `static' keyword to frame
+       fields.
+
+2012-03-14  Huw Davies  <huw@codeweavers.com>
+
+       [sfnt] A refinement of the previous commit.
+
+       * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16,
+       tt_name_entry_ascii_from_other): Stop at null byte.
+
+2012-03-14  Huw Davies  <huw@codeweavers.com>
+
+       [sfnt] Add `name' table compatibility to MS Windows.
+
+       * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16,
+       tt_name_entry_ascii_from_other): Don't replace `\0' with question
+       marks when converting strings.
+
+2012-03-14  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Fix Savannah bug #35833.
+
+       Based on the patch given in the bug report.
+
+       * src/type1/t1load.c (IS_INCREMENTAL): New macro.
+       (read_binary_data): Add parameter `incremental'.
+       Update all callers using `IS_INCREMENTAL'.
+
+2012-03-11  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Return correct linear advance width values.
+
+       This was quite a subtle bug which accidentally showed up with glyph
+       `afii10023' of arial.ttf (version 2.76).  This glyph is a composite;
+       the first component, `E', has an advance width of 1366 font units,
+       while the advance width of the composite itself (which looks like
+       uppercase `E' with dieresis) is 1367 font units.  I think this is
+       actually a bug in the font itself, because there is no reason that
+       this glyph has not the same width as uppercase `E' without the
+       dieresis.  Anyway, it helped identify this problem.
+
+       Using the TrueType hinter, the correct value (1367) of `afii10023'
+       was returned, but the autohinter mysteriously returned 1366.
+
+       Digging in the code showed that the autohinter recursively calls
+       FT_Load_Glyph to load the glyph, adding the FT_LOAD_NO_SCALE load
+       flag.  However, the `linearHoriAdvance' field is still returned as a
+       scaled value.  To avoid scaling twice, the old code in autofit reset
+       `linearHoriAdvance', using the `horiAdvance' field.  This seemed to
+       work since FT_LOAD_NO_SCALE was in use, but it failed actually,
+       because `horiAdvance' is defined as the distance of the first
+       subglyph's phantom points, which in turn are initialized using the
+       advance width of the first subglyph.  And as the given example
+       shows, these widths can differ.
+
+       * src/autofit/afloader.c (af_loader_load_g): Temporarily set
+       FT_LOAD_LINEAR_DESIGN while calling FT_Load_Glyph to get unscaled
+       values for the linear advance widths.
+
+2012-03-10  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix SSW instruction.
+
+       * src/truetype/ttinterp.c (DO_SSW): SSW *does* use font units.  For
+       verification, it took some time to find a font which actually uses
+       this instruction.
+
+2012-03-09  Vinnie Falco  <vinnie.falco@gmail.com>
+
+       Prepare source code for amalgamation.
+
+       * include/freetype/freetype.h: Swap order of preprocessor blocks.
+
+2012-03-08  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.9 released.
+       =========================
+
+
+       Tag sources with `VER-2-4-9'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.9.
+
+       * 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/vc2010/freetype.vcxproj, builds/win32/vc2010/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.4.8/2.4.9/, s/248/249/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 9.
+
+       * builds/unix/configure.raw (version_info): Set to 14:1:8.
+
+2012-03-08  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Add missing overflow check.
+
+       * src/bdf/bdflib.c (_bdf_parse_glyphs) <BITMAP>: Add threshold for
+       `glyph->bpr'.
+
+2012-03-07  Vinnie Falco  <vinnie.falco@gmail.com>
+
+       Prepare source code for amalgamation.
+
+       * src/autofit/aferrors.h, src/bdf/bdferror.h, src/bzip2/ftbzip2.c,
+       src/cache/ftcerror.h, src/cff/cfferrs.h, src/cid/ciderrs.h,
+       src/gxvalid/gxverror.h, src/gzip/ftgzip.c, src/lzw/ftlzw.c,
+       src/otvalid/otverror.h, src/pcf/pcferror.h, src/pfr/pfrerror.h,
+       src/psaux/psauxerr.h, src/pshinter/pshnterr.h,
+       src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h,
+       src/smooth/ftsmerrs.h, src/truetype/tterrors.h,
+       src/type1/t1errors.h, src/type42/t42error.h, src/winfonts/fnterrs.h:
+       Add #undef FT_ERR_PREFIX before #define FT_ERR_PREFIX.
+
+2012-03-03  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #35660.
+
+       For some divisions, we use casts to 32bit entities.  Always guard
+       against division by zero with these casts also.
+
+       * src/base/ftcalc.c (ft_div64by32): Remove redundant cast.
+       (FT_MulDiv, FT_MulDiv_No_Round): Add 32bit cast.
+       (FT_DivFix): Add 32bit cast (this omission triggered the bug).
+
+2012-03-03  Werner Lemberg  <wl@gnu.org>
+
+       [psaux] Fix handling of track kerning.
+
+       * src/psaux/afmparse.c (afm_parse_track_kern): Don't inverse sign
+       for `min_kern'.  It is indeed quite common that track kerning
+       *increases* spacing for very small sizes.
+
+2012-03-02  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix Savannah bug #35689.
+
+       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check first outline
+       point.
+
+2012-03-01  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #35656.
+
+       * src/bdf/bdflib.c (_bdf_parse_glyphs) <_BDF_BITMAP>: Check validity
+       of nibble characters instead of accessing `a2i' array.
+
+2012-03-01  Werner Lemberg  <wl@gnu.org>
+
+       [winfonts] Fix Savannah bug #35659.
+
+       * src/winfonts/winfnt.c (FNT_Face_Init): Check number of glyphs.
+
+2012-03-01  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #35658.
+
+       * src/bdf/bdflib.c (_bdf_list_split): Initialize `field' elements
+       properly.
+
+2012-03-01  Werner Lemberg  <wl@gnu.org>
+
+       [psaux] Fix Savannah bug #35657.
+
+       If in function `skip_spaces' the routine `skip_comment' comes to the
+       end of buffer, `cur' is still increased by one, so we need to check
+       for `p >= limit' and not `p == limit'.
+
+       * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed,
+       PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Fix boundary checking.
+
+2012-03-01  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix Savannah bug #35646.
+
+       * src/truetype/ttinterp.c (Ins_MIRP): Typo, present since ages.  The
+       code is now in sync with the other operators (e.g. MSIRP) which
+       modify twilight points.
+
+2012-03-01  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #35643.
+
+       * src/bdf/bdflib.c (_bdf_list_ensure): Bring code in sync with
+       comment before `_bdf_list_split', this is, really allocate at least
+       five `field' elements.
+
+2012-03-01  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #35641.
+
+       * src/bdf/bdflib.c (_bdf_parse_glyphs) <DWIDTH, BBX>: Abort if
+       _BDF_ENCODING isn't set.  We need this because access to the `glyph'
+       variable might be undefined otherwise.
+
+2012-03-01  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix Savannah bug #35640.
+
+       * src/truetype/ttinterp.c (SkipCode, TT_RunIns): Fix boundary check
+       for NPUSHB and NPUSHW instructions.
+
+2012-02-29  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix Savannah bug #35601.
+
+       * src/truetype/ttinterp.c (Ins_SHZ): Use number of points instead of
+       last point for loop.
+       Also remove redundant boundary check.
+
+2012-02-29  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Remove redundant check.
+
+       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant
+       second check for ordered contour start points.
+
+2012-02-29  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Make SHC instruction behave similar to MS rasterizer.
+
+       * src/truetype/ttinterp.c (Ins_SHC): Handle virtual contour in
+       twilight zone.
+
+2012-02-29  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       Avoid modulo operators against a power-of-two denominator.
+
+       * src/afcjk.c (af_hint_normal_stem), src/base/ftoutln.c
+       (ft_contour_has), src/cff/cffgload.c (cff_decoder_parse_charstrings)
+       <cff_op_vvcurveto, cff_op_hhcurveto, cff_op_hvcurveto>,
+       src/gxvalid/gxvcommn.c (GXV_32BIT_ALIGNMENT_VALIDATE),
+       src/gxvalid/gxvfeat.c (gxv_feat_setting_validate): Replace `%' with
+       `&' operator.
+
+2012-02-29  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Don't synchronize digit widths for light rendering mode.
+
+       We don't hint horizontally in this mode.
+
+       * src/autofit/afloader.c (af_loader_load_g) <Hint_Metrics>:
+       Implement it.
+
+2012-02-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [type42] Minor code optimization (again).
+
+       * src/type42/t42parse.c (t42_parse_sfnts): Simplify previous change.
+
+2012-02-26  Mateusz Jurczyk  <mjurczyk@google.com>
+           Werner Lemberg  <wl@gnu.org>
+
+       [smooth] Fix Savannah bug #35604.
+
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `FT_Pos'
+       instead of `FT_UInt' for some variables and update comparisons
+       accordingly.  A detailed analysis can be found in the bug report.
+
+2012-02-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [type42] Minor code optimization.
+
+       * src/type42/t42parse.c (t42_parse_sfnts): Use bitmask instead of
+       modulo operator.
+
+2012-02-26  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2012-02-26  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Fix Savannah bug #35608.
+
+       * src/type1/t1parse.c (T1_Get_Private_Dict): Reject too short
+       dictionaries.
+
+2012-02-26  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Support `ENCODING -1 <n>' format.
+
+       * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Implement it.
+
+2012-02-26  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #35607.
+
+       * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Normalize
+       negative encoding values.
+
+2012-02-26  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Fix Savannah bug #35606.
+
+       * src/type1/t1load.c (parse_subrs): Add proper guards for `strncmp'.
+
+       * src/psaux/psobjs.c (ps_parser_skip_PS_token): Emit error message
+       only if cur < limit.
+
+2012-02-25  Werner Lemberg  <wl@gnu.org>
+
+       [pcf] Fix Savannah bug #35603.
+
+       * src/pcf/pcfread.c (pcf_get_properties): Assure final zero byte in
+       `strings' array.
+
+2012-02-25  Werner Lemberg  <wl@gnu.org>
+
+       [type42] Fix Savannah bug #35602.
+
+       * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more
+       thoroughly.
+
+2012-02-25  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bugs #35599 and #35600.
+
+       * src/bdf/bdflib.c (ACMSG16): New warning message.
+       (_bdf_parse_glyphs) <_BDF_BITMAP>: Check line length.
+
+2012-02-24  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bugs #35597 and #35598.
+
+       * src/bdf/bdflib.c (_bdf_is_atom): Fix handling of property value.
+
+2012-02-24  Vinnie Falco  <vinnie.falco@gmail.com>
+
+       Prepare source code for amalgamation (6/6).
+
+       * src/cff/cffdrivr.c: s/Load_Glyph/cff_glyph_load/.
+
+       * src/cid/cidload.c: s/parse_font_matrix/cid_parse_font_matrix/.
+       s/t1_init_loader/cid_init_loader/.
+       s/t1_done_loader/cid_done_loader/.
+
+       * src/pxaux/t1cmap.c: s/t1_get_glyph_name/psaux_get_glyph_name/.
+
+       * src/truetype/ttdriver.c: s/Load_Glyph/tt_glyph_load/.
+
+       * src/type1/t1load.c: s/parse_font_matrix/t1_parse_font_matrix/.
+
+2012-02-24  Vinnie Falco  <vinnie.falco@gmail.com>
+
+       Prepare source code for amalgamation (5/6).
+
+       * include/freetype/fterrors.h: Undefine FT_KEEP_ERR_PREFIX after
+       using it.
+
+2012-02-22  Vinnie Falco  <vinnie.falco@gmail.com>
+
+       Prepare source code for amalgamation (4/6).
+
+       * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine RAS_ARG,
+       RAS_ARGS, RAS_VAR, and RAS_VARS before defining it.
+
+       * src/smooth/ftgrays.c: s/TRaster/black_TRaster/,
+       s/PRaster/black_PRaster/.
+       * src/raster/ftraster.c: s/TRaster/gray_TRaster/,
+       s/PRaster/gray_PRaster/.
+
+2012-02-20  Vinnie Falco  <vinnie.falco@gmail.com>
+
+       Prepare source code for amalgamation (3/6).
+
+       * src/smooth/ftgrays.c: s/TWorker/black_TWorker/,
+       s/PWorker/black_PWorker/.
+       * src/raster/ftraster.c: s/TWorker/gray_TWorker/,
+       s/PWorker/gray_PWorker/.
+
+2012-02-20  Vinnie Falco  <vinnie.falco@gmail.com>
+
+       Prepare source code for amalgamation (2/6).
+
+       * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine FLOOR,
+       CEILING, TRUNC, and SCALED before defining it.
+
+2012-02-20  Vinnie Falco  <vinnie.falco@gmail.com>
+
+       Prepare source code for amalgamation (1/6).
+
+       See discussion starting at
+
+         http://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00037.html
+
+       * src/smooth/ftgrays.c: s/TBand/gray_TBand/.
+       * src/raster/ftraster.c: s/TBand/black_TBand/.
+
+2012-02-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [autofit] Fix outline flags.
+
+       * src/autofit/afloader.c (af_loader_load_g): Don't reassign
+       `outline.flags' so that this information is preserved.  See
+       discussion starting at
+
+         http://lists.gnu.org/archive/html/freetype-devel/2012-02/msg00046.html
+
+2012-02-11  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix Savannah bug #35466.
+
+       Jump instructions are now bound to the current function.  The MS
+       Windows rasterizer behaves the same, as confirmed by Greg Hitchcock.
+
+       * src/truetype/ttinterp.h (TT_CallRec): Add `Cur_End' element.
+       * src/truetype/ttobjs.h (TT_DefRecord): Add `end' element.
+
+       * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF): Check upper
+       bound of jump address.
+       (Ins_FDEF, Ins_CALL, Ins_LOOPCALL, Ins_UNKNOWN, TT_RunIns): Updated.
+
+2012-02-11  Werner Lemberg  <wl@gnu.org>
+
+       We don't use `extensions'.
+
+       * include/freetype/internal/ftobjs.h (FT_DriverRec): Remove
+       `extensions' field.
+
+2012-02-11  Werner Lemberg  <wl@gnu.org>
+
+       Clean up `generic' fields.
+
+       * include/freetype/internal/ftobjs.h (FT_ModuleRec, FT_LibraryRec):
+       Remove `generic' field since users can't access it.
+
+       * src/base/ftobjs.c (FT_Done_GlyphSlot): Call `generic.finalizer' as
+       advertised in the documentation of FT_Generic.
+       (Destroy_Module, FT_Done_Library): Updated to changes in `ftobjs.h'.
+
+2012-02-07  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Harmonize function arguments.
+
+       * src/autofit/afloader.c, src/autofit/afloader.h: Use `FT_Int32' for
+       `load_flags'.
+
+2012-02-07  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cffobjs.c (cff_face_init): Remove unnecessary casts.
+
+2012-01-17  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [gxvalid] Fix Savannah bug #35286.
+
+       Patch submitted by anonymous reporter.
+
+       * src/gxvalid/gxvcommn.c (gxv_XStateTable_subtable_setup):
+       gxv_set_length_by_ulong_offset() must be called with 3, not 4,
+       the number of the subtables in the state tables; classTable,
+       stateArray, entryTable.
+
+2012-01-17  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [raccess] Modify for PIC build.
+
+       Based on the patch provided by Erik Dahlstrom <ed@opera.com>,
+       http://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00010.html
+
+       Also `raccess_guess_table[]' and `raccess_rule_by_darwin_vfs()'
+       are renamed with `ft_' suffixes.
+
+       * src/base/ftbase.h: `raccess_rule_by_darwin_vfs()' is renamed
+       to `ft_raccess_rule_by_darwin_vfs()'.
+       * src/base/ftobjs.c: Ditto.
+
+       * src/base/ftrfork.c: Declarations of FT_RFork_Rule,
+       raccess_guess_rec, are moved to...
+       * include/freetype/internal/ftrfork.h: Here.
+
+       * include/freetype/internal/ftrfork.h:
+       FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END} macros are defined
+       to replace raccess_guess_table[] in both of PIC and non-PIC
+       modes.
+       * src/base/ftrfork.c: raccess_guess_table[] array is rewritten
+       by FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END}.
+
+       * src/base/basepic.h (BasePIC): Add `ft_raccess_guess_table'
+       storage.  (FT_RACCESS_GUESS_TABLE_GET): New macro to retrieve
+       the function pointer from `ft_raccess_guess_table' storage in
+       `BasePIC' structure.
+       * src/base/ftrfork.c (FT_Raccess_Guess): Rewritten with
+       FT_RACCESS_GUESS_TABLE_GET.
+       (raccess_get_rule_type_from_rule_index): Add `library' as the
+       first argument to the function, to retrieve the storage of
+       `ft_raccess_guess_table' from it.  Also `raccess_guess_table'
+       is replaced by FT_RACCESS_GUESS_TABLE_GET.
+       (ft_raccess_rule_by_darwin_vfs): Ditto.
+
+2012-01-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Remove trailing spaces.
+
+2012-01-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Formatting PIC related sources.
+
+       * src/autofit/afpic.c: Harmonize to FT2 coding conventions.
+       * src/base/basepic.c: Ditto.
+       * src/base/ftpic.c: Ditto.
+       * src/cff/cffpic.c: Ditto.
+       * src/pshinter/pshpic.c: Ditto.
+       * src/psnames/pspic.c: Ditto.
+       * src/raster/rastpic.c: Ditto.
+       * src/sfnt/sfntpic.c: Ditto.
+       * src/smooth/ftspic.c: Ditto.
+       * src/truetype/ttpic.c: Ditto.
+
+2012-01-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [autofit] Fix the inclusion of `aflatin2.h' in PIC file.
+
+       * src/autofit/afpic.c: Include `aflatin2.h' when
+       FT_OPTION_AUTOFIT2 is defined, as afglobal.c does so.
+       Unconditionally inclusion causes declared but unimplemented
+       warning by GCC 4.6.
+
+2012-01-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cff] Remove redundant declarations of cff_cmap_XXX_class_rec.
+
+       * src/cff/cffpic.c: The declarations of
+       FT_Init_Class_cff_cmap_encoding_class_rec() and
+       FT_Init_Class_cff_cmap_unicode_class_rec() are removed.
+       They can be obtained by the inclusion of cffcmap.h.
+       cffcmap.h invokes FT_DECLARE_CMAP_CLASS() and it declares
+       FT_Init_Class_cff_cmap_encoding_class_rec() etc in PIC mode.
+
+2012-01-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix redundant declaration warning in PIC mode.
+
+       Originally FT_DEFINE_{DRIVER,MODULE,RENDERER}() macros were
+       designed to declare xxx_pic_{free,init} by themselves.
+       Because these macros are used at the end of the module
+       interface (e.g. ttdriver.c) and the wrapper source to build
+       a module as a single object (e.g. truetype.c) includes
+       the PIC file (e.g. ttpic.c) before the module interface,
+       these macros are expanded AFTER xxx_pic_{free,init} body
+       when the modules are built as single object.
+       The declaration after the implementation causes the redundant
+       declaration warnings, so the declarations are moved to module
+       PIC headers (e.g. ttpic.h).  Separating to other header files
+       are needed for multi build.
+
+       * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER):
+       Remove class_##_pic_free and class_##_pic_init declarations.
+       * include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
+       FT_DEFINE_MODULE): Ditto.
+
+       * src/base/basepic.h: Insert a comment and fix coding style.
+       * src/autofit/afpic.h: Declare autofit_module_class_pic_{free,
+       init}.
+       * src/cff/cffpic.h: Declare cff_driver_class_pic_{free,init}.
+       * src/pshinter/pshpic.h: Declare pshinter_module_class_pic_{free,
+       init}.
+       * src/psnames/pspic.h: Declare psnames_module_class_pic_{free,
+       init}.
+       * src/raster/rastpic.h: Declare
+       ft_raster{1,5}_renderer_class_pic_{free,init}
+       * src/sfnt/sfntpic.h: Declare sfnt_module_class_pic_{free,init}.
+       * src/smooth/ftspic.h: Declare
+       ft_smooth_{,lcd_,lcdv_}renderer_class_pic_{free,init}.
+       * src/truetype/ttpic.h: Declare tt_driver_class_pic_{free,init}.
+
+2012-01-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Make pspic.c to include module error header to fix multi build.
+
+       * src/psnames/pspic.c: Include `psnamerr.h'.
+
+2012-01-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [base] Fix a dereference of uninitialized variable in PIC mode.
+
+       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): `glyph' must be
+       set before derefering to obtain `library'.  The initialization
+       of `clazz', `glyph', `library' and NULL pointer check are
+       reordered to minimize PIC conditonals.
+
+2012-01-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [base] Insert explicit cast for GCC 4.6 in PIC mode.
+
+       * src/base/ftinit.c (FT_Add_Default_Modules): Under PIC
+       configuration, FT_DEFAULT_MODULES_GET returns
+       FT_Module_Class** pointer, GCC 4.6 warns that
+       const FT_Module_Class* const* variable is warned as
+       inappropriate to store it.  To calm it, explicit cast is
+       inserted.  Also `library' is checked to prevent the NULL
+       pointer dereference in FT_DEFAULT_MODULES_GET.
+
+2012-01-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix PIC build broken by d9145241fe378104ba4c12a42534549faacc92e6.
+
+       Under PIC configuration, FT_{CFF,PSCMAPS,SFNT,TT}_SERVICES_GET
+       take no arguments but derefer the variable named `library'
+       internally.
+
+       * src/cff/cffdrivr.c (cff_get_interface): Declare `library' and
+       set it if non-NULL driver is passed.
+       * src/truetype/ttdriver.c (tt_get_interface): Ditto.
+
+       * src/sfnt/sfdriver.c (sfnt_get_interface): Declare `library'
+       under PIC configuration, and set it if non-NULL module is given.
+       * src/psnames/psmodule.c (psnames_get_interface): Ditto.
+
+2012-01-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Make PIC files include module error headers, to use the error codes
+       with per-module prefix.
+
+       * src/autofit/afpic.c: Include `aferrors.h'.
+       * src/cff/cffpic.c: Include `cfferrs.h'.
+       * src/pshinter/pshpic.c: Include `pshnterr.h'.
+       * src/raster/rastpic.c: Include `rasterrs.h'.
+       * src/sfnt/sfntpic.c: Include `sferrors.h'.
+       * src/smooth/ftspic.c: Include `ftsmerrs.h'.
+       * src/truetype/ttpic.c: Include `tterrors.h'.
+
+2012-01-04  Tobias Ringström  <tobias@ringis.se>
+
+       [truetype] Fix IP instruction if x_ppem != y_ppem.
+
+       * src/truetype/ttinterp.c (Ins_IP): Scale `orus' coordinates
+       properly.
+
+2012-01-02  Werner Lemberg  <wl@gnu.org>
+
+       Fix tracing message for `loca' table.
+
+       * src/truetype/ttpload.c (tt_face_get_location): Don't emit a
+       warning message if the last `loca' entry references an empty glyph.
+
+2011-12-10  Werner Lemberg  <wl@gnu.org>
+
+       Add some variable initializations.
+       Reported by Richard COOK <rscook@unicode.org>.
+
+       * src/type1/t1driver.c (t1_ps_get_font_value): Initialize `val'.
+       * src/smooth/ftgrays.c (gray_render_conic): Initialize `levels'
+       earlier.
+
+2011-12-08  Werner Lemberg  <wl@gnu.org>
+
+       Fix serious scaling bug in `FT_Get_Advances'.
+
+       * src/base/ftadvanc.c (FT_Get_Advances): Advance values returned by
+       `FT_Load_Glyph' must be simply multiplied by 1024.
+
+2011-12-08  Werner Lemberg  <wl@gnu.org>
+
+       * src/bdf/bdflib.c (_bdf_parse_start): Drop redundant error tracing.
+
+2011-12-02  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [mac] Unify DARWIN_NO_CARBON with FT_MACINTOSH.
+
+       Originally FT_MACINTOSH was a pure auto macro and DARWIN_NO_CARBON
+       was a configurable macro to disable Carbon-dependent code.  Because
+       now configure script sets DARWIN_NO_CARBON by default and disables
+       Darwin & Carbon-dependent codes, these macros can be unified.
+       FT_MACINTOSH (undefined by default) is kept and DARWIN_NO_CARBON
+       (defined by default) is removed, because DARWIN_NO_CARBON violates
+       FT_XXX naming convention of public macros, and a macro configured by
+       default is not portable for the building without configure (e.g.
+       make devel).
+
+       * builds/unix/configure.raw: Define FT_MACINTOSH if Carbon-based
+       old Mac font support is requested and Carbon is available.
+       * builds/unix/ftconfig.in: Undefine FT_MACINTOSH when the support
+       for Mac OS X without Carbon (e.g.  Mac OS X 10.4 for ppc64) is
+       requested.
+       * include/freetype/config/ftconfig.in: Ditto.
+       * builds/vms/ftconfig.h: Ditto.
+
+       * src/base/ftbase.h: Remove DARWIN_NO_CARBON.
+       * src/base/ftbase.c: Ditto.
+       * src/base/ftobjs.c: Ditto.
+       * src/base/ftrfork.c: Ditto.
+
+       * src/base/ftmac.c: Compile the body if FT_MACINTOSH is defined
+       (same with TT_USE_BYTECODE_INTERPRETER in ttinterp.c).
+       * builds/mac/ftmac.c: Ditto.
+
+       * builds/mac/FreeType.m68k_cfm.make.txt: Define FT_MACINTOSH.
+       * builds/mac/FreeType.m68k_far.make.txt: Ditto.
+       * builds/mac/FreeType.ppc_classic.make.txt: Ditto.
+       * builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
+
+2011-11-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix Savannah bug #34728 (`make devel' on Mac OS X).
+
+       * builds/toplevel.mk: Check `/dev/null' to identify the Unix-
+       like systems without `init' nor `hurd' (e.g. Mac OS X >= 10.4).
+       * builds/unix/detect.mk: Ditto.
+
+2011-11-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [apinames] Fix the overflow of signed integer hash.
+
+       * src/tools/apinames.c (names_add): Change the type of `h' from
+       int to unsigned int, to prevent undefined behaviour in the
+       overflow of signed integers (overflow of unsigned int is defined
+       to be wrap around).  Found by clang test suggested by Sean
+       McBride.
+
+2011-11-30  Werner Lemberg  <wl@gnu.org>
+
+       [winfonts] Remove casts.
+
+       * src/winfonts/winfnt.c (winfnt_driver_class): Remove all casts and
+       update affected functions.
+       (FNT_Size_Select): Fix number of arguments.
+
+2011-11-30  Werner Lemberg  <wl@gnu.org>
+
+       [type42] Remove casts.
+
+       * src/type42/t42driver.c (t42_driver_class): Remove all casts and
+       update affected functions.
+
+       * src/type42/t42objs.c, src/type42/t42objs.h: Updated for t42driver
+       changes.
+
+2011-11-30  Werner Lemberg  <wl@gnu.org>
+
+       [type1] Remove casts.
+
+       * src/type1/t1driver.c (t1_driver_class): Remove all casts and
+       update affected functions.
+
+       * src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1objs.c:
+       Updated for t1driver changes.
+       src/type1/t1objs.h (T1_Driver): Remove unused typedef.
+       Updated for t1driver changes.
+
+2011-11-27  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #34896.
+
+       ENCODING now covers the whole Unicode range.
+
+       Note, however, that this change is quite expensive since it
+       increases the size of three arrays by almost 400kByte in total.  The
+       right fix is to replace the logic with something smarter.
+       Additionally, there exist very old BDFs for three-byte CCCII
+       encoding which exceeds the range of Unicode (another reason to have
+       a smarter logic).
+
+       * src/bdf/bdf.h (bdf_font_t): Increase size of `nmod' and `umod'
+       arrays.
+       * src/bdf/bdflib.c (bdf_parse_t): Increase size of `have' array.
+
+2011-11-27  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Improve tracing.
+
+       * src/bdf/bdflib.c (DBGMSG1, DBGMSG2): New macros.
+       (_bdf_parse_glyphs): Use them.
+
+2011-11-26  Werner Lemberg  <wl@gnu.org>
+
+       Improve tracing.
+
+       * src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
+       (PCF_Face_Done): Remove tracing message.
+
+       * src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
+       (cff_face_init), src/cid/cidobjs.c (cid_face_init),
+       src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
+       (sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
+       src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
+       (T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
+       `greeting' message.
+
+       * src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
+       (T42_Open_Face): Improve tracing.
+
+2011-11-26  Werner Lemberg  <wl@gnu.org>
+
+       [cid] Fix error code.
+
+       * src/cid/cidparse.c (cid_parser_new): Do it.
+
+2011-11-26  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Fix error code.
+
+       * src/cff/cffload.c (cff_font_load): Do it.
+
+2011-11-26  Werner Lemberg  <wl@gnu.org>
+
+       Add new error code FT_Err_Missing_Module.
+
+       Previously, FreeType misleadingly returned
+       FT_Err_Unknown_File_Format if a module was missing (or a test was
+       missing completely).
+
+       * include/freetype/fterrdef.h (FT_Err_Missing_Module): Define.
+
+       * src/cff/cffobjs.c (cff_face_init), src/cff/cffdrivr.c
+       (cff_get_glyph_name), src/cid/cidobjs.c (cid_face_init),
+       src/sfnt/sfobjs.c (sfnt_init_face), src/truetype/ttobjs.c
+       (tt_face_init), src/type1/t1objs.c (T1_Face_Init),
+       src/type42/t42objs.c (T42_Face_Init, T42_Driver_Init): Updated.
+
+       * src/type1/t1afm.c (T1_Read_Metrics), src/type/t1objs.c
+       (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Remove now
+       redundant test for `psaux'.
+
+2011-11-25  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Add more error messages.
+
+       * src/bdf/bdflib.c (_bdf_set_default_spacing, _bdf_add_property):
+       Add line number argument.
+       Update all callers.
+       (ERRMSG5, ERRMSG6, ERRMSG7, ERRMSG8, ERRMSG9): New macros.
+       (_bdf_readstream, _bdf_set_default_spacing, _bdf_add_property,
+       _bdf_parse_glyphs, _bdf_parse_start): Add error messages.
+
+2011-11-24  Werner Lemberg  <wl@gnu.org>
+
+       * include/freetype/fterrors.h: Remove dead code.
+
+2011-11-15  Werner Lemberg  <wl@gnu.org>
+
+       * docs/releases: Updated.
+
+2011-11-15  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.8 released.
+       =========================
+
+
+       Tag sources with `VER-2-4-8'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.8.
+
+       * 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/vc2010/freetype.vcxproj, builds/win32/vc2010/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.4.7/2.4.8/, s/247/248/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8.
+
+       * builds/unix/configure.raw (version_info): Set to 14:0:8.
+
+2011-11-13  Chris Liddell  <chris.liddell@artifex.com>
+
+       Add FT_Get_PS_Font_Value() API.
+
+       This allows a Type 1 font face to be interrogated to retrieve most
+       of the dictionary keys (keys not relevant to FreeType's Type 1
+       interpreter are not available).
+
+       * include/freetype/internal/services/svpsinfo.h
+       (PS_GetFontValueFunc): New typedef.
+       (PSInfo): Add `ps_get_font_value'.
+       (FT_DEFINE_SERVICE_PSINFOREC): Updated.
+
+       * include/freetype/internal/t1types.h (T1_EncodingType): Moved to...
+       * include/freetype/t1tables.h: Here.
+       (PS_Dict_Keys): New enumeration.
+       (FT_Get_PS_Font_Value): New declaration.
+
+       * src/base/fttype1.c (FT_Get_PS_Font_Value): New function.
+
+       * src/type1/t1driver.c (t1_ps_get_font_value): This new function
+       does the real job.
+       (t1_service_ps_info): Add it.
+
+       * src/cff/cffdrivr.c (cff_service_ps_info), src/cid/cidriver.c
+       (cid_service_ps_info), src/type42/t42drivr.c (t42_service_ps_info):
+       Updated.
+
+2011-11-08  Braden Thomas  <bthomas@apple.com>
+
+       [cid] Various loading fixes.
+
+       * src/cid/cidload.c (cid_load_keyword) <default>,
+       (parse_font_matrix, parse_expansion_factor): Correctly check number
+       of dictionaries.
+       (cid_read_subrs): Protect against invalid values of `num_subrs'.
+       Assure that the elements of the `offsets' array are ascending.
+
+2011-11-05  Werner Lemberg  <wl@gnu.org>
+
+       * README: We use copyright ranges also.
+
+       According to
+
+         http://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html
+
+       this should be mentioned explicitly.
+
+2011-10-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [raccess] Supplement for previous fix.
+
+       * src/base/ftbase.h (raccess_rule_by_darwin_vfs): Do not declare
+       it on native Mac OS X.
+       * src/base/ftrfork.c (raccess_get_rule_type_from_rule_index):
+       Hide raccess_get_rule_type_from_rule_index() on native Mac OS X
+       too.
+
+2011-10-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [raccess] Hide raccess_rule_by_darwin_vfs() on native Mac OS X.
+
+       * src/base/ftrfork.c (raccess_rule_by_darwin_vfs): Do not
+       compile on native Mac OS X because it is not used.
+
+2011-10-25  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix MD instruction for twilight zone.
+
+       * src/truetype/ttinterp.c (Ins_MD): Without this fix, the MD
+       instruction applied to original coordinates of twilight points
+       always returns zero.
+
+2011-10-18  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.7 released.
+       =========================
+
+
+       Tag sources with `VER-2-4-7'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.7.
+
+       * 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/vc2010/freetype.vcxproj, builds/win32/vc2010/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.4.6/2.4.7/, s/246/247/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7.
+
+       * builds/unix/configure.raw (version_info): Set to 13:2:7.
+
+2011-10-15  Kal Conley  <kcconley@gmail.com>
+
+       Fix handling of transformations if no renderer is present.
+
+       * src/base/ftobjs.c (FT_Load_Glyph): Thinko.
+
+2011-10-15  Kal Conley  <kcconley@gmail.com>
+
+       Fix conditions for autohinting.
+
+       * src/base/ftobjs.c (FT_Load_Glyph): Handle
+       FT_LOAD_IGNORE_TRANSFORM.
+
+2011-10-07  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [gxvalid] Fix a bug to detect too large offset in morx table.
+
+       * src/gxvalid/gxvmorx2.c
+       (gxv_morx_subtable_type2_ligActionIndex_validate): Fix a bug
+       that too large positive offset cannot be detected.
+
+2011-10-01  Braden Thomas  <bthomas@apple.com>
+
+       Handle some border cases.
+
+       * include/freetype/config/ftstdlib.h (FT_USHORT_MAX): New macro.
+
+       * src/base/ftbitmap.c (FT_Bitmap_Convert): Protect against invalid
+       value of `target->rows'.
+
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add check for
+       flex start.
+
+       * src/raster/ftrend1.c (ft_raster1_render): Check `width' and
+       `height'.
+
+       * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Protect against
+       invalid values in `localpoints' array.
+
+2011-10-01  Werner Lemberg  <wl@gnu.org>
+
+       [psnames] Handle zapfdingbats.
+       Problem reported by Nicolas Rougier <Nicolas.Rougier@inria.fr>.
+
+       * src/tools/glnames.py (adobe_glyph_list): Add data from AGL's
+       `zapfdingbats.txt' file.
+
+       * src/psnames/pstables.h: Regenerated.
+
+2011-09-27  Simon Bünzli  <zeniko@gmail.com>
+
+       [type1] Fix Savannah bug #34189.
+
+       * src/type1/t1load.c (T1_Open_Face): Initialize
+       `face->len_buildchar'.
+
+2011-09-26  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Dump SIDs while tracing.
+
+       * src/cff/cffobjs.c (cff_face_init): Do it.
+
+       * src/cff/cffparse.c (cff_parser_run) [FT_DEBUG_LEVEL_TRACE]
+       <cff_kind_string>: Identify as SID.
+
+2011-09-17  Werner Lemberg  <wl@gnu.org>
+
+       Remove unused FT_ALIGNMENT macro.
+
+       * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
+       include/freetype/config/ftconfig.h: Do it.
+
+2011-09-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       [smooth] Slightly optimize conic and cubic flatterners.
+
+       * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move
+       out some code from the main loop to speed it up.
+
+2011-09-11  Tomas Hoger  <thoger@redhat.com>
+
+       Slightly improve LZW_CLEAR handling.
+
+       * src/lzw/ftzopen.c (ft_lzwstate_io) <FT_LZW_PHASE_CODE>:
+       Ensure that subsequent (modulo garbage byte(s)) LZW_CLEAR codes are
+       handled as clear codes.  This also re-sets old_code and old_char to
+       predictable values, which is a little better than using `random'
+       ones if the code following LZW_CLEAR is invalid.
+
+2011-09-11  Tomas Hoger  <thoger@redhat.com>
+
+       Add explicit LZW decompression stack size limit.
+
+       Stack larger than 1<<LZW_MAX_BITS is never needed if prefix table is
+       constructed correctly.  It's even less than that, see e.g.
+       libarchive code comment for a better size upper bound:
+
+         http://code.google.com/p/libarchive/source/browse/trunk/libarchive/archive_read_support_filter_compress.c?r=3635#121
+
+       This patch adds explicit stack size limit, enforced when stack is
+       realloced.
+
+       An alternative is to ensure that code < state->prefix[code - 256]
+       when traversing prefix table.  Such check is less efficient and
+       should not be required if prefix table is constructed correctly in
+       the first place.
+
+       * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Implement it.
+
+2011-09-11  Tomas Hoger  <thoger@redhat.com>
+
+       Protect against loops in the prefix table.
+
+       LZW decompressor did not sufficiently check codes read from the
+       input LZW stream.  A specially-crafted or corrupted input could
+       create a loop in the prefix table, which leads to memory usage
+       spikes, as there's no decompression stack size limit.
+
+       * src/lzw/ftzopen.c (ft_lzwstate_io) <FT_LZW_PHASE_START>: First
+       code in valid LZW stream must be 0..255.
+       <FT_LZW_PHASE_CODE>: In the special KwKwK case, code == free_ent,
+       code > free_ent is invalid.
+
+2011-09-09  Werner Lemberg  <wl@gnu.org>
+
+       Better tracing of metrics.
+
+       * src/base/ftobjs.c (FT_Request_Size, FT_Select_Size): Decorate with
+       FT_TRACE.
+
+2011-09-07  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Fix Savannah bug #33816.
+
+       * src/cff/cfftypes.h (CFF_FontRecDictRec): New member
+       `has_font_matrix'.
+       * src/cff/cffparse.c (cff_parse_font_matrix): Set it.
+       Update tracing output.
+       * src/cff/cffobjs.c (cff_face_init): Use it so that the heuristics
+       can be removed.
+
+2011-08-30  Werner Lemberg  <wl@gnu.org>
+
+       Better tracing of metrics.
+
+       * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics):
+       Decorate with FT_TRACE.
+
+2011-08-25  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Better tracing of the parsing process.
+
+       * src/cff/cffload.c (cff_subfont_load, cff_font_load): Decorate with
+       FT_TRACE.
+
+       * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox,
+       cff_parse_private_dict, cff_parse_cid_ros): Updated.
+       (CFF_FIELD_NUM, CFF_FIELD_FIXED, CFF_FIELD_FIXED_1000,
+       CFF_FIELD_STRING, CFF_FIELD_BOOL, CFF_FIELD_CALLBACK, CFF_FIELD,
+       CFF_FIELD_DELTA): Add argument for ID.
+       (cff_parser_run): Decorate with FT_TRACE.
+
+       * src/cff/cffparse.h (CFF_Field_Handler) [FT_DEBUG_LEVEL_TRACE]: Add
+       `id' member.
+
+       * src/cff/cfftoken.h: Add IDs to all fields.
+
+2011-08-16  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #34022.
+
+       * README, docs/INSTALL: Remove references to UPGRADE.UNIX.
+
+2011-08-15  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #34018.
+
+       * docs/UPGRADE.UNIX: Removed.  Obsolete.
+
+2011-08-15  David Bevan  <david.bevan@pb.com>
+
+       Fix Savannah bug #33992.
+
+       * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix border case.
+
+2011-08-12  Werner Lemberg  <wl@gnu.org
+
+       [truetype] Fix degenerate case in S{P,F,DP}VTL opcodes.
+
+       * src/truetype/ttinterp.c (Ins_SxVTL): Handle p1 == p2 specially.
+       (Ins_SDPVTL): Handle v1 == v2 specially.
+
+2011-08-09  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Fix Savannah bug #33975.
+
+       * src/cff/cffparse.c (cff_parse_font_matrix): Fix typo.
+
+2011-07-29  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.6 released.
+       =========================
+
+
+       Tag sources with `VER-2-4-6'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.6.
+
+       * 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/vc2010/freetype.vcxproj, builds/win32/vc2010/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.4.5/2.4.6/, s/245/246/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6.
+
+       * builds/unix/configure.raw (version_info): Set to 13:1:7.
+
+2011-07-29  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Add some more tracing infos.
+
+       * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox,
+       cff_parse_cid_ros): Add tracing.
+
+2011-07-22  Dirk Müller  <dmueller@suse.de>
+
+       [psaux, type1] Fix null pointer dereferences.
+
+       Found with font fuzzying.
+
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Check
+       `decoder->buildchar'.
+
+       * src/type1/t1load.c (t1_load_keyword): Check `blend->num_designs'.
+
+2011-07-20  Chris Morgan  <cmorgan@cybexintl.com>
+
+       Add FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT.
+
+       Useful for embedded systems which don't need file stream support.
+
+       * src/base/ftsystem.c, src/base/ftobjs.c (FT_Stream_New): Implement
+       it.
+
+2011-07-20  Elton Chung  <elton328@gmail.com>
+
+       * src/base/ftpatent.c (FT_Face_SetUnpatentedHinting): Fix typo.
+
+2011-07-16  Steven Chu  <steven.f.chu@gmail.com>
+
+       [truetype] Fix metrics on size request for scalable fonts.
+
+       * src/truetype/ttdriver.c (tt_size_request): Fix copying metrics
+       from TT_Size to FT_Size if scalable font.
+
+       See
+
+         http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00049.html
+
+       for some comparison images.
+
+2011-07-14  Matthias Drochner  <M.Drochner@fz-juelich.de>.
+
+       [psaux] Fix potential sign extension problems.
+
+       When shifting right a signed value, it is not defined by the
+       C standard whether one gets a sign extension or not.  Use a macro to
+       do an explicit cast from a signed short (assuming that this is
+       16bit) to an int.
+
+       * src/psaux/t1decode.c (Fix2Int): New macro.
+       Use it where appropriate.
+
+2011-07-14  Werner Lemberg  <wl@gnu.org>
+
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
+       <op_callothersubr>: Better handling of subroutine index 0.
+       From Matthias Drochner <M.Drochner@fz-juelich.de>.
+
+2011-07-10  Алексей Подтележников  <apodtele@gmail.com>
+
+       [psaux] Optimize previous commit.
+
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
+       <op_callothersubr>: Move error check down to avoid testing twice for
+       good cases.
+
+2011-07-08  Werner Lemberg  <wl@gnu.org>
+
+       [psaux] Add better argument check for `callothersubr'.
+
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
+       <op_callothersubr>: Reject negative arguments.
+
+2011-07-07  Werner Lemberg  <wl@gnu.org>
+
+       [sfnt] Try harder to find non-zero values for ascender and descender.
+
+       * src/sfnt/sfobjs.c (sfnt_load_face): Consult `OS/2' table in case
+       the `hhea' table's values are zero.
+
+2011-07-03  Werner Lemberg  <wl@gnu.org>
+
+       Fix previous commit.
+
+       We want to unset FT_FACE_FLAG_SCALABLE only if there are bitmap
+       strikes in the font.
+
+       * src/truetype/ttobjs.c (tt_face_init): Implement it.
+
+       * docs/CHANGES: Updated.
+
+2011-07-02  Just Fill Bugs  <mozbugbox@yahoo.com.au>
+
+       [truetype] Fix Savannah bug #33246.
+
+       * src/truetype/ttobjs.c (tt_check_single_notdef): New function.
+       (tt_face_init): Use it to test FT_FACE_FLAG_SCALABLE.
+
+2011-07-02  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2011-07-02  David Bevan  <david.bevan@pb.com>
+
+       [ftstroke] Major revision.
+
+       The main problems
+       -----------------
+
+         o If FT_STROKER_LINEJOIN_BEVEL was specified, unlimited miter
+           joins (not bevel joins) were generated.  Indeed, the meanings of
+           `miter' and `bevel' were incorrectly reversed (consistently) in
+           both the code and comments.
+
+         o The way bevel joins were constructed (whether specified
+           explicitly, or created as a result of exceeding the miter limit)
+           did not match what is required for stroked text in PostScript or
+           PDF.
+
+       The main fixes
+       --------------
+
+         o The behaviour of FT_STROKER_LINEJOIN_BEVEL has been corrected.
+
+         o A new line join style, FT_STROKER_LINEJOIN_MITER_FIXED, has been
+           introduced to support PostScript and PDF miter joins.
+
+         o FT_STROKER_LINEJOIN_MITER_VARIABLE has been introduced as an
+           alias for FT_STROKER_LINEJOIN_MITER.
+
+       Additionally, a variety of stroking errors have been fixed.  These
+       would cause various artifacts (including points `at infinity'),
+       especially when stroking poor quality fonts.
+
+       See
+
+         http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00001.html
+
+       for example documents.  The FreeType stroker now produces results
+       very similar to that produced by GhostScript and Distiller for these
+       fonts.
+
+       Other problems
+       --------------
+
+       The following problems have been resolved:
+
+         o Inside corners could be generated incorrectly.  Intersecting the
+           inside corner could cause a missing triangular area and other
+           effects.
+
+           The intersection point can only be used if the join is between
+           two lines and both lines are long enough.  The `optimization'
+           condition in `ft_stroker_inside' has been corrected; this
+           requires the line length to be passed into various functions and
+           stored in `FT_StrokerRec'.
+
+         o Incorrect cubic curves could be generated.  The angle
+           calculations in `FT_Stroker_CubicTo' have been corrected to
+           handle the case of the curve crossing the +/-PI direction.
+
+         o If the border radius was greater than the radius of curvature of
+           a curve, then the negative sector would end up outside (not
+           inside) the border.  This situation is now recognized and the
+           negative sector is circumnavigated in the opposite direction.
+           (If round line joins are being used, this code is disabled
+           because the line join will always cover the negative sector.)
+
+         o When a curve is split, the arcs may not join smoothly (especially
+           if the curve turns sharply back on itself).  Changes in
+           direction between adjacent arcs were not handled.  A round
+           corner is now added if the deviation from one arc to the next is
+           greater than a suitable threshold.
+
+         o The current direction wasn't retained if a the outline contained
+           a zero length lineto or a curve that was determined to be
+           `basically a point'.  This could cause a spurious join to be
+           added.
+
+         o Cubics with close control points could be mishandled.  All eight
+           cases are now distinguished correctly.
+
+       Other improvements
+       ------------------
+
+       o Borders for cubic curves could be too `flat'.
+         FT_SMALL_CUBIC_THRESHOLD has been reduced a little to prevent
+         this.
+
+       o The handling and use of movable points has been simplified a
+         little.
+
+       o Various values are now computed only if the results are actually
+         needed.
+
+       o The directions of the outer and inner borders have been swapped,
+         as recommended by Graham Asher.
+
+       * src/base/ftstroke.c: Revised.
+       * include/freetype/ftstroke.h: Updated.
+
+2011-06-30  İsmail Dönmez <ismail@namtrac.org>
+
+       * builds/toplevel.mk: We use git, not CVS, thus skip `.gitignore'.
+
+2011-06-29  Werner Lemberg  <wl@gnu.org>
+
+       [bdf] Fix Savannah bug #33663.
+
+       * src/bdf/bdflib.c (_bdf_parse_glyphs): Handle negative values for
+       ENCODING correctly.
+
+       * docs/CHANGES: Document it.
+
+2011-06-24  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.4.5 released.
+       =========================
+
+
+       Tag sources with `VER-2-4-5'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.4.5
+
+       * 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/vc2010/freetype.vcxproj, builds/win32/vc2010/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.4.4/2.4.5/, s/244/245/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
+
+       * builds/unix/configure.raw (version_info): Set to 13:0:7.
+
+2011-06-20  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Fix change
+       from 2011-05-04.
+
+2011-06-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [gxvalid] make the `prop' validation tracing verbose.
+
+       * src/gxvalid/gxvprop.c: Add tracing messages for errors.
+
+2011-06-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [autogen.sh] Reflect environment variable LIBTOOLIZE.
+
+2011-06-18  Werner Lemberg <wl@gnu.org>
+
+       Update license documentation.
+
+       * docs/GPL.TXT: Renamed to...
+       * docs/GPLv2.TXT: This.
+
+       * docs/LICENSE.TXT: Updated.
+
+2011-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix g++4.6 compiler warnings in module drivers.
+
+       The background is same with previous commit.
+
+       * src/truetype/ttgxvar.c (ft_var_readpackedpoints):
+       Init `points'.  (TT_Vary_Get_Glyph_Deltas): Init
+       `delta_xy'.  (TT_Get_MM_Var): Init `mmvar'.
+       * src/type1/t1load.c (T1_Get_MM_Var): Ditto.
+       * src/cff/cffdrivr.c (cff_ps_get_font_info): Init
+       `font_info'.
+       * src/cff/cffload.c (cff_index_get_pointers): Init `t'.
+       (cff_font_load): Init `sub'.
+       * src/cff/cffobjs.c (cff_size_init): Init `internal'.
+       (cff_face_init): Init `cff'.
+       * src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps):
+       Init `snaps'.
+       * src/pcf/pcfread.c (pcf_get_properties): Init `properties'.
+       (pcf_get_bitmaps): Init `offsets'.  (pcf_get_encodings):
+       Init `tmpEncoding'.
+       * src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'.
+       * src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'.
+       * src/cache/ftcmru.c (FTC_MruList_New): Init `node'.
+       * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and
+       `zip_buff'.
+       * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'.
+       * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'.
+
+2011-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [base] Fix g++4.6 compiler warnings in src/base/*.c.
+
+       Passing uninitialized pointer to FT_NEW() families is
+       not problematic theoretically (as far as the returned
+       pointer is checked before writing), but g++4.6 dislikes
+       it and warns by -Wuninitialized.  Initialize them by NULL.
+
+       * src/base/ftobjs.c (FT_Stream_New): Init `stream'.
+       (new_memory_stream): Ditto.
+       (FT_New_GlyphSlot): Init `slot'.
+       (FT_CMap_New): Init `cmap'.
+       (open_face_PS_from_sfnt_stream): Init `sfnt_ps'.
+       (Mac_Read_POST_Resource): Init `pfb_data'.
+       (Mac_Read_sfnt_Resource): Init `sfnt_data'.
+       * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets):
+       Init `offsets_internal' and `ref'.
+       (raccess_guess_darwin_hfsplus): Init `newpath'.
+       (raccess_guess_darwin_newvfs): Ditto.
+       * src/base/ftbitmap.c (ft_bitmap_assure_buffer):
+       Init `buffer'.
+       * src/base/ftstroke.c (FT_Stroker_New): Init `stroker'.
+
+2011-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [gxvalid] Cleanup.
+
+       Some invalid, overrunning, unrecommended non-zero values
+       are cared in paranoid validation mode only.  There are
+       many lines looking like:
+
+         if ( valid->root->level >= FT_VALIDATE_PARANOID )
+           FT_INVALID_xxx;
+
+       To simplify them, GXV_SET_ERR_IF_PARANOID( err ) is
+       introduced for more paranoid validation in future.
+
+       * src/gxvalid/gxvcommn.h (IS_PARANOID_VALIDATION):
+       New macro to assure valid->root->level is more or
+       equal to FT_VALIDATE_PARANOID.  (GXV_SET_ERR_IF_PARANOID):
+       New macro to raise an error if in paranoid validation.
+       * src/gxvalid/gxvcommn.c: Use GXV_SET_ERR_IF_PARANOID().
+       * src/gxvalid/gxvfeat.c: Ditto.
+       * src/gxvalid/gxvjust.c: Ditto.
+       * src/gxvalid/gxvkern.c: Ditto.
+       * src/gxvalid/gxvmort.c: Ditto.
+       * src/gxvalid/gxvmort0.c: Ditto.
+       * src/gxvalid/gxvmort1.c: Ditto.
+       * src/gxvalid/gxvmort2.c: Ditto.
+       * src/gxvalid/gxvmorx1.c: Ditto.
+       * src/gxvalid/gxvmorx2.c: Ditto.
+
+2011-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [gxvalid] Fix gcc4.6 compiler warnings in gxvtrak.c.
+
+       * src/gxvalid/gxvtrak.c (gxv_trak_trackTable_validate):
+       Check different entries pointing same traking value.
+       (gxv_trak_validate): Remove unused variable `table_size'.
+
+2011-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
+
+       * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
+       Conditionalize unvalidated variable `subFeatureFlags'.
+       (gxv_morx_chain_validate): Conditionalize unvalidated
+       variable `defaultFlags'.
+
+       * src/gxvalid/gxmorx0.c
+       (gxv_morx_subtable_type0_entry_validate):
+       Conditionalize unvalidated variables; `markFirst',
+       `dontAdvance', `markLast', `verb'.
+
+       * src/gxvalid/gxmorx1.c
+       (gxv_morx_subtable_type1_entry_validate): Conditionalize
+       unvalidated variables; `setMark', `dontAdvance'.
+
+       * src/gxvalid/gxvmorx2.c
+       (gxv_morx_subtable_type2_ligActionOffset_validate):
+       Conditionalize unvalidated variables; `last', `store'.
+       Checking for overrunning offset is added.
+       (gxv_morx_subtable_type2_entry_validate):
+       Conditionalize unvalidated variables; `setComponent',
+       `dontAdvance', `performAction'.
+       (gxv_morx_subtable_type2_ligatureTable_validate):
+       Check if the GID for ligature does not exceed the
+       max GID in `maxp' table.
+
+       * src/gxvalid/gxvmort5.c
+       (gxv_morx_subtable_type5_InsertList_validate):
+       Conditionalize unvalidated loading of `insert_glyphID'
+       array.  (gxv_morx_subtable_type5_entry_validate):
+       Conditionalize unvalidated variables; `setMark',
+       `dontAdvance', `currentIsKashidaLike',
+       `markedIsKashidaLike', `currentInsertBefore',
+       `markedInsertBefore'.
+
+2011-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [gxvalid] Fix gcc4.6 compiler warnings in gxvmort*.c.
+
+       * src/gxvalid/gxvmort.c (gxv_mort_subtables_validate):
+       Conditionalize unvalidated variable `subFeatureFlags'.
+       (gxv_mort_chain_validate): Conditionalize unvalidated
+       variable `defaultFlags'.
+
+       * src/gxvalid/gxmort0.c
+       (gxv_mort_subtable_type0_entry_validate): Check the
+       conflict of the marks for the glyphs.
+
+       * src/gxvalid/gxmort1.c
+       (gxv_mort_subtable_type1_offset_to_subst_validate):
+       Local variables `min_gid', `max_gid' are replaced by
+       variables in the validator.
+       (gxv_mort_subtable_type1_entry_validate): Conditionalize
+       unvalidated variables; `setMark', `dontAdvance'.
+       (gxv_mort_subtable_type1_substTable_validate):
+       Validate the GID by the min/max GIDs in the validator.
+
+       * src/gxvalid/gxvmort2.c
+       (gxv_mort_subtable_type2_ligActionOffset_validate):
+       Conditionalize unvalidated variables; `last', `store'.
+       Checking for overrunning offset is added.
+       (gxv_mort_subtable_type2_entry_validate):
+       Conditionalize unvalidated variables; `setComponent',
+       `dontAdvance'.
+       (gxv_mort_subtable_type2_ligatureTable_validate):
+       Check if the GID for ligature does not exceed the
+       max GID in `maxp' table.
+
+       * src/gxvalid/gxvmort5.c
+       (gxv_mort_subtable_type5_InsertList_validate):
+       Conditionalize unvalidated loading of `insert_glyphID'
+       array.  (gxv_mort_subtable_type5_entry_validate):
+       Conditionalize unvalidated variables; `setMark',
+       `dontAdvance', `currentIsKashidaLike',
+       `markedIsKashidaLike', `currentInsertBefore',
+       `markedInsertBefore'.
+
+2011-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [gxvalid] Fix gcc4.6 compiler warnings in gxvkern.c.
+
+       * src/gxvalid/gxvkern.c
+       (gxv_kern_subtable_fmt0_pairs_validate): Conditionalize
+       unvalidated variable `kernValue'.
+       (gxv_kern_subtable_fmt1_entry_validate): Conditionalize
+       unvalidated variables; `push', `dontAdvance', `kernAction',
+       `kernValue'.
+       (gxv_kern_coverage_new_apple_validate): Conditionalize
+       trace-only variables; `kernVertical', `kernCrossStream',
+       `kernVariation'.
+       (gxv_kern_coverage_classic_apple_validate): Conditionalize
+       trace-only variables; `horizontal', `cross_stream'.
+       (gxv_kern_coverage_classic_microsoft_validate):
+       Conditionalize trace-only variables; `horizontal',
+       `minimum', `cross_stream', `override'.
+       (gxv_kern_subtable_validate): Conditionalize trace-only
+       variables; `version', `tupleIndex'.
+
+2011-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [gxvalid] Fix gcc4.6 compiler warnings in gxvjust.c.
+
+       * src/gxvalid/gxvjust.c (gxv_just_check_max_gid):
+       New function to unify the checks of too large GID.
+       (gxv_just_wdp_entry_validate): Conditionalize unvalidated
+       variables; `beforeGrowLimit', `beforeShrinkGrowLimit',
+       `afterGrowLimit', `afterShrinkGrowLimit', `growFlags',
+       `shrinkFlags'.  Additional check for non-zero values in
+       unused storage `justClass' is added.
+       (gxv_just_actSubrecord_type0_validate): Conditionalize
+       unvalidated variable `order'.  GID is checked by
+       gxv_just_check_max_gid().  Additional check for upside-down
+       relationship between `lowerLimit' and `upperLimit' is added.
+       (gxv_just_actSubrecord_type1_validate): GID is checked by
+       gxv_just_check_max_gid().
+       (gxv_just_actSubrecord_type2_validate): Conditionalize
+       unvalidated variable `substThreshhold'.  GID is checked by
+       gxv_just_check_max_gid().
+       (gxv_just_actSubrecord_type5_validate): GID is checked by
+       gxv_just_check_max_gid().
+       (gxv_just_classTable_entry_validate): Conditionalize
+       unvalidated variables; `setMark', `dontAdvance',
+       `markClass', `currentClass'.
+
+2011-06-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [gxvalid] Preparation to fix gcc4.6 compiler warnings.
+
+       * src/gxvalid/gxvcommn.h (GXV_LOAD_TRACE_VARS): New macro to
+       conditionalize the variable which is only used for trace messages.
+       Automatically set by FT_DEBUG_LEVEL_TRACE.
+       (GXV_LOAD_UNUSED_VARS): New macro to conditionalize the loading of
+       unvalidated variables.  Undefined by default to calm gcc4.6 warning.
+       (GXV_ValidatorRec.{min_gid,max_gid}): New variables to hold defined
+       GID ranges, for the comparison of GID ranges in different subtables.
+
+2011-06-08  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Remove unused structure member.
+
+       * src/autofit/afhints.h (AF_SegmentRec): Remove `contour'.
+       * src/autofit/aflatin.c (af_latin_hints_compute_segments),
+       src/autofit/aflatin2.c (af_latin2_hints_compute_segments): Updated.
+
+2011-05-30  Werner Lemberg  <wl@gnu.org>
+
+       Fix g++ 4.6 compilation.
+
+       * src/autofit/afhints.c (af_glyph_hints_dump_segments,
+       af_glyph_hints_dump_edges): Use cast.
+
+2011-05-30  Werner Lemberg  <wl@gnu.org>
+
+       Fix gcc 4.6 compiler warnings.
+
+       * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Use casts and
+       remove unused variables.
+       * src/autofit/aflatin.c (af_latin_hints_compute_edges): Comment out
+       `up_dir'.
+       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `height_org'
+       and `width_org' conditionalized.
+
+2011-05-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [mac] Conditionalize the inclusion of `AvailabilityMacros.h'.
+
+       The native SDK on earliest Mac OS X (10.0-10.1) did not have
+       `AvailabilityMacros.h'.  To prevent the inclusion of missing
+       header file, ECANCELED (introduced in 10.2) in POSIX header
+       file <errno.h> is checked to detect the system version.
+
+       * include/freetype/config/ftconfig.h: Conditionalize the
+       inclusion of `AvailabilityMacros.h'.
+       * builds/unix/ftconfig.in: Ditto.
+       * builds/vms/ftconfig.h: Ditto.
+
+2011-05-27  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve tracing of hinting process.
+
+       * src/autofit/aflatin.c (af_latin_hint_edges): Add tracing message
+       `ADJUST'.
+
+2011-05-26  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Fix trace message.
+
+       * src/autofit/aflatin.c (af_latin_hint_edges): Show correct value in
+       tracing message.
+
+2011-05-24  Daniel Zimmermann  <netzimme@googlemail.com>
+
+       Reduce warnings for MS Visual Studio 2010.
+
+       * src/autofit/afhints.c (af_glyph_hints_get_num_segments,
+       af_glyph_hints_get_segment_offset) [!FT_DEBUG_AUTOFIT]: Provide
+       return value.
+       * src/cff/cffgload.c (cff_slot_load): Add cast.
+       * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Use proper
+       loop variable type.
+
+2011-05-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Automake component `builds/unix/install-sh' is removed.
+
+       * builds/unix/install-sh: Removed.  It is not needed to
+       include repository, because autogen.sh installs it.
+       * builds/unix/.gitignore: Register install-sh.
+
+2011-05-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [autofit] Make trace message for CJK bluezone more verbose.
+
+2011-05-08  Just Fill Bugs  <mozbugbox@yahoo.com.au>
+            suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [autofit] Add bluezones for CJK Ideographs.
+
+       To remove extremas of vertical strokes of CJK Ideographs at
+       low resolution and make the top and bottom horizontal stems
+       aligned, bluezones for CJK Ideographs are calculated from
+       sample glyphs.  At present, vertical bluezones (bluezones
+       to align vertical stems) are disabled by default.  For detail, see
+       http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html
+       http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html
+       http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html
+
+       * include/freetype/internal/fttrace.h: New trace component `afcjk'.
+       * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version
+       for AF_Latin{Blue,Axis,Metric}Rec.
+       (af_cjk_metrics_check_digits): Ditto, shared with Indic module.
+       (af_cjk_metrics_init_widths): Ditto.
+       (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric.
+       (af_cjk_metrics_scale): Ditto (declaration).
+       (af_cjk_hints_init): Ditto (declaration).
+       (af_cjk_hints_apply): Ditto (declaration).
+       * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body).
+       (af_cjk_hints_init): Ditto (body).
+       (af_cjk_hints_apply): Ditto (body).
+       (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths.
+       (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits.
+       (af_cjk_metrics_init): Call CJK bluezone initializer.
+       (af_cjk_metrics_scale_dim): Add code to scale bluezones.
+       (af_cjk_hints_compute_blue_edges): New function, CJK version of
+       af_latin_hints_compute_blue_edges.
+       (af_cjk_metrics_init_blues): New function, CJK version of
+       af_latin_metrics_init_blues.
+       (af_cjk_hints_edges): Add code to align the edge stems to blue zones.
+
+       * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric
+       instead of AF_LatinMetric, and initialize as af_cjk_metrics_init.
+       However bluezones are not initialized.
+       (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric.
+       (af_indic_hints_init): Ditto.
+       (af_indic_hints_apply): Ditto.
+
+       * docs/CHANGES: Note about CJK bluezone support.
+
+2011-05-06  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Remove unused struct member.
+
+       * src/autofit/aflatin.h (AF_LatinAxis): Remove `control_overshoot'.
+
+2011-05-04  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Simplify.
+
+2011-05-01  Just Fill Bugs  <mozbugbox@yahoo.com.au>
+            Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Add more debugging functions.
+
+       * src/autofit/afhints.c (af_glyph_hints_get_num_segments,
+       af_glyph_hints_get_segment_offset): New functions.
+
+2011-05-01  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Add new option `--disable-mmap' to configure script.
+
+       * builds/unix/configure.raw: New option `--disable-mmap'
+       is added.  It is for the developers to simulate the systems
+       without mmap() (like 4.3BSD, minix etc) on POSIX systems.
+
+2011-04-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [truetype] Always recalculate the sfnt table checksum.
+
+       * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Recalculate
+       the sfnt table checksum even if non-zero value is written in
+       the TrueType font header.  Some bad PDF generators write
+       wrong values.  For details see examples and benchmark tests
+       of the latency by recalculation:
+       http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00091.html
+       http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00096.html
+
+2011-04-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [truetype] Register a set of tricky fonts, NEC FA family.
+
+       * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids):
+       Add 8 checksum sets for NEC FA family.  For the tricky fonts
+       without some tables (e.g. NEC FA fonts lack cvt table),
+       extra check is added to assure that a zero-length table in the
+       registry is not included in the font.
+
+2011-04-29  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [truetype] Fix a bug in the sfnt table checksum getter.
+
+       * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Check the
+       return value of face->goto_table() correctly.
+
+2011-04-28  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Improve tracing messages.
+
+       * src/autofit/aflatin.c (af_latin_metrics_init_blues,
+       af_latin_align_linked_edge, af_latin_hint_edges): Do it.
+
+2011-04-25  Kan-Ru Chen  <kanru@kanru.info>
+
+       [truetype] Always check the checksum to identify tricky fonts.
+
+       Because some PDF generators mangle the family name badly,
+       the trickyness check by the checksum should be invoked always.
+       For sample PDF, see
+       http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00073.html
+
+       * src/truetype/ttobjs.c (tt_check_trickyness): Even when
+       tt_check_trickyness_family() finds no trickyness,
+       tt_check_trickyness_sfnt_ids() is invoked.
+
+2011-04-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [autofit] Add more Indic scripts with hanging baseline.
+
+       * src/autofit/afindic.c (af_indic_uniranges): Tibetan, Limbu,
+       Sundanese, Meetei Mayak, Syloti Nagri and Sharada scripts are
+       added.
+
+2011-04-21  Behdad Esfahbod  <behdad@behdad.org>
+
+       Always ignore global advance.
+
+       This makes FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH redundant,
+       deprecated, and ignored.  The new behavior is what every major user
+       of FreeType has been requesting.  Global advance is broken in many
+       CJK fonts.  Just ignoring it by default makes most sense.
+
+       * src/truetype/ttdriver.c (tt_get_advances),
+       src/truetype/ttgload.c (TT_Get_HMetrics, TT_Get_VMetrics,
+       tt_get_metrics, compute_glyph_metrics, TT_Load_Glyph),
+       src/truetype/ttgload.h: Implement it.
+
+       * docs/CHANGES: Updated.
+
+2011-04-21  rainy6144  <rainy6144@gmail.com>
+
+       [autofit] Blur CJK stems if too many to preserve their gaps.
+
+       When there are too many stems to preserve their gaps in the
+       rasterization of CJK Ideographs at a low resolution, blur the
+       stems instead of showing clumped stems.  See
+       http://lists.gnu.org/archive/html/freetype-devel/2011-02/msg00011.html
+       http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00046.html
+       for details.
+
+       * src/autofit/afcjk.c (af_cjk_hint_edges): Store the position of
+       the previous stem by `has_last_stem' and `last_stem_pos', and skip
+       a stem if the current and previous stem are too near to preserve
+       the gap.
+
+2011-04-18  Werner Lemberg  <wl@gnu.org>
+
+       Integrate autofitter debugging stuff.
+
+       * devel/ftoption.h, include/freetype/config/ftoption.h
+       (FT_DEBUG_AUTOFIT): New macro.
+
+       * include/freetype/internal/fttrace.h: Add trace components for
+       autofitter.
+
+       * src/autofit/aftypes.h (AF_LOG): Removed.
+       (_af_debug): Removed.
+
+       * src/autofit/*: s/AF_DEBUG/FT_DEBUG_AUTOFIT/.
+       s/AF_LOG/FT_TRACE5/.
+       Define FT_COMPONENT where necessary.
+
+2011-04-18  Werner Lemberg  <wl@gnu.org>
+
+       Synchronize config files.
+
+       * builds/unix/ftconfig.in: Copy missing assembler routines from
+       include/freetype/config/ftconfig.h.
+
+2011-04-13  Werner Lemberg  <wl@gnu.org>
+
+       [psaux] Fix Savannah bug #33047.
+
+       Patch submitted by anonymous reporter.
+
+       * src/psaux/psobjs.c (ps_table_add): Use FT_PtrDist for pointer
+       difference.
+
+2011-04-11  Kan-Ru Chen  <kanru@kanru.info>
+
+       Fix reading of signed integers from files on 64bit platforms.
+
+       Previously, signed integers were converted to unsigned integers, but
+       this can fail because of sign extension.  For example, 0xa344a1eb
+       becomes 0xffffffffa344a1eb.
+
+       We now do the reverse which is always correct because the integer
+       size is the same during the cast from unsigned to signed.
+
+       * include/freetype/internal/ftstream.h, src/base/ftstream.c
+       (FT_Stream_Get*): Replace with...
+       (FT_Stream_GetU*): Functions which read unsigned integers.
+       Update all macros accordingly.
+
+       * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Updated.
+
+2011-04-07  Werner Lemberg  <wl@gnu.org>
+
+       Update Unicode ranges for CJK autofitter; in particular, add Hangul.
+
+       * src/autofit/afcjk.c (af_cjk_uniranges): Update to Unicode 6.0.
+
+2011-04-04  Werner Lemberg  <wl@gnu.org>
+
+       Fix formatting of autofit debug dumps.
+
+       * src/autofit/afhints.c (af_glyph_hints_dump_points,
+       af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Adjust
+       column widths.
+
+2011-03-30  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/aftypes.h (AF_OutlineRec): Removed, unused.
+
+2011-03-24  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 256.
+       This limit is given on p. 37 of Adobe Technical Note #5014.
+
+2011-03-23  Werner Lemberg  <wl@gnu.org>
+
+       * src/truetype/ttpload.c (tt_face_load_loca): Fix mismatch warning.
+
+2011-03-20  Werner Lemberg  <wl@gnu.org>
+
+       * src/sfnt/sfobjs.c (sfnt_open_font): Check number of TTC subfonts.
+
+2011-03-19  Werner Lemberg  <wl@gnu.org>
+
+       More C++ compilation fixes.
+
+       * src/autofit/afhints.c (af_glyph_hints_dump_points,
+       af_glyph_hints_dump_segments, af_glyph_hints_dump_edges)
+       [__cplusplus]: Protect with `extern "C"'.
+
+2011-03-18  Werner Lemberg  <wl@gnu.org>
+
+       C++ compilation fixes.
+
+       * src/autofit/aflatin.c (af_latin_hints_apply), src/autofit/afcjk.c
+       (af_cjk_hints_apply): Use cast for `dim'.
+
+2011-03-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       A better fix for Savannah bug #32671.
+
+       * src/smooth/ftgrays.c (gray_render_conic): Clean up code and
+       replace WHILE loop with a more natural DO-WHILE construct.
+
+2011-03-16  Werner Lemberg  <wl@gnu.org>.
+
+       * src/base/ftstroke.c (FT_StrokerRec): Remove unused `valid' field.
+       Suggested by Graham Asher.
+
+2011-03-09  Werner Lemberg  <wl@gnu.org>
+
+       Make FT_Sfnt_Table_Info return the number of SFNT tables.
+
+       * src/sfnt/sfdriver.c (sfnt_table_info): Implement it.
+       * include/freetype/tttables.h: Update documentation.
+       * docs/CHANGES: Updated.
+
+2011-03-07  Bram Tassyns  <bramt@enfocus.be>
+
+       [cff] Fix Savannah bug #27988.
+
+       * src/cff/cffobjs.c (remove_style): New function.
+       (cff_face_init): Use it to strip off the style part of the family
+       name.
+
+2011-03-07  Werner Lemberg  <wl@gnu.org>
+
+       * docs/CHANGES: Updated.
+
+2011-03-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       Quick fix for Savannah bug #32671.
+
+       This isn't the optimal solution yet, but it restores the previous
+       rendering quality (more or less).
+
+       * src/smooth/ftgrays.c (gray_render_conic): Do more splitting.
+
+2011-03-06  Werner Lemberg  <wl@gnu.org>
+
+       Fix autohinting fallback.
+
+       * src/base/ftobjs.c (FT_Load_Glyph): Assure that we only check TTFs,
+       ignoring CFF-based OTFs.
+
+2011-02-27  Werner Lemberg  <wl@gnu.org>
+
+       Add AF_CONFIG_OPTION_USE_WARPER to control the autofit warper.
+
+       * devel/ftoption.h, include/freetype/config/ftoption.h
+       (AF_CONFIG_OPTION_USE_WARPER): New macro.
+       * src/autofit/aftypes.h (AF_USE_WARPER): Remove.
+
+       * src/autofit/*: s/AF_USE_WARPER/AF_CONFIG_OPTION_USE_WARPER/.
+
+       * src/autofit/afwarp.c [!AF_CONFIG_OPTION_USE_WARPER]: Replace dummy
+       variable assignment with a typedef.
+
+2011-02-26  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Slight simplifications.
+
+       * src/autofit/aflatin.c (af_latin_hints_link_segments): Remove
+       test which always returns false.
+       (af_latin_hints_compute_blue_edges): Remove redundant assignment.
+
+2011-02-24  Werner Lemberg  <wl@gnu.org>
+
+       * docs/PROBLEMS: Mention rendering differences on different
+       platforms.
+       Suggested and worded by Jason Owen <jason.a.owen@gmail.com>.
+
+2011-02-24  Werner Lemberg  <wl@gnu.org>
+
+       [autofit] Comment out unused code.
+
+       * src/autofit/aflatin.c, src/autofit/aflatin2.c
+       (af_latin_hints_compute_edges): Do it.
+
+2011-02-24  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/afhints.h (AF_GlyphHints): Remove unused field.
+
+2011-02-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cache] Fix an off-by-one bug in `FTC_Manager_RemoveFaceID'.
+       Found by <ychen1392001@yahoo.com.cn>, see detail in
+
+         http://lists.gnu.org/archive/html/freetype/2011-01/msg00023.html
+
+       * src/cache/ftccache.c (FTC_Cache_RemoveFaceID): Check the node
+       buckets[cache->p + cache->mask] too.
+
+2011-02-19  Kevin Kofler  <kevin.kofler@chello.at>
+
+       Fall back to autohinting if a TTF/OTF doesn't contain any bytecode.
+       This is Savannah patch #7471.
+
+       * src/base/ftobjs.c (FT_Load_Glyph): Implement it.
+
+2011-02-19  John Tytgat  <John.Tytgat@esko.com>
+
+       [cff] Fix subset prefix removal.
+       This is Savannah patch #7465.
+
+       * src/cff/cffobjs.c (remove_subset_prefix): Update length after
+       subset prefix removal.
+
+2011-02-13  Bradley Grainger  <bgrainger@logos.com>
+
+       Add inline assembly version of FT_MulFix for MSVC.
+
+       * include/freetype/config/ftconfig.h: Ported the FT_MulFix_i386
+       function from GNU inline assembly syntax (see #ifdef __GNUC__ block
+       above) to MASM syntax for Microsoft Visual C++.
+
+2011-02-13  Bradley Grainger  <bgrainger@logos.com>
+
+       Add project and solution files in Visual Studio 2010 format.
+
+       * builds/win32/.gitignore: Ignore user-specific cache files.
+       * builds/win32/vc2010/: Add VS2010 project & solution files, created
+       by upgrading builds/win32/vc2008/freetype.vcproj.
+       * objs/.gitignore: Ignore Visual Studio output files.
+
+2011-02-01  Werner Lemberg  <wl@gnu.org>
+
+       * src/autofit/afdummy.c: Include `aferrors.h'.
+       Problem reported by Chris Liddell <chris.liddell@artifex.com>.
+
+2011-02-01  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Ignore unknown operators in charstrings.
+       Patch suggested by Miles.Lau <sunliang_liu@foxitsoftware.com>.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing
+       message for unknown operators and continue instead of exiting with a
+       syntax error.
+
+2011-02-01  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] FT_LOAD_PEDANTIC now affects `prep' and `fpgm' also.
+
+       * src/truetype/ttgload.c (tt_loader_init): Handle
+       `FT_LOAD_PEDANTIC'.
+       * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep,
+       tt_size_init_bytecode, tt_size_ready_bytecode): New argument to
+       handle pedantic mode.
+       * src/truetype/ttobjs.h: Updated.
+
+2011-01-31  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Protect jump instructions against endless loops.
+
+       * src/truetype/interp.c (DO_JROT, DO_JMPR, DO_JROF): Exit with error
+       if offset is zero.
+
+2011-01-31  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Improve handling of invalid references.
+
+       * src/truetype/interp.c: Set even more TT_Err_Invalid_Reference
+       error codes only if pedantic hinting is active.  At the same time,
+       try to provide sane values which hopefully allow useful
+       continuation.  Exception to this is CALL and LOOPCALL – due to
+       possible stack corruption it is necessary to bail out.
+
+2011-01-31  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Improve handling of stack underflow.
+
+       * src/truetype/ttinterp.c (TT_RunIns, Ins_FLIPPT, Ins_DELTAP,
+       Ins_DELTAC): Exit with error only if `pedantic_hinting' is set.
+       Otherwise, try to do something sane.
+
+2011-01-30  Werner Lemberg  <wl@gnu.org>
+
+       * src/sfnt/ttmtx.c (tt_face_load_hmtx): Fix tracing message.
+
+2011-01-30  LIU Sun-Liang  <sunliang_liu@foxitsoftware.com>
+
+       [truetype]: Fix behaviour of MIAP for invalid arguments.
+
+       * src/truetype/ttinterp.c (Ins_MIAP): Set reference points even in
+       case of error.
+
+2011-01-18  Werner Lemberg  <wl@gnu.org>
+
+       [truetype] Fix handling of MIRP instruction.
+
+       Thanks to Greg Hitchcock who explained the issue.
+
+       * src/truetype/ttinterp.c (Ins_MIRP): Replace a `>=' operator with
+       `>' since the description in the specification is incorrect.
+       This fixes, for example, glyph `two' in font `Helvetica Neue LT Com
+       65 medium' at 15ppem.
+
+2011-01-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix ARM assembly code in include/freetype/config/ftconfig.h.
+
+       * include/freetype/config/ftconfig.h (FT_MulFix_arm):
+       Copy the maintained code from builds/unix/ftconfig.in.
+       Old GNU binutils could not accept the reduced syntax
+       `orr %0, %2, lsl #16'.  Un-omitted syntax like RVCT,
+       `orr %0, %0, %2, lsl #16' is better.  Reported by
+       Johnson Y. Yan.  The bug report by Qt developers is
+       considered too.
+
+       http://bugreports.qt.nokia.com/browse/QTBUG-6521
+
+2011-01-15  Werner Lemberg  <wl@gnu.org>
+
+       [raster] Make bbox handling the same as with Microsoft's rasterizer.
+
+       Right before B/W rasterizing, the bbox gets simply rounded to
+       integers.  This fixes, for example, glyph `three' in font `Helvetica
+       Neue LT Com 65 Medium' at 11ppem.
+
+       Thanks to Greg Hitchcock who explained this behaviour.
+
+       * src/raster/ftrend1.c (ft_raster1_render): Implement it.
+
+2011-01-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Copy -mcpu=* & -march=* options from CFLAGS to LDFLAGS.
+
+       * builds/unix/configure.raw: Consider recent gcc-standard
+       flags to specify architecture in CFLAGS & LDFLAGS
+       harmonization.  Requested by Savannah bug #32114, to
+       support multilib feature of BuildRoot SDK correctly.
+
+2011-01-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix off-by-one bug in CFLAGS & LDFLAGS harmonizer.
+
+       * builds/unix/configure.raw: Some important options that
+       included in CFLAGS but not in LDFLAGS are copied to
+       LDFLAGS, but the last option in CFLAGS was not checked.
+
+2011-01-13  Werner Lemberg  <wl@gnu.org>
+
+       [raster] Add undocumented drop-out rule to the other bbox side also.
+
+       * src/raster/ftraster.c (Vertical_Sweep_Drop,
+       Horizontal_Sweep_Drop): Implement it.
+
+2011-01-13  Werner Lemberg  <wl@gnu.org>
+
+       [raster] Reduce jitter value.
+
+       This catches a rendering problem with glyph `x' from Tahoma at
+       10ppem.  It seems that the increase of the precision in the change
+       from 2009-06-11 makes a larger jitter value unnecessary.
+
+       * src/raster/ftraster.c (Set_High_Precision): Implement it.
+
+2011-01-13  Werner Lemberg  <wl@gnu.org>
+
+       [raster] Handle drop-outs at glyph borders according to Microsoft.
+
+       If a drop-out rule would switch on a pixel outside of the glyph's
+       bounding box, use the right (or top) pixel instead.  This is an
+       undocumented feature, but some fonts like `Helvetica Neue LT Com 65
+       Medium' heavily rely on it.
+
+       Thanks to Greg Hitchcock who explained this behaviour.
+
+       * src/raster/ftraster.c (Vertical_Sweep_Drop,
+       Horizontal_Sweep_Drop): Implement it.
+
+2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cache] Fix Savannah bug #31923, patch drafted by Harsha.
+
+       When a node comparator changes the cached nodes during the
+       search of a node matching with queried properties, the
+       pointers obtained before the function should be updated to
+       prevent the dereference to freed or reallocated nodes.
+       To minimize the rescan of the linked list, the update is
+       executed when the comparator notifies the change of cached
+       nodes. This change depends previous change:
+       38b272ffbbdaae276d636aec4ef84af407d16181
+
+       * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Rescan the
+       top node if the cached nodes are changed.
+       * src/cache/ftccache.c (FTC_Cache_Lookup): Ditto.
+
+2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cache] Notice if a cache query induced the node list change.
+
+       Some node comparators (comparing the cache node contents and the
+       properties specified by the query) can flush the cache node to
+       prevent the cache inflation.  The change may invalidate the pointers
+       to the node obtained before the node comparison, so it should be
+       noticed to the caller.  The problem caused by the cache node
+       changing is reported by Harsha, see Savannah bug #31923.
+
+       * src/cache/ftccache.h (FTC_Node_CompareFunc): Add new argument
+       `FT_Bool* list_changed' to indicate the change of the cached nodes
+       to the caller.
+       (FTC_CACHE_LOOKUP_CMP): Watch the change of the cached nodes by
+       `_list_changed'.
+       (FTC_CACHE_TRYLOOP_END): Take new macro argument `_list_changed'
+       and update it when `FTC_Manager_FlushN' flushes any nodes.
+
+       * src/cache/ftccback.h (ftc_snode_compare): Updated to fit with new
+       FTC_Node_CompareFunc type.
+       (ftc_gnode_compare): Ditto.
+
+       * src/cache/ftcbasic.c: Include FT_INTERNAL_OBJECTS_H to use
+       TRUE/FALSE macros.
+       (ftc_basic_gnode_compare_faceid): New argument `FT_Bool*
+       list_changed' to indicate the change of the cache nodes (anyway, it
+       is always FALSE).
+
+       * src/cache/ftccmap.c: Include FT_INTERNAL_OBJECTS_H to use
+       TRUE/FALSE macros.
+       (ftc_cmap_node_compare): New argument `FT_Bool* list_changed' to
+       indicate the change of the cache nodes (anyway, it is always FALSE).
+       (ftc_cmap_node_remove_faceid): Ditto.
+
+       * src/cache/ftccache.c (FTC_Cache_NewNode): Pass a NULL pointer to
+       `FTC_CACHE_TRYLOOP_END', because the result is not needed.
+       (FTC_Cache_Lookup): Watch the change of the cache nodes by
+       `list_changed'.
+       (FTC_Cache_RemoveFaceID): Ditto.
+
+       * src/cache/ftcglyph.c: Include FT_INTERNAL_OBJECTS_H to use
+       TRUE/FALSE macros.
+       (ftc_gnode_compare): New argument `FT_Bool* list_changed' to
+       indicate the change of the cache nodes (anyway, it is always FALSE).
+       (FTC_GNode_Compare): New argument `FT_Bool* list_changed' to be
+       passed to `ftc_gnode_compare'.
+       * src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto.
+
+       * src/cache/ftcsbits.c (ftc_snode_compare): New argument `FT_Bool*
+       list_changed' to indicate the change of the cache nodes, anyway.  It
+       is updated by `FTC_CACHE_TRYLOOP'.
+       (FTC_SNode_Compare): New argument `FT_Bool* list_changed' to be
+       passed to `ftc_snode_compare'.
+       * src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto.
+
+2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cache] Fit `FTC_GNode_Compare' to `FTC_Node_CompareFunc'.
+
+       * src/cache/ftcglyph.h (FTC_GNode_Compare): Add the 3rd
+       argument `FTC_Cache  cache' to fit FTC_Node_CompareFunc
+       prototype.
+       * src/cache/ftcglyph.c (FTC_GNode_Compare): Ditto. Anyway,
+       `cache' is not used by its child `ftc_gnode_compare'.
+
+2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cache] Deduplicate the code to get the top node by a hash.
+
+       There are several duplicated code fragments getting the top node
+       from a cache by a given hash, like:
+
+           idx = hash & cache->mask;
+           if ( idx < cache->p )
+             idx = hash & ( cache->mask * 2 + 1 );
+           pnode = cache->buckets + idx;
+
+       To remove duplication, a cpp-macro to do same work
+       `FTC_NODE__TOP_FOR_HASH' is introduced.  For non-inlined
+       configuration, non-`ftc_get_top_node_for_hash' is also introduced.
+
+       * src/cache/ftccache.h (FTC_NODE__TOP_FOR_HASH): Declare
+       and implement inlined version.
+       (FTC_CACHE_LOOKUP_CMP): Use `FTC_NODE__TOP_FOR_HASH'.
+       * src/cache/ftccache.c (ftc_get_top_node_for_hash): Non-inlined
+       version.
+       (ftc_node_hash_unlink): Use `FTC_NODE__TOP_FOR_HASH'.
+       (ftc_node_hash_link): Ditto.
+       (FTC_Cache_Lookup): Ditto.
+
+2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cache] inline-specific functions are conditionalized.
+
+       * src/cache/ftcglyph.c (FTC_GNode_Compare): Conditionalized for
+       inlined configuration.  This function is a thin wrapper of
+       `ftc_gnode_compare' for inlined `FTC_CACHE_LOOKUP_CMP' (see
+       `nodecmp' argument).  Under non-inlined configuration,
+       `ftc_gnode_compare' is invoked by `FTC_Cache_Lookup', via
+       `FTC_Cache->clazz.node_compare'.
+
+       * src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto.
+       * src/cache/ftcsbits.c (FTC_SNode_Compare): Ditto, for
+       `ftc_snode_compare'.
+       * src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto.
+
+2011-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       [cache] Correct a type mismatch under non-inlined config.
+
+       * src/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP): `FTC_GCache_Lookup'
+       takes the node via a pointer `FTC_Node*', differently from cpp-macro
+       `FTC_CACHE_LOOKUP_CMP'.
+
+2011-01-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Update Jamfile to include Bzip2 support.
+
+       * Jamfile: Include src/bzip2 to project.
+       Comments for lzw, gzip, bzip2 are changed to clarify that
+       they are for compressed PCF fonts, not others.
+       (e.g. compressed BDF fonts are not supported yet)
+
+2011-01-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Update Symbian project files to include Bzip2 support.
+
+       Currently, it provides `FT_Stream_OpenBzip2' that returns
+       unimplemented error always, to prevent unresolved symbol
+       error for the applications designed for Unix systems.
+
+       * builds/symbian/bld.inf: Include ftbzip2.h.
+       * builds/symbian/freetype.mmp: Include ftbzip2.c.
+
+2011-01-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Update classic MacOS makefiles to include Bzip2 support.
+
+       Currently, it provides `FT_Stream_OpenBzip2' that returns
+       unimplemented error always, to prevent unresolved symbol
+       error for the applications designed for Unix systems.
+
+       * builds/mac/FreeType.m68k_cfm.make.txt: Include ftbzip2.c.o.
+       * builds/mac/FreeType.m68k_far.make.txt: Ditto.
+       * builds/mac/FreeType.ppc_carbon.make.txt: Include ftbzip2.c.x.
+       * builds/mac/FreeType.ppc_classic.make.txt: Ditto.
+
+2011-01-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Update Amiga makefiles to include Bzip2 support.
+
+       Currently, it provides `FT_Stream_OpenBzip2' that returns
+       unimplemented error always, to prevent unresolved symbol
+       error for the applications designed for Unix systems.
+
+       * builds/amiga/makefile: Include bzip2.ppc.o built from ftbzip2.c.
+       * builds/amiga/makefile.os4: Include bzip2.o built from ftbzip2.c.
+       * builds/amiga/smakefile: Ditto.
+
+2011-01-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Update pkg-config tools to reflect Bzip2 support.
+
+       * builds/unix/freetype-config.in: Include `-lbz2' to
+       --libs output, if built with Bzip2 support.
+       * builds/unix/freetype2.in: Ditto.
+
+2011-01-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       * builds/unix/configure.raw: Remove `SYSTEM_BZ2LIB' macro.
+
+       SYSTEM_ZLIB is used to switch the builtin zlib source
+       or system zlib source out of FreeType2.  But ftbzip2
+       module has no builtin bzip2 library and always requires
+       system bzip2 library.  Thus SYSTEM_BZ2LIB is always yes,
+       it is not used.
+
+2011-01-03  Werner Lemberg  <wl@gnu.org>
+
+       */rules.mk: Handle `*pic.c' files.
+
+2010-12-31  Werner Lemberg  <wl@gnu.org>
+
+       * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 64.
+       Problem reported by Tom Bishop <wenlin@wenlin.com>.
+
+2010-12-31  Werner Lemberg  <wl@gnu.org>
+
+       Improve bzip2 support.
+
+       * include/freetype/ftmoderr.h: Add bzip2.
+
+       * docs/INSTALL.ANY, docs/CHANGES: Updated.
+
+       * src/pcf/README: Updated.
+       * include/freetype/internal/pcftypes.h: Obsolete, removed.
+
+2010-12-31  Joel Klinghed  <the_jk@yahoo.com>
+
+       Add bzip2 compression support to handle *.pcf.bz2 files.
+
+       * builds/unix/configure.raw: Test for libbz2 library.
+
+       * devel/ftoption.h, include/freetype/config/ftoption.h
+       (FT_CONFIG_OPTION_USE_BZIP2): Define.
+       * include/freetype/config/ftheader.h (FT_BZIP2_H): Define.
+
+       * include/freetype/ftbzip2.h: New file.
+
+       * src/bzip2/*: New files.
+
+       * src/pcf/pcf.h: s/gzip_/comp_/.
+       * src/pcf/pcfdrvr.c: Include FT_BZIP2_H.
+       s/gzip_/comp_/.
+       (PCF_Face_Init): Handle bzip2 compressed files.
+
+       * docs/formats.txt, modules.cfg: Updated.
+
+2010-12-25  Harsha  <mm.harsha@gmail.com>
+
+       Apply Savannah patch #7422.
+
+       If we encounter a space in a string then the sbit buffer is NULL,
+       height and width are 0s.  So the check in ftc_snode_compare will
+       always pass for spaces (comparision with 255).  Here the comments
+       above the condition are proper but the implementation is not.  When
+       we create an snode I think it is the proper way to initialize the
+       width to 255 and then put a check for being equal to 255 in snode
+       compare function.
+
+       * src/cache/ftcsbits.c (FTC_SNode_New): Initialize sbit widths with
+       value 255.
+       (ftc_snode_compare): Fix condition.
+
+2010-12-13  Werner Lemberg  <wl@gnu.org>
+
+       Fix parameter handling of `FT_Set_Renderer'.
+       Reported by Kirill Tishin <siege@bk.ru>.
+
+       * src/base/ftobjs.c (FT_Set_Renderer): Increment `parameters'.
+
+2010-12-09  Werner Lemberg  <wl@gnu.org>
+
+       [cff] Allow `hlineto' and `vlineto' without arguments.
+
+       We simply ignore such instructions.  This is invalid, but it doesn't
+       harm; and indeed, there exist such subsetted fonts in PDFs.
+
+       Reported by Albert Astals Cid <aacid@kde.org>.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
+       [cff_op_hlineto]: Ignore instruction if there aren't any arguments
+       on the stack.
+
 2010-11-28  Werner Lemberg  <wl@gnu.org>
 
        * Version 2.4.4 released.
 2010-11-28  Werner Lemberg  <wl@gnu.org>
 
        * Version 2.4.4 released.
 
 2010-11-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 
 2010-11-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       [UVS] Fix find_variant_selector_charmap(), Savannah bug #31545.
+       [UVS] Fix `find_variant_selector_charmap', Savannah bug #31545.
 
 
-       Since 2010-07-04, find_variant_selector_charmap() returns
+       Since 2010-07-04, `find_variant_selector_charmap' returns
        the first cmap subtable always under rogue-compatible
        configuration, it causes NULL pointer dereference and
        make UVS-related functions crashed.
        the first cmap subtable always under rogue-compatible
        configuration, it causes NULL pointer dereference and
        make UVS-related functions crashed.
 
 2010-10-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 
 2010-10-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       Revert a change of `_idx' type in FTC_CACHE_LOOKUP_CMP().
+       Revert a change of `_idx' type in `FTC_CACHE_LOOKUP_CMP'.
 
        * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Revert
        the type of `_idx' from FT_PtrDist (by previous change)
 
        * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Revert
        the type of `_idx' from FT_PtrDist (by previous change)
 
        On LLP64 platforms (e.g. Win64), FT_ULong (32-bit)
        variables are inappropriate to calculate hash values
 
        On LLP64 platforms (e.g. Win64), FT_ULong (32-bit)
        variables are inappropriate to calculate hash values
-       from the memory address (64-bit).  The hash variables  
+       from the memory address (64-bit).  The hash variables
        are extended from FT_ULong to FT_PtrDist and new
        hashing macro functions are introduced.  The hash
        values on 16-bit memory platforms are changed, but
        are extended from FT_ULong to FT_PtrDist and new
        hashing macro functions are introduced.  The hash
        values on 16-bit memory platforms are changed, but
        address, so using signed type FT_PtrDist is safe.
 
        * src/cache/ftccache.h (_FTC_FACE_ID_HASH): New hash
        address, so using signed type FT_PtrDist is safe.
 
        * src/cache/ftccache.h (_FTC_FACE_ID_HASH): New hash
-       function to replace FTC_FACE_ID_HASH() for portability.
-       * src/cache/ftcmanag.h (FTC_SCALER_HASH): Replace 
-       FTC_FACE_ID_HASH() by _FTC_FACE_ID_HASH().
+       function to replace `FTC_FACE_ID_HASH' for portability.
+       * src/cache/ftcmanag.h (FTC_SCALER_HASH): Replace
+       `FTC_FACE_ID_HASH' by `_FTC_FACE_ID_HASH'.
        * src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto.
 
        * src/cache/ftccache.h (FTC_NodeRec): The type of the
        * src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto.
 
        * src/cache/ftccache.h (FTC_NodeRec): The type of the
        * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Ditto.
        Also the type of the internal variable `_idx' is changed to
        FT_PtrDist from FT_UFast for better pointer calculation.
        * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Ditto.
        Also the type of the internal variable `_idx' is changed to
        FT_PtrDist from FT_UFast for better pointer calculation.
-       
+
 2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
        [cache] Hide internal macros incompatible with LLP64.
 
 2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
        [cache] Hide internal macros incompatible with LLP64.
 
-       FT_POINTER_TO_ULONG(), FTC_FACE_ID_HASH() and
-       FTC_IMAGE_TYPE_HASH() are enclosed by
+       `FT_POINTER_TO_ULONG', `FTC_FACE_ID_HASH', and
+       `FTC_IMAGE_TYPE_HASH' are enclosed by
        FT_CONFIG_OPTION_OLD_INTERNALS and hidden from
        normal clients.
 
        FT_CONFIG_OPTION_OLD_INTERNALS and hidden from
        normal clients.
 
 
 2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 
 2010-10-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       Change the type of FT_MEM_VAL() from FT_ULong to FT_PtrDist.
+       Change the type of `FT_MEM_VAL' from FT_ULong to FT_PtrDist.
 
        On LLP64 platforms (e.g. Win64), unsigned long (32-bit)
 
        On LLP64 platforms (e.g. Win64), unsigned long (32-bit)
-       cannot cover the memory address (64-bit).  FT_MEM_VAL() is
+       cannot cover the memory address (64-bit).  `FT_MEM_VAL' is
        used for hashing only and not dereferred, so using signed
        type FT_PtrDist is safe.
 
        used for hashing only and not dereferred, so using signed
        type FT_PtrDist is safe.
 
                http://trac.macports.org/ticket/18859
 
        * src/base/ftobjs.c (load_face_in_embedded_rfork):
                http://trac.macports.org/ticket/18859
 
        * src/base/ftobjs.c (load_face_in_embedded_rfork):
-       When FT_Stream_New() returns FT_Err_Cannot_Open_Stream, it
-       means that the file is possible to be fopen()-ed but zero-sized.
-       Also there is a case that the resource fork is not zero-sized, 
+       When `FT_Stream_New' returns FT_Err_Cannot_Open_Stream, it
+       means that the file is possible to be `fopen'-ed but zero-sized.
+       Also there is a case that the resource fork is not zero-sized,
        but no supported font exists in it.  If a rule by Darwin VFS
        falls into such cases, there is no need to try other Darwin VFS
        rules anymore.  Such cases are marked by vfs_rfork_has_no_font.
        but no supported font exists in it.  If a rule by Darwin VFS
        falls into such cases, there is no need to try other Darwin VFS
        rules anymore.  Such cases are marked by vfs_rfork_has_no_font.
        a resource fork via ANSI C or POSIX interface.  Current resource
        fork accessor tries all possible methods to support all kernels.
        But if a method could open a resource fork but no font is found,
        a resource fork via ANSI C or POSIX interface.  Current resource
        fork accessor tries all possible methods to support all kernels.
        But if a method could open a resource fork but no font is found,
-       there is no need to try other methods older than tested method. 
+       there is no need to try other methods older than tested method.
        To determine whether the rule index is for Darwin VFS, a local
        To determine whether the rule index is for Darwin VFS, a local
-       function ftrfork.c::raccess_rule_by_darwin_vfs() is introduced.
+       function `ftrfork.c::raccess_rule_by_darwin_vfs' is introduced.
        To use this function in ftobjs.c etc but it should be inlined,
        it is exposed by ftbase.h.
 
        To use this function in ftobjs.c etc but it should be inlined,
        it is exposed by ftbase.h.
 
 
 2010-10-12  Werner Lemberg  <wl@gnu.org>
 
 
 2010-10-12  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #31310.
+       [truetype] Fix Savannah bug #31310.
 
        * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against
        invalid `runcnt' values.
 
 2010-10-08  Chris Liddell  <chris.liddell@artifex.com>
 
 
        * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against
        invalid `runcnt' values.
 
 2010-10-08  Chris Liddell  <chris.liddell@artifex.com>
 
-       Fix Savannah bug #31275.
+       [sfnt] Fix Savannah bug #31275.
 
        * src/sfnt/ttpost.c: Include FT_INTERNAL_DEBUG_H.
 
 
        * src/sfnt/ttpost.c: Include FT_INTERNAL_DEBUG_H.
 
 
 2010-10-02  Werner Lemberg  <wl@gnu.org>
 
 
 2010-10-02  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #31088 (sort of).
+       [sfnt] Fix Savannah bug #31088 (sort of).
 
        * src/sfnt/ttload.c (tt_face_load_maxp): Always allocate at least 64
        function entries.
 
        * src/sfnt/ttload.c (tt_face_load_maxp): Always allocate at least 64
        function entries.
 
 2010-10-01  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 
 2010-10-01  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       Fix Savannah bug #31040.
+       [truetype] Fix Savannah bug #31040.
 
        * src/truetype/ttinterp.c (free_buffer_in_size): Remove.
        (TT_RunIns): Updated.
 
        * src/truetype/ttinterp.c (free_buffer_in_size): Remove.
        (TT_RunIns): Updated.
        * src/cff/cffload.c (cff_index_access_element): `off2', the offset
        to the next element is truncated at the end of the stream to prevent
        invalid I/O.  As `off1', the offset to the requested element has
        * src/cff/cffload.c (cff_index_access_element): `off2', the offset
        to the next element is truncated at the end of the stream to prevent
        invalid I/O.  As `off1', the offset to the requested element has
-       been checked by FT_STREAM_SEEK(), `off2' should be checked
+       been checked by `FT_STREAM_SEEK', `off2' should be checked
        similarly.
 
 2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
        similarly.
 
 2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 
 2010-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
-       [cff] Make trace message in cff_charset_load() verbose.
+       [cff] Make trace message in` cff_charset_load' verbose.
        See Savannah bug #30975.
 
        * src/cff/cffload.c (cff_charset_load): Report the original `nleft'
        See Savannah bug #30975.
 
        * src/cff/cffload.c (cff_charset_load): Report the original `nleft'
        See Savannah bug #31040.
 
        * src/sfnt/ttpost.c (load_post_names): Get the length of `post'
        See Savannah bug #31040.
 
        * src/sfnt/ttpost.c (load_post_names): Get the length of `post'
-       table and pass the limit of `post' table to load_format_20() and
-       load_format_25().
+       table and pass the limit of `post' table to `load_format_20' and
+       `load_format_25'.
        (load_format_20): Stop the parsing when we reached at the limit of
        `post' table.  If more glyph names are required, they are filled by
        NULL names.
        (load_format_20): Stop the parsing when we reached at the limit of
        `post' table.  If more glyph names are required, they are filled by
        NULL names.
 
        * src/truetype/ttinterp.c (free_buffer_in_size): Don't duplicate
        FT_GlyphZoneRec size->twilight to be freed.  If duplicated,
 
        * src/truetype/ttinterp.c (free_buffer_in_size): Don't duplicate
        FT_GlyphZoneRec size->twilight to be freed.  If duplicated,
-       FT_FREE() erases the duplicated pointers only and leave original
+       `FT_FREE' erases the duplicated pointers only and leave original
        pointers.  They can cause the double-free crash when the burst
        pointers.  They can cause the double-free crash when the burst
-       errors occur in TrueType interpreter and free_buffer_in_size() is
+       errors occur in TrueType interpreter and `free_buffer_in_size' is
        invoked repeatedly.
 
 2010-09-15  Werner Lemberg  <wl@gnu.org>
        invoked repeatedly.
 
 2010-09-15  Werner Lemberg  <wl@gnu.org>
 
        * src/truetype/ttinterp.c (TT_RunIns): Decrease the trace level
        showing the error when the interpreter returns with an error,
 
        * src/truetype/ttinterp.c (TT_RunIns): Decrease the trace level
        showing the error when the interpreter returns with an error,
-       from FT_TRACE7() to FT_TRACE1().
+       from` FT_TRACE7' to `FT_TRACE1'.
 
 2010-08-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 
 2010-08-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 
 2010-08-17  Teijo Kinnunen <Teijo.Kinnunen@nuance.com>
 
 
 2010-08-17  Teijo Kinnunen <Teijo.Kinnunen@nuance.com>
 
-       Fix Savannah bug #30788.
+       [cache] Fix Savannah bug #30788.
 
        * src/cache/ftccache.c (FTC_Cache_Clear): Check `cache->buckets' for
        NULL too.
 
        * src/cache/ftccache.c (FTC_Cache_Clear): Check `cache->buckets' for
        NULL too.
 
 2010-08-05  Werner Lemberg  <wl@gnu.org>
 
 
 2010-08-05  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30657.
+       [truetype] Fix Savannah bug #30657.
 
        * src/truetype/ttinterp.c (BOUNDSL): New macro.
        Change `BOUNDS' to `BOUNDSL' where appropriate.
 
        * src/truetype/ttinterp.c (BOUNDSL): New macro.
        Change `BOUNDS' to `BOUNDSL' where appropriate.
 
 2010-08-05  Werner Lemberg  <wl@gnu.org>
 
 
 2010-08-05  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30656.
+       [type42] Fix Savannah bug #30656.
 
        * src/type42/t42parse.c (t42_parse_sfnts): Protect against negative
        string_size.
 
        * src/type42/t42parse.c (t42_parse_sfnts): Protect against negative
        string_size.
        [cff] Don't use any values in decoder after parsing error.
 
        * src/cff/cffgload.c (cff_slot_load): Skip the evaluations
        [cff] Don't use any values in decoder after parsing error.
 
        * src/cff/cffgload.c (cff_slot_load): Skip the evaluations
-       of the values in decoder, if cff_decoder_parse_charstrings()
+       of the values in decoder, if `cff_decoder_parse_charstrings'
        returns any error.
 
 2010-08-04  Werner Lemberg  <wl@gnu.org>
        returns any error.
 
 2010-08-04  Werner Lemberg  <wl@gnu.org>
 
 2010-07-08  Werner Lemberg  <wl@gnu.org>
 
 
 2010-07-08  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30361.
+       [truetype] Fix Savannah bug #30361.
 
        * src/truetype/ttinterp.c (Ins_IUP): Fix bounds check.
 
 
        * src/truetype/ttinterp.c (Ins_IUP): Fix bounds check.
 
 
 2010-06-30  Werner Lemberg  <wl@gnu.org>
 
 
 2010-06-30  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30263.
+       [smooth] Fix Savannah bug #30263.
 
        * src/smooth/ftgrays.c (gray_render_span): Use cast to `unsigned
        int' to avoid integer overflow.
 
        * src/smooth/ftgrays.c (gray_render_span): Use cast to `unsigned
        int' to avoid integer overflow.
 
 2010-06-26  Werner Lemberg  <wl@gnu.org>
 
 
 2010-06-26  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30262.
+       [sfnt] Fix Savannah bug #30262.
 
        * src/sfnt/ttload.c (tt_face_load_maxp): Limit `maxComponentDepth'
        arbitrarily to 100 to avoid stack exhaustion.
 
        * src/sfnt/ttload.c (tt_face_load_maxp): Limit `maxComponentDepth'
        arbitrarily to 100 to avoid stack exhaustion.
 
 2010-06-25  Werner Lemberg  <wl@gnu.org>
 
 
 2010-06-25  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30261.
+       [pfr] Fix Savannah bug #30261.
 
        * src/pfr/pfrobjs.c (pfr_face_init): Reject fonts which contain
        neither outline nor bitmap glyphs.
 
 2010-06-25  Werner Lemberg  <wl@gnu.org>
 
 
        * src/pfr/pfrobjs.c (pfr_face_init): Reject fonts which contain
        neither outline nor bitmap glyphs.
 
 2010-06-25  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30254.
+       [cff] Fix Savannah bug #30254.
 
        * src/cff/cffload.c (cff_index_get_pointers): Do sanity check for
        first offset also.
 
        * src/cff/cffload.c (cff_index_get_pointers): Do sanity check for
        first offset also.
 
 2010-06-24  Werner Lemberg  <wl@gnu.org>
 
 
 2010-06-24  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30247.
+       [pcf] Fix Savannah bug #30247.
 
        * src/pcf/pcfread.c (pcf_get_metrics): Disallow (invalid) fonts with
        zero metrics.
 
        * src/pcf/pcfread.c (pcf_get_metrics): Disallow (invalid) fonts with
        zero metrics.
 
 2010-06-24  Werner Lemberg  <wl@gnu.org>
 
 
 2010-06-24  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30236.
+       [sfnt] Fix Savannah bug #30236.
 
        * src/sfnt/ttcmap.c (tt_face_build_cmaps): Improve check for pointer
        to `cmap_table'.
 
 2010-06-24  Werner Lemberg  <wl@gnu.org>
 
 
        * src/sfnt/ttcmap.c (tt_face_build_cmaps): Improve check for pointer
        to `cmap_table'.
 
 2010-06-24  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30235.
+       [pfr] Fix Savannah bug #30235.
 
        * src/pfr/pfrgload.c (pfr_glyph_load_simple): Protect against
        invalid indices if there aren't any coordinates for indexing.
 
        * src/pfr/pfrgload.c (pfr_glyph_load_simple): Protect against
        invalid indices if there aren't any coordinates for indexing.
 
 2010-06-23  Werner Lemberg  <wl@gnu.org>
 
 
 2010-06-23  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30220.
+       [bdf] Fix Savannah bug #30220.
 
        * include/freetype/fterrdef.h
        (BDF_Err_Missing_Fontboundingbox_Field): New error code.
 
        * include/freetype/fterrdef.h
        (BDF_Err_Missing_Fontboundingbox_Field): New error code.
 
 2010-06-21  Werner Lemberg  <wl@gnu.org>
 
 
 2010-06-21  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30168.
+       [pfr] Fix Savannah bug #30168.
 
        * src/pfr/pfrgload.c (pfr_glyph_load_compound): Limit the number of
        subglyphs to avoid endless recursion.
 
 2010-06-20  Werner Lemberg  <wl@gnu.org>
 
 
        * src/pfr/pfrgload.c (pfr_glyph_load_compound): Limit the number of
        subglyphs to avoid endless recursion.
 
 2010-06-20  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30145.
+       [psaux] Fix Savannah bug #30145.
 
        * src/psaux/psobjs.c (t1_builder_add_contour): Protect against
        `outline == NULL' which might happen in invalid fonts.
 
 2010-06-19  Werner Lemberg  <wl@gnu.org>
 
 
        * src/psaux/psobjs.c (t1_builder_add_contour): Protect against
        `outline == NULL' which might happen in invalid fonts.
 
 2010-06-19  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30135.
+       [bdf] Fix Savannah bug #30135.
 
        * src/bdf/bdflib.c (_bdf_list_join): Don't modify value in static
        string `empty'.
 
        * src/bdf/bdflib.c (_bdf_list_join): Don't modify value in static
        string `empty'.
 
 2010-06-15  Werner Lemberg  <wl@gnu.org>
 
 
 2010-06-15  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30108.
+       [autofit] Fix Savannah bug #30108.
 
        * src/autofit/afglobal.c (af_face_globals_compute_script_coverage):
        Properly mask AF_DIGIT bit in comparison.
 
 2010-06-11  Werner Lemberg  <wl@gnu.org>
 
 
        * src/autofit/afglobal.c (af_face_globals_compute_script_coverage):
        Properly mask AF_DIGIT bit in comparison.
 
 2010-06-11  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30106.
+       [pshinter] Fix Savannah bug #30106.
 
        Point numbers for FreeType's implementation of hinting masks are
        collected before the final number of points of a glyph has been
 
        Point numbers for FreeType's implementation of hinting masks are
        collected before the final number of points of a glyph has been
 
 2010-06-09  Werner Lemberg  <wl@gnu.org>
 
 
 2010-06-09  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30082.
+       [cff] Fix Savannah bug #30082.
 
        * src/cff/cffgload.c (cff_decoder_parse_charstrings)
        <cff_op_callothersubr>: Protect against stack underflow.
 
 2010-06-08  Werner Lemberg  <wl@gnu.org>
 
 
        * src/cff/cffgload.c (cff_decoder_parse_charstrings)
        <cff_op_callothersubr>: Protect against stack underflow.
 
 2010-06-08  Werner Lemberg  <wl@gnu.org>
 
-       Fix Savannah bug #30053.
+       [cff] Fix Savannah bug #30053.
 
        * src/cff/cffparse.c (cff_parse_real): Handle border case where
        `fraction_length' has value 10.
 
        * src/cff/cffparse.c (cff_parse_real): Handle border case where
        `fraction_length' has value 10.
 
 2010-05-21  Bram Tassyns  <bramt@enfocus.be>
 
 
 2010-05-21  Bram Tassyns  <bramt@enfocus.be>
 
-       Fix Savannah bug #27987.
+       [cff] Fix Savannah bug #27987.
 
        * src/cff/cffobjs.c (remove_subset_prefix): New function.
        (cff_face_init): Use it to adjust `cffface->family_name'.
 
        * src/cff/cffobjs.c (remove_subset_prefix): New function.
        (cff_face_init): Use it to adjust `cffface->family_name'.
 
 2010-05-10  Ken Sharp  <ken.sharp@artifex.com>
 
 
 2010-05-10  Ken Sharp  <ken.sharp@artifex.com>
 
-       Fix Savannah bug #29846.
+       [psaux] Fix Savannah bug #29846.
 
        Previously we discovered fonts which used `setcurrentpoint' to set
        the initial point of a contour to 0,0.  This caused FreeType to
 
        Previously we discovered fonts which used `setcurrentpoint' to set
        the initial point of a contour to 0,0.  This caused FreeType to
        and real proper usage of the operator to work the same way as Adobe
        interpreters apparently do.
 
        and real proper usage of the operator to work the same way as Adobe
        interpreters apparently do.
 
-       (t1_decoder_parse_charstrings): Make `setcurrentpoint' use the top
-       two elements of the stack to establish unconditionally the current x
-       and y coordinates.
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Make
+       `setcurrentpoint' use the top two elements of the stack to establish
+       unconditionally the current x and y coordinates.
 
        Make the `flex' subroutine handling (OtherSubr 0) put the current
        x,y coordinates onto the stack, instead of two dummy uninitialised
 
        Make the `flex' subroutine handling (OtherSubr 0) put the current
        x,y coordinates onto the stack, instead of two dummy uninitialised
 
 2010-04-14  Ken Sharp  <ken.sharp@artifex.com>
 
 
 2010-04-14  Ken Sharp  <ken.sharp@artifex.com>
 
-       Fix Savannah bug #29444.
+       [psaux] Fix Savannah bug #29444.
 
        * src/psaux/psobjs.c (t1_builder_start_point): Accept (invalid)
        `lineto' immediately after `hsbw', in accordance with Acrobat, GS,
 
        * src/psaux/psobjs.c (t1_builder_start_point): Accept (invalid)
        `lineto' immediately after `hsbw', in accordance with Acrobat, GS,
 
 2010-04-14  Michał Cichoń  <thedmd@artifexmundi.com>
 
 
 2010-04-14  Michał Cichoń  <thedmd@artifexmundi.com>
 
-       Fix Savannah bug #27999.
+       [psaux] Fix Savannah bug #27999.
 
        * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID): Only remove
        selected entry, not all.
 
 2010-04-06  Jonathan Kew  <jfkthame@gmail.com>
 
 
        * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID): Only remove
        selected entry, not all.
 
 2010-04-06  Jonathan Kew  <jfkthame@gmail.com>
 
-       Add overflow check to `fvar' table.
+       [truetype] Add overflow check to `fvar' table.
 
        * src/truetype/ttgxvar.c (TT_Get_MM_Var): Check axis and instance
        count.
 
 2010-04-05  Ken Sharp  <ken.sharp@artifex.com>
 
 
        * src/truetype/ttgxvar.c (TT_Get_MM_Var): Check axis and instance
        count.
 
 2010-04-05  Ken Sharp  <ken.sharp@artifex.com>
 
-       Fix Savannah bug #29335.
+       [raster] Fix Savannah bug #29335.
 
        * src/raster/ftraster.c (Line_Up): Use slow multiplication to
        prevent overflow.  This shouldn't have any serious impact on speed,
 
        * src/raster/ftraster.c (Line_Up): Use slow multiplication to
        prevent overflow.  This shouldn't have any serious impact on speed,
 
 2010-04-01  John Tytgat  <John.Tytgat@esko.com>
 
 
 2010-04-01  John Tytgat  <John.Tytgat@esko.com>
 
-       Fix Savannah bug #29404.
+       [truetype] Fix Savannah bug #29404.
 
        * src/truetype/ttgload.c: Revert change 2752bd1a (check on bit 1
        of `head' table of TrueType fonts).
 
        * src/truetype/ttgload.c: Revert change 2752bd1a (check on bit 1
        of `head' table of TrueType fonts).
 
 2010-03-11  Chris Liddell  <chris.liddell@artifex.com>
 
 
 2010-03-11  Chris Liddell  <chris.liddell@artifex.com>
 
-       Fix Savannah bug #27442.
+       [raster] Fix Savannah bug #27442.
 
        * src/raster/ftraster.c (ft_black_reset): Fix `buffer_size'.
 
 2010-03-09  Werner Lemberg  <wl@gnu.org>
 
 
        * src/raster/ftraster.c (ft_black_reset): Fix `buffer_size'.
 
 2010-03-09  Werner Lemberg  <wl@gnu.org>
 
-       Remove unused variable.
+       [cff] Remove unused variable.
        Reported by Graham.
 
        * src/cff/cffparse.c (cff_parse_real): Remove `rest'.
 
 2010-03-02  John Tytgat  <John.Tytgat@esko.com>
 
        Reported by Graham.
 
        * src/cff/cffparse.c (cff_parse_real): Remove `rest'.
 
 2010-03-02  John Tytgat  <John.Tytgat@esko.com>
 
-       Improve CFF string (especially glyphname) lookup performance.
+       [cff] Improve CFF string (especially glyphname) lookup performance.
 
        We do this by avoiding memory allocation and file I/O.  This is
        Savannah patch #7104.
 
        We do this by avoiding memory allocation and file I/O.  This is
        Savannah patch #7104.
 
 2010-02-18  Chris Liddell  <chris.liddell@artifex.com>
 
 
 2010-02-18  Chris Liddell  <chris.liddell@artifex.com>
 
-       Fix Savannah bug #28905.
+       [truetype] Fix Savannah bug #28905.
 
        Initialize phantom points before calling the incremental interface
        to update glyph metrics.
 
        Initialize phantom points before calling the incremental interface
        to update glyph metrics.
 
 ----------------------------------------------------------------------------
 
 
 ----------------------------------------------------------------------------
 
-Copyright 2010 by
+Copyright 2010-2013 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This file is part of the FreeType project, and may only be used, modified,
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This file is part of the FreeType project, and may only be used, modified,
diff --git a/reactos/lib/3rdparty/freetype/ChangeLog.20 b/reactos/lib/3rdparty/freetype/ChangeLog.20
deleted file mode 100644 (file)
index 8fcc5e7..0000000
+++ /dev/null
@@ -1,2613 +0,0 @@
-2002-02-09  Werner Lemberg  <wl@gnu.org>
-
-       * README: Fix typo.
-       * docs/CHANGES: Minor fixes.
-
-
-       * Version 2.0.8 released.
-       =========================
-
-
-2002-02-08  David Turner  <david@freetype.org>
-
-       * docs/CHANGES: Updating for 2.0.8.
-
-       * include/freetype/freetype.h: Setting `PATCH_LEVEL' to 8 and
-       removing `FT_Get_Next_Char' from the API (temporarily).
-
-       * include/freetype/freetype.h: Adding comments to FT_Get_Next_Char;
-       note that this function might temporarily be removed for the 2.0.8
-       release.
-
-2002-02-07  David Turner  <david@freetype.org>
-
-       * src/pcf/pcfread.c (pcf_load_font): Removed immature support of
-       the AVERAGE_WIDTH property.
-
-2002-02-06  David Turner  <david@freetype.org>
-
-       * src/sfnt/sfobjs.c (SFNT_Load_Face): Since many fonts embedded in
-       PDF documents do not include 'cmap', 'post' and 'name' tables, the
-       SFNT face loader has been changed to not immediately report an
-       error if these are not present.
-
-       Note that the specification _requires_ these tables, but Adobe
-       seems to ignore it completely.
-
-       * src/sfnt/ttcmap.c: Removing compiler warnings.
-
-       * src/pcf/pcfread.c (pcf_read_TOC): Use FT_UInt.
-       (pcf_parse_metric, pcf_parse_compressed_metric): Removed.  Code
-       is now in ...
-       (pcf_get_metric): Here.
-       (pcfSeekToType): Renamed to ...
-       (pcf_seek_to_table_type): This.
-       Use FT_Int.
-       (pcfHasType): Renamed to ...
-       (pcf_has_table_type): This.
-       Use FT_Int.
-       (find_property): Renamed to ...
-       (pcf_find_property): This.
-       Use FT_Int.
-       (pcf_get_bitmaps, pcf_get_encodings): Handle invalid PCF fonts
-       better (delaying format checks out of FT_Access_Frame ..
-       FT_Forget_Frame blocks to avoid leaving the stream in an incorrect
-       state when encountering an invalid PCF font).
-
-       * src/pcf/pcfdriver.c (PCF_Done_Face): Renamed to ...
-       (PCF_Face_Done): This.
-       (PCF_Init_Face): Renamed to ...
-       (PCF_Face_Init): This.
-       (PCF_Get_Char_Index): Renamed to ...
-       (PCF_Char_Get_Index): This.
-       (PCF_Get_Next_Char): Renamed to ...
-       (PCF_Char_Get_Next): This.
-       (pcf_driver_class): Updated.
-
-       * src/pcf/pcf.h (PCF_Done_Face): Removed.
-
-2002-02-06  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/pcf/pcfdriver.c (FT_Done_Face): Fixed small memory leak.
-
-       * src/pcf/pcfread.c (pcf_load_font): Now handles the `AVERAGE_WIDTH'
-       property to return correct character pixel (width/height) pairs for
-       embedded bitmaps.
-
-2002-02-04  Keith Packard  <keithp@keithp.com>
-
-       Adding the function `FT_Get_Next_Char', doing the obvious thing
-       w.r.t. the selected charmap.
-
-       * include/freetype/freetype.h: Add prototype.
-       * include/freetype/internal/ftdriver.h: Add `FTDriver_getNextChar'
-       typedef.
-       (FT_Driver_Class): Use it.
-       * include/freetype/internal/psnames.h: Add `PS_Next_Unicode_Func'
-       typedef.
-       (PSNames_Interface): Use it.
-       * include/freetype/internal/tttypes.h: Add `TT_CharNext_Func'
-       typedef.
-       (TT_CMapTable): Use it.
-
-       * src/base/ftobjs.c (FT_Get_Next_Char): New function, implementing
-       high-level API.
-       * src/cff/cffdrivr.c (cff_get_next_char): New function.
-       (cff_driver_class): Add it.
-       * src/cid/cidriver.c (Cid_Get_Next_Char): New function.
-       (t1cid_driver_class): Add it.
-       * src/pcf/pcfdriver.c (PCF_Get_Next_Char): New function.
-       (pcf_driver_class): Add it.
-       * src/psnames/psmodule.c (PS_Next_Unicode): New function.
-       (psnames_interface): Add it.
-       * src/sfnt/ttcmap.c (code_to_next0, code_to_next2, code_to_next4,
-       code_to_next6, code_to_next_8_12, code_to_next_10): New auxiliary
-       functions.
-       (TT_CharMap_Load): Use them.
-       * src/truetype/ttdriver.c (Get_Next_Char): New function.
-       (tt_driver_class): Add it.
-       * src/type1/t1driver.c (Get_Next_Char): New function.
-       (t1_driver_class): Add it.
-       * src/winfonts/winfnt.c (FNT_Get_Next_Char): New function.
-       (winfnt_driver_class): Add it.
-
-       * src/pcf/pcfread.c (pcf_load_font): For now, report Unicode for
-       Unicode and Latin 1 encodings.
-
-2002-02-02  Keith Packard  <keithp@keithp.com>
-
-       * builds/unix/freetype-config.in: Add missing `fi'.
-
-
-       * Version 2.0.7 released.
-       =========================
-
-
-2002-02-01  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h: Increasing FREETYPE_PATCH to 7
-       for the new release.
-
-2002-01-31  David Turner  <david@freetype.org>
-
-       * README, README.UNX, docs/CHANGES: Updating documentation for the
-       2.0.7 release.
-
-2002-01-30  David Turner  <david@freetype.org>
-
-       * INSTALL: Moved to ...
-       * docs/INSTALL: Here to avoid conflicts with the `install' script on
-       Windows, where the filesystem doesn't preserve case.
-
-2002-01-29  David Turner  <david@freetype.org>
-
-       * configure: Fixed the script.  It previously didn't accept more
-       than one argument correctly.  For example, when typing:
-
-         ./configure --disable-shared --disable-nls
-
-       the `--disable-nls' was incorrectly sent to the `make' program.
-
-2002-01-29  Werner Lemberg  <wl@gnu.org>
-
-       * README.UNX: Fix typo.
-       * builds/unix/install.mk (uninstall): Fix library name for libtool.
-
-2002-01-28  Francesco Zappa Nardelli  <Francesco.Zappa.Nardelli@ens.fr>
-
-       * src/pcf/pcfdriver.c (PCF_Done_Face): Fix incorrect destruction of
-       the face object (face->toc.tables, face->root.family_name,
-       face->root.available_size, face->charset_encoding,
-       face->charset_registry are now freed).  Thanks to Niels Moseley.
-
-2002-01-28  Roberto Alameda  <ojancano@geekmail.de>
-
-       * src/type1/t1load.c (parse_encoding): Set `loader->num_chars'.
-
-2002-01-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_subrs, parse_charstrings): Use copy
-       of `base' string for decrypting to not modify the original data.
-       Based on a patch by Jakub Bogusz <qboosh@pld.org.pl>.
-
-2002-01-27  Giuliano Pochini  <pochini@shiny.it>
-
-       * src/smooth/ftgrays.c (gray_render_scanline): Fix bug which caused
-       bad rendering of thin lines (less than one pixel thick).
-
-2002-01-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffdrivr.c (cff_get_name_index): Make last patch work
-       actually.
-
-2002-01-25  Martin Zinser  <zinser@decus.de>
-
-       * src/cache/ftccache.c (ftc_node_done, ftc_node_destroy): Fix
-       compilation warnings.
-       * src/base/descrip.mms (OBJS): Add `ftmm.obj'.
-       * src/cache/descrip.mms (ftcache.obj): Dependencies added.
-
-2002-01-25  WANG Yi  <wangyi@founder.com.cn>
-
-       * src/cff/cffdrivr.c (cff_get_name_index): Fix deallocation bug.
-
-2002-01-21  Antoine Leca  <Antoine-Freetype@Leca-Marti.org>
-
-       * docs/PATENTS: Typo fixed (thanks to Detlef `Hawkeye' Würkner) in
-       the URL for the online resource.
-
-2002-01-18  Ian Brown  <ian.brown@printsoft.de>
-
-       * builds/win32/ftdebug.c: New file.
-       * builds/win32/visualc/freetype.dsp: Updated.
-
-2002-01-18  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/src/base/ftsystem.c: Updated for AmigaOS 3.9.
-       * builds/amiga/README: Updated.
-
-2002-01-18  Ian Brown  <ian.brown@printsoft.de>
-
-       * builds/win32/visualc/freetype.dsp: Updated.
-
-2002-01-13  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/freetype2.a4: The script was still buggy.
-       * builds/unix/freetype-config.in: Make it really work for any install
-       prefix.
-
-2002-01-10  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/freetype2.a4: Fix some serious bugs.
-
-2002-01-09  David Turner  <david@freetype.org>
-
-       * builds/unix/configure.ac: Build top-level Jamfile.
-
-2002-01-09  Maxim Shemanarev  <mcseemagg@yahoo.com>
-
-       * src/smooth/ftgrays.c (gray_render_line): Small optimization to
-       the smooth anti-aliased renderer that deals with vertical segments.
-       This results in a 5-7% speedup in rendering speed.
-
-2002-01-08  David Turner  <david@freetype.org>
-
-       Added some wrapper scripts to make the installation more
-       Unix-friendly.
-
-       * configure, install: New files.
-
-       * INSTALL, README.UNX: Updated installation documentation to use the
-       new 'configure' and 'install' scripts.
-
-2002-01-07  David Turner  <david@freetype.org>
-
-
-       * Version 2.0.6 released.
-       =========================
-
-
-       * docs/BUGS, docs/CHANGES: Updating documentation for 2.0.6 release.
-
-       * src/tools/docmaker.py: Fixed HTML quoting in sources.
-       (html_format): Replaced with ...
-       (html_quote): New function.
-       (html_quote0): New function.
-       (DocCode::dump_html): Small improvement.
-       (DocParagraph::dump, DocBlock::html): Use html_quote0 and html_quote.
-
-       * include/freetype/config/ftoption.h: Setting default options for
-       a release build (debugging off, bytecode interpreter off).
-
-       * src/base/ftobjs.c, src/base/ftoutln.c, src/cache/ftccmap.c,
-       src/cff/cffload.c, src/cff/cffobjs.c, src/pshinter/pshalgo2.c,
-       src/sfnt/ttload.c, src/sfnt/ttsbit.c: Removing small compiler
-       warnings (in pedantic compilation modes).
-
-2002-01-05  David Turner  <david@freetype.org>
-
-       * src/autohint/ahhint.c (ah_align_linked_edge): Modified computation
-       of auto-hinted stem widths; this avoids color fringes in
-       `ClearType-like' rendering.
-
-       * src/truetype/ttgload.c (TT_Load_Glyph_Header,
-       TT_Load_Simple_Glyph, TT_Load_Composite_Glyph, load_truetype_glyph):
-       Modified the TrueType loader to make it more paranoid; this avoids
-       nasty buffer overflows in the case of invalid glyph data (as
-       encountered in the output of some buggy font converters).
-
-2002-01-04  David Turner  <david@freetype.org>
-
-       * README.UNX: Added special README file for Unix users.
-
-       * builds/unix/ftsystem.c (FT_New_Stream): Fixed typo.
-
-       * src/base/ftobjs.c: Added #include FT_OUTLINE_H to get rid
-       of compiler warnings.
-
-       * src/base/ftoutln.c (FT_Outline_Check): Remove compiler warning.
-
-2002-01-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1objs.c (T1_Face_Init): Add cast to avoid compiler
-       warning.
-
-2002-01-03  Keith Packard  <keithp@keithp.com>
-
-       * builds/unix/ftsystem.c (FT_New_Stream): Added a fix to ensure that
-       all FreeType input streams are closed in child processes of a `fork'
-       on Unix systems.  This is important to avoid (potential) access
-       control issues.
-
-2002-01-03  David Turner  <david@freetype.org>
-
-       * src/type1/t1objs.c (T1_Face_Init): Fixed a bug that crashed the
-       library when dealing with certain weird fonts like `Stalingrad', in
-       `sadn.pfb' (this font has no full font name entry).
-
-       * src/base/ftoutln.c, include/freetype/ftoutln.h (FT_Outline_Check):
-       New function to check the consistency of outline data.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Use `FT_Outline_Check' to
-       ensure that loaded glyphs are valid.  This allows certain fonts like
-       `tt1095m_.ttf' to be loaded even though it appears they contain
-       really funky glyphs.
-
-       There still is a bug there, though.
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fix error condition.
-
-2001-12-30  David Turner  <david@freetype.org>
-
-       * src/autohint/ahhint.c (ah_hinter_load): Fix advance width
-       computation of auto-hinted glyphs.  This noticeably improves the
-       spacing of letters in KDE and Gnome.
-
-2001-12-25  Antoine Leca  <Antoine-Freetype@Leca-Marti.org>
-
-       * builds/dos/detect.mk: Correcting the order for Borland compilers:
-       16-bit bcc was never selected, always overridden by 32-bit bcc32.
-
-2001-12-22  Francesco Zappa Nardelli  <Francesco.Zappa.Nardelli@ens.fr>
-
-       * src/pfc/pcfread.c (pcf_load_font): Handle property `POINT_SIZE'
-       and fix incorrect computation of `available_sizes'.
-
-2001-12-22  David Turner  <david@freetype.org>
-
-       * src/autohint/ahhint.c (ah_hinter_load): Auto-hinted glyphs had an
-       incorrect glyph advance in the case of mono-width fonts (like
-       Courier, Andale Mono, and others).
-
-2001-12-22  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/*: Adaptations to latest changes.
-       Support added for MorphOS.
-
-2001-12-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshrec.c (FT_COMPONENT): Redefine to `trace_pshrec'.
-       (ps_mask_table_merge, ps_hints_open, ps_hints_stem,
-       ps_hints_t1stem3, ps_hints_t2mask, ps_hints_t2counter): Fix
-       FT_ERROR messages.
-       * src/pshinter/pshalgo1.c (FT_COMPONENT): Define as
-       `trace_pshalgo1'.
-       * src/pshinter/pshalgo2.c (FT_COMPONENT): Define as
-       `trace_pshalgo2'.
-       * include/freetype/internal/ftdebug.h (FT_Trace): Updated.
-
-       * docs/modules.txt: New file.
-
-2001-12-21  David Turner  <david@freetype.org>
-
-       * src/pshinter/pshrec.c (ps_hints_t2mask, ps_hints_t2counter):
-       Ignore invalid `hintmask' and `cntrmask' operators (instead of
-       returning an error).  Glyph 2028 of the CFF font `MSung-Light-Acro'
-       couldn't be rendered otherwise (it seems its charstring is buggy,
-       though this requires more analysis).
-       (FT_COMPONENT): Define.
-
-       * src/cff/cffgload.c (CFF_Parse_CharStrings), src/psaux/t1decode.c
-       (T1_Decoder_Parse_Charstrings), src/pshinter/pshalgo2.c (*), Fixed a
-       bug where the X and Y axis where inverted in the postscript hinter.
-       This caused problem when displaying on non-square surfaces.
-
-       * src/pshinter/pshalgo2.c: s/vertical/dimension/.
-
-       * src/pshinter/pshglob.c (psh_globals_new): Replaced a floating
-       point constant with a fixed-float equivalent.  For some reasons not
-       all compilers are capable of directly computing a floating pointer
-       constant casted to FT_Fixed, and will link a math library instead.
-
-2001-12-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftccache.c (ftc_node_destroy, ftc_cache_lookup): Fix
-       tracing strings.
-       * src/cache/ftccmap.c (ftc_cmap_family_init): Ditto.
-       * src/cache/ftcmanag.c (ftc_family_table_alloc,
-       ftc_family_table_free, FTC_Manager_Check): Ditto.
-       * src/cache/ftcsbits.c (ftc_sbit_node_load): Ditto.
-
-       * src/base/ftobjs.c (FT_Done_Library): Remove compiler warning.
-
-2001-12-20  David Turner  <david@freetype.org>
-
-       Added PostScript hinter support to the CFF and CID drivers.
-
-       * include/freetype/internal/cfftypes.h (CFF_Font): New member
-       `pshinter'.
-       * src/cff/cffload.c (CFF_Get_Standard_Encoding): New function.
-       * src/cff/cffload.h: Updated.
-       * src/cff/cffgload.c (CFF_Init_Builder): Renamed to ...
-       (CFF_Builder_Init): This.
-       Added new argument `hinting'.
-       (CFF_Done_Builder): Renamed to ...
-       (CFF_Builder_Done): This.
-       (CFF_Init_Decoder): Added new argument `hinting'.
-       (CFF_Parse_CharStrings): Implement vstem support.
-       (CFF_Load_Glyph): Updated.
-       Add hinting support.
-       (cff_lookup_glyph_by_stdcharcode): Use CFF_Get_Standard_Encoding().
-       (cff_argument_counts): Updated.
-       * src/cff/cffgload.h: Updated.
-       * src/cff/cffobjs.c: Include FT_INTERNAL_POSTSCRIPT_HINTS_H.
-       (CFF_Size_Get_Globals_Funcs, CFF_Size_Done, CFF_Size_Init,
-       CFF_Size_Reset, CFF_GlyphSlot_Done, CFF_GLyphSlot_Init): New
-       functions.
-       (CFF_Init_Face): Renamed to ...
-       (CFF_Face_Init): This.
-       Add hinter support.
-       (CFF_Done_Face): Renamed to ...
-       (CFF_Face_Done): This.
-       (CFF_Init_Driver): Renamed to ...
-       (CFF_Driver_Init): This.
-       (CFF_Done_Driver): Renamed to ...
-       (CFF_Driver_Done): This.
-       * src/cff/cffobjs.h: Updated.
-       * src/cff/cffdrivr.c (cff_driver_class): Updated.
-
-       * include/freetype/internal/t1types.h (CID_FaceRec): New member
-       `pshinter'.
-       * src/cid/cidgload.c (CID_Load_Glyph): Add hinter support.
-       * src/cid/cidobjs.c: Include FT_INTERNAL_POSTSCRIPT_HINTS_H.
-       (CID_GlyphSlot_Done, CID_GlyphSlot_Init, CID_Size_Get_Globals_Funcs,
-       CID_Size_Done, CID_Size_Init, CID_Size_Reset): New functions.
-       (CID_Done_Face): Renamed to ...
-       (CID_Face_Done): This.
-       (CID_Init_Face): Renamed to ...
-       (CID_Face_Init): This.
-       Add hinting support.
-       (CID_Init_Driver): Renamed to ...
-       (CID_Driver_Init): This.
-       (CID_Done_Driver): Renamed to ...
-       (CID_Driver_Done): This.
-       * src/cid/cidobjs.h: Updated.
-       * src/cidriver.c: Updated.
-
-       * src/pshinter/pshrec.c (t2_hint_stems): Fixed.
-
-       * src/base/ftobjs.c (FT_Done_Library): Fixed a stupid bug that
-       crashed the library on exit.
-
-       * src/type1/t1gload.c (T1_Load_Glyph): Enable font matrix
-       transformation of hinted glyphs.
-
-       * src/cid/cidload.c (cid_read_subrs): Fix error condition.
-
-       * src/cid/cidobjs.c (CID_Face_Done): Fixed a memory leak; the subrs
-       routines were never released when CID faces were destroyed.
-
-       * src/cff/cffload.h, src/cff/cffload.c, src/cff/cffgload.c: Updated
-       to move the definition of encoding tables back within `cffload.c'
-       instead of making them part of a shared header (causing problems in
-       `multi' builds).  This reverts change 2001-08-08.
-
-       * docs/CHANGES: Updated for 2.0.6 release.
-       * docs/TODO: Added `stem3 and counter hints support' to the TODO
-       list for the Postscript hinter.
-       * docs/BUGS: Closed the AUTOHINT-NO-SBITS bug.
-
-2001-12-19  David Turner  <david@freetype.org>
-
-       * include/freetype/cache/ftcache.h: Added comments to indicate that
-       some of the exported functions should only be used by applications
-       that need to implement custom cache types.
-
-       * src/truetype/ttgload.c (cur_to_org, org_to_cur): Fixed a nasty bug
-       that prevented composites from loading correctly, due to missing
-       parentheses around macro parameters.
-
-       * src/sfnt/sfobjs.c (SFNT_Load_Face): Make the `post' and `name'
-       tables optional to load PCL fonts properly.
-
-       * src/truetype/ttgload.c (TT_Load_Glyph), src/base/ftobjs.c
-       (FT_Load_Glyph), include/freetype/freetype.h (FT_LOAD_SBITS_ONLY):
-       `Fixed' the bug that prevented embedded bitmaps to be loaded when
-       the auto-hinter is used.  This actually is a hack but will be enough
-       until the internal re-design scheduled for FreeType 2.1.
-
-       * src/raster/ftrend1.c (ft_raster1_render): Fixed a nasty outline
-       shifting bug in the monochrome renderer.
-
-       * README: Updated version numbers to 2.0.6.
-
-2001-12-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fix test for invalid
-       glyph header.
-
-2001-12-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Remove compiler warning.
-       * include/freetype/ftcache.h (FTC_Node_Unref): Removed.  It is
-       already in ftcmanag.h.
-       * src/cache/ftcsbits.c (ftc_sbit_node_load): Remove unused variable
-       `gfam'.
-       * src/cache/ftcmanag.c (ftc_family_table_alloc,
-       * ftc_family_table_free): Use FT_EXPORT_DEF.
-       * include/freetype/cache/ftcmanag.h: Updated.
-       * src/cache/ftccache.c (ftc_node_destroy): Use FT_EXPORT_DEF.
-       * src/cache/ftccmap.c (ftc_cmap_node_init): Remove unused variable
-       `cfam'.
-       Remove compiler warning.
-       (FTC_CMapCache_Lookup): Remove compiler warnings.
-       (ftc_cmap_family_init): Ditto.
-       (FTC_CMapCache_Lookup): Ditto.
-
-       * builds/unix/configure.ac: Increase `version_info' to 8:0:2.
-       * builds/unix/configure: Regenerated.
-
-2001-12-14  Werner Lemberg  <wl@gnu.org>
-
-       * builds/mac/README: Updated.
-
-2001-12-14  Scott Long  <scott@swiftview.com>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fixing crash when
-       dealing with invalid fonts (i.e. glyph size < 10 bytes).
-
-2001-12-14  Sam Latinga  <slouken@devolution.com>
-
-       * builds/mac/freetype.make: A new Makefile to build with MPW on
-       MacOS classic.
-
-2001-12-14  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c (TT_Load_Glyph), src/type1/t1gload.c
-       (T1_Load_Glyph), src/cid/cidgload.c (CID_Load_Glyph),
-       src/cff/cffgload.c (CFF_Load_Glyph): Fixed a serious bug common to
-       all font drivers (the advance width was never hinted when it
-       should).
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): New macro.
-       * src/base/ftdbgmem.c (debug_mem_dummy) [!FT_DEBUG_MEMORY]: Don't
-       use `extern' keyword.
-
-2001-12-12  David Turner  <david@freetype.org>
-
-       * src/pshinter/pshglob.c (psh_blues_scale_zones, psh_blues_snap_stem
-       psh_globals_new): Adding correct BlueScale/BlueShift support, plus
-       family blues processing.
-       * src/pshinter/pshglob.h (PSH_BluesRec): Updated.
-
-       Started adding support for the Postscript hinter in the CFF module.
-
-       * src/cff/cffgload.c: Include FT_INTERNAL_POSTSCRIPT_HINTS_H.
-       (CFF_Parse_CharStrings): Implement it.
-       * src/cff/cffgload.h: Updated.
-
-2001-12-12  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/freetype2.m4: Some portability fixes.
-
-2001-12-11  Jouk Jansen  <joukj@hrem.stm.tudelft.nl>
-
-       * src/base/descrip.mms (OBJS): Add ftdebug.obj.
-
-2001-12-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttload.c (TT_Load_Generic_Header): Typos.
-
-2001-12-11  David Turner  <david@freetype.org>
-
-       * builds/unix/freetype-config.in: Modified the script to prevent
-       passing `-L/usr/lib' to gcc.
-
-       * docs/FTL.TXT: Simple fix (change `LICENSE.TXT' to `FTL.TXT').
-
-       * builds/unix/freetype2.m4: New file for checking configure paths.
-       We need to install it in $(prefix)/share/aclocal/freetype2.m4 but I
-       didn't modify builds/unix/install.mk yet.
-
-       * INSTALL: Updated the instructions to build shared libraries with
-       Jam.  They were simply wrong.
-
-       * src/base/fttrigon.c (FT_Cos): Fixed a small bug that caused
-       slightly improper results for `FT_Cos' and `FT_Sin' (example:
-       FT_Sin(0) == -1!).
-
-2001-12-11  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * include/freetype/internal/ftstream.h (GET_LongLE, GET_ULongLE):
-       Fixed incorrect argument types.
-
-2001-12-10  Francesco Zappa Nardelli  <Francesco.Zappa.Nardelli@ens.fr>
-
-       * src/pcf/pcfdriver.c (PCF_Init_Face): Allow Xft to use PCF fonts
-       by setting the `face->metrics.max_advance' correctly.
-
-2001-12-07  David Turner  <david@freetype.org>
-
-       * include/freetype/cache/ftccmap.h, src/cache/ftccmap.c: Added new
-       charmap cache.
-       * src/cache/ftcache.c: Updated.
-
-       * src/autohint/ahhint.c (ah_hinter_hint_edges): s/UNUSED/FT_UNUSED/.
-
-2001-12-06  Leonard Rosenthol  <leonardr@lazerware.com>
-
-       Added support for reading .dfont files on Mac OS X.  Also added a
-       new routine which looks up a given font by name in the Mac OS and
-       returns the disk file where it resides.
-
-       * src/base/ftmac.c: Include <Files.h> and <TextUtils.h>.
-       (is_dfont): New auxiliary function.
-       (FT_New_Face_From_dfont): New function.
-       (FT_GetFile_From_Mac_Name): New exported function.
-       (FT_New_Face): Updated.
-       * include/freetype/ftmac.h: Updated.
-
-2001-12-06  David Turner  <david@freetype.org>
-
-       * src/cache/Jamfile, src/cache/rules.mk: Updated.
-
-2001-12-06  Werner Lemberg  <wl@gnu.org>
-
-       * INSTALL: Small update.
-
-2001-12-05  David Turner  <david@freetype.org>
-
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Re-ordered code for
-       debugging purposes.
-       Comment out use of `origin'.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render): Fixed a nasty hidden bug
-       where outline shifting wasn't correctly undone after bitmap
-       rasterization.  This created problems with certain glyphs (like '"'
-       of certain fonts) and the cache system.
-
-       * src/pshinter/pshalgo1.c (psh1_hint_table_init): Fix typo.
-       * src/pshinter/pshalgo2.c (psh2_hint_table_init): Fix typo.
-       (ps2_hints_apply): Small fix.
-
-2001-12-05  David Turner  <david@freetype.org>
-
-       * src/pshinter/pshalgo2.c (psh2_hint_table_init),
-       src/pshinter/pshalgo1.c (psh1_hint_table_init): Removed compiler
-       warnings.
-
-       * include/freetype/ftcache.h, include/freetype/cache/*, src/cache/*:
-       Yet another massive rewrite of the caching sub-system in order to
-       both increase performance and allow simpler cache sub-classing.  As
-       an example, the code for the image and sbit caches is now much
-       simpler.
-
-       I still need to update the documentation in
-       www/freetype2/docs/cache.html to reflect the new design though.
-
-       * include/freetype/config/ftheader.h (FT_CACHE_CHARMAP_H): New
-       macro.
-       (FT_CACHE_INTERNAL_CACHE_H): Updated.
-
-2001-12-05  David Krause  <freetype@davidkrause.com>
-
-       * docs/license.txt: s/X Windows/X Window System/.
-
-2001-12-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c: Fix definition condition of MEM_Set().
-       * src/smooth/ftgrays.c (M_Y): Change value to 192.
-       * src/base/ftdbgmem.c (ft_mem_table_destroy): Fix printf() parameter.
-       Remove unused variable.
-       * src/cache/ftcimage.c (ftc_image_node_init,
-       ftc_image_node_compare): Remove unused variables.
-       * src/cache/ftcsbits.c (ftc_sbit_node_weight): Remove unused
-       variable.
-       * src/raster/ftraster.c (MEM_Set): Move definition down to avoid
-       compiler warning.
-       * src/autohint/ahhint.c (ah_hinter_hint_edges): Use UNUSED() to
-       avoid compiler warnings.
-       * src/pcf/pcfread.c (tableNames): Use `const'.
-       (pcf_read_TOC): Change counter name to avoid compiler warning.
-       Use `const'.
-       * src/pshinter/pshrec.c (ps_hints_close): Remove redundant
-       declaration.
-       * src/pshinter/pshalgo1.c (psh1_hint_table_init): Rename variables
-       to avoid shadowing.
-       * src/pshinter/pshalgo2.c (psh2_hint_table_activate_mask): Ditto.
-       * src/type1/t1objs.h: Remove double declarations of `T1_Size_Init()'
-       and `T1_Size_Done()'.
-
-2001-11-20  Antoine Leca  <antoineleca@multimania.com>
-
-       * include/freetype/ttnameid.h: Added some new Microsoft language
-       codes and LCIDs as found in MSDN (Passport SDK).  Also added
-       comments about the meaning of bit 57 of the `OS/2' table
-       (TT_UCR_SURROGATES) which (with OpenType v.1.3) now means `there is
-       a character beyond 0xFFFF in this font'.  Thanks to Detlef Würkner
-       <TetiSoft@apg.lahn.de> for noticing this.
-
-2001-11-20  David Turner  <david@freetype.org>
-
-       * src/pshinter/{pshalgo2.c, pshalgo1.c}: Fixed stupid bug in sorting
-       routine that created nasty alignment artefacts.
-
-       * src/pshinter/pshrec.c, tests/gview.c: Debugging updates.
-
-       * src/smooth/ftgrays.c: De-activated experimental gamma support.
-       Apparently, `optimal' gamma tables depend on the monitor type,
-       resolution and general karma, so it's better to compute them outside
-       of the rasterizer itself.
-       (gray_convert_glyph): Use `volatile' keyword.
-
-2001-10-29  David Turner  <david@freetype.org>
-
-       Adding experimental `gamma' support.  This produces smoother glyphs
-       at small sizes for very little cost.
-
-       * src/smooth/ftgrays.c (grays_init_gamma): New function.
-       (gray_raster_new): Use it.
-
-       Various fixes to the auto-hinter.  They merely improve the output of
-       sans-serif fonts.  Note that there are still problems with serifed
-       fonts and composites (accented characters).
-
-       * src/autohint/ahglyph.c (ah_outline_load,
-       ah_outline_link_segments): Implement it.
-       Fix typos.
-       (ah_outline_save, ah_outline_compute_segments): Fix typos.
-       * src/autohint/ahhint.c (ah_align_serif_edge): New argument
-       `vertical'.  Implement improvement.
-       (ah_hint_edges_3, ah_hinter_hint_edges): Implement it.
-       Fix typos.
-       (ah_hinter_align_strong_points, ah_hinter_align_weak_points): Fix
-       typos.
-       (ah_hinter_load): Set `ah_debug_hinter' if DEBUG_HINTER is defined.
-       * src/autohint/ahmodule.c: Implement support for DEBUG_HINTER macro.
-       * src/autohint/ahtypes.h: Ditto.
-       (AH_Hinter): Remove `disable_horz_edges' and `disable_vert_edges'
-       (making them global as `ah_debug_disable_horz' and
-       `ah_debug_disable_vert').
-       Fix typos.
-
-       * tests/gview.c: Updated the debugging glyph viewer to show the
-       hints generated by the `autohint' module.
-
-2001-10-27  David Turner  <david@freetype.org>
-
-       * src/cache/ftcchunk.c (ftc_chunk_cache_lookup): Fixed a bug that
-       considerably lowered the performance of the abstract chunk cache.
-
-2001-10-26  David Turner  <david@freetype.org>
-
-       * include/freetype/ftcache.h, include/freetype/cache/*.h,
-       src/cache/*.c: Major re-design of the cache sub-system to provide
-       better performance as well as an `Acquire'/`Release' API.  Seems to
-       work well here, but probably needs a bit more testing.
-
-2001-10-26  Leonard Rosenthol  <leonardr@lazerware.com>
-
-       * builds/mac/README: Updated to reflect my taking over the project
-       and that is now being actively maintained.
-
-       * src/base/ftmac.c (parse_fond): Applied patches from Paul Miller
-       <paulm@profoundeffects.com> to support loading a face other than the
-       first from a FOND resource.
-       (FT_New_Face_From_FOND): Updated.
-
-2001-10-25  Leonard Rosenthol  <leonardr@lazerware.com>
-
-       * builds/mac/ftlib.prj: Update of CodeWarrior project file for Mac
-       OS for latest version (7) of CWPro and for recent changes to the FT
-       source tree.
-
-2001-10-25  David Turner  <david@freetype.org>
-
-       * include/freetype/config/ftoption.h: Updated comments to explain
-       precisely how to use project-specific macro definitions without
-       modifying this file manually.
-
-       (FT_CONFIG_FORCE_INT64): Define.
-
-       (FT_DEBUG_MEMORY): New macro.
-
-2001-10-24  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * builds/unix/ftsystem.c (FT_New_Memory): Added a missing `{'.
-
-2001-10-23  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/ftmemory.h, src/base/ftdbgmem.c:
-       Improvements to the memory debugger to report more information in
-       case of errors.  Also, some allocations that occurred through REALLOC
-       couldn't be previously caught correctly.
-
-       * src/autohint/ahglyph.c (ah_outline_compute_segments,
-       ah_outline_compute_edges), src/raster/ftraster.c (ft_black_new),
-       src/smooth/ftgrays.c (gray_render_span, gray_raster_new): Replaced
-       liberal uses of memset() by the MEM_Set() macro.
-
-2001-10-23  David Turner  <david@freetype.org>
-
-       * src/raster/ftraster.c (Update): Removed to be inlined in ...
-       (Sort): Updated.
-
-2001-10-22  David Turner  <david@freetype.org>
-
-       * builds/unix/ftsystem.c (FT_New_Memory, FT_Done_Memory),
-       builds/vms/ftsystem.c (FT_New_Memory, FT_Done_Memory),
-       builds/amiga/ftsystem.c (FT_New_Memory, FT_Done_Memory),
-       src/base/ftdbgmem.c: Updated the memory debugger and
-       platform-specific implementations of `ftsystem' in order to be able
-       to debug memory allocations on Unix, VMS and Amiga too!
-
-       * src/pshinter/pshalgo2.c (psh2_hint_table_record_mask): Removed
-       some bogus warnings.
-
-       * include/freetype/internal/ftmemory.h, src/base/ftdbgmem.c:
-       Modified the debugging memory manager to report the location (source
-       file name + line number) where leaked memory blocks are allocated in
-       the source file.
-
-       * src/base/ftdbgmem.c: New debugging memory manager.  You must
-       define the FT_DEBUG_MEMORY macro in `ftoption.h' to enable it.  It
-       will record every memory block allocated and report simple errors
-       like memory leaks and double deletes.
-
-       * src/base/Jamfile: Include ftdbgmem.
-       * src/base/rules.mk: Ditto.
-       * src/base/ftbase.c: Include ftdbgmem.c.
-
-       * include/freetype/config/ftoption.h: Added the FT_DEBUG_MEMORY
-       macro definition.
-
-       * src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory): Modified the
-       base component to use the debugging memory manager when the macro
-       FT_DEBUG_MEMORY is defined.
-
-2001-10-21  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/cffload.c (CFF_Done_Font): Free subfonts array only if
-       we are working with a CID keyed CFF font.  Otherwise, a variable
-       that was never allocated memory might freed.  This is a correction
-       to the previous patch for freeing subfonts.
-
-2001-10-21  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/cffload.c (CFF_Done_Font): Free the subfonts array to
-       avoid a memory leak.
-
-2001-10-21  David Turner  <david@freetype.org>
-
-       * src/pshinter/pshalgo2.c, src/pshinter/pshalgo1.c,
-       src/pshinter/pshglob.c: Removing compiler warnings in pedantic modes
-       (in multi-object compilation mode, mainly).
-
-2001-10-20  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/type1/t1load.c (parse_encoding): Add a test to make sure
-       that custom encodings (i.e., neither StandardEncoding nor
-       ExpertEncoding) are not loaded twice when the Type 1 font is
-       synthetic.
-
-       * src/type1/t1load.c (parse_font_name, parse_subrs): Added a test
-       for when loading synthetic fonts to make sure that the font name
-       and subroutines are not loaded twice.  This is to remove a memory
-       leak that occurred because the original memory blocks for these
-       objects were not deallocated when the objects were parsed the
-       second time.
-
-2001-10-19  David Turner  <david@freetype.org>
-
-       * src/smooth/ftgrays.c, src/pshinter/pshglob.h,
-       src/pshinter/pshrec.c, src/pshinter/pshalgo2.c: Getting rid of
-       compiler warnings.
-
-       * src/pshinter/module.mk, src/pshinter/rules.mk: Adding control
-       files to build the PostScript hinter with the `old' build system.
-
-2001-10-19  Jacob Jansen  <joukj@hrem.stm.tudelft.nl>
-
-       * descrip.mms, src/pshinter/descrip.mms: Updates to the VMS build
-       files.
-
-2001-10-18  David Turner  <david@freetype.org>
-
-       * src/psnames/pstables.h, src/tools/glnames.py: Rewrote the
-       `glnames.py' script used to generate the `pstables.h' header file.
-       The old one contained a serious bug that made FreeType return
-       incorrect glyph names for certain glyphs.
-
-       * src/truetype/ttdriver.c (Set_Char_Sizes): Changing computation of
-       pixel size from character size to use rounding.  This is an
-       experiment to see whether this gives values similar to Windows for
-       scaled ascent/descent/etc.
-
-       * src/base/ftcalc.c (FT_Div64by32): Changed the implementation
-       slightly since the original code was mis-compiled on Mac machines
-       using the MPW C compiler.
-
-       * src/base/ftobjs.c (FT_Realloc): When a memory block was grown
-       through FT_Realloc(), the new bytes were not set to 0, which created
-       some strange bugs in the PostScript hinter.
-       (destroy_face): Don't deallocate unconditionally.
-
-       * src/cid/cidgload.c (CID_Compute_Max_Advance, CID_Load_Glyph):
-       Adding support to new PostScript hinter.
-
-       * include/freetype/internal/psglobal.h,
-       include/freetype/internal/pshints.h,
-       include/freetype/config/ftmodule.h, src/pshinter/Jamfile,
-       src/pshinter/pshalgo.h, src/pshinter/pshalgo1.h,
-       src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.h,
-       src/pshinter/pshalgo2.c, src/pshinter/pshglob.h,
-       src/pshinter/pshglob.c, src/pshinter/pshinter.c,
-       src/pshinter/pshmod.c, src/pshinter/pshmod.h, src/pshinter/pshrec.c,
-       src/pshinter/pshrec.h: Adding new PostScript hinter module.
-
-       * include/freetype/internal/ftobjs.h,
-       include/freetype/internal/internal.h,
-       include/freetype/internal/psaux.h,
-       include/freetype/internal/t1types.h, src/psaux/psobjs.c,
-       src/psaux/psobjs.h, src/psaux/t1decode.h, src/psaux/t1decode.c,
-       src/type1/t1driver.c, src/type1/t1gload.c, src/type1/t1objs.c,
-       src/type1/t1objs.h: Updates to use the new PostScript hinter.
-
-       * tests/Jamfile, tests/gview.c: Adding a new glyph hinting
-       viewer/debugger to the source tree.  Note that you will _not_ be
-       able to compile it since it depends on an unavailable graphics
-       library named `Nirvana' to render vector images.
-
-2001-10-17  David Turner  <david@freetype.org>
-
-
-       * Version 2.0.5 released.
-       =========================
-
-
-       * include/freetype/freetype.h, include/internal/ftobjs.h,
-       src/base/ftobjs.c, src/type1/t1driver.c: Adding a new function named
-       'FT_Get_Postscript_Name' to retrieve the PostScript name of a given
-       font.  Should work with all formats except pure CFF/CEF fonts (this
-       will be added soon).
-
-       * src/cid/cidriver (cid_get_postscript_name): New function.
-       (CID_Get_Interface): Handle `postscript_name' interface.
-
-       * src/sfnt/sfdriver.c (get_sfnt_postscript_name): New function.
-       (SFNT_Get_Interface): Handle `postscript_name' interface.
-
-       * src/type1/t1driver.c (t1_get_ps_name): New function.
-       (Get_Interface): Handle `postscript_name' interface.
-
-       * README, docs/CHANGES: Updated for 2.0.5 release.
-
-2001-10-08  David Turner  <david@freetype.org>
-
-       Fixed a bug in `glnames.py' that prevented it from generating
-       correct glyph names tables.  This resulted in the unavailability of
-       certain glyphs like `Cacute', `cacute' and `lslash' in Unicode
-       charmaps, even if these were present in the font (causing problems
-       for Polish users).
-
-       * src/tools/glnames.py (mac_standard_names): Fixed.
-       (t1_standard_strings): Some fixes and renamed to ...
-       (sid_standard_names): This.
-       (t1_expert_encoding): Fixed.
-       (the_adobe_glyph_list): Renamed to ...
-       (adobe_glyph_names): This.
-       (the_adobe_glyphs): Renamed to ...
-       (adobe_glyph_values): This.
-       (dump_mac_indices, dump_glyph_list, dump_unicode_values, main):
-       Updated.
-       * src/psnames/pstables.h: Regenerated.
-       * src/psnames/psmodule.c (PS_Unicode_Value): Fix offset.
-       Fix return value.
-       Use `sid_standard_table' and `ps_names_to_unicode' instead of
-       `t1_standard_glyphs' and `names_to_unicode'.
-       (PS_Macintosh_Name): Use `ps_glyph_names' instead of
-       `standard_glyph_names'.
-       (PS_Standard_Strings): Use `sid_standard_names' instead of
-       `t1_standard_glyphs'.
-
-       * doc/BUGS, doc/TODO: New documents.
-
-2001-10-07  Richard Barber  <rich@solutionuk.com>
-
-       * src/cache/ftlru.c (FT_Lru_Lookup_Node): Fixed a bug that prevented
-       correct LRU behaviour.
-
-2001-10-07  David Turner  <david@freetype.org>
-
-       setjmp() and longjmp() are now used for rollback (i.e. when memory
-       pool overflow occurs).
-
-       Function names are now all uniformly prefixed with `gray_'.
-
-       * src/smooth/ftgrays.c: Include <setjmp.h>.
-       (ErrRaster_MemoryOverflow): New macro.
-       (TArea): New type to store area values in each cell (using `int' was
-       too small on 16-bit systems).  <limits.h> is included to properly
-       get the needed data type.
-       (TCell, TRaster): Use it.
-       (TRaster): New element `jump_buffer'.
-       (gray_compute_cbox): Use `RAS_ARG' as the only parameter and get
-       `outline' from it.
-       (gray_record_cell): Use longjmp().
-       (gray_set_cell): Use gray_record_cell() for error handling.
-       (gray_render_line, gray_render_conic, gray_render_cubic): Simplify.
-       (gray_convert_glyph_inner): New function, using setjmp().
-       (gray_convert_glyph): Use it.
-
-2001-10-07  David Turner  <david@freetype.org>
-
-       Provide a public API to manage multiple size objects for a given
-       FT_Face in the new header file `ftsizes.h'.
-
-       * include/freetype/ftsizes.h: New header file,
-       * include/freetype/internal/ftobjs.h: Use it.
-       Remove declarations of FT_New_Size and FT_Done_Size (moved to
-       ftsizes.h).
-       * include/freetype/config/ftheader.h (FT_SIZES_H): New macro.
-       * src/base/ftobjs.c (FT_Activate_Size): New function.
-       * src/cache/ftcmanag.c: Include ftsizes.h.
-       (ftc_manager_init_size, ftc_manager_flush_size): Use
-       FT_Activate_Size.
-
-2001-09-20  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/*: Added port to Amiga with the SAS/C compiler.
-
-2001-09-15  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/type1/t1afm.c (T1_Done_AFM): Free `afm'.
-
-2001-09-10  Yao Zhang  <yzhang@sharemedia.com>
-
-       * src/sfnt/ttcmap.c (code_to_index2): Handle code values with
-       hi-byte == 0 correctly.
-
-2001-09-10  Werner Lemberg  <wl@gnu.org>
-
-       * builds/link-std.mk ($(PROJECT_LIBRARY)): Fix typo.
-
-2001-08-30  Martin Muskens  <mmuskens@aurelon.com>
-
-       * src/type1/t1load.c (parse_font_matrix): A new way to compute the
-       units per EM with greater accuracy (important for embedded T1 fonts
-       in PDF documents that were automatically generated from TrueType
-       ones).
-
-       * src/type1/t1load.c (is_alpha): Now supports `+' in font names;
-       this is used in embedded fonts.
-
-       * src/psaux/psobjs.c (PS_Table_Add): Fixed a reallocation bug that
-       generated a dangling pointer reference.
-
-2001-08-30  Anthony Feik  <afeick@hotmail.com>
-
-       * src/type1/t1afm.c (T1_Read_Afm): Now correctly sets the flag
-       FT_FACE_FLAG_KERNING when appropriate for Type1 + AFM files.
-
-2001-08-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttload.c (TT_Load_CMap): Fix frame length of
-       `cmap_rec_fields'.
-
-       * include/freetype/fterrors.h [!FT_CONFIG_OPTION_USE_MODULE_ERRORS]:
-       Undefine FT_ERR_BASE before defining again.
-
-2001-08-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.h: Fix prototype of TT_Move_Func.
-
-2001-08-21  Werner Lemberg  <wl@gnu.org>
-
-       * builds/dos/dos-def.mk (NO_OUTPUT): Don't use `&>' but `>'.
-
-2001-08-21  David Turner  <david@freetype.org>
-
-       * include/freetype/config/ftoption.h: Changed the default setting
-       for FT_CONFIG_OPTION_USE_MODULE_ERRORS to undefined, since it breaks
-       source compatibility in a few cases.  Updated the comment to explain
-       that too.
-
-2001-08-17  Martin Muskens  <mmuskens@aurelon.com>
-
-       * src/base/ftcalc.c (FT_MulDiv): Fixed serious typo.
-
-2001-08-12  Werner Lemberg  <wl@gnu.org>
-
-       Updating to OpenType 1.3.
-
-       * include/freetype/internal/tttypes.h (TT_CMap0, TT_CMap2, TT_CMap4,
-       TT_CMap6): Adding field `language'.
-       (TT_CMapTable): Removing field `language'.
-       Type of `length' field changed to FT_ULong.
-       Adding fields for cmaps format 8, 10, and 12.
-       (TT_CMapGroup): New auxiliary structure.
-       (TT_CMap8_12, TT_CMap10): New structures.
-       * include/freetype/tttables.h (TT_HoriHeader, TT_VertHeader):
-       Removed last element of `Reserved' array.
-       * include/freetype/ttnameid.h (TT_PLATFORM_CUSTOM, TT_MS_ID_UCS_4,
-       TT_NAME_ID_CID_FINDFONT_NAME): New macros.
-
-       * src/sfnt/ttcmap.c (TT_CharMap_Load): Updated loading of `language'
-       field to the new structures.
-       Fixed freeing of arrays in case of unsuccessful loads.
-       Added support for loading format 8, 10, and 12 cmaps.
-       (TT_CharMap_Free): Added support for freeing format 8, 10, and 12
-       cmaps.
-       (code_to_index4): Small improvement.
-       (code_to_index6): Ditto.
-       (code_to_index8_12, code_to_index10): New functions.
-       * src/sfnt/ttload.c (TT_Load_Metrics_Header): Updated to new
-       structure.
-       (TT_Load_CMap): Ditto.
-
-       * src/sfnt/sfobjs.c (tt_encodings): Add MS UCS4 table (before MS
-       Unicode).
-
-2001-08-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1driver.c (t1_get_name_index): Fix compiler warning.
-
-2001-08-09  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/cffdrivr.c (get_cff_glyph_name): Renamed to
-       cff_get_glyph_name for consistency.
-
-       (cff_get_glyph_index): Minor documentation change.
-
-       * src/type1/t1driver.c (t1_get_name_index): New function used in
-       Get_Interface as the function returned when the `name_index'
-       function is requested.
-
-       (get_t1_glyph_name): Renamed to t1_get_glyph_name for consistency.
-
-2001-08-08  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/cffload.c: Removed definitions of cff_isoadobe_charset,
-       cff_expert_charset, cff_expertsubset_charset, cff_standard_encoding,
-       and cff_expert_encoding arrays to cffload.h.
-
-       * src/cff/cffload.h: Added definitions of cff_isoadobe_charset,
-       cff_expert_charset, cff_expertsubset_charset, cff_standard_encoding,
-       and cff_expert_encoding arrays.
-
-       * src/cff/cffdrivr.c (cff_get_name_index): New function, returned
-       when `cff_get_interface' is called with a request for the
-       `name_index' function.
-
-       (cff_get_interface): Modified so that it returns the function
-       `cff_get_name_index' when the `name_index' function is requested.
-
-       * src/base/ftobjs.c (FT_Get_Name_Index): New function, used to
-       return a glyph index for a given glyph name only if the driver
-       supports glyph names.
-
-       * include/freetype/internal/ftobjs.h (FT_Name_Index_Requester):
-       New function pointer type definition used in the function
-       FT_Get_Name_Index.
-
-       * include/freetype/freetype.h (FT_Get_Name_Index): Added
-       documentation and prototype.
-
-2001-07-26  Werner Lemberg  <wl@gnu.org>
-
-       * builds/cygwin/*: Removed.  Use the unix stuff instead.
-
-2001-07-26  Jouk Jansen  <joukj@hrem.stm.tudelft.nl>
-
-       * builds/vms/ftconfig.h (FT_CALLBACK_DEF): Updated to change dated
-       2001-06-27.
-
-2001-07-17  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/psaux.h (PS_Table): Use FT_Offset for
-       `cursor' and `capacity'.
-       * src/psaux/psobjc.c (reallocate_t1_table): Use FT_Long for second
-       parameter.
-       (PS_Table_Add): Use FT_Offset for `new_size'.
-
-       Add support for version 0.5 maxp tables.
-
-       * src/sfnt/ttload.c (TT_Load_MaxProfile): Implement it.
-       (TT_Load_OS2): Initialize some values.
-
-2001-07-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftsynth.c: Include ftcalc.h unconditionally.
-
-2001-07-07  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c, src/truetype/ttinterp.c, src/pcf/pcfread:
-       Removed pedantic compiler warnings when the bytecode interpreter is
-       compiled in.
-
-2001-07-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahhint.c (ah_hinter_align_weak_points): Remove
-       unused variable `edges'.
-       (ah_hinter_load): Remove unused variables `old_width' and
-       `new_width'.
-       * src/cid/cidload.c (cid_decrypt): Use `U' for constant (again).
-       * src/psaux/psobjs.c (T1_Decrypt): Ditto.
-       * src/type1/t1parse.c (T1_Get_Private_Dict): Ditto.
-
-2001-06-28  David Turner  <david@freetype.org>
-
-       * include/internal/ftstream.h: Modified the definitions
-       of the FT_GET_XXXX and NEXT_XXXX macros for 16-bit correctness.
-
-2001-06-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidload.c, src/cid/cidload.h (cid_decrypt): Use FT_Offset
-       instead of FT_Int as type for `length' parameter.
-       * include/freetype/internal/psaux.h (PSAux_Interface): Updated.
-
-2001-06-27  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * src/psaux/psobjs.c, src/psaux/psobjs.h (T1_Decrypt): Use FT_Offset
-       instead of FT_Int as type for `length' parameter.
-
-
-       * Version 2.0.4 released.
-       =========================
-
-
-2001-06-27  David Turner  <david@freetype.org>
-
-       * builds/unix/ftconfig.in: Changed the definition of the
-       FT_CALLBACK_DEF macro.
-
-       * include/freetype/ftconfig.h, src/*/*.c: Changed the definition and
-       use of the FT_CALLBACK_DEF macro in order to support 16-bit
-       compilers.
-
-       * builds/unix/ftconfig.in: Changed the definition of the
-       FT_CALLBACK_DEF macro.
-
-       * src/sfnt/ttload.c (TT_Load_Kern): The kern table loader now ensures
-       that the kerning table is correctly sorted (some problem fonts don't
-       have a correct kern table).
-
-2001-06-26  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * include/freetype/internal/ftstream.h (FT_GET_OFF3_LE): Fix typo.
-
-2001-06-24  David Turner  <david@freetype.org>
-
-       * src/base/ftcalc.c (ft_div64by32): Fixed the source to work
-       correctly on 16-bit systems.
-
-2001-06-23  Anthony Fok  <fok@debian.org>
-
-       * debian/*: Added Debian package build directory for 2.0.4.
-
-2001-06-22  David Turner  <david@freetype.org>
-
-       * docs/PATENTS: Added patents disclaimer.  This one was missing!
-
-       * docs/CHANGES, docs/todo: Updated for the upcoming 2.0.4 release.
-
-2001-06-20  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftconfig.h: Add two more `L's to
-       constants.
-       Add missing semicolons.
-
-       * builds/toplevel.mk: Do similar change as for
-       builds/unix/detect.mk.
-
-       * include/freetype/freetype.h (FT_ENC_TAG): New version to make it
-       easier to redefine.
-       * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto.
-
-       * src/pcf/pcfread.c (pcf_get_encodings): Add cast.
-
-2001-06-19  David Turner  <david@freetype.org>
-
-       * builds/win32/visualc/freetype.dsp, builds/win32/visualc/index.html:
-       Updated the Visual C++ project (for the 2.0.4 release).
-
-       * builds/unix/detect.mk: Added rule for AIX detection (which uses
-       /usr/sbin/init instead of /sbin/init).
-
-       * include/freetype/fterrors.h, src/*/*err*.h: Updated some of the
-       error macros to simplify handling of new error scheme.
-
-2001-06-19  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/fttypes.h (FT_ERROR_MODULE): New macro.
-
-2001-06-19  David Turner  <david@freetype.org>
-
-       Removing _lots_ of compiler warnings when the most pedantic warning
-       levels of Visual C++ and Borland C++ are used.  Too many files to be
-       listed here, but FT2 now compiles without warnings with VC++ and the
-       `/W4' warning level (lint-style).
-
-       * include/freetype/freetype.h (FT_New_Memory_Face): Updated
-       documentation.
-       * include/freetype/fttypes.h (FT_BOOL): New macro.
-       * include/freetype/internal/ftdebug.h: Add #pragma for Visual C++
-       to suppress warning.
-       * include/freetype/internal/ftstream.h (FT_GET_SHORT_{BE,LE},
-       FT_GET_OFF3_{BE,LE}, FT_GET_LONG_{BE,LE}): New macros.
-       (NEXT_*): Use them.
-       * src/autohint/ahglobal.c: Include FT_INTERNAL_DEBUG_H.
-       (FT_New_Memory_Face): Add `const' to function declaration.
-
-2001-06-18  Werner Lemberg  <wl@gnu.org>
-
-       Minor cleanups to remove compiler warnings.
-
-       * include/freetype/cache/ftcmanag.h (FTC_MAX_BYTES_DEFAULT): Use
-       `L' for constant.
-       * include/freetype/config/ftoption.h (FT_RENDER_POOL_SIZE): Ditto.
-       * src/base/ftcalc.c (FT_MulDiv): Use `L' for constant.
-       * src/base/ftglyph.c (FT_Glyph_Get_CBox): Remove `error' variable.
-       * src/base/fttrigon.c (ft_trig_arctan_table): Use `L' for constants.
-       * src/base/ftobjs.c (FT_Done_Size): Fix return value.
-       (FT_Set_Char_Size, FT_Set_Pixel_Sizes, FT_Get_Kerning): Remove
-       unused `memory' variable.
-       * src/autohint/ahglyph.c (ah_get_orientation): Use `L' for constant.
-       * src/autohint/ahhint.c (ah_hint_edges_3,
-       ah_hinter_align_edge_points): Remove unused `before' and `after'
-       variables.
-       (ah_hinter_align_weak_points): Remove unused `edge_limit' variable.
-       (ah_hinter_load): Remove unused `new_advance', `start_contour',
-       and `metrics' variables.
-       * src/cff/cffload.c (CFF_Load_Encoding): Remove dead code to avoid
-       compiler warning.
-       * src/cff/cffobjs.c (CFF_Init_Face): Remove unused `base_offset'
-       variable.
-       * src/cff/cffgload.c (CFF_Parse_CharStrings): Remove unused
-       `outline' variable.
-       (cff_compute_bias): Use `U' for constant.
-       * src/cid/cidload.c (cid_decrypt): Ditto.
-       * src/psaux/psobjs.c (T1_Decrypt): Ditto.
-       * src/psaux/t1decode.c (T1_Decoder_Parse_CharStrings): Ditto.
-       * src/sfnt/ttload.c (TT_Load_Kern): Remove unused `version'
-       variable.
-       * src/sfnt/ttsbit.c (TT_Load_SBit_Image): Remove unused `top'
-       variable.
-       * src/truetype/ttgload.c (load_truetype_glyph): Remove unused
-       `num_contours' and `ins_offset' variables.
-       (compute_glyph_metrics): Remove unused `Top' and `x_scale'
-       variables.
-       (TT_Load_Glyph): Remove unused `memory' variable.
-       * src/smooth/ftgrays.c (grays_raster_render): Use `L' for constants.
-
-2001-06-18  Werner Lemberg  <wl@gnu.org>
-
-       Make the new error scheme source compatible with older FT versions
-       by introducing another layer.
-
-       * include/freetype/fterrors.h (FT_ERRORDEF_, FT_NOERRORDEF_): New
-       macros.
-       (FT_NOERRORDEF): Removed.
-       * include/*/*err*.h: Use FT_ERRORDEF_ and FT_NOERRORDEF_.
-
-2001-06-16  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h (FT_ENC_TAG): New macro.
-       (FT_Encoding_): Use it.
-       * include/freetype/ftimage.h (FT_IMAGE_TAG): Define it
-       conditionally.
-
-2001-06-14  David Turner  <david@freetype.org>
-
-       Modified the TrueType interpreter to let it use the new
-       trigonometric functions provided in `fttrigon.h'.  This gets rid of
-       some old 64-bit computation routines, as well as many warnings when
-       compiling the library with the `long long' 64-bit integer type.
-
-       * include/freetype/config/ftoption.h: Undefine
-       FT_CONFIG_OPTION_OLD_CALCS.
-       * include/freetype/internal/ftcalc.h: Rearrange use of
-       FT_CONFIG_OPTION_OLD_CALCS.
-       * src/base/ftcalc.c: Add declaration of FT_Int64 if
-       FT_CONFIG_OPTION_OLD_CALCS isn't defined.
-       * src/truetype/ttinterp.c: Use FT_TRIGONOMETRY_H.
-       (Norm): Add a special version if FT_CONFIG_OPTION_OLD_CALCS isn't
-       defined.
-       (Current_Ratio, Normalize): Simplify code.
-
-2001-06-11  Mike Owens  <MOwens@amtdatasouth.com>
-
-       * src/base/ftcalc.c (FT_MulDiv, FT_DivFix, FT_Sqrt64): Remove
-       compiler warnings.
-
-2001-06-08  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.in: Renamed to ...
-       * builds/unix/configure.ac: This to make sure that autoconf 2.50 is
-       needed.
-       Run `autoupdate' on it.
-       Increase `version_info' to 7:0:1.
-       * builds/unix/configure: Regenerated.
-
-2001-06-08  David Turner  <david@freetype.org>
-
-       * src/autohint/ahhint.c (ah_hinter_load_glyph): Fixed a bug that
-       corrupted transformed glyphs that were auto-hinted (the transform
-       was applied twice).
-
-       Fixed a bug that returned an invalid linear width for composite
-       TrueType glyphs.
-
-       * include/internal/tttypes.h (TT_Loader_): Two new elements `linear'
-       and `linear_def'.
-       * src/truetype/ttgload.c (load_truetype_glyph,
-       compute_glyph_metrics): Use it.
-
-       * include/fttypes.h (FT_ERROR_BASE): New macro.
-       * src/base/ftobjs.c (FT_Open_Face, FT_Render_Glyph_Internal): Use it
-       to make source code work with the new error scheme implemented by
-       Werner.
-       * src/base/ftoutln.c (FT_Outline_Render): Ditto.
-
-2001-06-07  Werner Lemberg  <wl@gnu.org>
-
-       Updating to libtool 1.4.0 and autoconf 2.50.
-
-       * builds/unix/ltconfig: Removed.
-       * builds/unix/ltmain.sh, builds/unix/configure.in,
-       builds/unix/aclocal.m4: Updated.
-       * builds/unix/configure: Regenerated.
-
-2001-06-06  Werner Lemberg  <wl@gnu.org>
-
-       Complete redesign of error codes.  Please check ftmoderr.h for more
-       details.
-
-       * include/freetype/internal/cfferrs.h,
-       include/freetype/internal/tterrors.h,
-       include/freetype/internal/t1errors.h: Removed.  Replaced with files
-       local to the module.  All extra error codes have been moved to
-       `fterrors.h'.
-
-       * src/sfnt/ttpost.h: Move error codes to `fterrors.h'.
-
-       * src/autohint/aherrors.h, src/cache/ftcerror.h, src/cff/cfferrs.h,
-       src/cid/ciderrs.h, src/pcf/pcferror.h, src/psaux/psauxerr.h,
-       src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h,
-       src/smooth/ftsmerrs.h, src/truetype/tterrors.h,
-       src/type1/t1errors.h, src/winfonts/fnterrs.h: New files defining the
-       error names for the module it belongs to.
-
-       * include/freetype/ftmoderr.h: New file, defining the module error
-       offsets.  Its structure is similar to `fterrors.h'.
-
-       * include/freetype/fterrors.h (FT_NOERRORDEF): New macro.
-       (FT_ERRORDEF): Redefined to use module error offsets.
-       All internal error codes are now public; unused error codes have
-       been removed, some are new.
-
-       * include/freetype/config/ftheader.h (FT_MODULE_ERRORS_H): New
-       macro.
-       * include/freetype/config/ftoption.h
-       (FT_CONFIG_OPTION_USE_MODULE_ERRORS): New macro.
-
-       All other source files have been updated to use the new error codes;
-       some already existing (internal) error codes local to a module have
-       been renamed to give them the same name as in the base module.
-
-       All make files have been updated to include the local error files.
-
-2001-06-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidtokens.h: Replaced with...
-       * src/cid/cidtoken.h: This file for 8+3 consistency.
-
-       * src/raster/ftraster.c: Use macros for header file names.
-
-       * src/include/freetype/tttables.h (TT_HoriHeader_, TT_VertHeader_):
-       Fix length of `Reserved' array.  Note that this isn't the real fix
-       since recent OpenType specs have introduced a `CaretOffset' field
-       instead of the first reserved byte.
-
-2001-05-29  Werner Lemberg  <wl@gnu.org>
-
-       * INSTALL: Minor fixes.
-
-
-       * Version 2.0.3 released.
-       =========================
-
-
-2001-05-29  David Turner  <david@freetype.org>
-
-       * INSTALL, docs/CHANGES: Updated.
-
-2001-05-25  David Turner  <david@freetype.org>
-
-       Moved several documents from the top-level to the `docs' directory.
-
-       * src/base/ftcalc.c (FT_DivFix): Small fix to return value.
-
-2001-05-16  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fixed a bug in the
-       composite loader.  Spotted by Keith Packard.
-       * src/base/ftobjs.c (FT_GlyphLoader_Check_Points,
-       FT_GlyphLoader_Check_Subglyphs): Ditto.
-
-2001-05-14  David Turner  <david@freetype.org>
-
-       Fixed the incorrect blue zone computations, and improved the
-       composite support.  Note that these changes result in improved
-       rendering, while sometimes introducing their own artefacts.  This is
-       probably the last big change to the autohinter before the
-       introduction of a complete replacement.
-
-       * src/autohint/ahglobal.c (sort_values): Fix loop.
-       * src/autohint/ahglyph.c: Removed some obsolete code.
-       (ah_outline_compute_edges): Modify code to set the ah_edge_round
-       flag.
-       (ah_outline_compute_blue_edges): Add code to compute active blue
-       zones.
-       * src/autohint/ahhint.c (ah_hinter_glyph_load): Change load_flags
-       value.
-
-       * src/base/ftcalc.c (FT_DivFix): Fixed a bug in the 64-bit code that
-       created incorrect scale factors!
-       (FT_Round_Fix, FT_CeilFix, FT_FloorFix): Minor improvements.
-
-2001-05-12  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftbbox.h: FTBBOX_H -> __FTBBOX_H__.
-       * include/freetype/fttrigon.h: __FT_TRIGONOMETRY_H__ ->
-       __FTTRIGON_H__.
-       Include FT_FREETYPE_H.
-       Beautified; added copyright.
-       * src/base/fttrigon.c: Beautified; added copyright.
-
-2001-05-11  David Turner  <david@freetype.org>
-
-       * src/cff/cffparse.c (cff_parse_font_matrix), src/cid/cidload.c
-       (parse_font_matrix), src/type1/t1load.c (parse_font_matrix): Fixed
-       the incorrect EM size computation.
-
-       * include/freetype/fttrigon.h, src/base/fttrigon.c: New files,
-       adding trigonometric functions to the core API (using Cordic
-       algorithms).
-       * src/base/ftbase.c, src/base/Jamfile, src/base/rules.mk: Use them.
-
-       * builds/newline: New file.
-       * builds/top_level.mk, builds/detect.mk: Use it.  This fixes
-       problems with Make on Windows 2000, as well as problems when `make
-       distclean' is invoked on a non-Unix platform when there is no
-       `config.mk' in the current directory.
-
-       * builds/freetype.mk: Fixed a problem with object deletions under
-       Dos/Windows/OS/2 systems.
-
-       Added new directory to hold tools and test programs.
-
-       * docs/docmaker.py, docs/glnames.py: Moved to...
-       * src/tools/docmaker.py, src/tools/glnames.py: This place.
-       * src/tools/cordic.py: New file used to compute arctangent table
-       needed by fttrigon.c.
-       * src/tools/test_bbox.c, src/tools/test_trig.c: New test files.
-
-       * src/tools/docmaker.py: Improved the script to add the current date
-       at the footer of each web page (useful to distinguish between
-       versions).
-
-       * Jamfile: Fixed incorrect HDRMACRO argument.
-
-       * TODO: Removed the cubic arc bbox computation note, since it has been
-       fixed recently.
-       * src/base/ftbbox.c (test_cubic_zero): Renamed to...
-       (test_cubic_extrema): This function.  Use `UL' for unsigned long
-       constants.
-
-       * include/freetype/t1tables.h, include/freetype/config/ftoption.h:
-       Formatting.
-
-2001-05-10  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c (FT_Open_Face): Fixed a small memory leak
-       which happened when trying to open 0-size font files!
-
-2001-05-09  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/ftcalc.h: Move declaration of
-       FT_SqrtFixed() out of `#ifdef FT_LONG64'.
-
-2001-05-08  Francesco Zappa Nardelli  <Francesco.Zappa.Nardelli@ens.fr>
-
-       * src/pcfdriver.c (PCF_Load_Glyph): Fixed incorrect bitmap width
-       computation.
-
-2001-05-08  David Turner  <david@freetype.org>
-
-       * docs/docmaker.py: Updated the DocMaker script in order to add
-       command line options (--output,--prefix,--title), fix the erroneous
-       line numbers reported during errors and warnings, and other
-       formatting issues.
-
-       * src/base/ftcalc.c (FT_MulDiv, FT_MulFix, FT_DivFix): Various tiny
-       fixes related to rounding in 64-bits routines and
-       pseudo-`optimizations'.
-
-2001-04-27  David Turner  <david@freetype.org>
-
-       * src/base/ftbbox.c (BBox_Cubic_Check): Fixed the coefficient
-       normalization algorithm (invalid final bit position, and invalid
-       shift computation).
-
-2001-04-26  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/config.guess, builds/unix/config.sub: Updated to
-       latest versions from gnu.org.
-
-       * builds/compiler/gcc-dev.mk: Add `-Wno-long-long' flag.
-
-       * include/freetype/internal/ftcalc.h: Define FT_SqrtFixed()
-       unconditionally.
-       * src/base/ftbbox.c: Include FT_INTERNAL_CALC_H.
-       Fix compiler warnings.
-       * src/base/ftcalc.c: Fix (potential) compiler warnings.
-
-2001-04-26  David Turner  <david@freetype.org>
-
-       * src/base/ftcalc.c (FT_SqrtFixed): Corrected/optimized the 32-bit
-       fixed-point square root computation.  It is now used even with
-       64-bits integers, as it is _much_ faster than calling FT_Sqrt64 :-)
-
-       * src/base/ftbbox.c: Removed invalid `#include FT_BEZIER_H' line.
-
-2001-04-25  David Turner  <david@freetype.org>
-
-       * src/base/ftbbox.c (BBox_Cubic_Check): Rewrote function to use
-       direct computations with 16.16 values instead of sub-divisions.  It
-       is now slower, but proves a point :-)
-
-       * src/raster/ftraster.c, src/smooth/ftgrays.c, src/base/ftbbox.c:
-       Fixed the Bézier stack depths.
-
-       * src/base/ftcalc.c (FT_MulFix): Minor rounding fix.
-
-       * builds/beos: Added BeOS-specific files to the old build system
-       (no changes were necessary to support BeOS in the Jamfile though).
-
-2001-04-20  David Turner  <david@freetype.org>
-
-       * ftconfig.h, ftoption.h: Updated `ftconfig.h' to detect 64-bit int
-       types on platforms where Autoconf is not available).  Also removed
-       FTCALC_USE_LONG_LONG and replaced it with
-       FT_CONFIG_OPTION_FORCE_INT64.
-
-       * builds/win32/freetype.dsp: Updated the Visual C++ project file.
-       Doesn't create a DLL yet.
-
-       * cffgload.c: Removed a compilation warning.
-
-2001-04-10  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * t1load.c (parse_charstrings): Changed code for placing .notdef
-       glyph into slot 0 so that we no longer have a memory access
-       violation.
-
-       * t1load.h: In structure T1_Loader, added swap_table (of type
-       PS_Table) to facilitate placing the .notdef glyph into slot 0.
-
-2001-04-10  Francesco Zappa Nardelli  <francesco.zappa.nardelli@ens.fr>
-
-       * src/pcf/pcfdriver.c (PCF_Get_Char_Index): Fix return value.
-
-2001-04-09  Laurence Withers  <lwithers@lwithers.demon.co.uk>
-
-       * builds/dos/detect.mk: Add support for bash.
-
-2001-04-05  Werner Lemberg  <wl@gnu.org>
-
-       * builds/os2/*.mk: These files have been forgotten to update to
-       the structure of similar makefiles.
-       * builds/dos/*.mk: Ditto.
-       * builds/ansi/*.mk: Ditto.
-
-       * builds/win32/win32-def.mk (BUILD): Fix typo.
-
-       * builds/compiler/*.mk (CLEAN_LIBRARY): Don't use NO_OUTPUT.
-       This is already used in the link_*.mk files.
-
-2001-04-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/*/Jamfile: Slight changes to make files more cryptic.
-
-2001-04-03  Werner Lemberg  <wl@gnu.org>
-
-       * Jamfile, src/Jamfile, src/*/Jamfile: Formatted.  Slight changes
-       to give files identical structure.
-
-2001-04-02  Werner Lemberg  <wl@gnu.org>
-
-       * CHANGES: Reformatted, minor fixes.
-       * TODO: Updated.
-       * README: Formatting.
-       * include/freetype/freetype.h: Formatting.
-
-       * Jamfile: Fix typo.
-
-       * src/cff/cffparse.c: Move error code #defines to...
-       * include/freetype/internal/cfferrs.h: This file.
-       * src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffload.c: Replaced
-       `FT_Err_*' with `CFF_Err_*'.
-       * src/cid/cidparse.c: Replaced `FT_Err_*' with `T1_Err_*'.
-       * src/psaux/psobjs.c, src/psaux/t1decode.c: Ditto.
-       * src/sfnt/sfobcs.c, src/sfnt/ttload.c: Replaced `FT_Err_*' with
-       `TT_Err_*'.
-       * src/truetype/ttgload.c, src/truetype/ttobjs.c: Ditto.
-       * src/type1/t1gload.c, src/type1/t1load.c, src/type1/t1objs.c,
-       src/type1/t1parse.c: Replaced `FT_Err_*' with `T1_Err_*'.
-
-       * include/freetype/internal/cfferrs.h: Add
-       `CFF_Err_Unknown_File_Format'.
-       * include/freetype/internal/t1errors.h: Add
-       `T1_Err_Unknown_File_Format'.
-       * include/freetype/internal/tterrors.h: Add
-       `TT_Err_Unknown_File_Format'.
-
-       * src/cff/cffload.h: Add `cff_*_encoding' and `cff_*_charset'
-       references.
-       * src/psaux/psobjs.c: Include `FT_INTERNAL_TYPE1_ERRORS_H'.
-
-       * src/cff/cffobjs.c (CFF_Init_Face, CFF_Done_Face): Use
-       FT_LOCAL_DEF.
-       * src/cid/cidobjs.c (CID_Done_Driver): Ditto.
-       * src/trutype/ttobjs.c (TT_Init_Face, TT_Done_Face, TT_Init_Size):
-       Ditto.
-       * src/type1/t1objs.c (T1_Done_Driver): Ditto.
-       * src/pcf/pcfdriver.c (PCF_Done_Face): Ditto.
-       * src/pcf/pcf.h: Use FT_LOCAL for `PCF_Done_Face'.
-
-2001-04-02  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/sfnt/ttload.c (TT_Load_Metrics): Fix an improper pointer
-       dereference.  Submitted by Herbert Duerr <duerr@sun.com>.
-
-2001-03-26  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * include/freetype/config/ftconfig.h: Changed hexadecimal
-       constants to use suffix U to avoid problems with HP-UX's c89
-       compiler.  Submitted by G.W. Lucas <glucas@sonalysts.com>.
-
-2001-03-24  David Turner  <david.turner@freetype.org>
-
-       * Jamrules, Jamfile, src/Jamfile, src/*/Jamfile: Adding jamfiles to
-       the source tree.  See www.freetype.org/jam/index.html for details.
-
-
-       * Version 2.0.2 released.
-       =========================
-
-
-2001-03-20  Werner Lemberg  <wl@gnu.org>
-
-       * builds/win32/detekt.mk: Fix .PHONY target for Intel compiler.
-
-2001-03-20  David Turner  <david.turner@freetype.org>
-
-       * include/freetype/config/ftheader.h, include/freetype/ftsnames.h:
-       Renamed `ftnames.h' to `ftsnames.h', and FT_NAMES_H to
-       FT_SFNT_NAMES_H.
-
-       * docs/docmaker.py: Added generation of INDEX link in table of
-       contents.
-
-       * INSTALL, docs/BUILD: Updated documentation to indicate that the
-       compilation process has changed slightly (no more `src' required in
-       the include path).
-
-       * builds/*/*-def.mk: Changed the objects directory from `obj' to
-       `objs'.
-
-       * include/freetype/config/ftheader.h: Removed obsolete macros like
-       FT_SOURCE_FILE, etc. and added cache-specific macro definitions that
-       were previously defined in <freetype/ftcache.h>.  Added comments to
-       be included in a new API Reference section.
-
-       * src/*/*: Removed the use of FT_SOURCE_FILE, etc.  Now, each
-       component needs to add its own directory to the include path at
-       compile time.  Modified all `rules.mk' and `descrip.mms'
-       accordingly.
-
-2001-03-20  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.in: Add $ft_version.
-       * builds/unix/freetype-config.in: Use it.
-       * builds/unix/configure: Updated.
-
-2001-03-19  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/type1/t1load.c (parse_font_matrix): Assign the units per em
-       value an unsigned short value, first by shifting right 16 bits,
-       then by casting the results to FT_UShort.
-
-       * src/cff/cffparse.c (cff_parse_font_bbox): Assign the units per em
-       value an unsigned short value, first by shifting right 16 bits,
-       then by casting the results to FT_UShort.
-
-2001-03-17  David Turner  <david.turner@freetype.org>
-
-       * src/cid/cidobjs.c, src/cid/cidload.c, src/pcf/pcfread.c,
-       src/type1/t1load.c, src/type1/t1objs.c: Added a few casts to remove
-       compiler warnings in pedantic modes.
-
-       * include/config/ft2build.h, include/config/ftheader.h: The file
-       `ft2build.h' was renamed to `ftheader.h' to avoid conflicts with the
-       top-level <ft2build.h>.
-
-       * include/config/ftheader.h: Added new section describing the #include
-       macros.
-
-2001-03-17  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/cffparse.c (cff_parse_font_bbox): Obtain rounded FT_Fixed
-       values for the bounding box numbers.
-
-       * src/cff/cffobjs.c (CFF_Init_Face): When processing a CFF/CEF font,
-       set `root->ascender' (`root->descender') to the integer part of
-       `root->bbox.yMax' (`root->bbox.yMin', respectively).
-
-2001-03-16  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/cffdrivr.c (get_cff_glyph_name):  New function.  Used in
-       cff_get_interface to facilitate getting a glyph name for glyph index
-       via FT_Get_Glyph_Name().
-
-       (cff_get_interface): Added support for getting a glyph name via the
-       `glyph_name' module interface.  Uses the new function
-       get_cff_glyph_name().
-       Submitted by Sander van der Wal <svdwal@xs4all.nl>.
-
-       * src/cff/cffobjs.c (CFF_Init_Face): Logical or the face flags with
-       FT_FACE_FLAG_GLYPH_NAMES only if FT_CONFIG_OPTION_NO_GLYPH_NAMES is
-       not defined.  This is to add support for getting a glyph name from a
-       glyph index via FT_Get_Glyph_Name().
-       Submitted by Sander van der Wal <svdwal@xs4all.nl>.
-
-       * src/cff/cffgload.c (CFF_Parse_CharStrings): Added support for
-       deprecated operator `dotsection'.
-       Submitted by Sander van der Wal <svdwal@xs4all.nl>.
-
-2001-03-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Fix error
-       messages.
-
-       * INSTALL, docs/BUILD: We need GNU make 3.78.1 or newer.
-
-2001-03-12  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * include/freetype/internal/psaux.h:  Changed the lenIV member of
-       the T1_Decoder_ struct to be an FT_Int instead of an FT_UInt.
-
-       * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings):  Adjust
-       for lenIV seed bytes at the start of a decrypted subroutine.
-
-       * src/cid/cidload.c (cid_read_subrs): Decrypt subroutines only
-       if lenIV >= 0.
-
-       * src/cid/cidgload.c (cid_load_glyph): Decrypt charstrings only
-       if lenIV >= 0.
-
-2001-03-11  Werner Lemberg  <wl@gnu.org>
-
-       * TODO: Updated.
-
-       * src/pcf/pcfread.c: Put READ_Fields() always in a conditional to
-       avoid compiler warnings.
-
-2001-03-10  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * TODO: New file.
-
-       * include/freetype/freetype.h: Added prototypes and notes for
-       three new functions: FT_RoundFix, FT_CeilFix, and FT_FloorFix.
-       * src/base/ftcalc.c (FT_RoundFix, FT_CeilFix, FT_FloorFix): Added
-       implementation code.
-
-       * src/cid/cidobjs.c (CID_Init_Face): Use calculated units_per_EM,
-       and if that is not available, default to 1000 units per EM.  Changed
-       assignment code for ascender and descender values.
-       * src/cid/cidload.c (parse_font_matrix): Added units_per_EM
-       processing.
-       (parse_font_bbox): Changed to use FT_Fixed number handling.
-
-       * src/type1/t1objs.c (T1_Init_Face): Changed the assignment code
-       for ascender, descender, and max_advance_width.
-       * src/type1/t1load.c (parse_font_bbox): Changed to use FT_Fixed
-       number handling.
-
-2001-03-10  Henrik Grubbström  <grubba@roxen.com>
-
-       * src/*/*.c: Added many casts to make code more 64bit-safe.
-
-2001-03-07  Werner Lemberg  <wl@gnu.org>
-
-       * INSTALL, docs/BUILD: We need GNU make 3.78 or newer.
-
-2001-03-07  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/type1/t1objs.c (T1_Init_Face): Minor correction: We must wait
-       until parse_font_bbox is changed before we use logical shift rights
-       in the assignments of `root->ascender', `root->descender', and
-       `root->max_advance_width'.
-
-       (T1_Done_Face): Free `char_name' table to avoid a memory leak.
-       Submitted by Sander van der Wal <svdwal@xs4all.nl>.
-
-2001-03-05  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/cffgload.c (CFF_Load_Glyph): Set glyph control data to the
-       the Type 2 glyph charstring (used by conversion programs).
-       Submitted by Ha Shao <hashao@chinese.com>.
-
-2001-03-04  Antoine Leca  <Antoine.Leca@renault.fr>
-
-       * include/freetype/ttnameid.h: Correct a stupid typo which prevented
-       correct compilation (TT_MS_LANGID_TIGRIGNA_ETHIOPIA appeared twice).
-
-2001-03-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahtypes.h (AH_Hinter): Add elements
-       `disable_horz_edges', `disable_vert_edges'.
-       * src/autohint/ahhint.c (ah_hint_edges_3, ah_hinter_hint_edges): Use
-       them (and remove static variables with the same names).
-       * src/pcf/pcfutil.c (BitOrderInvert): Add `const'.
-       * docs/glnames.py: Updated to latest pstables.h changes.
-
-       * builds/unix/detect.mk: Add test for Hurd.
-       * builds/hurd/detect.mk: Removed.
-
-2001-03-04  Sander van der Wal  <svdwal@xs4all.nl>
-
-       * src/psnames/pstables.h: Add more `const'.
-       * src/pcf/pcfutil.c: Ditto.
-
-2001-03-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Fixing typo
-       (FT_Glyph_Done -> FT_Done_Glyph).
-
-2001-03-01  Antoine Leca  <Antoine.Leca@renault.fr>
-
-       * include/freetype/ttnameid.h: Added some new Microsoft language
-       codes and LCIDs as found in Office Xp.
-
-2001-02-28  David Turner  <david.turner@freetype.org>
-
-       * builds/hurd/detect.mk: New file.  Added support to detect the GNU
-       Hurd operating system as Unix-like.  Fix submitted by Anthony Fok
-       <foka@debian.org>.
-
-       * src/type1/t1gload.c (T1_Load_Glyph): Set glyph control data to the
-       the Type 1 glyph charstring (used by conversion programs).
-       Submitted by Ha Shao <hashao@chinese.com>.
-
-2001-02-22  David Turner  <david.turner@freetype.org>
-
-       * src/base/ftgrays.c (grays_sweep): The function didn't exit
-       immediately if `num_cells' was 0 as it should.  Thanks to Boris for
-       finding this out.
-
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Fixed memory leak when
-       bitmap rendering fails (thanks to Graham Asher).
-
-2001-02-13  Werner Lemberg  <wl@gnu.org>
-
-       * docs/docmaker.py (DocSection::add_element): Use
-       `self.print_error()'.
-
-       * builds/unix/config.{guess,sub}: Updated (from ftp.gnu.org).
-
-2001-02-13  David Turner  <david.turner@freetype.org>
-
-       * docs/docmaker.py, include/freetype/*.h: Updated the DocMaker
-       script to support chapters and section block ordering.  Updated the
-       public header files accordingly.
-
-       * src/base/ftglyph.c (FT_Glyph_Copy): Advance width and glyph format
-       were not correctly copied.
-
-2001-02-08  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/cffparse.c (cff_parse_font_matrix): Removed an
-       unnecessary fprintf( stderr, ... ).
-
-2001-02-07  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/type1/t1objs.c (T1_Init_Face): Added code to get the
-       units_per_EM from the value assigned in parse_font_matrix, if
-       available.  Default to 1000 if not available.
-
-       * src/cff/cffparse.c (cff_parse_font_matrix): Added logic to get
-       the units_per_EM from the FontMatrix.
-
-       (cff_parse_fixed_thousand): New function.  Gets a real number from
-       the CFF font, but multiplies by 1000 (this is to avoid rounding
-       errors when placing this real number into a 16.16 fixed number).
-
-       (cff_parse_real): Added code so that the integer part is moved
-       into the high sixteen bits of the 16.16 fixed number.
-
-       * src/cff/cffobjs.c (CFF_Init_Face): Added logic to get the units
-       per EM from the CFF dictionary, if available.
-
-       * include/freetype/internal/cfftypes.h: In struct CFF_Font_Dict_,
-       added a units_per_em member to facilitate passing of units_per_em
-       from function cff_parse_font_matrix.
-
-       * src/type1/t1load.c (is_alpha): Make `-' a legal alphanumeric
-       character.  This is so that font names with `-' are fully parsed,
-       etc...
-
-2001-02-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psobjs.c (shift_elements): Remove if clause (which is
-       obsolete now).
-
-       (reallocate_t1_table, PS_Table_Done): Replace REALLOC() with ALLOC()
-       + MEM_Copy() to avoid a memory bug.
-
-2001-02-01  David Turner  <david.turner@freetype.org>
-
-       * docs/docmaker.py: Improved the index sorting routine to place
-       capital letters before small ones.  Added the `<order>' marker to
-       section blocks in order to give the order of blocks.
-
-2001-01-30  Antoine Leca  <Antoine.Leca@renault.fr>
-
-       * include/freetype/ttnameid.h: Latest updates to Microsoft language
-       ID codes.
-
-2001-01-24  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/t1load.c (parse_font_matrix): Added heuristic to get
-       units_per_EM from the font matrix.
-
-       (parse_dict): Deleted test to see whether the FontInfo keyword has
-       been seen.  Deletion of this test allows fonts without FontInfo
-       dictionaries to be parsed by the Type 1 driver.
-
-       (T1_Open_Face): Deleted empty subroutines array test to make sure
-       fonts with no subroutines still are parsed.
-
-2001-01-17  Francesco Zappa Nardelli  <francesco.zappa.nardelli@ens.fr>
-
-       * src/pcfread.c (pcf_get_properties, pcf_get_metrics,
-       pcf_get_bitmaps): Fix compiler errors.
-
-2001-01-11  David Turner  <david.turner@freetype.org>
-
-       * src/pcf/pcfread.c: Removed some compilation warnings related
-       to comparison of signed vs. unsigned integers.
-
-       * include/freetype/internal/ftdebug.h: Changed the debug trace
-       constants from trace_t2xxxx to trace_cffxxxx to be able to compile
-       the CFF driver in debug mode.
-
-2001-01-11  Matthew Crosby  <mcrosby@marthon.org>
-
-       * builds/unix/freetype-config.in: Fix problems with separate
-       --prefix and --exec-prefix.
-
-2001-01-11  David Turner  <david.turner@freetype.org>
-
-       * docs/docmaker.py: Added cross-references generation as well as
-       more robust handling of pathname wildcard matching.
-
-2001-01-10  Werner Lemberg  <wl@gnu.org>
-
-       * docs/docmaker.py: Minor improvements to reduce unwanted spaces
-       and empty lines in output.
-
-2001-01-09  David Turner  <david.turner@freetype.org>
-
-       * docs/docmaker.py: Improved script to generate table of contents
-       and index pages.  It also supports wildcards on non Unix systems.
-
-       * include/freetype/*.h, include/freetype/cache/*.h: Updated comments
-       to include section definitions/delimitations for the API Reference
-       generator.
-
-       * include/freetype/freetype.h: Moved declaration of
-       `FT_Generic_Finalizer' and the `FT_Generic' structure to...
-       * include/freetype/fttypes.h: here.
-
-2001-01-04  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ttnameid.h: Updated Unicode code range comments.
-
-2001-01-03  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/rules.mk: Use cffgload.{c,h} instead of t2gload.{c,h}.
-
-       * include/freetype/internal/internal.h: Changed to use cfftypes.h
-       (cfferrs.h) instead of t2types.h (t2errors.h, respectively).
-
-       * include/freetype/internal/cfftypes.h: Merged in changes from
-       t2types.h and made this the canonical `types' header for the CFF
-       driver.
-
-       * include/freetype/internal/t2types.h: This file was merged with
-       cfftypes.h and is no longer necessary.
-
-       * include/freetype/internal/t2errors.h: Renamed to cfferrs.h.
-
-       * src/cff/cffobjs.c, src/cff/cffobjs.h, src/cff/cffparse.c,
-       src/cff/cffdrivr.c, src/cff/cff.c, src/cff/cffload.c,
-       src/cff/cffgload.c, src/cff/cffgload.h: Changed to use
-       cffgload.{c,h} instead of t2gload.{c,h}.  All occurrences of t2_
-       (T2_) were replaced with cff_ (CFF_, respectively).
-
-       * src/cff/t2gload.h: Renamed cffgload.h.
-
-       * src/cff/t2gload.c: Renamed cffgload.c
-
-2000-01-02  Jouk Jansen  <joukj@hrem.stm.tudelft.nl>
-
-       * builds/vms: Support files for VMS architecture added.
-       * descrip.mms, src/*/descrip.mms: VMS makefiles added.
-       * README.VMS: New file.
-
-2000-01-01  Werner Lemberg  <wl@gnu.org>
-
-       * LICENSE.TXT: Added info about PCF driver license.
-
-2001-01-01  Francesco Zappa Nardelli  <francesco.zappa.nardelli@ens.fr>
-
-       * src/pcf/*: New driver module for PCF font format (used in
-       X Window System).
-       * include/freetype/internal/ftdebug.h (FT_Trace): Added values for
-       PCF driver.
-       * include/freetype/internal/pcftypes.h: New file.
-       * include/freetype/config/ftmodule.h: Added PCF driver module.
-
-2001-01-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/winfonts/winfnt.c (FNT_Get_Char_Index): Fix parameter type.
-
-2000-12-31  Werner Lemberg  <wl@gnu.org>
-
-       * builds/modules.mk (clean_module_list): Fixed deletion of module
-       file in case `make make_module_list' is called before `make setup'.
-
-2000-12-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (CFF_Load_Charset): Improved error messages.
-       (CFF_Load_Charset, CFF_Load_Encoding): Remove unnecessary variable
-       definition.
-
-2000-12-30  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * include/freetype/internal/t2types.h,
-       include/freetype/internal/cfftypes.h: Changed the structures for
-       CFF_Encoding and CFF_Encoding for the new implementations of the
-       charset and encoding parsers in the CFF driver.
-
-       * src/cff/t2gload.c (t2_lookup_glyph_by_stdcharcode,
-       t2_operator_seac): Added these functions for use in implementing the
-       seac emulation provided by the Type 2 endchar operator.
-       (T2_Parse_CharStrings): Added seac emulation for the endchar
-       operator.
-
-       * src/cff/cffload.c (CFF_Load_Encoding, CFF_Load_Charset,
-       CFF_Done_Encoding, CFF_Done_Charset): Extended to load and parse the
-       charset/encoding tables, and free the memory used by them when the
-       CFF driver is finished with them.  Added tables
-
-           cff_isoadobe_charset
-           cff_expert_charset
-           cff_expertsubset_charset
-           cff_standard_encoding
-           cff_expert_encoding
-
-       so that the encoding/charset parser can handle predefined encodings and
-       charsets.
-
-2000-12-24  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/t2gload.c (T2_Load_Glyph): Added code so that the font
-       transform is applied.
-
-       * src/cff/cffparse.c (cff_parse_font_matrix): Added code so that
-       the font matrix numbers are scaled by 1/(matrix->yy).  Also, the
-       offset vector now contains integer values instead of 16.16 fixed
-       numbers.
-
-2000-12-22  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/autohint/ahhint.c (ah_hinter_load_glyph):
-       Removed unnecessary comments and commented-out code.
-
-2000-12-21  David Turner  <david.turner@freetype.org>
-
-       * src/cid/cidafm.c, src/cid/cidafm.h: removed un-needed files,
-       we'll work on supporting CID AFM files later I guess :-)
-
-2000-12-21  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/autohint/ahhint.c (ah_hinter_load, ah_hinter_load_glyph):
-       Changed so that fonts with a non-standard FontMatrix render
-       correctly.  Previously, the first glyph rendered from such a
-       font did not have the transformation matrix applied.
-
-2000-12-17  Werner Lemberg  <wl@gnu.org>
-
-       * *.mk: Added lots of `.PHONY' targets.
-
-2000-12-17  Karsten Fleischer  <kfleisc1@ford.com>
-
-       * *.mk: Implemented `platform' target to disable auto-detection.
-
-2000-12-14  Werner Lemberg  <wl@gnu.org>
-
-       * docs/design/modules.html: Removed.  Covered by design-*.html.
-
-       * INSTALL: Added info about makepp.
-
-2000-12-14  David Turner  <david.turner@freetype.org>
-
-       Added support for clipped direct rendering in the smooth renderer.
-       This should not break binary compatibility of existing applications.
-
-       * include/freetype/fttypes.h, include/freetype/ftimage.h: Move
-       definition of the FT_BBox structure from the former to the latter.
-       * include/freetype/ftimage.h: Add `ft_raster_flag_clip' value to
-       FT_Raster_Flag enumeration.
-       Add `clip_box' element to FT_Raster_Params structure.
-       * src/smooth/ftgrays.c (grays_convert_glyph): Implement it.
-
-       * INSTALL: Updated installation instructions on Win32, listing the
-       new `make setup list' target used to list supported
-       compilers/targets.
-
-       * src/raster/ftraster.c (ft_black_render): Test for unsupported
-       direct rendering before testing arguments.
-
-2000-12-13  David Turner  <david.turner@freetype.org>
-
-       * include/freetype/config/ft2build.h,
-       include/freetype/internal/internal.h: Fixed header inclusion macros
-       to use direct definitions.  This is the only way to do these things
-       in a portable way :-(  The rest of the code should follow shortly
-       though everything compiles now.
-
-       * builds/compiler/intelc.mk, builds/compiler/watcom.mk: New files.
-
-       * builds/win32/detect.mk: Added support for the Intel C/C++
-       compiler, as well as _preliminary_ (read: doesn't work!) support for
-       Watcom.  Also added a new setup target.  Type `make setup list' for
-       a list of supported command-line compilers on Win32.
-
-       * src/base/ftdebug.c: Added dummy symbol to avoid empty file if
-       conditionals are off.
-
-2000-12-13  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/ftsystem.c: Fixed typos.  Fixed inclusion of wrong
-       ftconfig.h file.
-
-2000-12-12  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ft2build.h (FT2_ROOT, FT2_CONFIG_ROOT):
-       Removed.  ANSI C doesn't (explicitly) allow macro expansion in
-       arguments using `##'.
-       (FT2_PUBLIC_FILE, FT2_CONFIG_FILE, FT2_INTERNAL_FILE): Use directory
-       names directly.  Make them configurable.  Use `##' to strip leading
-       and trailing spaces from arguments.
-
-       * builds/unix/ft2unix.h: Adapted.
-
-       * src/base/ftsystem.c (ft_alloc, ft_realloc, ft_free, ft_io_stream,
-       ft_close_stream): Use FT_CALLBACK_DEF.
-
-       * builds/unix/ftsystem.c: Use new header scheme.
-       (FT_Done_Memory): Use free() from FT_Memory structure.
-
-       * src/base/ftinit.c, src/base/ftmac.c: Header scheme fixes.
-
-2000-12-11  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ft2build.h (FT2_CONFIG_ROOT,
-       FT2_PUBLIC_FILE, FT2_CONFIG_FILE, FT2_INTERNAL_FILE,
-       FT_SOURCE_FILE): Use `##' operator to be really ANSI C compliant.
-
-2000-12-09  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/detect.mk: Remove unused USE_CFLAGS variable.
-
-2000-12-08  Werner Lemberg  <wl@gnu.org>
-
-       * */*.h: Changed body inclusion macro names to start and end with
-       `__' (those which haven't converted yet).  Fixed minor conversion
-       issues.
-
-       * src/winfonts/winfnt.c: Updated to new header inclusion scheme.
-
-       * src/truetype/ttinterp.c: Remove unused CALC_Length() macro.
-
-2000-12-07  David Turner  <david.turner@freetype.org>
-
-       * */*.[ch]: Changed source files to adhere to the new
-       header inclusion scheme.  Not completely tested but works for now
-       here.
-
-       * src/cff/t2driver.c: Renamed and updated to...
-       * src/cff/cffdrivr.c: New file.
-       * src/cff/t2driver.h: Renamed and updated to...
-       * src/cff/cffdrivr.h: New file.
-       * src/cff/t2load.c: Renamed and updated to...
-       * src/cff/cffload.c: New file.
-       * src/cff/t2load.h: Renamed and updated to...
-       * src/cff/cffload.h: New file.
-       * src/cff/t2objs.c: Renamed and updated to...
-       * src/cff/cffobjs.c: New file.
-       * src/cff/t2objs.h: Renamed and updated to...
-       * src/cff/cffobjs.h: New file.
-       * src/cff/t2parse.c: Renamed and updated to...
-       * src/cff/cffparse.c: New file.
-       * src/cff/t2parse.h: Renamed and updated to...
-       * src/cff/cffparse.h: New file.
-       * src/cff/t2tokens.h: Renamed and updated to...
-       * src/cff/cfftoken.h: New file.
-
-       * src/cff/cff.c, src/cff/rules.mk: Updated.
-
-2000-12-06  David Turner  <david.turner@freetype.org>
-
-       * src/cache/ftlru.c (FT_Lru_Done): Fixed memory leak.
-
-2000-12-06  Werner Lemberg  <wl@gnu.org>
-
-       * builds/module.mk: Replaced `xxx #' with `xxx$(space).
-       * builds/os2/detekt.mk, builds/win32/detekt.mk: Moved comment to
-       avoid trailing spaces in variable.
-       * builds/freetype.mk: Use $(D) instead of $D to make statement more
-       readable.
-
-       * docs/docmaker.py: Formatting.
-
-2000-12-05  David Turner  <david.turner@freetype.org>
-
-       * src/psaux/psauxmod.c: Fixed a broken inclusion of component
-       header files (an FT_FLAT_COMPILE test was missing).
-
-       * src/cache/ftcmanag.c (FTC_Manager_Done): Fixed a bug that caused
-       an occasional crash when the function was called (due to a dangling
-       pointer).
-
-       * src/base/ftsystem.c (FT_Done_Memory): Fixed an obvious bug:
-       The ANSI `free()' function was called instead of `memory->free()'.
-
-       * docs/docmaker.py: Added section filtering, multi-page generation
-       (index page generation is still missing though).
-
-2000-12-04  David Turner  <david.turner@freetype.org>
-
-       * builds/unix/install.mk, builds/unix/ft2unix.h: The file `ft2unix.h'
-       is now installed as <ft2build.h> for Unix systems.  Note that we
-       still use the `freetype2/freetype' installation path for now.
-
-       * */*.[ch]: Now using <ft2build.h> as the default build and setup
-       configuration file in all public headers.  Internal source files
-       still need some changes though.
-
-       * builds/devel/ft2build.h, builds/devel/ftoption.h: Created a new
-       directory to hold all development options for both the Unix and
-       Win32 developer builds.
-
-       * builds/win32/detect.mk, builds/win32/w32-bccd.mk,
-       builds/win32/w32-dev.mk: Changed the developer build targets to
-       `devel-gcc' and `devel-bcc' in order to be able to develop with the
-       Borland C++ compiler.
-
-2000-12-01  David Turner  <david.turner@freetype.org>
-
-
-       * Version 2.0.1 released.
-       =========================
-
-
-       * builds/unix/configure.in, builds/unix/configure,
-       builds/cygwin/configure.in, builds/cygwin/configure: Setting
-       `version_info' to 6:1:0 for the 2.0.1 release.
-
-       * CHANGES: Added a summary of changes between 2.0.1 and 2.0.
-
-       * builds/unix/ftconfig.in, builds/cygwin/ftconfig.in: Changes
-       to allow compilation under Unix with the Unix-specific config
-       files.
-
-2000-12-01  Werner Lemberg  <wl@gnu.org>
-
-       * INSTALL: Revised.
-       * builds/compiler/bcc-dev.mk, builds/compiler/visualage.mk,
-       builds/compiler/bcc.mk, builds/win32/w32-bcc.mk,
-       builds/win32/w32-bccd.mk: Revised.
-       * include/freetype/config/ftbuild.h,
-       include/freetype/internal/internal.h: Revised.
-       * include/freetype/ftimage.h: Updated to new header inclusion scheme.
-
-2000-11-30  Werner Lemberg  <wl@gnu.org>
-
-       * builds/toplevel.mk (.PHONY): Adding `distclean'.
-       * builds/unix/detect.mk (.PHONY): Adding `devel', `unix', `lcc',
-       `setup'.
-
-2000-11-30  David Turner  <david.turner@freetype.ogr>
-
-       * INSTALL: Slightly updated the quick starter documentation to
-       include IDE compilation, prevent against BSD Make, and specify `make
-       setup' instead of a single `make' for build configuration.
-
-       * include/config/ftbuild.h, include/internal/internal.h: Added new
-       configuration files used to determine the location of all public,
-       configuration, and internal header files for FreeType 2.  Modified
-       all headers under `include/freetype' to reflect this change.  Note
-       that we still need to change the library source files themselves
-       though.
-
-       * builds/compiler/bcc.mk, builds/compiler/bcc-dev.mk,
-       builds/win32/w32-bcc.mk, builds/win32/w32-bccd.mk,
-       builds/win32/detect.mk: Added new files to support compilation with
-       the free Borland C++ command-line compiler.  Modified the detection
-       rules to recognize the new `bcc32' target in `make setup bcc32'.
-
-       * src/sfnt/ttcmap.c, src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
-       src/truetype/ttobjs.c, src/truetype/ttgload.c,
-       src/truetype/ttinterp.c: Fixed a few comparisons that Borland C++
-       didn't really like.  Basically, this compiler complains when FT_UInt
-       is compared to FT_UShort (apparently, it promotes `UShort' to `Int'
-       in these cases).
-
-2000-11-30  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * t2objs.c (T2_Init_Face): Added calculation of `face->height' for
-       pure CFF fonts.
-
-       * t1objs.c (T1_Init_Face): Fixed computation of `face->height'.
-
-2000-11-29  David Turner  <david.turner@freetype.org>
-
-       * src/base/ftbbox.c (BBox_Conic_Check): Fixed a really stupid
-       bug in the formula used to compute the conic Bézier extrema
-       of non-monotonous arcs.
-
-2000-11-29  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftcalc.c (FT_SqrtFixed), src/base/ftobjs.c
-       (FT_Set_Renderer): Use FT_EXPORT_DEF.
-       * src/cache/ftcimage.c (FTC_Image_Cache_Lookup),
-       src/cache/ftcmanag.c (FTC_Manager_Done, FTC_Manager_Reset,
-       FTC_Manager_Lookup_Face, FTC_Manager_Lookup_Size,
-       FTC_Manager_Register_Cache), src/cache/ftcsbits.c
-       (FTC_SBit_Cache_Lookup): Ditto.
-
-       * src/include/freetype/cache/ftcglyph.h (FTC_GlyphNode_Init),
-       src/include/freetype/ftmac.h (FT_New_Face_From_FOND): Use FT_EXPORT.
-
-2000-11-29  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfdriver.c: Include ttsbit.h and ttpost.h only
-       conditionally.
-
-       * src/truetype/ttdriver.c (Set_Char_Sizes, Set_Pixel_Sizes): Set
-       `size->strike_index' only conditionally.
-
-       * src/type1/t1driver.c, src/type1/t1objs.c: Include t1afm.h only
-       conditionally.
-
-       * src/winfonts/winfnt.h: Move all type definitions to...
-       * src/include/freetype/internal/fnttypes.h: New file.
-       * src/winfonts/winfnt.c: Use it.
-
-2000-11-29  ??? ???  <darin@eazel.com>
-
-       * include/freetype/internal/ftdebug.h: Replaced FT_CAT and FT_XCAT
-       with a direct solution (which also satisfies picky compilers).
-
-2000-11-28  YAMANO-UCHI Hidetoshi  <mer@din.or.jp>
-
-       * src/truetype/ttobjs.c (TT_Init_Size): Fix #ifdef's to work with
-       disabled interpreter also.
-
-       * src/base/ftnames.c (FT_Get_Sfnt_Name_Count): Fix incorrect
-       parentheses.
-
-2000-11-26  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/t2gload.c (T2_Parse_CharStrings): Added logic to glyph
-       width setting code to take into account even/odd argument counts
-       and glyph width operand before endchar/hmoveto/vmoveto.
-
-2000-11-26  Werner Lemberg  <wl@gnu.org>
-
-       * builds/ansi/ansi.mk: Fix inclusion order of files.
-
-2000-11-26  Keith Packard  <keithp@keithp.com>
-
-       * src/type1/t1objs.c (T1_Init_Face): Compute style flags.
-
-2000-11-26  Werner Lemberg  <wl@gnu.org>
-
-       * builds/compiler/ansi-cc.mk (CLEAN_LIBRARY): Fix rule and
-       conditional.
-
-2000-11-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_subrs, parse_charstrings): Use decrypt
-       function from PSAux module.
-
-       * src/type1/t1parse.c (T1_Done_Parse): Renamed to...
-       (T1_Finalize_Parser): New function (to avoid name clash with a
-       function in the PSAux module).
-       (T1_Decrypt): Removed since it is duplicated in the PSAux module.
-       (T1_Get_Private_Dict): Added `psaux' as new parameter; use decrypt
-       function from PSAux module.
-
-       * src/type1/t1parse.h: Adapted.
-
-2000-11-22  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/cff/t2objs.c (T2_Init_Face): For pure CFF fonts, set
-       `root->num_faces' to `cff->num_faces' and set `units_per_EM'
-       to 1000.
-
-       * src/cff/t2parse.c (parse_t2_real): Fixed real number parsing
-       loop.
-
-       * src/cff/t2load.c (T2_Get_String): Called T2_Get_Name with a
-       sid that was off by one.
-
-2000-11-16  David Turner  <david@freetype.org>
-
-       * src/autohint/ahtypes.h (AH_Hinter): Added new fields to control
-       auto-hinting of synthetic Type 1 fonts.
-
-       * src/autohint/ahhint.c (ah_hinter_load, ah_hinter_load_glyph):
-       Added auto-hinting support of synthetic Type 1 fonts.
-
-2000-11-12  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * src/sfnt/ttload.c (TT_LookUp_Table, TT_Load_Generic_Table): Change
-       tracing output.
-
-       * src/sfnt/sfobjs.c (SFNT_Load_Face): Set boolean variable
-       `has-outline' to true only if the font has a `glyf' or `CFF ' table.
-
-2000-11-11  Werner Lemberg  <wl@gnu.org>
-
-       * builds/win32/visualc/freetype.dsp: Fix raster1->raster and
-       type1z->type1.
-
-2000-11-11  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * builds/unix/freetype-config.in, builds/cygwin/freetype-config.in:
-       Added a --libtool option.  When freetype-config --libtool is
-       invoked, the absolute path to the libtool convenience library
-       is returned.
-
-2000-11-11  Werner Lemberg  <wl@gnu.org>
-
-       * builds/cygwin/cygwin-def.in: Same fix as previous.
-
-2000-11-10  Tom Kacvinsky  <tkacvins@freetype.org>
-
-       * builds/unix/unix-def.in: Add
-
-           INSTALL_PROGRAM := @INSTALL_PROGRAM@
-           INSTALL_SCRIPT  := @INSTALL_SCRIPT@
-
-       so that installation of freetype-config does not fail.
-
-2000-11-10  Werner Lemberg  <wl@gnu.org>
-
-       * builds/cygwin/freetype-config.in, builds/unix/freetype-config.in:
-       Move test down for empty --exec-prefix.
-       Fix --version.
-
-       * builds/cygwin/install.mk, builds/unix/install.mk: Use
-       $(INSTALL_SCRIPT) for installation of freetype-config.
-
-       * builds/cygwin/install.mk: Fix clean target names.
-
-2000-11-09  David Turner  <david@freetype.org>
-
-
-       * Version 2.0 released.
-       =======================
-
-----------------------------------------------------------------------------
-
-Copyright 2000, 2001, 2002, 2007 by
-David Turner, Robert Wilhelm, and Werner Lemberg.
-
-This file is part of the FreeType project, and may only be used, modified,
-and distributed under the terms of the FreeType project license,
-LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-indicate that you have read the license and understand and accept it
-fully.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/reactos/lib/3rdparty/freetype/ChangeLog.21 b/reactos/lib/3rdparty/freetype/ChangeLog.21
deleted file mode 100644 (file)
index d6371d1..0000000
+++ /dev/null
@@ -1,9439 +0,0 @@
-2005-06-08  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.1.10 released.
-       ==========================
-
-
-       * src/pcf/readme: Renamed to...
-       * src/pcf/README: This.
-
-2005-06-07  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/*: Added copyright notes, reworked some comments.
-
-2005-06-05  Werner Lemberg  <wl@gnu.org>
-
-       * Add copyright notices to all files which don't have one.
-
-       * docs/license.txt: Renamed to...
-       * docs/LICENSE.TXT: This.
-       * docs/FTL.txt: Renamed to...
-       * docs/FTL.TXT: This.
-       * docs/GPL.txt: Renamed to...
-       * docs/GPL.TXT: This.
-
-       * docs/PATENTS: Slightly reworded.  Suggested by Sylvain Beucler
-       <beuc@gnu.org>.
-
-2005-06-04  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftimage.h (FT_Outline_MoveToFunc,
-       FT_Outline_LineToFunc, FT_Outline_ConicToFunc,
-       FT_Outline_CubicToFunc, FT_Raster_RenderFunc),
-       include/freetype/ftrender.h (FT_Glyph_TransformFunc,
-       FT_Renderer_RenderFunc, FT_Renderer_TransformFunc): Don't use
-       `const' to stay compatible with FreeType 2.1.9.
-
-2005-06-01  Adam D. Moss  <adam@gimp.org>
-
-       * src/base/ftstroke.c (ft_stroker_inside): Revert `sigma' patch from
-       2004-07-11; this gives much better results under normal
-       circumstances.
-
-2005-05-30  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): Minor
-       documentation improvements.
-
-       * include/freetype/ftoutln.h (FT_Outline_Embolden): Fix typos.
-
-       * src/base/ftbitmap.c (FT_Bitmap_Embolden): Add support for bitmap
-       of pixel_mode FT_PIXEL_MODE_GRAY2 or FT_PIXEL_MODE_GRAY4.
-       If xstr is larger than 8 and bitmap is of pixel_mode
-       FT_PIXEL_MODE_MONO, set xstr to 8 instead of returning error.
-
-2005-05-29  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftbitmap.c (FT_Bitmap_Embolden): Fix emboldening bitmap
-       of mode FT_PIXEL_MODE_GRAY.  Also add support for mode
-       FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V.
-       (ft_bitmap_assure_buffer): FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V
-       should have ppb (pixel per byte) 1.
-       Zero the padding when there's no need to allocate memory.
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Handle slot->advance
-       too.
-       More suited emboldening strength.
-
-2005-05-28  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftbitmap.c (FT_Bitmap_Embolden): Handle negative pitch.
-       Handle FT_PIXEL_MODE_GRAY with num_gray != 256.
-       Improve speed for FT_PIXEL_MODE_GRAY.
-       (ft_bitmap_assure_buffer): Accept FT_PIXEL_MODE_LCD and
-       FT_PIXEL_MODE_LCD_V.
-
-2005-05-27  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Initialize `error'.
-
-       * src/base/ftobjs.c (ft_cmap_done_internal): New function.
-       (FT_CMap_Done): Remove cmap from cmap list.
-       (destroy_charmaps, FT_CMap_New): Don't call FT_CMap_Done but
-       ft_cmap_done_internal.
-
-2005-05-26  Werner Lemberg  <wl@gnu.org>
-
-       * docs/GPL.txt: Update postal address of FSF.
-
-2005-05-26  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): Improve
-       documentation.
-
-       * src/base/ftsynth.c (FT_BOLD_THRESHOLD): Removed.
-       (FT_GlyphSlot_Embolden): Check whether slot is bitmap owner.
-       Always modify the metrics.
-
-2005-05-24  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2005-05-24  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): New declaration.
-
-       * include/freetype/ftoutln.h (FT_Outline_Embolden): New declaration.
-
-       * src/base/ftbitmap.c (ft_bitmap_assure_buffer): New auxiliary
-       function.
-       (FT_Bitmap_Embolden): New function.
-
-       * src/base/ftoutln.c (FT_Outline_Embolden): New function.
-
-       * src/base/ftsynth.c: Don't include FT_INTERNAL_CALC_H and
-       FT_TRIGONOMETRY_H but FT_BITMAP_H.
-       (FT_GlyphSlot_Embolden): Use FT_Outline_Embolden or
-       FT_Bitmap_Embolden.
-
-2005-05-24  Werner Lemberg  <wl@gnu.org>
-
-       * configure: Always remove config.mk, builds/unix/unix-def.mk, and
-       builds/unix/unix-cc.mk.  This fixes repeated calls of the script.
-       Reported by Nelson Beebe and Behdad Esfahbod.
-
-       * README.CVS: Mention file permissions.
-
-2005-05-23  Werner Lemberg  <wl@gnu.org>
-
-       * builds/amiga/makefile.os4 (WARNINGS), builds/compiler/gcc-dev.mk
-       (CFLAGS), builds/compiler/gcc.mk (CFLAGS): Remove
-       -fno-strict-aliasing.
-
-       * src/sfnt/rules.mk (SFNT_DRV_SRC): Don't include ttsbit0.c --
-       it is currently loaded from ttsbit.c.
-
-2005-05-23  Behdad Esfahbod  <behdad@cs.toronto.edu>
-
-       Say you have `(Foo*)x' and want to assign, pass, or return it as
-       `(Bar*)'.  If you simply say `x' or `(Bar*)x', then the C compiler
-       would warn you that type casting incompatible pointer types breaks
-       strict-aliasing.  The solution is to cast to `(void*)' instead which
-       is the generic pointer type, so the compiler knows that it should
-       make no strict-aliasing assumption on `x'.  But the problem with
-       `(void*)x' is that seems like in C++, unlike C, `void*' is not a
-       generic pointer type and assigning `void*' to `Bar*' without a cast
-       causes an error.  The solution is to cast to `Bar*' too, with
-       `(Bar*)(void*)x' as the result -- this is what the patch does.
-
-       * include/freetype/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP),
-       include/freetype/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): Remove
-       cast on lvalue, use a temporary pointer instead.
-       Cast temporarily to (void*) to not break strict aliasing.
-
-       * include/freetype/internal/ftmemory.h (FT_MEM_ALLOC,
-       FT_MEM_REALLOC, FT_MEM_QALLOC, FT_MEM_QREALLOC, FT_MEM_FREE),
-       src/base/ftglyph.c (FT_Glyph_To_Bitmap): Cast temporarily to (void*)
-       to not break strict aliasing.
-
-       * src/base/ftinit.c (FT_USE_MODULE): Fix wrong type information.
-
-       * builds/unix/configure.ac (XX_CFLAGS): Remove -fno-strict-aliasing.
-
-2005-05-23  David Turner  <dturner@freetype.org>
-
-       Fix Savannah bug #12213 (incorrect behaviour of the cache sub-system
-       in low-memory conditions).
-
-       * include/freetype/cache/ftccache.h (FTC_CACHE_TRYLOOP,
-       FTC_CACHE_TRYLOOP_END): New macros.
-
-       * src/cache/ftccache.c (FTC_Cache_NewNode), src/cache/ftcsbits.c
-       (ftc_snode_compare): Use FT_CACHE_TRYLOOP and FTC_CACE_TRYLOOP_END.
-
-2005-05-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/rules.mk (BASE_SRC): Don't add ftsynth.c here but...
-       (BASE_EXT_SRC): Here.
-
-2005-05-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftrfork.c (raccess_guess_apple_generic): Mark
-       `version_number' and `entry_length' as unused.
-       (raccess_guess_linux_double_from_file_name): Remove `memory'.
-       (raccess_make_file_name): Mark `error' as unused.
-
-       * src/bdf/bdflib.c (_bdf_parse_properties): Remove `memory'.
-
-       * src/cid/cidobjs.c (cid_face_init): Remove `psnames'.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Remove `memory'.
-
-       * src/truetype/ttgxvar.c (ft_var_readpackedpoints,
-       ft_var_readpackeddeltas, ft_var_load_avar): Mark `error' as unused.
-
-       * src/base/rules.mk (BASE_SRC): Add ftsynth.c.
-
-2005-05-21  David Turner  <david@freetype.org>
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Fix a bug that
-       produced unpleasant artefacts when trying to embolden very sharp
-       corners.
-
-2005-05-20  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2005-05-20  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftbitmap.c: Don't include FT_FREETYPE_H and FT_IMAGE_H
-       but FT_BITMAP_H.
-       (FT_Bitmap_Copy): New function (from ftglyph.c).
-
-       * include/freetype/ftbitmap.h (FT_Bitmap_Copy): New public
-       definition.
-
-       * src/base/ftglyph.c: Include FT_BITMAP_H.
-       (ft_bitmap_copy): Move to ftbitmap.c.
-       (ft_bitmap_glyph_init): Remove `memory' variable.
-       Create new bitmap object if FT_GLYPH_OWN_BITMAP isn't set.
-       (ft_bitmap_glyph_copy): Use FT_Bitmap_Copy.
-       (ft_bitmap_glyph_done): Use FT_Bitmap_Done.
-       (ft_outline_glyph_init): Use FT_Outline_Copy.
-
-       * src/base/ftoutln.c (FT_Outline_Copy): Handle source == target.
-       (FT_Outline_Done_Internal): Check for valid `memory' pointer.
-       (FT_Outline_Translate, FT_Outline_Reverse, FT_Outline_Render,
-       FT_Outline_Transform): Check for valid `outline' pointer.
-
-       * src/base/ftobjs.c (FT_New_GlyphSlot): Prepend glyph slot to
-       face->glyph, otherwise a new second glyph slot cannot be created.
-       (FT_Done_GlyphSlot): Fix memory leak.
-       (FT_Open_Face): Updated -- face->glyph is already managed by
-       FT_New_GlyphSlot.
-
-       * src/type42/t42objs.c (T42_GlyphSlot_Done): Updated.
-
-2005-05-20  Kirill Smelkov  <kirr@mns.spb.ru>
-
-       * include/freetype/ftimage.h (FT_Raster_Params),
-       include/freetype/ftoutln.h (FT_Outline_Translate,
-       FT_Outline_Transform), src/base/ftoutln.c (FT_Outline_Translate,
-       FT_Outline_Transform): Decorate parameters with `const' where
-       appropriate.
-       Update all callers.
-
-       * src/raster/ftraster.c (ft_black_reset), src/smooth/ftgrays.c
-       (gray_raster_reset): Remove `const' from `pool_base' argument.
-
-2005-05-18  Kirill Smelkov  <kirr@mns.spb.ru>
-
-       * src/raster/ftmisc.h: New file.  Only needed if ftraster.c is
-       compiled as stand-alone.
-
-       * src/raster/ftraster.c: Add comment how to compile as stand-alone.
-       s/FT_CONFIG_OPTION_STATIC_RASTER/FT_STATIC_RASTER/.
-       s/TT_STATIC_RASTER/FT_STATIC_RASTER/.
-       [_STANDALONE_]: Include ftimage.h and ftmisc.h.
-       (FT_TRACE1, FT_TRACE6, ft_memset, FT_MEM_ZERO): Define
-       conditionally.
-       (Render_Glyph, Render_Gray_Glyph): Return Raster_Err_None (or
-       Raster_Err_Unsupported).
-       (ft_black_new) [_STANDALONE_]: Fix type of `the_raster'.
-       (ft_black_init, ft_black_reset, ft_black_set_mode, ft_black_render):
-       Use `ras', not `raster'.
-       (ft_black_done): Use FT_UNUSED_RASTER.
-       (Horizontal_Sweep_Init, Horizontal_Sweep_Step,
-       Horizontal_Gray_Sweep_Span): Use FT_UNUSED_RASTER.
-
-2005-05-18  Werner Lemberg  <wl@gnu.org>
-
-       * docs/announce: Start updating.
-
-       * docs/CHANGES: Updated.
-
-2005-05-16  Vitaliy Pasternak  <v_a_pasternak@mail.ru>
-
-       * builds/win32/visualc/freetype.vcproj: Updated.
-       Exclude debug info for `Release' versions to reduce library size.
-
-2005-05-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Open_Face): Make it work as documented, this
-       is, ignore `aface' completely if face_index < 0.  Reported by David
-       Osborn <spam@habitualhiatus.com>.
-
-2005-05-16  Kirill Smelkov  <kirr@mns.spb.ru>
-
-       * include/freetype/ftimage.h (FT_Outline_MoveToFunc,
-       FT_Outline_LineTo_Func, FT_Outline_ConicToFunc,
-       FT_Outline_CubicToFunc), src/smooth/ftgrays.c (gray_render_conic,
-       gray_render_cubic, gray_move_to, gray_line_to, gray_conic_to,
-       gray_cubic_to, gray_render_span, gray_sweep): Decorate parameters
-       with `const' where appropriate.
-
-2005-05-11  Kirill Smelkov  <kirr@mns.spb.ru>
-
-       * include/freetype/ftimage.h (FT_Raster_RenderFunc),
-       include/freetype/ftrender.h (FT_Glyph_TransformFunc,
-       FT_Renderer_Render_Func, FT_Renderer_TransformFunc),
-       src/base/ftglyph.c (ft_outline_glyph_transform),
-       src/raster/ftrend1.c (ft_raster1_transform, ft_raster1_render),
-       src/smooth/ftgrays.c (FT_Outline_Decompose, gray_raster_render),
-       src/smooth/ftsmooth.c (ft_smooth_transform,
-       ft_smooth_render_generic, ft_smooth_render, ft_smooth_render_lcd,
-       ft_smooth_render_lcd_v): Decorate parameters with `const' where
-       appropriate.
-
-       * src/raster/ftraster.c (RASTER_RENDER_POOL): Removed.  Obsolete.
-       (ft_black_render): Decorate parameters with `const' where
-       appropriate.
-
-2005-05-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttcmap.c (tt_cmap4_set_range): Fix typo (FT_PEEK_SHORT ->
-       FT_PEEK_USHORT) which caused crashes.  Reported by Ismail Donmez
-       <ismail@kde.org.tr>.
-
-2005-05-08  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/ftserv.h (FT_FACE_FIND_GLOBAL_SERVICE)
-       [__cplusplus]: Fix typo.
-
-2005-05-07  Werner Lemberg  <wl@gnu.org>
-
-       Handle unsorted SFNT type 4 cmaps correctly (reported by Dirck
-       Blaskey <listtarget@danbala.com>).
-
-       * src/sfnt/ttcmap.h (TT_CMap): Add member `unsorted'.
-       * src/sfnt/ttcmac.c: Use SFNT_Err_Ok where appropriate.
-
-       (tt_cmap0_validate, tt_cmap2_validate, tt_cmap6_validate,
-       tt_cmap8_validate, tt_cmap10_validate, tt_cmap12_validate): Use
-       `FT_Error' as return type.
-       (tt_cmap4_validate): Use `FT_Error' as return type.
-       Return error code for unsorted cmap.
-       (tt_cmap4_char_index, tt_cmap4_char_next): Use old code for unsorted
-       cmaps.
-       (tt_face_build_cmaps): Set `unsorted' variable in cmap.
-
-2005-05-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttpload.c (tt_face_get_location): Fix typo.
-
-2005-05-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_face_init): Set ppem value in top
-       dictionary for SFNT-based CFF.
-
-2005-05-05  Werner Lemberg  <wl@gnu.org>
-
-       Handle malformed `loca' table entries.
-
-       * docs/TODO: Add some bugs which should be fixed.
-
-       * include/freetype/internal/tttypes.h (TT_FaceRec): Add `glyf_len'
-       element.
-
-       * src/truetype/ttpload.c (tt_face_load_loca): Get length of `glyf'
-       table.
-       (tt_face_get_location): Fix computation of `asize' for malformed
-       `loca' entries.
-
-2005-05-01  David Turner  <david@freetype.org>
-
-       * Jamfile: Remove `otvalid' from the list of compiled modules.
-
-       * include/freetype/internal/ftserv.h: Add compiler pragmas to get
-       rid of annoying warnings with Visual C++ compiler in maximum warning
-       mode.
-
-       * src/autofit/afhints.c, src/autofit/aflatin.c, src/base/ftstroke.c,
-       src/bdf/bdfdrivr.c, src/cache/ftcbasic.c, src/cache/ftccmap.c,
-       src/cache/ftcmanag.c, src/cff/cffload.c, src/cid/cidload.c,
-       src/lzw/zopen.c, src/otvalid/otvgdef.c, src/pcf/pcfread.c,
-       src/sfnt/sfobjs.c, src/truetype/ttgxvar.c: Remove compiler warnings.
-
-2005-04-28  Werner Lemberg  <wl@gnu.org>
-
-       * docs/TODO: Updated.
-
-2005-04-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/otvalid/otvcommn.c
-       (otv_GSUBGPOS_have_MarkAttachmentType_flag): Handle table == 0.
-
-2005-04-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_face_init): Set default upem value in top
-       font dict also.
-       Handle font matrix settings in subfonts.
-
-       * src/cff/cffgload.c (cff_slot_load): Use the correct font matrix
-       for CID-keyed fonts with subfonts.
-
-       * docs/formats.txt: Updated.
-
-2005-04-14  Kirill Smelkov  <kirr@mns.spb.ru>
-
-       * include/freetype/freetype.h (FT_Vector_Transform),
-       include/freetype/ftimage.h (FT_Raster_Params),
-       include/freetype/ftoutln.h, src/base/ftoutln.c (FT_Outline_Get_CBox,
-       FT_Outline_Copy, FT_Outline_Transform, FT_Vector_Transform,
-       FT_Outline_Get_Bitmap), src/raster/ftraster.c (ft_black_render),
-       src/smooth/ftgrays.c (gray_raster_render): Decorate parameters with
-       `const' where appropriate.
-
-2005-04-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_charstrings): Catch this non-standard
-       beginning of the /CharStrings dictionary:
-
-         /CharStrings 118 dict def
-         Private begin
-         CharStrings begin
-
-       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Fix arguments
-       to call of tt_sbit_decoder_load_bitmap.
-
-2005-04-13  Werner Lemberg  <wl@gnu.org>
-
-       * docs/TODO: Updated.
-
-       * autogen.sh: Use `--force' for all commands.
-
-2005-04-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshalgo.c (ps_hints_apply): Change scaling values
-       only if `fitted' is not zero.
-
-2005-04-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (tt_face_get_metrics) [FT_OPTIMIZE_MEMORY]:
-       Fix typo which sometimes causes wrong metrics for the last glyph.
-
-2005-04-04  David Turner  <david@freetype.org>
-
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       (FT_OPTIMIZE_MEMORY): Comment out this macro for the upcoming 2.1.10
-       release.
-       (*_CHESTER_*): Removed.  No longer used.
-
-       * src/autofit/afhints.c (af_axis_hints_new_segment,
-       af_axis_hints_new_edge): Small tweak to use less heap memory.
-
-2005-04-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1parse.c (T1_New_Parser): Relax the check for a valid
-       first line in the font.
-
-2005-04-03  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES, include/freetype/freetype.h: Improve documentation
-       of FT_Set_Pixel_Sizes and FT_Set_Char_Size.
-
-2005-03-26  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/src/base/ftsystem.c (ft_amiga_stream_io): Fix buffer
-       offsets after a large read.
-
-2005-03-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/afglobal.c (af_face_globals_get_metrics):
-       s/index/gidx/.
-
-       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Fix compiler
-       warnings.
-
-       * src/sfnt/rules.mk (SFNT_DRV_SRC): Add ttsbit0.c.
-
-       * src/sfnt/ttsbit0.h: Dummy file for build with `make'.
-
-2005-03-26  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       Update of the Amiga port.
-
-       * builds/amiga/makefile, builds/amiga/makefile.os4,
-       builds/amiga/smakefile: Included the base extension files
-       (ftbitmap.c, ftotval.c, ftpfr.c, ftstroke.c, ftxf86.c).
-
-2005-03-25  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       Update of the Amiga port.
-
-       * builds/amiga/makefile, builds/amiga/smakefile: Handle new modules.
-
-       * builds/amiga/makefile.os4: Makefile for AmigaOS4 SDK.
-
-       * builds/amiga/README: Updated.
-
-       * builds/amiga/include/freetype/config/ftconfig.h: Handle gcc for
-       AmigaOS4.
-
-       * builds/amiga/include/freetype/config/ftmodule.h: Handle new
-       modules.
-
-       * builds/amiga/src/base/ftdebug.c: Updated to current version of
-       default ftdebug.c.
-       Add various include files and macros to have proper support for
-       both AmigaOS4 and older AmigaOS versions.
-       Don't declare KVPrintF explicitly.
-       Replace getenv with GetVar.
-       Actually enable debugging code.
-
-       * builds/amiga/src/base/ftsystem.c: Major rewrite.
-
-2005-03-23  Werner Lemberg  <wl@gnu.org>
-
-       * tests/*: Removed.
-
-2005-03-23  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES, docs/INSTALL.ANY: Updated.
-
-       * include/freetype/ftmoderr.h: Replace `Autohint' with `Autofit'.
-       Add `OTvalid'.
-
-       * src/autofit/aferrors.h: New file.
-
-       * src/autofit/afglobal.c, src/autofit/afhints.c,
-       src/autofit/aflatin.c, src/autofit/afloader.c: s/FT_Err_/AF_Err_/.
-       Include aferrors.h.
-
-       * src/autofit/rules.mk (AUTOF_DRV_H): Include aferrors.h.
-
-       * src/otvalid/otverror.h: s/FT_Mod_Err_OTV/FT_Mod_Err_OTvalid/.
-
-2005-03-22  David Turner  <david@freetype.org>
-
-       * src/autohint/*: Removed.
-       * Jamfile: Updated.
-
-2005-03-15  David Turner  <david@freetype.org>
-
-       * src/bdf/bdflib.c: Remove compiler warnings.
-       (hash_rehash, hash_init): Don't call FT_MEM_ZERO.
-       (_bdf_list_t): Add `memory' field.
-       (_bdf_list_init, _bdf_list_done, _bdf_list_ensure): New functions.
-       (_bdf_shift, _bdf_join): Rename to...
-       (_bdf_list_shift, _bdf_list_join): This.
-       (_bdf_split): Renamed to...
-       (_bdf_list_split): This.  Use new functions.
-       (bdf_internal_readstream): Removed.
-       (NO_SKIP): New macro.
-       (_bdf_readstream): Rewritten.
-       (bdf_create_property, _bdf_add_comment): Improve allocation.
-       (_bdf_set_default_spacing, _bdf_parse_glyphs): Updated.  Improve
-       allocation.
-       (_bdf_parse_properties, _bdf_parse_start): Updated.
-       (bdf_load_font): Updated to use new functions.
-
-       * src/type1/t1parse.c (check_type1_format): New function.
-       (T1_New_Parser): Use it to check font header before allocating
-       anything on the heap.
-
-       * src/type42/t42parse.c (t42_parser_init): Modify functions to check
-       the font header before allocating anything on the heap.
-
-       * include/freetype/internal/ftmemory.h (FT_ARRAY_MAX,
-       FT_ARRAY_CHECK): New macros.
-
-       * src/base/ftstream.c (FT_Stream_TryRead): New function.
-       * include/freetype/internal/ftstream.h: Updated.
-
-       * src/pcf/pcfread.c (pcf_read_TOC), src/pcf/pcfutil.c
-       (BitOrderInvert, TwoByteSwap, FourByteSwap): Minor fixes and
-       simplifications.  Try to protect the PCF driver from doing stupid
-       things with broken fonts.
-
-       * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Check the LZW header before
-       doing anything else.  This avoids unnecessary heap allocations
-       (400KByte of heap memory for the LZW decoder).
-
-       * src/gzip/ftgzip.c (FT_Stream_OpenGZip): Ditto for the gzip
-       decoder, although the code savings are smaller.
-
-       * docs/CHANGES: Updated.
-
-2005-03-10  David Turner  <david@freetype.org>
-
-       * src/tools/glnames.py: Add comment to explain the compression
-       being used for the Adobe Glyph List.
-
-2005-03-10  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttpload.c (tt_face_load_cvt, tt_face_load_fpgm):
-       Fix serious typo which prevented correct TT rendering.
-
-       * include/freetype/internal/ftmemory.h: Undo change from 2005-03-03.
-       To suppress warnings it is sufficient to use `-fno-strict-aliasing'.
-
-2005-03-10  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/glnames.py: Formatted.
-       Format output to be in sync with other FreeType code.
-       Import `re' and `os.path'.
-       (StringTable) <__init__>: Add parameter to initialize master table
-       name.
-       (StringTable) <dump>: Don't pass master table name.
-       (StringTable) <dump_sublist>: Emit explanatory comment.
-       Simplify and make output more human readable.
-       (t1_bias, glyph_list, adobe_glyph_names): Removed.  Unused.
-       (main): Use `basename' for file name in header.
-
-       * src/psnames/pstables.h: Regenerated.
-
-2005-03-09  David Turner  <david@freetype.org>
-
-       * src/tools/glnames.py: Rewrite the generator for the `pstables.h'
-       header file which contains various constant tables related to glyph
-       names.  It now uses a different, more compact storage scheme that
-       saves about 20KB.  This also closes Savannah bug #12262.
-
-       * src/psnames/pstables.h: Regenerated.
-
-       * src/psnames/psmodule.c (ps_unicode_value): Use
-       `ft_get_adobe_glyph_index', a new function defined in `pstables.h'.
-       (ps_get_macintosh_name, ps_get_standard_strings): Updated.
-
-       * src/base/ftobjs.c (FT_Set_Char_Sizes): Handle fractional sizes
-       more carefully.  This fixes Savannah bug #12263.
-
-2005-03-06  David Turner  <david@freetype.org>
-
-       * src/otvalid/otvgsub.c, src/otvalid/otvgpos.c: Make static tables
-       constant.
-
-       * src/autofit/aflatin.c (af_latin_metrics_init): Fix Savannah bug
-       #12212 (auto-hinter refuses to work if no Unicode charmap in font).
-
-2005-03-05  Werner Lemberg  <wl@gnu.org>
-
-       * autogen.sh: New script for bootstrapping.
-
-       * README.CVS: New file which documents bootstrapping.
-
-       * builds/unix/aclocal.m4, builds/unix/config.guess,
-       builds/unix/config.sub, builds/unix/configure,
-       builds/unix/ltmain.sh: Removed.
-
-2005-03-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftutil.c: Include FT_INTERNAL_OBJECTS_H.
-
-2005-03-03  Werner Lemberg  <wl@gnu.org>
-
-       Various fixes for C and C++ compiling.
-
-       * src/autofit/*: Add copyright messages.
-
-       * src/autofit/afhints.c (af_glyph_hints_done): Don't use
-       `AF_Dimension' but `int' for loop counter.
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_widths): Don't use
-       `AF_Dimension' but `int' for loop counter.
-       Use proper enumeration value for `render_mode'.
-       (af_latin_metrics_scale_dim): Don't shadow variables.
-       (af_latin_hints_compute_segments): Use proper cast for `major_dir'
-       and `segment_dir'.
-       (af_latin_align_linked_edge, af_latin_hint_edges): Fix arguments of call to
-       `af_latin_compute_stem_width'.
-       (af_latin_hints_apply): Don't use `AF_Dimension' but `int' for loop
-       counter.
-
-       * src/base/ftdbgmem.c (ft_mem_table_get_source, FT_DumpMemory): Use
-       proper cast for memory allocation.
-
-       * src/cff/cffdrivr.c (cff_get_kerning): Use proper cast for
-       initialization of `sfnt'.
-
-       * src/sfnt/sfdriver.c: Include `ttkern.h'.
-
-       * src/sfnt/ttkern.c (tt_face_get_kerning): Don't shadow variables.
-
-       * src/truetype/ttgload.c: Include `ttpload.h'.
-
-2005-03-03  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/ftmemory.h (FT_ALLOC, FT_REALLOC,
-       FT_QALLOC, FT_QREALLOC) [gcc >= 3.3]: Provide macro versions which
-       avoid compiler warnings.
-       (FT_NEW, FT_NEW_ARRAY, FT_RENEW_ARRAY, FT_QNEW, FT_QNEW_ARRAY,
-       FT_QRENEW_ARRAY, FT_ALLOC_ARRAY, FT_REALLOC_ARRAY): Updated.
-
-       * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
-       FT_FACE_FIND_GLOBAL_SERVICE, FT_FACE_LOOKUP_SERVICE) [__cplusplus]:
-       Provide macro versions which avoid compiler warnings.
-
-       * src/base/ftutil.c (ft_highpow2): New utility function.
-
-       * include/freetype/internal/ftobjs.h: Updated.
-
-       * src/pfr/pfrload.c (pfr_get_gindex, pfr_compare_kern_pairs,
-       pfr_sort_kerning_pairs): Don't define if FT_OPTIMIZE_MEMORY is set.
-       (pfr_phy_font_done): Don't handle `kern_pairs' if FT_OPTIMIZE_MEMORY
-       is set.
-       (pfr_phy_font_load): Don't call `pfr_sort_kerning_pairs' if
-       FT_OPTIMIZE_MEMORY is set.
-
-       * src/pfr/pfrobjs.c (pfr_slot_load): Comment out some code which
-       doesn't work with broken fonts.
-       (pfr_face_get_kerning) [FT_OPTIMIZE_MEMORY]: Implement.
-
-       * src/pfr/pfrtypes.h (PFR_KernItemRec): Optimize member types.
-       (PFR_NEXT_KPAIR): New macro.
-       (PFR_PhyFontRec): Don't define `kern_pairs' if FT_OPTIMIZE_MEMORY is
-       set.
-
-       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Introduce
-       temporary variable to avoid gcc warning.
-       (tt_face_load_sbit_image): Mark unused variables with FT_UNUSED.
-
-       * src/truetype/ttpload.c (tt_face_load_loca) [FT_OPTIMIZE_MEMORY]:
-       Remove redundant variable.
-
-       * include/freetype/config/ftmodule.h: Moving the order of drivers to
-       speed up font loading.  The PCF and BDF loaders are still slow and
-       consume far too much memory.
-
-2005-03-03  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h: Updated to recent changes.
-
-2005-03-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/afdummy.c, src/autofit/afdummy.h
-       (af_dummy_script_class): Fix type.
-
-       * src/autofit/aflatin.c, src/autofit/aflatin.h
-       (af_latin_script_class): Fix type.
-
-       * src/autofit/rules.mk (AUTOF_DRV_SRC): Fix typo.
-
-2005-03-01  David Turner  <david@freetype.org>
-
-       * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning),
-       src/sfnt/ttsbit0.c (tt_face_load_sbit_strikes,
-       tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_compound,
-       tt_sbit_decoder_load_image), src/sfnt/ttload.c
-       (tt_face_load_metrics): Remove compiler warnings
-       -- redundant variables, missing initializations, etc.
-
-       * src/sfnt/ttsbit.h: Handle FT_OPTIMIZE_MEMORY.
-
-       * src/autofit/rules.mk, src/autofit/module.mk,
-       src/autofit/afangles.h: New files.
-
-       * src/autofit/afhints.c (af_axis_hints_new_segment,
-       af_axis_hints_new_edge): New functions.
-       (af_glyph_hints_done): Do proper deallocation.
-       (af_glyph_hints_reload): Only reallocate points array.  This
-       drastically reduces heap usage.
-
-       * src/autofit/afhints.h (AF_PointRec, AF_SegmentRec): Optimize
-       member types and positions.
-       (AF_AxisHintsRec): Add `max_segments' and `max_edges'.
-       (af_axis_hints_new_segment, af_axis_hints_new_edge): New prototypes.
-
-       * src/autofit/aflatin.c (af_latin_metricsc_scale): Don't call
-       AF_SCALER_EQUAL_SCALES.
-       (af_latin_hints_compute_segments): Change return type to FT_Error.
-       Update all callers.
-       Improve segment allocation.
-       (af_latin_hints_compute_edges): Change return type to FT_Error.
-       Update all callers.
-       Improve edge allocation and link handling.
-       (af_latin_hints_detect_features): Change return type to FT_Error.
-       Update all callers.
-
-       * src/autofit/aflatin.h: Updated.
-
-       * src/autofit/afloader.c (af_loader_load_g)
-       <FT_GLYPH_FORMAT_OUTLINE>: Assure axis->num_edges > 1.  This fixes
-       a bug with certain fonts.
-
-       * include/freetype/config/ftmodule.h: The auto-fitter is now the
-       only supported auto-hinting module.
-
-       * include/freetype/config/ftstdlib.h (FT_INT_MAX): New macro.
-
-2005-02-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttpload.c (tt_face_load_loca): Fix typo.
-
-       * src/sfnt/ttkern.c: Include `ttkern.h'.
-       (FT_COMPONENT): Updated.
-
-       * include/freetype/internal/fttrace.h: Add entry for `ttkern'.
-
-       * src/sfnt/ttsbit0.c: s/FT_Err_/SFNT_Err_/.
-       Decorate constants with `U' and `L' where necessary.
-
-       * src/sfnt/ttcmap.c (tt_cmap4_next): Remove unused variable.
-
-2005-02-28  David Turner  <david@freetype.org>
-
-       * src/base/ftdbgmem.c (FT_DumpMemory): Added sorting of memory
-       sources according to decreasing maximum cumulative allocations.
-       (ft_mem_source_compare): New auxiliary function.
-
-       * src/sfnt/ttsbit0.c: New file, implementing a heap-optimized
-       embedded bitmap loader.
-
-       * src/sfnt/ttsbit.c: Include `ft2build.h', FT_INTERNAL_DEBUG_H,
-       FT_INTERNAL_STREAM_H, FT_TRUETYPE_TAGS_H.
-       Load `ttsbit0.c' if FT_OPTIMIZE_MEMORY is set, otherwise use
-       file contents.
-       (tt_face_load_sbit_strikes): Set up root fields to indicate the
-       strikes.  This fixes Savannah bug #12107.
-       Use `static' keyword for `sbit_line_metrics_field',
-       `strike_start_fields', `strike_end_fields'.
-
-       * include/freetype/internal/tttypes.h (TT_FaceRec): Define
-       `sbit_table', `sbit_table_size', `sbit_num_strikes' if
-       FT_OPTIMIZE_MEMORY is set.
-       Don't define `num_sbit_strikes' and `sbit_strikes' if
-       FT_OPTIMIZE_MEMORY is set.
-
-       * src/cff/cffobjs.c (sbit_size_reset): Handle FT_OPTIMIZE_MEMORY.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Fixed bug that prevented
-       loading SFNT fonts without a `kern' table.
-       Properly pass root->face_flags.
-       Remove code for TT_CONFIG_OPTION_EMBEDDED_BITMAPS.
-
-       * src/sfnt/sfdriver.c (sfnt_interface)
-       [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Don't use `tt_find_sbit_image'
-       and `tt_load_sbit_metrics'.
-
-       * src/sfnt/ttcmap.c: Optimize linear charmap scanning for Format 4.
-       (OPT_CMAP4): New macro.
-       (TT_CMap4Rec) [OPT_CMAP4]: New structure.
-       (tt_cmap4_init, tt_cmap4_set_range, tt_cmap4_next, tt_cmap4_reset)
-       [OPT_CMAP4]: New functions.
-       (tt_cmap4_char_next) [OPT_CMAP4]: Use `tt_cmap4_next' and
-       `tt_cmap4_reset'.
-       (tt_cmap4_class_rec) [OPT_CMAP4]: Use `TT_CMap4Rec' and
-       `tt_cmap4_init'.
-
-       * src/truetype/ttobjs.c (Reset_SBit_Size): Handle
-       FT_OPTIMIZE_MEMORY.
-
-       * src/autofit/afhints.h (AF_PointRec, AF_SegmentRec, AF_EdgeRec):
-       Optimize member types.
-
-       * src/autofit/afloader.c (af_loader_done): Call
-       `af_glyph_hints_done'.
-
-2005-02-27  David Turner  <david@freetype.org>
-
-       * src/sfnt/ttkern.c (tt_face_load_kern): Fix a small bug which
-       caused invalid (random) return values for the horizontal kerning.
-
-2005-02-25  David Turner  <david@freetype.org>
-
-       Implement several memory optimizations to drastically reduce the
-       heap usage of FreeType, especially in the case of memory-mapped
-       files.  The idea is to avoid loading and decoding tables in the
-       heap, and instead access the raw data whenever possible (i.e., when
-       it doesn't compromise performance).
-
-       This has several benefits: For example, opening vera.ttf now uses
-       just a small amount of memory (even when the FT_Library footprint is
-       accounted for), until you start loading glyphs.  Even then, you save
-       at least 20KB compared to the non-optimized case.  Performance of
-       various operations, including open and close, has also been
-       dramatically improved.
-
-       More optimizations to come, especially for the auto-hinter.
-
-       * include/freetype/internal/sfnt.h (TT_Face_GetKerningFunc): New
-       function type.
-       (SFNT_Interface): Add it.
-
-       * include/freetype/internal/tttypes.h (TT_HdmxEntryRec, TT_HdmxRec,
-       TT_Kern0_PairRec): Don't define if FT_OPTIMIZE_MEMORY is set.
-       (TT_FaceRec): Define `horz_metrics', `horz_metrics_size',
-       `vert_metrics', `vert_metrics_size', `hdmx_table',
-       `hdmx_table_size', `hdmx_record_count', `hdmx_record_size',
-       `hdmx_record_sizes', `kern_table', `kern_table_size,
-       `num_kern_tables', `kern_avail_bits', `kern_order_bits' if
-       FT_OPTIMIZE_MEMORY is set.
-       Don't define `hdmx', `num_kern_pairs', `kern_table_index',
-       `kern_pairs' if FT_OPTIMIZE_MEMORY is set.
-
-       * src/base/ftdbgmem.c (ft_mem_table_set): Don't shadow variable.
-       Fix compiler warning.
-
-       * src/cff/cffdrivr.c (Get_Kerning): Renamed to...
-       (cff_get_kerning): This.  Simplify.
-       (cff_driver_class): Updated.
-
-       * src/sfnt/Jamfile (_sources): Add `ttkern'.
-       * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttkern.c'.
-
-       * src/sfnt/sfdriver.c (sfnt_interface): Add `tt_face_get_kerning'.
-
-       * src/sfnt/sfnt.c: Include `ttkern.c'.
-
-       * src/sfnt/sfobjs.c: Include `ttkern.h'.
-       (sfnt_load_face): Consider the `kern' and `gasp' table as optional.
-       (sfnt_done_face): Call `tt_face_done_kern'.
-       Handle horizontal metrics for FT_OPTIMIZE_MEMORY.
-
-       * src/sfnt/ttkern.c, src/sfnt/ttkern.h: New files.  Code has been
-       taken from `ttload.c' and `ttload.h'.
-       Provide special versions of `tt_face_load_kern',
-       `tt_face_get_kerning', and `tt_face_done_kern' for
-       FT_OPTIMIZE_MEMORY.
-
-       * src/sfnt/ttload.c (tt_face_load_metrics, tt_face_load_hdmx,
-       tt_face_free_hdmx): Provide version for FT_OPTIMIZE_MEMORY.
-       (tt_face_load_kern, tt_kern_pair_compare, TT_KERN_INDEX): Moved to
-       `ttkern.c'.
-
-       * src/sfnt/ttload.h: Updated.
-
-       * src/sfnt/ttsbit.c (sbit_metrics_field): Add `static' keyword.
-
-       * src/truetype/ttdriver.c (Get_Kerning): Renamed to...
-       (tt_get_kerning): This.  Simplify.
-       (tt_driver_class): Updated.
-
-       * src/truetype/ttgload.c (TT_Get_Metrics): Renamed to...
-       (tt_face_get_metrics): This.  Provide version for FT_OPTIMIZE_MEMORY.
-       Update all callers.
-       (Get_Advance_Widths): Replaced with...
-       (Get_Advance_WidthPtr): This.  Provide version for
-       FT_OPTIMIZE_MEMORY.
-       Update all callers.
-
-       * src/truetype/ttgload.h: Updated.
-
-2005-02-22  David Turner  <david@freetype.org>
-
-       * src/base/ftdbgmem.c: Partly rewritten.  Added the ability to list
-       all allocation sites in the memory debugger.  Also a new function
-       FT_DumpMemory() was added.  It is only available in builds with
-       FT_DEBUG_MEMORY defined, and you must declare it in your own code to
-       use it, i.e., with something like:
-
-         extern void FT_DumpMemory( FT_Memory );
-
-         ...
-
-         FT_DumpMemory( memory );
-
-       * include/freetype/config/ftoption.h
-       (TT_CONFIG_OPTION_BYTECODE_INTERPRETER): Comment out definition --
-       again.
-       (FT_OPTIMIZE_MEMORY): New configuration macro to control various
-       optimizations for reducing the heap footprint of memory-mapped
-       TrueType files.
-
-       * include/freetype/internal/ftmemory.h (FT_ARRAY_ZERO): New
-       convenience macro.
-
-       * include/freetype/internal/tttypes.h (TT_FaceRec)
-       [FT_OPTIMIZE_MEMORY]: Use optimized types for `num_locations' and
-       `glyph_locations'.
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Call
-       `tt_face_get_location'.
-
-       * src/truetype/ttobjs.c (tt_face_init)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Improve error handling.
-       (tt_face_done): Call `tt_face_done_loca'.
-
-       * src/truetype/ttpload.c (tt_face_get_location, tt_face_done_loca):
-       New functions.  If FT_OPTIMIZE_MEMORY is set, the locations table is
-       read directly from memory-mapped streams, instead of being decoded
-       into the heap.
-       (tt_face_load_loca) [FT_OPTIMIZE_MEMORY]: New implementation.
-       (tt_face_load_cvt, tt_face_load_fpgm): Only load table if the
-       bytecode interpreter is compiled in.
-
-       * src/truetype/ttpload.h: Updated.
-
-       * src/autohint/ahglyph.c (ah_outline_load): Improve allocation
-       logic.
-
-2005-02-20  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
-       --copy' from libtool 1.5.14.
-       * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
-       automake 1.9.4.
-
-       * builds/unix/config.guess, builds/unix/config.sub: Updated from
-       `config' CVS module at subversions.gnu.org.
-
-       * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
-       `texinfo' CVS module at subversions.gnu.org.
-
-2005-02-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffcmap.c (cff_cmap_unicode_init): Don't try to build
-       a cmap for a CID-keyed font which doesn't have SIDs.
-
-2005-02-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (read_binary_data): Return more meaningful
-       value.
-       (parse_encoding, parse_subrs, parse_charstrings, parse_dict): Check
-       parser error value after call to T1_Skip_PS_Token (where necessary).
-
-       * src/type1/t1parse.c (T1_Get_Private_Dict): Check parser error
-       value after call to T1_Skip_PS_Token.
-
-       * src/cid/cidparse.c (cid_parser_new): Check parser error value
-       after call to cid_parser_skip_PS_token.
-
-       * src/type42/t42parse.c (t42_parse_encoding, t42_parse_sfnts,
-       t42_parse_charstrings, t42_parse_dict): Check parser error value
-       after call to T1_Skip_PS_Token (where necessary).
-
-       * src/psaux/psobjc.c (skip_string, ps_parser_skip_PS_token,
-       ps_tobytes): Add error messages.
-
-2005-02-12  Werner Lemberg  <wl@gnu.org>
-
-       * configure: Output more variables to the created Makefile so that
-       it can be used for ft2demos also (if the FT2DEMOS variable is
-       defined).
-
-2005-02-10  David Turner  <david@freetype.org>
-
-       * src/pfr/pfrgload.c (pfr_glyph_load): Fix an unbounded growing
-       dynamic array when loading a glyph from a PFR font (Savannah bug
-       #11921).
-
-       * src/base/ftbitmap.c (FT_Bitmap_Convert): Small improvements to the
-       conversion function (mainly stupid optimization).
-
-       * src/base/Jamfile: Adding ftbitmap.c to the list of compiled files.
-
-2005-02-10  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/freetype-config.in: Add new flag `--ftversion' to
-       return the FreeType version.  Suggested by George Williams
-       <gww@silcom.com>.
-
-       * docs/CHANGES: Updated.
-
-2005-02-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/otvalid/otvmod.c (otv_validate): Deallocate arrays in case
-       of error.  Reported by YAMANO-UCHI Hidetoshi <mer@din.or.jp>.
-
-2005-02-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
-       <op_closepath>: Accept `T1_Parse_Have_Moveto' state also which can
-       happen in empty glyphs.  Reported by Ian Brown
-       <ian.brown@printsoft.de> (Savannah bug #11856).
-
-2005-02-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/*: Removed.  Obsolete.
-
-2004-12-28  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
-       --copy' from libtool 1.5.10.
-       * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
-       automake 1.9.4.
-       * builds/unix/configure: Regenerated with autoconf 2.59b.
-
-       * builds/unix/config.guess, builds/unix/config.sub: Updated from
-       `config' CVS module at subversions.gnu.org.
-
-       * builds/unix/install-sh: Updated from
-       `texinfo' CVS module at subversions.gnu.org.
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Add proper cast for
-       ft_alloc.
-       Fix compiler warning.
-
-2004-12-27  Dirck Blaskey  <listtarget@danbala.com>
-
-       * src/cff/cffobjs.c (cff_face_init): Improve computation of
-       FT_STYLE_BOLD_FLAG.
-
-2004-12-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_face_init): A CFF within an SFNT can have
-       only a single font.  This is undocumented but has been verified on
-       the opentype list.
-
-2004-12-26  Werner Lemberg  <wl@gnu.org>
-
-       * Jamfile (FT2_COMPONENTS): Add `otvalid'.
-
-2004-12-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftbitmap.c (FT_Bitmap_Convert): Fix compiler warning.
-
-2004-12-15  Werner Lemberg  <wl@gnu.org>
-
-       * vms_make.com: Add ftbitmap.obj.
-
-2004-12-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftbitmap.c, include/freetype/ftbitmap.h: New files for
-       handling various bitmap formats.
-
-       * include/freetype/config/ftheader.h (FT_BITMAP_H): New macro.
-
-       * src/base/rules.mk (BASE_EXT_SRC): Add ftbitmap.c.
-
-       * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Don't convert bitmaps to 8bpp
-       but return them as-is.
-
-       * docs/CHANGES: Mention new bitmap API.
-       * include/freetype/ftchapter.s: Updated.
-
-2004-12-11  Robert Clark  <freetype@ratty.org.uk>
-
-       * src/base/ftobjs.c (FT_Get_Kerning): Make kerning amount
-       dependent on ppem by scaling down for ppem < 25, then do normal
-       rounding.  This gives slightly better results than rounding towards
-       zero.
-
-2004-12-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Get_Kerning): Always round towards zero
-       for FT_KERNING_DEFAULT.  This greatly enhances the kerning for
-       small ppem values.
-
-2004-12-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (ft_glyphslot_clear): Reset `lsb_delta' and
-       `rsb_delta'.
-
-2004-12-05  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/install.mk (install): Use $(OBJ_BUILD) for ftconfig.h.
-
-2004-12-03  Antoine Leca  <Antoine-Freetype@Leca-Marti.org>
-
-       * include/freetype/ttnameid.h: Updated to latest
-       specifications from Microsoft.
-
-2004-11-26  Jouk Jansen  <joukj@hrem.stm.tudelft.nl>
-
-       * vms_make.com: Include ftbbox.c.
-       Fix `ccopt'.
-       Handle `otvalid' module.
-       Update `vmslib.dat' default values.
-       Fixes to `libs.opt'.
-
-2004-11-23  Anders Kaseorg  <anders@kaseorg.com>
-
-       * src/base/ftoutln.c (FT_OrientationExtremumRec,
-       ft_orientation_extremum_compute): Removed.
-       (FT_Outline_Get_Orientation): Rewritten, simplified.
-
-       * src/autohint/ahglyph.c: Include FT_OUTLINE_H.
-       (ah_test_extremum, ah_get_orientation): Removed.
-       (ah_outline_load): Use FT_Outline_Get_Orientation.
-
-       * src/base/ftsynth.c (ft_test_extrama, ft_get_orientation): Removed.
-       (FT_GlyphSlot_Embolden): Use FT_Outline_Get_Orientation.
-
-2004-11-23  Fernando Papa  <fpapa@netgate.com.uy>
-
-       * src/truetype/ttinterp.h: Fix typo.
-
-2004-11-22  Antoine Leca  <Antoine-Freetype@Leca-Marti.org>
-
-       * builds/win32/detect.mk: Corrected logic that detects Windows NT to
-       use the previous change even if win32 is forced.  Corrected
-       detection of win32 on Win9X.
-
-       * builds/dos/detect.mk: Added same correction as for win32 about
-       COPY on Windows NT.  Detection of plain DOS 7.x.
-
-2004-11-22  Werner Lemberg  <wl@gnu.org>
-
-       * builds/detect.mk: Undo change from 2004-11-20.
-       * builds/win32/detect.mk: If the `OS' environment variable contains
-       `Windows_NT', use `cmd.exe /c copy' for copying files.
-
-2004-11-20  Werner Lemberg  <wl@gnu.org>
-
-       * builds/detect.mk (dos_setup): Use `cmd.exe' for copying
-       $(CONFIG_MK) to force lowercase file name under Windows.
-
-2004-11-19  Werner Lemberg  <wl@gnu.org>
-
-       Fix a serious bug in the TT hinter.
-
-       * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Don't shift
-       points vertically before hinting.
-
-       * docs/CHANGES: Updated.
-
-       * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily,
-       FTC_GCache_Lookup): A new try to fix comparison with zero.
-
-2004-11-16  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.ac: Add `-fno-strict-aliasing' if gcc is
-       used.
-       * builds/unix/configure: Regenerated.
-       * builds/unix/config.guess, builds/unix/config.sub: Updated from
-       `config' CVS module at subversions.gnu.org.
-
-2004-11-16  Dr. Martin P.J. Zinser  <zinser@decus.de>
-
-       * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily,
-       FTC_GCache_Lookup): Fix comparison with zero.
-
-       * docs/INSTALL.VMS: Updated.
-
-       * vms_make.com: Updated.  All `descrip.mms' files are now created
-       automatically.
-
-       * src/*/descrip.mms: Removed.
-
-2004-11-16  Owen Taylor  <otaylor@redhat.com>
-
-       * builds/unix/freetype-config.in: Suppress -L$libdir for
-       /usr/lib64 as well as /usr/lib.  (Reported by Dan Winship -
-       https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=139199)
-
-2004-11-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffdrivr.c (cff_service_ps_info): Updated.
-       * src/cid/cidriver.c (cid_service_ps_info): Updated.
-       * src/type42/t42drivr.c (t42_ps_get_font_private): New function.
-       (t42_service_ps_info): Updated.
-
-       * src/type42/t42parse.c (t42_parse_dict): Remove compiler warning.
-
-2004-11-11  David Bevan  <dbevan@emtex.com>
-
-       Add new function FT_Get_PS_Font_Private().
-
-       * include/freetype/internal/services/svpsinfo.h
-       (PS_GetFontPrivateFunc): New service function.
-
-       * include/freetype/t1tables.h, src/base/fttype1.c
-       (FT_Get_PS_Font_Private): New function.
-
-       * src/type1/t1driver.c (t1_ps_get_font_private): New function.
-       (t1_service_ps_info): Updated.
-
-2004-10-13  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftstdlib.h: Include `stddef.h'.
-       (ft_ptrdiff_t): Define.
-
-       * include/freetype/fttypes.h (FT_PtrDist): Use `ft_ptrdiff_t'.
-
-       * src/cid/cidload.c (cid_parse_dict), src/type1/t1load.c
-       (parse_dict): Fix compiler warning.
-
-2004-10-11  Joshua Neal  <jneal@csdaily.com>
-
-       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Check for pointer
-       overflow.
-
-       * src/sfnt/ttload.c (tt_face_load_hdmx): Protect against bad input.
-       Don't use FT_QNEW_ARRAY but FT_NEW_ARRAY to make deallocation work
-       in case of failure.
-
-       * src/sfnt/ttsbit.c (Load_SBit_Range): Check range intervals.
-       (tt_face_load_sbit_strikes): Allocate `strike_sbit_ranges' after
-       frame test.
-
-       * src/truetype/ttgload.c (TTLoad_Simple_Glyph): Add assertion for
-       `flag'.
-
-2004-10-09  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2004-10-09  Boris Letocha  <b.letocha@cz.gmc.net>
-
-       Fix handling of NPUSHW if skipped in data stream.
-
-       * src/truetype/ttinterp.c (opcode_length): Set value for NPUSHW
-       to -2.
-       (SkipCode, TT_RunIns): Use opcode_length value for computation of
-       bytes to be skipped.
-
-2004-09-10  Jouk Jansen  <joukj@hrem.stm.tudelft.nl>
-
-       * vms_make.com: Updated.
-
-2004-09-09  Werner Lemberg  <wl@gnu.org>
-
-       Adding OpenType validation module.  The code is based on the
-       (unfinished) `otlayout' module but has been heavily modified to make
-       it much more compact.
-
-       * src/otvalid/*: New module.
-
-       * include/freetype/ftotval.h, src/base/ftotval.c,
-       include/freetype/internal/services/svotval.h: New files.
-
-       * include/freetype/config/ftmodule.h: Add otv_module_class.
-       * include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
-       macro.
-       * include/freetype/internal/ftserv.h
-       (FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
-       * include/freetype/internal/fttrace.h (otvmodule, otvcommon,
-       otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
-
-       * include/freetype/ftchapters.h: Updated.
-
-       * src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
-       src/base/rules.mk (BASE_EXT_SRC): Updated.
-
-       * docs/CHANGES: Updated.
-
-2004-09-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/docmaker/sources.py (re_source_block_format2) <column>:
-       Use lookahead assertion to not match `*/'.  This removes spurious
-       insertions of `/' in the HTML output.
-
-2004-09-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Fix call to
-       FT_NEW_ARRAY.
-
-2004-09-04  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/ftobjs.h: Don't include
-       FT_CONFIG_STANDARD_LIBRARY_H.
-       (FT_Validator, FT_ValidationLevel, FT_ValidatorRec, FT_VALIDATOR,
-       ft_validator_init, ft_validator_run, ft_validator_error, FT_INVALID,
-       FT_INVALID_TOO_SHORT, FT_INVALID_OFFSET, FT_INVALID_FORMAT,
-       FT_INVALID_GLYPH_ID, FT_INVALID_DATA): Move to...
-
-       * include/freetype/internal/ftvalid.h: New file.
-       Make FT_INVALID return module-specific error codes.
-
-       * include/freetype/internal/internal.h (FT_INTERNAL_VALIDATE_H): New
-       macro.
-
-       * include/freetype/fterrors.h: Undefine FT_ERR_PREFIX only if
-       FT_KEEP_ERR_PREFIX isn't defined.
-
-       * src/base/ftobjs.c: Include FT_INTERNAL_VALIDATE_H.
-
-       * src/sfnt/ttcmap.h: Don't include FT_INTERNAL_OBJECTS_H but
-       FT_INTERNAL_VALIDATE_H.
-
-       * src/sfnt/ttcmap.c: Don't include FT_INTERNAL_OBJECTS_H but
-       FT_INTERNAL_VALIDATE_H.
-       Include sferrors.h before FT_INTERNAL_VALIDATE_H.
-       s/FT_Err_Ok/SFNT_Err_Ok/.
-
-       * src/sfnt/sferrors.h: Define FT_KEEP_ERR_PREFIX.
-
-       * src/type1/t1afm.c: Include t1errors.h.
-
-2004-09-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftdebug.c (ft_debug_init): Highest debug level is 7,
-       not 6.
-       * docs/DEBUG: Updated.
-
-2004-08-30  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/tttags.h (TTAG_BASE, TTAG_GDEF, TTAG_GPOS,
-       TTAG_JSTF): New tags.
-
-       * include/freetype/fttypes.h (FT_Bytes, FT_Tag): New typedefs.
-       (FT_Int): Add `signed'.
-
-2004-08-29  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/otlgpos.c (otl_gpos_subtable_validate): Add argument
-       to pass number of lookups.
-       Update all callers.
-       Don't call otl_lookup_list_validate but otl_lookup_validate.
-       (otl_gpos_validate): Call otl_lookup_list_validate instead of
-       otl_gpos_subtable_validate.
-
-       * src/otlayout/otlgpos.h: Updated.
-
-       * src/otlayout/otljstf.c (otl_jstf_max_validate): Add argument to
-       pass number of lookups.
-       Update all callers.
-
-
-       * src/cff/cffparse.c (cff_parse_real): s/exp/exponent/ to avoid
-       compiler warning.
-
-
-       * src/sfnt/ttcmap0.c, src/sfnt/ttcmap0.h: Renamed to...
-       * src/sfnt/ttcmap.c, src/sfnt/ttcmap.h: This.
-       * src/sfnt/Jamfile, src/sfnt/rules.mk, src/sfnt/sfdriver.c,
-       src/sfnt/sfnt.c, src/sfnt/sfobjs.c: Updated.
-
-
-       * builds/compiler/gcc-dev.mk (CFLAGS): Don't add `-Wnested-externs'
-       if compiler is g++ (v3.3.3 emits a warning otherwise).
-
-2004-08-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/otlgpos.c (otl_value_length): Return number of bytes,
-       not number of 16bit entities.
-       (otl_gpos_lookup2_validate): Check class definition tables for
-       format 2.
-       Fix loop for format 2.
-       (otl_liga_mark2_validate): Fix offset for otl_anchor_validate.
-
-2004-08-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftmac.c: Don't include truetype/ttobjs.h.
-       Don't include type1/t1objs.h.
-       (FT_New_Face_From_FSSpec) [!__MWERKS__]: Remove compiler warnings.
-
-2004-08-27  Mathieu Malaterre  <mathieu@malaterre.com>
-
-       * src/base/ftmac.c: Handle OS_INLINE for xlc compiler also.
-
-2004-08-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/otlayout.h: Add copyright.
-       (OTL_INVALID_OFFSET): Removed.
-
-       * src/otlayout/otlgdef.h: Include otlayout.h.
-       Comment out inclusion of otltable.h.
-
-       * src/otlayout/otlgpos.c (otl_gpos_lookup4_validate): Fix call
-       to otl_base_array_validate.
-       (otl_liga_mark2_validate): Fix `for' loop.
-
-       * src/otlayout/otlgsub.c (otl_ligature_validate): Check `glyph_id',
-       not components array.
-
-       * src/otlcommn.c (otl_lookup_get_count, otl_feature_get_count):
-       Comment out.
-       (otl_lookup_list_get_count, otl_feature_list_get_count): Activate.
-       (otl_feature_list_validate, otl_gsubgpos_get_lookup_count):
-       s/otl_lookup_get_count/otl_lookup_list_get_count/.
-       (otl_script_list_validate):
-       s/otl_feature_get_count/otl_feature_list_get_count/.
-       (otl_script_validate): Call otl_lang_validate for default language.
-
-       * src/otlayout/otlcommn.h: Updated.
-
-2004-08-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/otlgpos.c (otl_gpos_lookup1_validate,
-       otl_gpos_lookup2_validate, otl_gpos_lookup3_validate,
-       otl_gpos_lookup4_validate, otl_gpos_lookup5_validate,
-       otl_gpos_lookup6_validate, otl_gpos_lookup9_validate,
-       otl_gpos_validate): Update
-       function arguments.
-       (otl_gpos_lookup7_validate, otl_gpos_lookup8_validate): Update
-       function arguments.
-       Handle NULL offsets correctly.
-       Check sequence and lookup indices for format 3.
-       (otl_pos_rule_validate, otl_chain_pos_rule_validate): Add argument
-       to pass lookup count.
-       Check sequence and glyph indices.
-       (otl_gpos_subtable_validate): Update function arguments.
-       Update callers.
-
-       * src/otlayout/otlgpos.h: Updated.
-
-       * src/otlayout/otlgsub.c (otl_gsub_lookup1_validate,
-       otl_gsub_lookup3_validate, otl_gsub_lookup8_validate): Update
-       function arguments.
-       Add glyph index checks.
-       (otl_sequence_validate, otl_alternate_set_validate,
-       otl_ligature_validate): Add argument to pass glyph count.
-       Update callers.
-       Add glyph index check.
-       (otl_gsub_lookup2_validate, otl_gsub_lookup4_validate): Update
-       function arguments.
-       (otl_ligature_set_validate): Add argument to pass glyph count.
-       Update caller.
-       (otl_sub_class_rule_validate,
-       otl_sub_class_rule_set_validate): Removed.
-       (otl_sub_rule_validate, otl_chain_sub_rule_validate): Add argument
-       to pass lookup count.
-       Update callers.
-       Add lookup index check.
-       (otl_sub_rule_set_validate, otl_chain_sub_rule_set_validate): Add
-       argument to pass lookup count.
-       Update callers.
-       (otl_gsub_lookup5_validate): Update function arguments.
-       Handle NULL offsets correctly.
-       Don't call otl_sub_class_rule_set_validate but
-       otl_sub_rule_set_validate.
-       Check sequence and lookup indices for format 3.
-       (otl_gsub_lookup6_validate): Update function arguments.
-       Handle NULL offsets correctly.
-       Check sequence and lookup indices for format 3.
-       (otl_gsub_lookup7_validate, otl_gsub_validate): Update function
-       arguments.
-
-       * src/otlayout/otlgsub.h: Updated.
-
-       * src/otlayout/otlbase.c (otl_base_validate): Handle NULL offsets
-       correctly.
-
-       * src/otlayout/otlcommn.c (otl_class_definition_validate): Fix
-       compiler warning.
-       (otl_coverage_get_first, otl_coverage_get_last): New functions.
-       (otl_lookup_validate): Add arguments to pass lookup and glyph
-       counts.
-       Update callers.
-       (otl_lookup_list_validate): Add argument to pass glyph count.
-       Update callers.
-
-       * src/otlayout/otlcommn.h: Updated.
-
-       * src/otlayout/otljstf.c (otl_jstf_extender_validate,
-       otl_jstf_max_validate, otl_jstf_script_validate,
-       otl_jstf_priority_validate, otl_jstf_lang_validate): Add parameter
-       to validate glyph indices.
-       Update callers.
-       (otl_jstf_validate): Add parameter which specifies number of glyphs
-       in font.
-
-       * src/otlayout/otljstf.h: Updated.
-
-2004-08-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/otlgpos.c (otl_liga_mark2_validate): Add parameter
-       to handle possible NULL values properly.
-       Update all callers.
-
-2004-08-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/gpos.c: Rename counting variables to be more
-       meaningful.
-       Add copyright.
-       (otl_liga_attach_validate): Renamed to...
-       (otl_liga_mark2_validate): This.
-       Update all callers.
-       (otl_mark2_array_validate): Removed.
-       (otl_gpos_lookup6_validate): Call otl_liga_mark2_validate, not
-       otl_mark2_array_validate.
-       (otl_pos_class_set_validate, otl_pos_class_rule_validate): Removed.
-       (otl_gpos_lookup7_validate): Complete code for format 2.
-       (otl_chain_pos_class_rule_validate,
-       otl_chain_pos_class_set_validate): Removed.
-       (otl_gpos_lookup8_validate): Don't call
-       otl_chain_pos_class_set_validate but
-       otl_chain_pos_rule_set_validate.
-       Simplify some code.
-
-       * src/otlayout/otlgpos.h: Add copyright.
-
-2004-08-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/otljstf.c (otl_jstf_gsub_mods_validate): Removed.
-       (otl_jstf_gpos_mods_validate): Renamed to...
-       (otl_jstf_gsubgpos_mods_validate): This.
-       Test whether lookup_count is zero.
-       (otl_jstf_priority_validate): Use otl_jstf_gsubgpos_mods_validate.
-       (otl_jstf_validate): Initialize gsub_lookup_count and
-       gpos_lookup_count if gsub or gpos is zero.
-
-       * src/otlayout/otlgsub.c: Rename counting variables to be more
-       meaningful.
-       Add copyright.
-       (otl_gsub_lookup1_validate): Simplify code.
-       (otl_gsub_lookup2_validate, otl_gsub_lookup3_validate,
-       otl_gsub_lookup4_validate, otl_gsub_lookup7_validate): Remove unused
-       variables.
-       (otl_gsub_lookup5_validate): Remove unused variable.
-       Fix call to otl_sub_rule_set_validate and
-       otl_sub_class_rule_set_validate.
-       (otl_chain_sub_class_rule_validate,
-       otl_chain_sub_class_set_validate): Removed.
-       (otl_gsub_lookup6_validate): Remove unused variable.
-       Fix call to otl_chain_sub_rule_set_validate.
-       (otl_gsub_lookup7_validate): Handle lookup type 8 also.
-       (otl_gsub_lookup8_validate: New function.
-       (otl_gsub_lookup1_apply, otl_gsub_lookup2_apply,
-       otl_gsub_lookup3_apply): Commented out.
-       (otl_gsub_validate_funcs): Add otl_gsub_lookup7_validate and
-       otl_gsub_lookup8_validate.
-       (otl_gsub_validate): Updated.
-
-       * src/otlayout/otlgsub.h: Add copyright.
-
-       * src/otlayout/otlcommn.c, src/otlayout/otlcommn.h
-       (otl_coverage_get_index): Comment out.
-
-2004-08-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/otlcommn.c (otl_gsubgpos_get_lookup_count): New
-       function.
-       * src/otlayout/otlcommn.h: Updated.
-
-       * src/otlayout/otlbase.c: Rename counting variables to be more
-       meaningful.
-       Add copyright message.
-       * src/otlayout/otlbase.h: Add copyright message.
-
-       * src/otlayout/otlgdef.c: Rename counting variables to be more
-       meaningful.
-       Add copyright message.
-       Use OTL_CHECK everywhere.
-       (otl_caret_value_validate): Remove unused variable.
-       (otl_gdef_validate): All tables are optional.
-       * src/otlayout/otlgdef.h: Add copyright message.
-
-       * src/otlayout/otljstf.c: Rename counting variables to be more
-       meaningful.
-       Add copyright message.
-       (otl_jstf_gsub_mods_validate, otl_jstf_gpos_mods_validate): Add
-       parameter to pass lookup count.
-       Update all callers.
-       Check lookup array.
-       (otl_jstf_max_validate):
-       s/otl_gpos_subtable_check/otl_gpos_subtable_validate/.
-       (otl_jstf_priority_validate, otl_jstf_lang_validate,
-       otl_jstf_script_validate): Add two parameters to pass lookup counts.
-       Update all callers.
-       (otl_jstf_validate): Add two parameters to pass GPOS and GSUB
-       table offsets; use otl_gsubgpos_get_lookup_count to convert extract
-       lookup counts.
-       Fix typo.
-       * src/otlayout/otljstf.h: Updated.
-       Add copyright message.
-
-       * src/otlayout/otlgpos.c (otl_gpos_subtable_validate): New function.
-       (otl_gpos_validate): Use it.
-       * src/otlayout/otlgpos.h: Updated.
-
-2004-08-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/otcommn.c: Use OTL_CHECK everywhere.
-       (otl_coverage_validate): Initialize `p',
-       s/count/num_glyphs/.
-       s/start_cover/start_coverage/.
-       (otl_coverage_get_index): Return OTL_Long, not OTL_Int.
-       Remove unused variables.
-       (otl_class_definition_validate): s/count/num_glyphs/.
-       Remove unused variables.
-       (otl_class_definition_get_value, otl_device_table_get_start,
-       otl_device_table_get_end, otl_device_table_get_delta,
-       otl_lookup_get_table, otl_lookup_list_get_count,
-       otl_lookup_list_get_lookup, otl_lookup_list_get_table,
-       otl_feature_get_lookups, otl_feature_list_get_count,
-       otl_feature_list_get_feature, otl_lang_get_count,
-       otl_lang_get_req_feature, otl_lang_get_features): Commented out
-       temporarily until we really need it.
-       (otl_lookup_validate): Removed.
-       (otl_lookup_table_validate): Renamed to ...
-       (otl_lookup_validate): This.  Update callers.
-       (otl_lookup_list_validate): Remove already commented out definition
-       and move the other definition up.
-       (otl_feature_validate): Add parameter to pass number of lookups.
-       Update callers.
-       Check lookup indices.
-       (otl_feature_list_validate): Add parameter to pass lookup table.
-       Update callers.
-       (otl_lang_validate): Add parameter to pass number of features.
-       Update callers.
-       Handle req_feature and check feature indices.
-       (otl_script_validate): Add parameter to pass number of features.
-       Update callers.
-       (otl_script_list_validate): Add parameter to pass feature table.
-       Update callers.
-
-       * src/otlayout/otcommn.h: s/LOCALDEF/LOCAL/.
-       Comment out the same functions as in otcommn.c.
-       (otl_script_list_get_script): Removed.
-
-       * src/otlayout/otlgsub.c (otl_gsub_lookup1_apply): Change `index' to
-       type OTL_Long.
-       (otl_gsub_lookup2_apply, otl_gsub_lookup3_apply): Change `index' to
-       type OTL_Long.
-       Fix test.
-       (otl_gsub_validate): Fix order of validation.
-
-       * src/otlayout/otlgpos.c (otl_gpos_validate): Fix order of
-       validation.
-
-2004-08-12  Werner Lemberg  <wl@gnu.org>
-
-       Make otlayout module compile (without actually working).
-
-       * src/otlayout/*: s/OTL_Valid/OTL_Validator/.
-       s/NULL/0/.
-
-       * src/otlayout/otlayout.h: Fix various typos.
-       (OTL_Bool): New typedef.
-       (OTL_Int, OTL_Long, OTL_Int16, OTL_Int32): Use `signed' keyword.
-       (OTL_Err_InvalidArgument): Removed.
-       (OTL_Err_InvalidData, OTL_Err_InvalidSize): New enum values.
-       (OTL_MAKE_TAG): Add missing parenthesis.
-       (OTL_INVALID_DATA): Use OTL_Err_InvalidData.
-       (OTL_INVALID_TOO_SHORT): Use OTL_Err_InvalidSize.
-       (OTL_INVALID_FORMAT, OTL_INVALID_OFFSET): New macros.
-
-       * src/otlayout/otlgpos.c: s/FT_/OTL_/.
-       s/OTL_Short/OTL_Int16/.
-       (otl_gpos_pairset_validate): Add return type.
-       (otl_base_array_validate): Fix call to otl_anchor_validate.
-       (otl_liga_array_validate): Fix call to otl_liga_attach_validate.
-       (otl_gpos_lookup5_validate): Fix typos.
-       (otl_gpos_lookup6_validate): Fix call to otl_mark2_array_validate.
-       (otl_gpos_lookup7_validate): Comment out unfinished code.
-       Fix typos.
-
-       * src/otlayout/otlgsub.c: Add forward declaration for
-       otl_gsub_validate_funcs.
-       (otl_gsub_lookup1_apply, otl_gsub_lookup2_apply,
-       otl_gsub_lookup3_apply): Fix call to otl_parser_check_property.
-       s/otl_coverage_lookup/otl_coverage_get_index/.
-       (otl_ligature_validate): Add missing variable declaration.
-       (otl_sub_rule_validate): Fix typo.
-       (otl_sub_class_rule_validate): Add missing variable declaration.
-       Fix typo.
-       (otl_gsub_lookup5_validate): Fix typo.
-       (otl_gsub_lookup6_validate): Fix call to
-       otl_chain_sub_class_set_validate.
-       (otl_gsub_validate_funcs): Don't use `const'.
-
-       * src/otlayout/otlcommn.c (otl_class_definition_get_value,
-       otl_device_table_validate, otl_device_table_get_delta,
-       otl_lookup_validate, otl_script_validate): Add missing
-       variable declarations.
-       (otl_lookup_list_validate): Comment out first definition.
-       (otl_lookup_list_foreach, otl_feature_list_foreach): Comment out.
-       (otl_feature_list_validate):
-       s/otl_feature_table_validate/otl_feature_validate/.
-       (otl_script_list_validate):
-       s/otl_script_table_validate/otl_script_validate/.
-
-       * src/otlayout/otlcommn.h: Comment out first declaration.
-       (otl_lookup_list_foreach, otl_feature_list_foreach): Comment out.
-
-       * src/otlayout/otlbase.c (otl_base_coord_validate): Fix call to
-       otl_device_table_validate.
-       (otl_base_script_validate): Add missing variable declarations.
-       (otl_base_script_list_validate): Fix call to
-       otl_base_script_validate.
-       (otl_axis_table_validate): Fix calls to otl_base_tag_list_validate
-       and otl_base_script_list_validate.
-       (otl_base_validate): Fix calls to otl_axis_table_validate.
-
-       * src/otlayout/otlgdef.c (otl_attach_list_validate): Fix call to
-       otl_attach_point_validate.
-       (otl_caret_value_validate): Add missing variable declaration.
-       Fix call to otl_device_table_validate.
-       (otl_ligature_glyph_validate): Fix call to otl_caret_value_validate.
-       (otl_ligature_caret_list_validate): Fix call to
-       otl_ligature_glyph_validate.
-       (otl_gdef_validate): Fix calls to otl_class_definition_validate,
-       otl_attach_list_validate, otl_ligature_caret_list_validate, and
-       otl_class_definition_validate.
-
-       * src/otlayout/otltable.h (otl_table_validate, otl_table_init,
-       otl_table_set_script): Comment out.
-
-       * src/otlayout/otlparse.h (OTL_ParserRec):
-       s/OTL_Alternate/OTL_GSUB_Alternate/.
-       (OTL_ParseError): Add OTL_Err_Parser_Memory and
-       OTL_Err_Parser_Internal.
-       (otl_parser_error): Fix typo.
-       (otl_parser_check_property): Remove third argument.
-
-       * src/otlayout/otlparse.c (otl_string_ensure):
-       s/OTL_Parse_Err_Memory/OTL_Err_Parser_Memory/.
-       (OTL_STRING_ENSURE, otl_parser_error, otl_parser_get_index,
-       otl_parser_replace_1, otl_parser_replace_n): Fix typos.
-       (OTL_PARSER_UNCOVERED): Removed.
-       (otl_parser_check_property): Remove third argument.
-
-       * src/otlayout/otljstf.c (otl_jstf_priority_validate): Add missing
-       variable declaration.
-
-       * src/otlayout/otlutils.h (OTL_MEM_REALLOC): Fix typo.
-
-2004-08-11  Danny  <dannyboynow@yahoo.com>
-
-       * src/base/ftstream.c (FT_Stream_Close): Don't reset stream->close
-       to NULL.  This allows custom close functions to delete the FT_STREAM
-       object.
-
-2004-08-11  Werner Lemberg  <wl@gnu.org>
-
-       Add API to get information about SFNT tables.
-
-       * include/freetype/internal/services/svsfnt.h
-       (FT_SFNT_Table_Info_Func): New typedef.
-       (SFNT_Table): Add it.
-
-       * src/base/ftobjs (FT_Sfnt_Table_Info): New function.
-
-       * include/freetype/tttables.h: Updated.
-
-       * src/sfnt/sfdriver.c (sfnt_table_info): New function.
-       (sfnt_service_sfnt_table): Add it.
-
-       * docs/CHANGES: Updated.
-
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.
-
-       * builds/unix/configure.ac (version_info): Set to 9:8:3.
-       * builds/unix/configure: Updated.
-
-       * builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj: s/219/2110/, s/2.1.9/2.1.10/.
-
-       * builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
-       s/2.1.9/2.1.10/.
-
-       * docs/CHANGES, docs/VERSION.DLL: Updated.
-
-2004-08-11  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/base/ftrfork.c (FT_Raccess_Guess)
-       [!FT_CONFIG_OPTION_GUESSING_EMBEDDED_FORK]: Remove compiler
-       warnings.
-
-2004-08-06  Adam Piotrowski  <st_intel@poczta.onet.pl>
-
-       * src/pfr/pfrload.c (pfr_sort_kerning_pairs): Single-byte
-       adjustments are unsigned, not signed.
-
-2004-08-05  David Turner  <david@freetype.org>
-
-       `Activate' gray-scale specifing hinting within the TrueType
-       bytecode interpreter.  This is an experimental feature which
-       should probably be made optional.
-
-       * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
-       load_truetype_glyph): Move the code to set the pedantic_hinting flag
-       to...
-       (TT_Load_Glyph): Here.
-       Set `grayscale' flag except for `FT_LOAD_TARGET_MONO'.
-
-       * src/truetyep/ttinterp.c (Ins_GETINFO): Return MS rasterizer
-       version 1.7.
-       Return rotation and stretching info only if glyph is rotated or
-       stretched, respectively.
-       Handle grayscale info.
-
-       * src/truetype/ttinterp.h (TT_ExecContextRec): Add `grayscale'
-       member.
-
-2004-08-02  George Williams  <gww@silcom.com>
-
-       * src/base/ftobjs.c (FT_Attach_File): Initialize `open.stream'.
-
-2004-08-01  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2004-08-01  George Williams  <gww@silcom.com>
-
-       FreeType now can read kerning values from PFM files.
-
-       * src/type1/t1afm.c (T1_Done_AFM): Renamed to...
-       (T1_Done_Metrics): This.
-       Update all callers.
-       (T1_Read_AFM): Make it static.
-       Don't enter and leave a frame.
-       (LITTLE_ENDIAN_USHORT, LITTLE_ENDIAN_UINT): New macros.
-       (T1_Read_PFM): New function.
-       (T1_Read_Metrics): New higher-level function to be used instead of
-       T1\1fRead_AFM.
-       Update all callers.
-
-2004-07-31  Werner Lemberg  <wl@gnu.org>
-
-       * src/pcf/pcfread (pcf_load_font), src/bdf/bdfdrivr.c
-       (BDF_Face_Init), src/truetype/ttgxvar (TT_Get_MM_Var,
-       tt_face_vary_cvt): Fix compiler warnings.
-
-2004-07-26  Søren Sandmann  <sandmann@daimi.au.dk>
-
-       * src/pcf/pcfread.c (pcf_interpret_style): Always allocate memory for
-       face->style_name.
-       * src/pcf/pcfdrivr.c (PCF_Face_Done): Free `style_name'.
-
-2004-07-26  Darren J Longhorn  <darren.longhorn@redcom.co.uk>
-
-       * include/freetype/config/ftconfig.h (FT_SIZEOF_LONG): Recognize
-       five-byte `long' (which is avoided then).
-
-2004-07-25  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/pcf/pcfdrivr.c (PCF_Set_Pixel_Size): Compare heights, not
-       ppem values.
-       (PCF_Set_Point_Size): Don't call PCF_Set_Pixel_Size but provide own
-       code to compare ppem values.
-       * src/bdf/bdfdrivr.c (BDF_Set_Pixel_Size): Compare heights, not
-       ppem values.
-       (BDF_Set_Point_Size): Don't call BDF_Set_Pixel_Size but provide own
-       code to compare ppem values.
-
-2004-07-25  Kornfeld Eliyahu Peter  <peter@e-kadmon.net>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Handle
-       TT_NAME_ID_PREFERRED_FAMILY and TT_NAME_ID_PREFERRED_SUBFAMILY.
-
-2004-07-24  Derek B. Noonburg  <derekn@foolabs.com>
-
-       * src/cff/cffload.c (cff_font_load): Always create inverse mapping.
-       Even if the charstring count is the same as the CID count, it is
-       still possible that the font uses a different CID -> GID mapping.
-
-2004-07-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttobjs.c (tt_face_init): Accept 0x00020000 format tag
-       found in some Arphic fonts made for Chinese version of Windows 3.1.
-
-2004-07-17  David Turner  <david@freetype.org>
-
-       Fixed a dangling pointer bug in the cache code that happened in very
-       rare cases, i.e., when a new family object was destroyed by an
-       out-of-memory condition during a glyph node initialization.  The
-       function FTC_Cache_Lookup would flush the cache and restart the
-       lookup with a bad pointer.
-
-       * include/freetype/cache/ftcglyph.h (FTC_FAMILY_TREE): New macro.
-       (FTC_GCACHE_LOOKUP_CMP): Use it.
-       Handle reference count in `num_nodes' correctly.
-
-       * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily): Use
-       FTC_FAMILY_FREE.
-       (FTC_GCache_Lookup): Handle reference count in `num_nodes' correctly.
-
-       * src/cache/ftcmanag.c (FTC_Manager_FlushN): Fixed a cache flushing
-       bug.
-
-       * src/truetype/ttinterp.c (Normalize): Fixed a bug that caused
-       long and unnecessary delays while normalizing huge vectors.
-
-2004-07-15  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-       * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix compiler
-       warning.
-
-2004-07-15  David Turner  <david@freetype.org>
-
-       * src/base/ftstroke.c (FT_Stroker_ParseOutline): Single points
-       are not stroked, preventing a bug with pala.ttf and other
-       fonts.
-
-       * include/freetype/ftstroke.h: Updating documentation comments.
-
-2004-07-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftstroke.c (ft_stroke_border_reverse): Removed.  Unused.
-
-2004-07-12  David Turner  <david@freetype.org>
-
-       * src/base/ftstroke.c (ft_stroke_border_close): Add second parameter
-       to indicate reversion of points.
-       Update all callers.
-       (ft_stroke_border_reverse): Fix initialization of `point1' and
-       `tag1'.
-
-       * src/cache/ftcsbits.c (ftc_snode_load): Fixing advance computation
-       for transformed glyphs.
-
-2004-07-11  David Turner  <david@freetype.org>
-
-       Fix bugs that prevented the stroker to correctly generate stroked
-       paths from closed paths, i.e., nearly all glyphs in vectorial fonts.
-
-       The code is still _very_ buggy though; treat with special care.
-
-       * src/base/ftstroke.c (FT_STROKE_TAG_BEGIN_END): New macro.
-       (ft_stroke_border_reverse): New function.
-       (ft_stroker_inside): Remove local variable `sigma'; use different
-       threshold.
-       (ft_stroker_add_reverse_left): Switch begin/end tags if necessary.
-       (FT_Stroker_EndSubPath): Call ft_stroker_inside and
-       ft_stroke_border_reverse.
-
-2004-06-26  Peter Kovar  <peter.kovar@r3.roburnet.sk>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fix typo.
-
-2004-06-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1afm.c (afm_atoindex): Fix boundary test.  Reported
-       by Dirck Blaskey.
-
-2004-06-24  David Turner  <david@freetype.org>
-
-
-       * Version 2.1.9 released.
-       =========================
-
-
-       * src/truetype/ttgload.c, src/truetype/ttxgvar.c: Removing
-       compiler warnings.
-
-2004-06-23  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/ftmemory.h [FT_DEBUG_MEMORY]: Declare
-       FT_QAlloc_Debug and FT_QRealloc_Debug.
-
-       * src/base/ftutil.c (FT_QAlloc): Fix error and debug messages.
-       (FT_QRealloc): Call FT_QAlloc if original pointer is NULL.
-       Fix error message.
-
-2004-06-23  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/ftmemory.h, src/base/ftutil.c
-       (FT_QAlloc, FT_QRealloc), src/base/ftdbgmem.c (FT_QAlloc_Debug,
-       FT_QRealloc_Debug): New functions that perform allocation without
-       zero-ing out the corresponding blocks.
-
-       * include/freetype/internal/ftmemory.h (FT_MEM_QALLOC,
-       FT_MEM_QREALLOC, FT_MEM_QNEW, FT_MEM_QNEW_ARRAY,
-       FT_MEM_QRENEW_ARRAY, FT_QALLOC, FT_QREALLOC, FT_QNEW, FT_QNEW_ARRAY,
-       FT_QRENEW_ARRAY): New macros.
-
-       * src/base/ftstream.c (FT_Stream_EnterFrame): Use FT_QALLOC.
-       * src/gzip/ftgzip.c (FT_Stream_OpenGzip):  Use FT_QNEW_ARRAY.
-       * src/sfnt/sfobjs.c (tt_face_get_name): Use FT_QNEW_ARRAY.
-
-       * src/sfnt/ttload.c (tt_face_load_directory, tt_face_load_metrics,
-       tt_face_load_gasp): Use FT_QNEW_ARRAY.
-       (tt_face_load_kern): Use FT_QNEW_ARRAY.
-       Small optimization in the kerning table verifier; this speeds up
-       TrueType face opening by about 7%.
-       (tt_face_load_hdmx): Use FT_QNEW_ARRAY and FT_QALLOC.
-
-       * include/freetype/config/ftmodule.h: Changed the order of modules,
-       putting TrueType and Type 1 first.  This dramatically improves the
-       performance of face open/close operations.  For example, putting the
-       TrueType driver first in the list results in a 5x speedup when
-       opening `Vera.ttf'.
-
-       The very problem is that both the PCF and BDF drivers do a lot more
-       than necessary to detect that they cannot handle a font file.
-
-2004-06-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/pcf/pcfread.c (pcf_read_TOC, pcf_get_properties,
-       pcf_get_metrics, pcf_get_bitmaps, pcf_get_encodings): Improve
-       debugging messages.
-
-       * src/pcf/pcfdrivr.c (FT_COMPOMENT): Move up.
-       (PCF_Face_Init): Simplify code.
-
-       * src/bdf/bdfdrivr.h (BDF_FaceRec): New element `default_glyph'.
-
-       * src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_start),
-       src/bdf/bdf.h (bdf_font_t): s/default_glyph/default_char/.
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Fix number of glyphs.
-       Set `default_glyph'.
-       (BDF_Glyph_Load): Use `default_glyph' for undefined glyph.
-
-       * docs/CHANGES: Updated.
-
-2004-06-21  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2004-06-21  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
-       load_truetype_glyph): Don't access (unrounded)
-       `TT_Size.root.metrics' but (rounded) `TT_Size.metrics'.  This fixes
-       a scaling bug that caused incorrect rendering when the bytecode
-       interpreter was enabled.
-
-2004-06-14  Huw D M Davies  <h.davies1@physics.ox.ac.uk>
-
-       * src/winfonts/winfnt.c (FNT_Face_Init): Set x_ppem and y_ppem
-       based on pixel_width and pixel_height.
-       (FNT_Size_Set_Pixels): Updated.
-
-2004-06-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/lzw/zopen.c: Comment out inclusion of signal.h and unistd.h.
-       Reported by Hyvärinen Jyrki Juhani.
-
-2004-06-11  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2004-06-10  David Turner  <david@freetype.org>
-
-       * src/base/ftobject.c, src/base/fthash.c, src/base/ftexcept.c,
-       src/base/ftsysio.c, src/base/ftsysmem.c, src/base/ftlist.c: Removed.
-       Obsolete.
-
-       * src/raster/ftraster.c (Alignment, PAlignment): New union to fix
-       problems with 64bit systems.
-       (AlignProfileSize): Use it.
-
-2004-06-08  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h (FT_GlyphMetrics): Move `lsb_delta'
-       and `rsb_delta' elements to...
-       (FT_GlyphSlotRec): Here to retain binary compatibility with older
-       FreeType versions.
-       Update all users.
-
-       * src/sfnt/sfobjs.c (tt_face_get_name): Remove compiler warning.
-
-       * src/winfonts/winfnt.c (FNT_Load_Glyph): Add missing initialization
-       of slot->metrics.width and slot->metrics.height when loading a
-       Windows FNT glyph.  Thanks to Huw Davies.
-
-       * include/freetype/cache/ftcmru.h (FTC_MruNode_CompareFunc): Change
-       return type to FT_Bool.
-
-       * src/cache/ftbasic.c (ftc_basic_family_compare): Change return
-       type to FT_Bool.
-
-       * src/cache/ftccache.c (FTC_Cache_Init, ftc_cache_init): Make
-       the former call the latter, not vice versa.
-       (FTC_Cache_Done, ftc_cache_done): Ditto.
-
-       * src/cache/ftcglyph.c (FTC_GNode_Compare, ftc_gnode_compare): Make
-       the former call the latter, not vice versa.
-       (FTC_GCache_Init, ftc_gcache_init): Ditto.
-       (FTC_GCache_Done, ftc_gcache_done): Ditto.
-
-       * src/cache/ftcimage.c (FTC_INode_Free, ftc_inode_free): Make the
-       former call the latter, not vice versa.
-       (FTC_INode_Weight, ftc_inode_weight): Ditto.
-
-       * src/cache/ftcmanag.c (ftc_size_node_compare,
-       ftc_size_node_compare_faceid, ftc_face_node_compare): Change return
-       type to FT_Bool.
-
-       * src/cache/ftcsbits.c (FTC_SNode_Free, ftc_snode_free): Make the
-       former call the latter, not vice versa.
-       (FTC_SNode_Weight, ftc_snode_weight): Ditto.
-       (FTC_SNode_Compare, ftc_snode_compare): Ditto.
-
-       * src/cache/ftcsbits.c: Fix some bugs and inefficiencies in the cache
-       sub-system.
-
-2004-06-05  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/afloader.c (af_loader_load_g): Set `lsb_delta' and
-       `rsb_delta' in slot->metrics and tune side bearings slightly.
-
-2004-06-04  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2004-06-04  David Chester  <davidchester@gmx.net>
-
-       Improve inter-letter spacing for autohinted glyphs.
-
-       * include/freetype/freetype.h (FT_Glyph_Metrics): Add elements
-       `lsb_delta' and `rsb_delta'.
-
-       * src/autohint/ahhint.c (ah_hinter_load): Set `lsb_delta' and
-       `rsb_delta' in slot->metrics and tune side bearings slightly.
-
-2004-06-04  David Turner  <david@freetype.org>
-
-       * src/autofit/*: Important fixes to the auto-fitter.  The output
-       now seems to be 100% equivalent to the auto-hinter, while being
-       about 2% faster (which proves that script-specific algorithm
-       selection isn't a performance problem).
-
-       To test it, change `autohint' to `autofit' in
-       <freetype/config/ftmodule.h> and recompile.
-
-       A few more testing is needed before making this the official
-       auto-hinting module.
-
-2004-06-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (compute_glyph_metrics): Fix compiler
-       warnings.
-
-2004-06-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (tt_face_get_name): Make sure that an English
-       name record for the Apple platform is preferred to a non-English
-       entry for the Microsoft platform.  Problem reported by HANDA
-       Ken'ichi.
-
-2004-05-19  George Williams  <gww@silcom.com>
-
-       * src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): New
-       auxiliary functions.
-       (T1_Get_MM_Var): Provide axis tags.
-       Use mm_axis_unmap and mm_weights_unmap to provide default values
-       for design and normalized axis coordinates.
-
-       * include/freetype/t1tables.h (PS_DesignMapRec): Change type of
-       `design_points' to FT_Long.
-       Update all users.
-
-2004-05-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftbbox.c (BBox_Conic_Check): Fix boundary cases.
-       Reported by Mikey Anbary <manbary@vizrt.com>.
-
-2004-05-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_done_face): Free face->postscript_name.
-
-2004-05-15  George Williams  <gww@silcom.com>
-
-       * src/sfnt/ttload.c (tt_face_load_max_profile): Always set
-       face->root.num_glyphs.
-
-2004-05-14  Masatake YAMATO  <jet@gyve.org>
-           George Williams  <gww@silcom.com>
-
-       * src/sfnt/ttload.c (sfnt_dir_check): Handle `bhed' properly.
-
-2004-05-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftcbasic.c (ftc_basic_family_compare,
-       ftc_basic_family_init, ftc_basic_family_get_count,
-       ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
-       ftc_basic_gnode_compare_faceid): Adjust parameters and return types
-       to prototypes given in header files from include/freetype/cache.
-       Use casts to proper types locally.
-       (ftc_basic_image_family_class, ftc_basic_image_cache_class,
-       ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
-       casts.
-
-       * src/cache/ftccback.h: Adjust parameters and return types to
-       prototypes given in header files from include/freetype/cache.
-
-       * src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
-       ftc_inode_weight): Adjust parameters and return types to prototypes
-       given in header files from include/freetype/cache.  Use casts to
-       proper types locally.
-
-       * src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
-       ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
-       types to prototypes given in header files from
-       include/freetype/cache.  Use casts to proper types locally.
-
-       * src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
-       ftc_cmap_node_weight, ftc_cmap_node_compare,
-       ftc_cmap_node_remove_faceid): Adjust parameters and return types to
-       prototypes given in header files from include/freetype/cache.  Use
-       casts to proper types locally.
-       (ftc_cmap_cache_class): Remove casts.
-
-       * src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
-       ftc_gcache_done): Adjust parameters and return types to prototypes
-       given in header files from include/freetype/cache.  Use casts to
-       proper types locally.
-
-       * src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
-       ftc_size_node_init, ftc_size_node_reset,
-       ftc_size_node_compare_faceid, ftc_face_node_init,
-       ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
-       return types to prototypes given in header files from
-       include/freetype/cache.  Use casts to proper types locally.
-
-       (ftc_size_list_class, ftc_face_list_class): Remove casts.
-
-2004-05-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
-       Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
-       (autohint_module_class): Remove casts.
-
-       * src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
-       ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
-       ft_outline_glyph_done, ft_outline_glyph_copy,
-       ft_outline_glyph_transform, ft_outline_glyph_bbox,
-       ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
-       to FT_XXXGlyph locally.
-       Use FT_CALLBACK_DEF throughout.
-       (ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
-
-       * src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
-       bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
-       and do a cast to BDF_CMap locally.
-       (bdf_cmap_class): Remove casts.
-
-2004-05-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.h (CFF_Builder): Remove `error'.
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Replace
-       `Memory_Error' with `Fail' und update all users.
-
-2004-05-11  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/psaux.h (T1_ParseState): New
-       enumeration.
-       (T1_BuilderRec): Replace `path_begun' with `parse_state'.
-       Remove `error'.
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Replace
-       `Memory_Error' with `Fail' and update all users.
-       Don't use `builder->error'.
-       Replace `path_begun' with `parse_state' and check parsing states.
-
-       * src/psaux/psobjs.c (t1_builder_init, t1_builder_start_point):
-       Replace `path_begun' with `parse_state' and check parsing states.
-
-2004-05-10  George Williams  <gww@silcom.com>
-
-       * src/truetype/ttxgvar.c (ft_var_load_avar): Do free arrays in case
-       of error -- `avar' is optional so we can't rely on tt_done_blend
-       being called automatically.
-
-2004-05-09  George Williams  <gww@silcom.com>
-
-       * src/truetype/ttxgvar.c (ft_var_load_avar, ft_var_load_gvar): Fix
-       error handling.
-
-2004-05-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/pfrobjs.c, src/pfr/pfrobjs.h (pfr_face_init,
-       pfr_face_done, pfr_face_get_kerning, pfr_slot_init, pfr_slot_done,
-       pfr_slot_load): Don't use PFR_XXX but FT_XXX arguments which are
-       typecast to the proper PFR_XXX types within the function.
-       Update code accordingly.
-
-       * src/pfr/pfrdrivr.c (pfr_get_kerning, pfr_get_advance,
-       pfr_get_metrics, pfr_get_service): Don't use PFR_XXX but FT_XXX
-       arguments which are typecast to the proper PFR_XXX types within the
-       function.
-       Update code accordingly.
-       Use FT_CALLBACK_DEF throughout.
-       (pfr_metrics_service_rec, pfr_driver_class): Remove casts.
-
-2004-05-06  Masatake YAMATO  <jet@gyve.org>
-
-       * src/truetype/ttgxvar.c (ft_var_load_gvar): Use FT_FACE_STREAM.
-       (*): Rename local variable OffsetToData to offsetToData.
-
-2004-05-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_size_done, cff_size_init, cff_size_reset,
-       cff_slot_done, cff_slot_init, cff_face_init, cff_face_done): Access
-       root fields directly.
-       * src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
-
-       * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
-       frame before calling TT_Vary_Get_Glyph_Deltas.
-
-       * src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
-       consistency.
-       (pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
-       pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
-       are typecast to the proper PCF_XXX types within the function.
-       Update code accordingly.
-       (pcf_cmap_class): Remove casts.
-       (PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
-       PCF_XXX but FT_XXX arguments which are typecast to the proper
-       PCF_XXX types within the function.
-       Update code accordingly.
-       Use FT_CALLBACK_DEF throughout.
-       (PCF_Set_Point_Size): New wrapper function.
-       (PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
-       (pcf_driver_class): Remove casts.
-
-2004-05-04  Steve Hartwell  <shspamsink@comcast.net>
-
-       * src/truetype/ttobjs.c (tt_driver_done): Fix typo.
-
-2004-05-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
-       BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
-       are typecast to the proper BDF_XXX types within the function.
-       Update code accordingly.
-       Use FT_CALLBACK_DEF throughout.
-       (BDF_Set_Point_Size): New wrapper function.
-       (bdf_driver_class): Remove casts.
-
-       * src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
-       Don't use CFF_XXX but FT_XXX arguments which are typecast to the
-       proper CFF_XXX types within the function.
-       Update code accordingly.
-       Use FT_CALLBACK_DEF throughout.
-       (cff_driver_class): Remove casts.
-
-       * src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
-       cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
-       cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
-       Don't use CFF_XXX but FT_XXX arguments which are typecast to the
-       proper CFF_XXX types within the function.
-       Update code accordingly.
-       (cff_point_size_reset): New wrapper function.
-
-       * src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
-       cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
-       cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
-       Don't use CID_XXX but FT_XXX arguments which are typecast to the
-       proper CID_XXX types within the function.
-       Update code accordingly.
-       (cid_point_size_reset): New wrapper function.
-
-       * src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
-       Don't use CID_XXX but FT_XXX arguments which are typecast to the
-       proper CID_XXX types within the function.
-       Update code accordingly.
-
-       * src/cid/cidriver.c (cid_get_interface):
-       Don't use CID_XXX but FT_XXX arguments which are typecast to the
-       proper CID_XXX types within the function.
-       Update code accordingly.
-       Use FT_CALLBACK_DEF.
-       (t1cid_driver_class): Remove casts.
-
-       * src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
-       * src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
-       variables (this is done later).
-       (ft_var_load_avar): Fix call to FT_FRAME_ENTER.
-       (TT_Get_MM_Var): Fix size for `fvar_fields'.
-       (TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
-       correctly.
-
-       * src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
-       current size is zero.
-
-2004-05-03  Steve Hartwell  <shspamsink@comcast.net>
-
-       * src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
-       tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
-       tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
-       typecast to the proper TT_XXX types within the function.
-       Update code accordingly.
-
-       * src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
-       Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
-       FT_XXX arguments which are typecast to the proper TT_XXX types
-       within the function.
-       Update code accordingly.
-       (tt_driver_class): Remove casts.
-
-2004-05-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttload.c (tt_face_free_names): Check that `table->names'
-       is not NULL.  Reported by Gordon Childs <gchilds@quickcut.com.au>.
-
-2004-04-29  Werner Lemberg  <wl@gnu.org>
-
-       * docs/formats.txt: Add more information on PFR format.
-
-2004-04-28  Werner Lemberg  <wl@gnu.org>
-
-       * docs/formats.txt: New file.
-       * docs/CHANGES: Updated.
-
-2004-04-28  Masatake YAMATO  <jet@gyve.org>
-
-       * include/freetype/internal/tttypes.h (GX_BlendRec_)
-       [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Fix a typo.
-
-       * src/truetype/ttgxvar.h (GX_BlendRec_): Fix a typo.
-
-2004-04-27  Masatake YAMATO  <jet@gyve.org>
-
-       * src/truetype/ttgxvar.h: Use FT_LOCAL instead of FT_LOCAL_DEF
-       for function declarations.
-
-2004-04-25  George Williams  <gww@silcom.com>
-
-       * src/truetype/ttgxvar.c (ft_var_apply_tuple): Fix typo.
-
-2004-04-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/Jamfile, docs/CHANGES: Updated.
-
-2004-04-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/pcf/pcfdrivr.c: Revert change from 2004-04-17.
-       * src/pcf/pcfutil.c: Use FT_LOCAL_DEF.
-       * src/pcf/pcfutil.h: Include FT_CONFIG_CONFIG_H.
-       Use FT_BEGIN_HEADER and FT_END_HEADER.
-       Use FT_LOCAL.
-
-2004-04-24  George Williams  <gww@silcom.com>
-
-       Add support for Apple's distortable font technology (in GX fonts).
-
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       (TT_CONFIG_OPTION_GX_VAR_SUPPORT): New macro.
-
-       * include/freetype/ftmm.h (FT_Var_Axis, FT_Var_Named_Style,
-       FT_MM_Var): New structures.
-       (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates,
-       FT_Set_Var_Blend_Coordinates): New function declarations.
-
-       * include/freetype/internal/services/svmm.h (FT_Get_MM_Var_Func,
-       FT_Set_Var_Design_Func): New typedefs.
-       Update MultiMasters service.
-
-       * include/freetype/internal/tttypes.h
-       [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H.
-       (GX_Blend) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New typedef.
-       (TT_Face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New members `doblend'
-       and `blend'.
-
-       * include/freetype/tttags.h (TTAG_avar, TTAG_cvar, TTAG_gvar): New
-       macros.
-
-       * include/freetype/internal/fttrace.h: Add `ttgxvar'.
-
-       * src/base/ftmm.c (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates,
-       FT_Set_Var_Blend_Coordinates): New functions.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face)
-       [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Set FT_FACE_FLAG_MULTIPLE_MASTERS
-       flag for GX var fonts.
-
-       * src/truetype/ttgxvar.c, src/truetype/ttgxvar.h: New files.
-
-       * src/truetype/truetype.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
-       ttgxvar.c.
-
-       * src/truetype/ttdriver.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
-       FT_MULTIPLE_MASTERS_H, FT_SERVICE_MULTIPLE_MASTERS_H, and ttgxvar.h.
-       (tt_service_gx_multi_masters) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]:
-       New service.
-       (tt_services) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated.
-
-       * src/truetype/ttgload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
-       ttgxvar.h.
-       (TT_Process_Simple_Glyph, load_truetype_glyph)
-       [TT_CONFIG_OPTION_GX_VAR_SUPPORT] :Support GX var fonts.
-
-       * src/truetype/ttobjs.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
-       ttgxvar.h.
-       (tt_done_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call
-       tt_done_blend.
-
-       * src/truetype/ttpload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
-       ttgxvar.h.
-       (tt_face_load_cvt)  [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call
-       tt_face_vary_cvt.
-
-       * src/truetype/rules.mk (TT_DRV_SRC): Add ttgxvar.c.
-
-       * src/type1/t1driver.c (t1_service_multi_masters): Add T1_Get_MM_Var
-       and T1_Set_Var_Design.
-
-       * src/type1/t1load.c (FT_INT_TO_FIXED, FT_FIXED_TO_INT): New macros.
-       (T1_Get_MM_Var, T1_Set_Var_Design): New functions.
-
-       * src/type1/t1load.h (T1_Get_MM_Var, T1_Set_Var_Design): New
-       function declarations.
-
-2004-04-23  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftcache.h (FT_Get_CharMap_Index): Rename
-       declaration and move to...
-       * include/freetype/freetype.h (FT_Get_Charmap_Index): Here.
-       (FREETYPE_PATCH): Set to 9.
-
-       * src/base/ftobjs.c (FT_Get_Charmap_Index): New function.
-
-       * builds/unix/configure.ac (version_info): Set to 9:7:3.
-       * builds/unix/configure: Updated.
-
-       * builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj: s/218/219/.
-
-       * builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
-       s/2.1.8/2.1.9/.
-
-       * docs/CHANGES, docs/VERSION.DLL: Updated.
-
-2004-04-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffparse.c (cff_parser_run), src/psaux/psobjs.c
-       (ps_parser_load_field): Use FT_CHAR_BIT.
-
-2004-04-21  David Turner  <david@freetype.org>
-
-
-       * Version 2.1.8 released.
-       =========================
-
-
-       * src/cff/cffobjs.c (cff_face_init): Fix a small memory leak.
-
-       * src/autofit/afloader.c (af_loader_load_g), src/autofit/afmodule.c
-       (af_autofitter_load_glyph), src/base/ftdebug.c (FT_Trace_Get_Name):
-       Remove compiler warnings.
-
-       * src/autofit/aftypes.h: Undefine AF_DEBUG.
-
-       * src/lzw/zopen.c (rmask), src/pcf/pcfdrivr.c (pcf_service_bdf,
-       pcf_services), src/pcf/pcfread.c (tableNames), src/psaux/psobjs.c
-       (ft_char_table), src/type42/t42drivr.c (t42_service_glyph_dict,
-       t42_service_ps_font_name): Decorate data arrays with `const' to
-       avoid populating the `.data' segment.
-
-       * src/lzw/Jamfile: New file.
-
-2004-04-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psobjs.c (T1Radix): Renamed to...
-       (ps_radix): This.
-       Update current cursor position.
-
-       * docs/CHANGES: Updated.
-
-2004-04-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c, src/truetype/ttgload.h (TT_Load_Glyph),
-       src/ttdriver.c (Load_Glyph): Change type of `glyph_index' to
-       FT_UInt.  From Lex Warners.
-
-2004-04-17  Chisato Yamauchi  <cyamauch@a.phys.nagoya-u.ac.jp>
-
-       * src/sfnt/ttload.c (tt_face_load_sfnt_header): Really fix change
-       from 2004-03-19.
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Use `ft_strlen'.
-
-       * src/pcf/pcfutil.c, src/pcf/pcfutil.h: Decorate functions with
-       `static'.
-       Remove unused function `RepadBitmap'.
-       * src/pcf/pcfdrivr.c: Don't include pcfutil.h.
-
-2004-04-16  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/freetype-config.in (usage): Fix and improve usage
-       information.
-
-2004-04-15  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/ftconfig.in, builds/vms/ftconfig.h: Define
-       FT_CHAR_BIT.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Don't apply autohinting if
-       glyph is vertically distorted or mirrored.
-
-       * src/cff/cffgload.c (cff_slot_load): Handle zero `size' properly
-       for embedded bitmaps.
-
-       * docs/CHANGES: Updated.
-
-2004-04-15  bytesoftware  <bytesoftware@btinternet.com>
-
-       * include/freetype/config/ftconfig.h, src/base/ftstream.c
-       (FT_Stream_ReadFields): More fixes using FT_CHAR_BIT.
-
-2004-04-14  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftconfig.h (FT_CHAR_BIT): New macro.
-
-2004-04-14  Alex Strelnikov  <ptktyrf@mail.ru>
-
-       * src/cache/ftcsbits.c (ftc_snode_load): Initialize `*asize' in case
-       of error.
-
-2004-04-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftmac.c [__GNUC__]: Define OS_INLINE.
-       * builds/unix/configure.ac: Don't try to remove `-ansi' compilation
-       switch on the Mac.
-
-       * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
-       --copy' from libtool 1.5.6.
-       * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
-       automake 1.8a.
-       * builds/unix/configure: Regenerated with autoconf 2.59a.
-
-2004-04-13  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftconfig.h: Use CHAR_BIT to define
-       size of FT_SIZEOF_xxx.
-
-2004-04-12  Chisato Yamauchi  <cyamauch@a.phys.nagoya-u.ac.jp>
-
-       * include/freetype/internal/sfnt.h (TT_Find_SBit_Image_Func,
-       TT_Load_SBit_Metrics_Func): New typedefs.
-       (SFNT_Interface): Add find_sbit_image and load_sbit_metrics.
-
-       * src/sfnt/sfdriver.c (sfnt_interface): Updated.
-       * src/sfnt/ttsbit.h (tt_find_sbit_image, tt_load_sbit_metrics): New
-       declarations.
-       * src/sfnt/ttsbit.c (find_sbit_image): Renamed to...
-       (tt_find_sbit_image): This.
-       Updated all callers.
-       (load_sbit_metrics): Renamed to...
-       (tt_load_sbit_metrics): This.
-       Updated all callers.
-
-2004-04-12  Werner Lemberg  <wl@gnu.org>
-
-       * configure: Accept makepp also.
-
-       * builds/unix/detect.mk: Use proper path to unix-def.mk.
-       * builds/unix/unix-def.in (BUILD_DIR, PLATFORM): Remove.
-       * builds/unix/unix.mk (BUILD_DIR, PLATFORM): Define.
-       Use BUILD_DIR.
-
-       * docs/INSTALL, docs/INSTALL.GNU, docs/INSTALL.UNX: Update
-       documentation on makepp.
-
-2004-04-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/lzw/zopen.c: Don't include sys/param.h and sys/stat.h.
-
-2004-04-10  Werner Lemberg  <wl@gnu.org>
-
-       * src/lzw/ftlzw.c: Include zopen.h dependent on
-       FT_CONFIG_OPTION_USE_LZW.
-
-       * src/base/ftdebug.c: s/index/idx/ to avoid compiler warnings.
-
-2004-04-02  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
-       --copy' from libtool 1.5.2.
-       * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
-       automake 1.8a.
-       * builds/unix/configure: Regenerated with autoconf 2.59a.
-
-2004-04-01  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/ft-munmap.m4 (FT_MUNMAP_PARAM): Fix arguments of
-       AC_COMPILE_IFELSE.
-       * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
-       automake 1.8a.
-       * builds/unix/configure: Regenerated with autoconf 2.59a.
-       * builds/unix/config.guess, builds/unix/config.sub: Updated from
-       `config' CVS module at subversions.gnu.org.
-       * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
-       `texinfo' CVS module at subversions.gnu.org.
-       * builds/freetype.mk (refdoc): Updated.
-
-2004-03-31  Werner Lemberg  <wl@gnu.org>
-
-       Handle broken FNT files which don't have a trailing NULL byte
-       in the face name string.
-
-       * src/winfonts/winfnt.h (FNT_FontRec): New member `family_name'.
-       * src/winfonts/winfnt.c (fnt_font_done): Free font->family_name.
-       (FNT_Face_Init): Append a final zero byte to the font face name.
-
-2004-03-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttload.c (tt_face_load_sfnt_header): Fix change from
-       2004-03-19.
-
-2004-03-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/descrip.mms (OBJS): Add ftbbox.obj.
-
-2004-03-26  George Williams  <gww@silcom.com>
-
-       Add vertical phantom points.
-
-       * include/freetype/internal/tttypes.h (TT_LoaderRec): Add
-       `top_bearing', `vadvance', `pp3', and `pp4'.
-
-       * src/autofit/afloader.c (af_loader_load_g): Handle two more points.
-
-       * src/autohint/ahhint.c (ah_hinter_load): Handle two more points.
-       * src/truetype/ttgload.c (Get_VMetrics): New function.
-       (TT_Load_Simple_Glyph, TT_Process_Simple_Glyph): Handle two more
-       points.
-       (load_truetype_glyph): Use Get_VMetrics.
-       Handle two more points.
-       (compute_glyph_metrics): Thanks to vertical phantom points we now
-       can always compute `advance_height' and `top_bearing'.
-       * src/truetype/ttobjs.h (TT_SubglyphRec): Add vertical phantom
-       points.
-
-
-       * src/autohint/ahglyph.c (ah_outline_load): Fix allocation of
-       `news'.
-
-2004-03-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Fix left side bearing.
-
-2004-03-20  Steve Hartwell  <shspamsink@comcast.net>
-
-       * src/cache/ftcmru.c (FTC_MruList_RemoveSelection): Handle a NULL
-       value for `selection' as `select all'.
-
-2004-03-19  Steve Hartwell  <shspamsink@comcast.net>
-
-       * src/sfnt/ttload.c (tt_face_load_sfnt_header): Reject face_index
-       values > 0 if loading non-TTC fonts.
-
-       * src/base/ftmac.c (open_face_from_buffer): Set positive face_index
-       to zero before calling FT_Open_Face.
-
-       * docs/CHANGES: Updated.
-
-2004-03-04  Werner Lemberg  <wl@gnu.org>
-
-       * Jamfile, vms_make.com, builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype/vcproj, include/freetype/ftmoderr.h:
-       Add LZW module.
-
-       * Jamfile.in: Removed.
-
-       * docs/CHANGES: Updated.
-
-       * include/freetype/internal/ftobjs.h: s/MIN/FT_MIN/, s/MAX/FT_MAX/,
-       s/ABS/FT_ABS/.  Updated all callers.
-
-       * src/type1/t1load.c (parse_dict), src/pcf/pcfdrivr.c
-       (PCF_Face_Init): Use FT_ERROR_BASE.
-
-2004-03-04  Albert Chin  <china@thewrittenword.com>
-
-       Add support for PCF fonts compressed with LZW (extension .pcf.Z,
-       created with `compress').
-
-       * include/freetype/config/ftoption.h, devel/ftoption.h
-       (FT_CONFIG_OPTION_USE_LZW): New macro.
-
-       * include/freetype/ftlzw.h: New file.
-       * include/freetype/config/ftheader.h (FT_LZW_H): New macro for
-       ftlzw.h.
-
-       * src/lzw/*: New files.
-
-       * src/pcf/pcfdrivr.c: Include FT_LZW_H.
-       (PCF_Face_Init): Try LZW also.
-
-       * src/gzip/ftgzip.c: s/0/Gzip_Err_Ok/ where appropriate.
-       Beautify.
-
-2004-03-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshalgo.c (psh_hint_table_init): Simplify code.
-
-2004-03-02  Werner Lemberg  <wl@gnu.org>
-
-       Add embedded bitmap support to CFF driver.
-
-       * src/cff/cffobjs.h (CFF_SizeRec): New structure.
-
-       * src/cff/cffgload.c (cff_builder_init): Updated.
-       (cff_slot_load): Updated.
-       [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Load sbit.
-
-       * src/cff/cffobjs.c (sbit_size_reset)
-       [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: New function.
-       (cff_size_get_globals_funcs, cff_size_done, cff_size_init): Updated.
-       (cff_size_reset): Updated.
-       [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Call sbit_size_reset.
-
-       * src/cff/cffdrivr.c (Load_Glyph): Updated.
-       (cff_driver_class): Use CFF_SizeRec.
-
-       * docs/CHANGES: Updated.
-
-2004-03-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshglob.c (psh_globals_scale_widths): Don't use
-       FT_RoundFix but FT_PIX_ROUND.
-       (psh_blues_snap_stem): Don't use blue_shift but blue_threshold.
-
-       * src/pshinter/pshalgo.c (PSH_STRONG_THRESHOLD_MAXIMUM): New macro.
-       (psh_glyph_find_string_points): Use PSH_STRONG_THRESHOLD_MAXIMUM.
-       (psh_glyph_find_blue_points): New function.  Needed for fonts like
-       p052003l.pfb (URW Palladio L Roman) which have flex curves at the
-       base line within blue zones, but the flex curves aren't covered by
-       hints.
-       (ps_hints_apply): Use psh_glyph_find_blue_points.
-
-2004-02-27  Garrick Meeker  <garrick@digitalanarchy.com>
-
-       * builds/unix/configure.ac: Fix compiler flags for
-       `--with-old-mac-fonts'.
-       * builds/unix/configure: Regenerated.
-
-       * src/base/ftmac.c: s/TARGET_API_MAC_CARBON/!TARGET_API_MAC_OS8/.
-       (FT_New_Face_From_Resource): New function.
-       (FT_New_Face): Use FT_New_Face_From_Resource.
-       (FT_New_Face_From_FSSpec): Use FT_New_Face_From_Resource.
-       [__MWERKS__]: Don't include FSp_fopen.h.
-
-2004-02-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshglob.c (psh_globals_new): Fix value of
-       `dim->stdw.count'.
-       Don't assign default values to blue scale and blue shift.
-
-2004-02-25  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2004-02-25  Garrick Meeker  <garrick@digitalanarchy.com>
-           Steve Hartwell  <shspamsink@comcast.net>
-
-       Improve MacOS fond support.  Provide a new API
-       `FT_New_Face_From_FSSpec' similar to `FT_New_Face'.
-
-       * src/base/ftmac.c [__MWERKS__]: Include FSp_fpopen.h.
-       STREAM_FILE [__MWERKS__]: New macro.
-       (ft_FSp_stream_close, ft_FSp_stream_io) [__MWERKS__]: New functions.
-       (file_spec_from_path) [__MWERKS__]: Updated #if statement.
-       (get_file_type, make_lwfn_spec): Use `const' for argument.
-       (is_dfont) [TARGET_API_MAC_CARBON]: Removed.
-       (count_face_sfnt, count_faces): New functions.
-       (parse_fond): Do some range checking.
-       (read_lwfn): Change type of second argument.
-       No longer call FSpOpenResFile.
-       (OpenFileAsResource): New function.
-       (FT_New_Face_From_LWFN): Use `const' for second argument.
-       Use OpenFileAsResource.
-       (FT_New_Face_From_Suitcase): Change type of second argument.
-       No longer call FSpOpenResFile.
-       Loop over all resource indices.
-       (FT_New_Face_From_dfont) [TARGET_API_MAC_CARBON]: Removed.
-       (FT_GetFile_From_Mac_Name): Use `const' for first argument.
-       (ResourceForkSize): Removed.
-       (FT_New_Face): Updated to use new functions.
-       (FT_New_Face_From_FSSpec): New function.
-
-       * include/freetype/ftmac.h: Updated.
-
-2004-02-24  Malcolm Taylor  <mtaylor@clear.net.nz>
-
-       * src/autohint/ahhint.c (ah_hinter_load) <FT_GLYPH_FORMAT_OUTLINE>:
-       Handle case where outline->num_vedges is zero while computing hinted
-       metrics.
-
-2004-02-24  Gordon Childs  <gchilds@quickcut.com.au>
-
-       * src/cff/cffcmap.c (cff_cmap_unicode_init): Provide correct value
-       for `count'.
-
-2004-02-24  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/t1tables.h (PS_PrivateRec): Add
-       `expansion_factor'.
-
-       * src/pshinter/pshglob (psh_blues_scale_zones): Fix computation
-       of blues->no_overshoots -- `blues_scale' is stored with a
-       magnification of 1000, and `scale' returns fractional pixels.
-
-       * src/type1/t1load.c (T1_Open_Face): Initialize `blue_shift',
-       `blue_fuzz', `expansion_factor', and `blue_scale' according to the
-       Type 1 specification.
-
-       * src/type1/t1tokens.h: Handle `ExpansionFactor'.
-
-       * docs/CHANGES: Updated.
-
-2004-02-24  Masatake YAMATO  <jet@gyve.org>
-
-       Provide generic access to MacOS resource forks.
-
-       * src/base/ftrfork.c, include/freetype/internal/ftrfork.h: New
-       files.
-
-       * src/base/ftobjs.c: Include FT_INTERNAL_RFORK_H.
-       (Mac_Read_POST_Resource, Mac_Read_sfnt_Resource): Remove arguments
-       `resource_listoffset' and `resource_data' and adapt code
-       accordingly.  These values are calculated outside of the function
-       now.
-       Add new argument `offsets'.
-       (IsMacResource): Use `FT_Raccess_Get_HeaderInfo' and
-       `FT_Raccess_Get_DataOffsets'.
-       (load_face_in_embedded_rfork): New function.
-       (load_mac_face): Use load_face_in_embedded_rfork.
-       (ft_input_stream_new): Renamed to...
-       (FT_Stream_New): This.  Use FT_BASE_DEF.  Updated all callers.
-       (ft_input_stream_free): Renamed to...
-       (FT_Stream_Free): This.  Use FT_BASE_DEF.  Updated all callers.
-
-       * src/base/ftbase.c: Include ftrfork.c.
-
-       * src/base/rules.mk (BASE_SRC), src/base/Jamfile: Updated.
-
-       * include/freetype/internal/internal.h (FT_INTERNAL_RFORK_H):
-       New macro.
-
-       * include/freetype/internal/fttrace.h: Added `rfork' as a new
-       trace definition.
-
-       * include/freetype/internal/ftstream.h: Declare FT_Stream_New and
-       FT_Stream_Free.
-
-       * include/freetype/config/ftoption.h, devel/ftoption.h
-       (FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK): New option.
-
-       * include/freetype/config/ftstdlib.h (ft_strrchr): New macro.
-
-2004-02-23  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-       * include/freetype/internal/ftdebug.h: Include FT_FREETYPE_H.
-
-2004-02-23  Masatake YAMATO  <jet@gyve.org>
-
-       Provide a simple API to control FreeType's tracing levels.
-
-       * include/freetype/internal/ftdebug.h (FT_Trace_Get_Count,
-       FT_Trace_Get_Name): New declarations.
-
-       * src/base/ftdebug.c (FT_Trace_Get_Count, FT_Trace_Get_Name): New
-       functions.
-
-2004-02-23  David Turner  <david@freetype.org>
-
-       * src/autofit/afhints.c, src/autofit/afhints.h,
-       src/autofit/aflatin.c, src/autofit/afloader.c, src/types.h: Grave
-       bugs have been fixed.  The auto-fitter works, doesn't crash, but
-       still produces unexpected results...
-
-2004-02-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshalgo.c (PSH_STRONG_THRESHOLD): Changed to hold
-       the accepted shift for strong points in fractional pixels (which
-       is a heuristic value).
-       (psh_glyph_find_strong_points): Compute threshold for
-       psh_hint_table_find_strong_points.
-       (psh_hint_table_find_strong_point): Add parameter to pass threshold.
-
-2004-02-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshrec.c (ps_mask_table_set_bits): Don't call
-       ps_mask_table_alloc but ps_mask_table_last.
-       (ps_hints_t2mask): Use correct position and number for vertical
-       and horizontal hinter mask bits.
-
-       * docs/CHANGES: Updated.
-
-2004-02-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftstroke.c (FT_Glyph_StrokeBorder): Fix enum handling.
-       * src/cff/cffdrivr.c (cff_get_cmap_info): Remove compiler warning.
-
-2004-02-18  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h: Document FT_LOAD_TARGET_XXX properly.
-
-       * src/base/ftglyph.c (ft_bitmap_glyph_class,
-       ft_outline_glyph_class): Tag with FT_CALLBACK_TABLE_DEF.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render): Handle
-       FT_RENDER_MODE_LIGHT.
-
-2004-02-17  Werner Lemberg  <wl@gnu.org>
-
-       Fix callback functions in cache module.
-
-       * src/cache/ftccback.h: New file for callback declarations.
-
-       * src/cache/ftcbasic.c (ftc_basic_family_compare,
-       ftc_basic_family_init, ftc_basic_family_get_count,
-       ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
-       ftc_basic_gnode_compare_faceid): Use FT_CALLBACK_DEF.
-       (ftc_basic_image_family_class, ftc_basic_image_cache_class,
-       ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class):
-       Use FT_CALLBACK_TABLE_DEF and local wrapper functions.
-
-       * src/cache/ftccache.c: Include ftccback.h.
-       (ftc_cache_init, ftc_cache_done): New wrapper functions which use
-       FT_LOCAL_DEF.
-
-       * src/cache/ftccmap.c: Include ftccback.h.
-       (ftc_cmap_cache_class): Use local wrapper functions.
-
-       * src/cache/ftcglyph.c: Include ftccback.h.
-       (ftc_gnode_compare, ftc_gcache_init, ftc_gcache_done): New wrapper
-       functions which use FT_LOCAL_DEF.
-
-       * src/cache/ftcimage.c: Include ftccback.h.
-       (ftc_inode_free, ftc_inode_new, ftc_inode_weight): New wrapper
-       functions which use FT_LOCAL_DEF.
-
-       * src/cache/ftcmanag.c (ftc_size_list_class, ftc_face_list_class):
-       Use FT_CALLBACK_TABLE_DEF.
-
-       * src/cache;/ftcsbits.c: Include ftccback.h.
-       (ftc_snode_free, ftc_snode_new, ftc_snode_weight,
-       ftc_snode_compare): New wrapper functions which use FT_LOCAL_DEF.
-
-       * src/cache/rules.mk (CACHE_DRV_H): Add ftccback.h.
-
-2004-02-17  Masatake YAMATO  <jet@gyve.org>
-
-       * include/freetype/ftmac.h (FT_GetFile_From_Mac_Name): Fix a typo
-       (FT_EXPORT_DEF -> FT_EXPORT).
-
-       * include/freetype/ftxf86.h (FT_Get_X11_Font_Format): Ditto.
-
-2004-02-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Set_Char_Size): Fix typo.
-
-2004-02-14  Masatake YAMATO  <jet@gyve.org>
-
-       * builds/unix/ftsystem.c: Include errno.h.
-       (ft_close_stream): Renamed to...
-       (ft_close_stream_by_munmap): This.
-       (ft_close_stream_by_free): New function.
-       (FT_Stream_Open): Use fallback method if mmap fails.
-       Use proper function for closing the stream.
-
-2004-02-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_dict): Initialize `start_binary'.
-
-2004-02-13  Robert Etheridge  <roberte@stcc.cc.tx.us>
-
-       * src/type42/t42objs.c (T42_Face_Init), src/type1/t1objs.c
-       (T1_Face_Init), src/cid/cidobjs.c (cid_face_init): Fix computation
-       of underline_position and underline_thickness.
-
-2004-02-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Set_Char_Size): Return immediately if
-       ppem values don't change.  Suggested by Graham Asher.
-
-2004-02-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidload.c (cid_face_open): Always allocate
-       face->cid_stream so that we can deallocate it safely.
-
-2004-02-10  Werner Lemberg  <wl@gnu.org>
-
-       Make the PS parser more tolerant w.r.t. non-standard font data.  In
-       general, an error is only reported in case of a syntax error; a
-       wrong type is now simply ignored (if possible).  To be independent
-       of the order of various MM-specific keywords, the parse_shared_dict
-       routine has been removed -- the PS parser is now capable to skip
-       this data.  It no longer fails on parsing e.g.
-
-         dup /WeightVector exch def
-
-       Since the token following /WeightVector isn't `[' (starting an
-       array) it is simply ignored.
-
-       * include/freetype/fterrdef.h: Define `FT_Err_Ignore' (0xA2) as a
-       new internal error value.
-
-       * src/type1/t1load.c (parse_blend_axis_types,
-       parse_blend_design_positions, parse_blend_design_map): Return
-       T1_Err_Ignore if no proper array is following the keyword.
-       (parse_weight_vector): Use T1_ToTokenArray, initializing `blend'
-       structure, if necessary.
-       Return T1_Err_Ignore if no proper array is following the keyword.
-       (parse_shared_dict): Removed.
-       (parse_encoding): Set parser->root.error to return T1_Err_Ignore
-       if no result can be obtained.
-       Check for errors before accessing `elements' array.
-       (t1_keywords): Remove /shareddict.
-       (parse_dict): Reset error if t1_load_keyword returns T1_Err_Ignore.
-       Set keyword_flag only in case of success.
-       Check error code if skipping an unrecognized token.
-       (T1_Open_Face) [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: Call T1_Done_Blend
-       if blend commands haven't set up a proper MM font.
-
-       * src/psaux/psobjs.c (ps_parser_load_field_table): Remove special
-       code for synthetic fonts.
-       Return PSaux_Err_Ignore if no proper value has been found.
-
-2004-02-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       <cff_op_endchar>: Preserve glyph width before calling
-       cff_operator_seac.
-
-2004-02-09  Martin Muskens  <mmuskens@aurelon.com>
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Handle special
-       first argument for `hintmask' and `cntrmask' operators also.
-
-2004-02-08  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.in: Call AC_SUBST for `enable_shared',
-       `hardcode_libdir_flag_spec', and `wl'.
-       * builds/unix/configure: Regenerated.
-
-       * builds/unix/freetype-config.in: Make --prefix and --exec-prefix
-       actually work.
-       Report a proper --rpath (or -R) value for --libs argument if a
-       shared library has been built.
-
-       * docs/CHANGES: Updated.
-
-2004-02-07  Keith Packard  <keithp@keithp.com>
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init, BDF_Set_Pixel_Size): Fix
-       computation of various vertical and horizontal metric values.
-
-       * src/pcfdrivr.c (PCF_Set_Pixel_Size), src/pcfread (pcf_load_font):
-       Ditto.
-
-2004-02-07  Werner Lemberg  <wl@gnu.org>
-
-       * builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.dsw, docs/CHANGES: Updated.
-
-2004-02-07  Vitaliy Pasternak  <v_a_pasternak@mail.ru>
-
-       * builds/win32/visualc/freetype.sln,
-       builds/win32/visualc/freetype.vcproj: New files for VS.NET 2003.
-
-2004-02-03  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP):
-       Initialize `node'.
-       * src/type1/t1load.c (parse_dict): Initialize `have_integer'.
-
-2004-02-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_dict): Handle `RD' and `-|' commands
-       outside of /Subrs or /CharStrings.  This can happen if there is
-       additional code manipulating those two arrays so that FreeType
-       doesn't recognize them properly.
-       (T1_Open_Face): Improve an error message.
-
-2004-02-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_charstrings): Exit immediately if
-       there are no elements in /CharStrings.  This is needed for fonts
-       like Optima-Oblique which not only define /CharStrings but access it
-       also.
-
-2004-02-01  David Turner  <david@freetype.org>
-
-       * src/sfnt/Jamfile: Removing `ttcmap' from the list of sources.
-
-       * include/freetype/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP)
-       <FTC_INLINE>: Provide macro version which doesn't use inline code.
-       * include/freetype/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP)
-       <FTC_INLINE>: Ditto.
-       Use FTC_MRULIST_LOOKUP_CMP.
-       * include/freetype/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): New
-       macro.
-       (FTC_MRULIST_LOOKUP): Use it.
-
-       * src/cache/Jamfile (_sources), src/cache/descrip.mms: Updated.
-       * src/cache/ftcbasic.c: Fix compiler warnings.
-       * src/cache/ftcmanag.c (FTC_Manager_LookupSize,
-       FTC_Manager_LookupFace) <FTC_INLINE>: Use FTC_MRULIST_LOOKUP_CMP.
-       * src/cache/ftcmru.c (FTC_MruList_Find): Fix a bug (found after
-       heavy testing).
-
-       * Jamfile: Updating `refdoc' target, and adding `autohint' to the
-       list of modules to build.  Both the autohinter and autofitter will
-       be built by default.  But which one will be used is determined by
-       the content of `ftmodule.h'.
-
-       * src/autofit/*: Many updates, but the code is still buggy...
-
-2004-01-31  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_operator_seac): Fix magnitude of
-       accent offset.
-       Update code similarly to the seac support for Type 1 fonts.
-       (cff_decoder_parse_charstrings) <cff_op_endchar>: Fix magnitude
-       of accent offset.
-       Don't hint glyphs twice if seac is emulated.
-       <cff_op_flex>: Assign correct point tags.
-       * docs/CHANGES: Updated.
-
-2004-01-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1parse.c (T1_Get_Private_Dict): Use FT_MEM_MOVE, not
-       FT_MEM_COPY, for copying the private dict.
-
-       * src/type1/t1load.c (parse_subrs): Assign number of subrs only
-       in first run.
-       (parse_charstrings): Parse /CharStrings in second run without
-       assigning values.
-       (parse_dict): Skip all /CharStrings arrays but the first.  We need
-       this for non-standard fonts like `Optima' which have different
-       outlines depending on the resolution.  Note that there is no
-       guarantee that we get fitting /Subrs and /CharStrings arrays; this
-       can only be done by a real PS interpreter.
-
-2004-01-29  Antoine Leca  <Antoine-Freetype@Leca-Marti.org>
-
-       * builds/win32/visualc/index.html: New file, giving detailed
-       explanations about forcing CR+LF line endings for the VC++ project
-       files.
-
-2004-01-22  Garrick Meeker  <garrick@digitalanarchy.com>
-
-       * src/cff/cffload.c (cff_subfont_load): Initialize `dict'.
-
-2004-01-22  Werner Lemberg  <wl@gnu.org>
-
-       Add support for the hexadecimal representation of binary data
-       started with `StartData' in CID-keyed Type 1 fonts.
-
-       * include/freetype/internal/t1types.h (CID_FaceRec): Add new
-       members `binary_data' and `cid_stream'.
-
-       * src/cid/cidload.c (cid_read_subrs): Use `face->cid_stream'.
-       (cid_hex_to_binary): New auxiliary function.
-       (cid_face_open): Add new argument `face_index' to return quickly
-       if less than zero.  Updated all callers.
-       Call `cid_hex_to_binary', then open and assign memory stream to
-       `face->cid_stream' if `parser->binary_length' is non-zero.
-       * src/cid/cidload.h: Updated.
-
-       * src/cid/cidobjs.c (cid_face_done): Free `binary_data' and
-       `cid_stream'.
-
-       * src/cid/cidparse.c (cid_parser_new): Check arguments to
-       `StartData' and set parser->binary_length accordingly.
-       * src/cid/cidparse.h (CID_Parser): New member `binary_length'.
-
-       * src/cid/cidgload.c (cid_load_glyph): Use `face->cid_stream'.
-
-       * docs/CHANGES: Updated.
-
-2004-01-21  Werner Lemberg  <wl@gnu.org>
-
-       include/freetype/config/ftstdlib.h (ft_atoi): Replaced with...
-       (ft_atol): This.
-       * src/base/ftdbgmem.c: s/atol/ft_atol/.
-       * src/type42/t42drivr.c: s/ft_atoi/ft_atol/.
-
-2004-01-20  Masatake YAMATO  <jet@gyve.org>
-
-       * include/freetype/ftcache.h: Delete duplicated definition of
-       FTC_FaceID.
-
-       * src/cff/cffdrivr.c (cff_get_cmap_info): Call sfnt module's TT CMap
-       Info service function if the cmap comes from sfnt.  Return 0 if the
-       cmap is sythesized in cff module.
-
-2004-01-20  David Turner  <david@freetype.org>
-
-       * src/cache/ftcmanag.c (ftc_size_node_compare): Call
-       FT_Activate_Size.
-
-2004-01-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1parse.c (T1_Get_Private_Dict): Skip exactly one
-       CR, LF, or CR/LF after `eexec'.
-
-2004-01-18  David Turner  <david@freetype.org>
-
-       * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Remove compiler
-       warning.
-
-       * src/tools/docmaker/*: Updating beautifier tool.
-
-2004-01-15  David Turner  <david@freetype.org>
-
-       * src/base/ftoutln.c (ft_orientation_extremum_compute): Fix
-       infinite loop bug.
-
-       * include/freetype/ftstroke.h: Include FT_GLYPH_H.
-       (FT_Stroker_Rewind, FT_Glyph_Stroke, FT_Glyph_StrokeBorder): New
-       declarations.
-
-       * src/base/ftstroke.c: Include FT_INTERNAL_OBJECTS_H.
-       (FT_Outline_GetOutsideBorder): Inverse result.
-       (FT_Stroker_Rewind, FT_Glyph_Stroke, FT_GlyphStrokeBorder): New
-       functions.
-       (FT_Stroker_EndSubPath): Close path if needed.
-       (FT_Stroker_Set, FT_Stroker_ParseOutline): Use FT_Stroker_Rewind.
-
-       * include/freetype/cache/ftcmanag.h (FTC_ScalerRec,
-       FTC_Manager_LookupSize): Moved to...
-       * include/freetype/ftcache.h (FTC_ScalerRec,
-       FTC_Manager_LookupSize): Here.
-
-       * src/tools/docmaker/docbeauty.py: New file to beautify the
-       documentation comments (e.g., to convert them to single block border
-       mode).
-       * src/tools/docmaker/docmaker.py (file_exists, make_file_list):
-       Moved to...
-       * src/tools/docmaker/utils.py (file_exists, make_file_list): Here.
-
-2004-01-14  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/ftmemory.h (FT_ARRAY_COPY,
-       FT_ARRAY_MOVE): New macros to make copying arrays easier.
-       Updated all relevant code to use them.
-
-2004-01-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_font_load): Load charstrings_index earlier.
-       Use number of charstrings as argument to CFF_Load_FD_Select (as
-       documented in the CFF specs).
-
-2004-01-13  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/pshinter/pshalgo.c (psh_glyph_init): Move assignment of
-       `glyph->memory' up to free arrays properly in case of failure.
-
-2004-01-10  Masatake YAMATO  <jet@gyve.org>
-
-       Make `FT_Get_CMap_Language_ID' work with CFF.  Bug reported by
-       Steve Hartwell <shspamsink@comcast.net>.
-
-       * src/cff/cffdrivr.c: Include FT_SERVICE_TT_CMAP_H.
-       (cff_services): Added an entry for FT_SERVICE_ID_TT_CMAP.
-       (cff_get_cmap_info): New function.
-       (cff_service_get_cmap_info) New entry for cff_services.
-
-       * src/sfnt/ttcmap0.c: Exit loop after a format match has been found.
-       Suggested by Steve Hartwell <shspamsink@comcast.net>.
-
-2004-01-03  Masatake YAMATO  <jet@gyve.org>
-
-       * src/base/ftobjs.c (destroy_charmaps): New function.
-       (destroy_face, open_face): Use `destroy_charmaps'.
-
-2004-01-01  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2004-01-01  Michael Jansson  <mjan@em2-solutions.com>
-
-       * src/winfonts/winfnt.c (FNT_Size_Set_Pixels): Fix sign of
-       size->metrics.descender.
-
-2003-12-31  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       [FT_DEBUG_LEVEL_TRACE]: Use `%ld' in FT_TRACE4.
-       <cff_op_flex1>: Change type of dx and dy to FT_Pos and remove
-       cast for accessing arguments.
-
-2003-12-31  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Revert previous
-       change.  It's not necessary.
-
-2003-12-29  Smith Charles  <smith.charles@free.fr>
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle `repeated
-       flags set' correctly.
-
-2003-12-29  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_face_init): Fix memory leak by deallocating
-       `full' and `weight' properly.
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       <cff_op_hintmask> [FT_DEBUG_LEVEL_TRACE]: Use `0x' as prefix for
-       tracing output.
-
-2003-12-26  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/sfnt.h (TT_Set_SBit_Strike_Func):
-       Use FT_UInt for ppem values.
-       * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Use FT_UInt for
-       ppem values.
-       * src/sfnt/ttsbit.h: Updated.
-
-       * src/base/ftobjs.c (FT_Set_Pixel_Sizes): Don't allow ppem values
-       larger than -0FFFF.
-
-2003-12-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/fttrigon.c, src/base/ftgloadr.c: Inlude
-       FT_INTERNAL_OBJECTS_H.
-
-       * src/base/ftstroke.c (FT_Outline_GetInsideBorder,
-       FT_Outline_GetOutsideBorder): s/or/o/ to make it compile with
-       C++ compilers.
-
-       * src/cache/ftcmru.c, include/freetype/cache/ftcmru.h:
-       s/select/selection/ to avoid compiler warning.
-       * src/cff/cffload.h: s/select/ftselect/ to avoid potential
-       compiler warning.
-
-2003-12-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftcsbits.c (FTC_SNode_Weight):
-       s/FTC_SBIT_ITEM_PER_NODE/FTC_SBIT_ITEMS_PER_NODE/.
-
-2003-12-24  David Turner  <david@freetype.org>
-
-       * Fixed compilation problems in the cache sub-system.
-
-       * Partial updates to src/autofit.
-
-       * Jamfile (FT2_COMPONENTS): Add autofit module.
-
-2003-12-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_lookup_glyph_by_stdcharcode): Handle
-       CID-keyed fonts.
-
-2003-12-23  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/ftobjs.h (FT_PAD_FLOOR, FT_PAD_ROUND,
-       FT_PAD_CEIL, FT_PIX_FLOOR, FT_PIX_ROUND, FT_CEIL): New macros.  They
-       are used to avoid compiler warnings with very pedantic compilers.
-       Note that `(x) & -64' causes a warning if (x) is not signed.  Use
-       `(x) & ~63' instead!
-       Updated all related code.
-
-       Add support for extraction of `inside' and `outside' borders.
-
-       * src/base/ftstroke.c (FT_StrokerBorder): New enumeration.
-       (FT_Outline_GetInsideBorder, FT_Outline_GetOutsideBorder,
-       FT_Stroker_GetBorderCounts, FT_Stroker_ExportBorder): New functions.
-       (FT_StrokeBorderRec): New boolean member `valid'.
-       (ft_stroke_border_get_counts): Updated.
-       * include/freetype/ftstroke.h: Updated.
-
-2003-12-22  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftwinfnt.h (FT_WinFNT_ID_*): New definitions
-       to describe the `charset' field in FT_WinFNT_HeaderRec.
-       * src/winfonts/winfnt.c (FNT_Face_Init): Set encoding to
-       FT_ENCODING_NONE except for FT_WinFNT_ID_MAC.
-
-       * include/freetype/freetype.h (FT_Encoding): Improve comment,
-       based on work by Detlef Würkner <TetiSoft@apg.lahn.de>.
-
-       * docs/CHANGES: Updated.
-
-2003-12-22  David Turner  <david@freetype.org>
-
-       * include/freetype/ftcache.h,
-       include/freetype/cache/ftcmanag.h,
-       include/freetype/cache/ftccache.h,
-       include/freetype/cache/ftcmanag.h,
-       include/freetype/cache/ftcmru.h (added),
-       include/freetype/cache/ftlru.h (removed),
-       include/freetype/cache/ftcsbits.h,
-       include/freetype/cache/ftcimage.h,
-       include/freetype/cache/ftcglyph.h,
-       src/cache/ftcmru.c,
-       src/cache/ftcmanag.c,
-       src/cache/ftccache.c,
-       src/cache/ftcglyph.c,
-       src/cache/ftcimage.c,
-       src/cache/ftcsbits.c,
-       src/cache/ftccmap.c,
-       src/cache/ftcbasic.c (added),
-       src/cache/ftclru.c (removed):
-
-         *Complete* rewrite of the cache sub-system to `solve' the
-         following points:
-
-           - all public APIs have been moved to FT_CACHE_H, everything
-             under `include/freetype/cache' is only needed by client
-             applications that want to implement their own caches
-
-           - a new function named FTC_Manager_RemoveFaceID to deal
-             with the uninstallation of FaceIDs
-
-           - the image and sbit cache are now abstract classes, that
-             can be extended much more easily by client applications
-
-           - better performance in certain areas.  Further optimizations
-             to come shortly anyway...
-
-           - the FTC_CMapCache_Lookup function has changed its signature,
-             charmaps can now only be retrieved by index
-
-           - FTC_Manager_Lookup_Face => FTC_Manager_LookupFace
-             FTC_Manager_Lookup_Size => FTC_Manager_LookupSize (still in
-             private header for the moment)
-
-2003-12-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_dict): Stop parsing if `eexec' keyword
-       is encountered.
-
-2003-12-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 32.  For
-       example, the Japanese Hiragino font already contains 15 subfonts.
-
-       * src/cff/cffload.c (cff_font_load): Deallocate `sids' array for
-       CID-keyed fonts.
-
-       * devel/ftoption.h: Define FT_DEBUG_MEMORY.
-
-2003-12-18  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ttnameid.h (TT_ADOBE_ID_LATIN_1): New macro.
-       * src/type1/t1objs.c (T1_Face_Init): Use TT_ADOBE_ID* values.
-
-2003-12-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cfftypes.h (CFF_FontRecDictRec): Change type of
-       `cid_count' to `FT_ULong'.
-
-       * src/cff/cffgload.c (cff_slot_load): Take care of empty `cids'
-       array.
-
-       * src/cff/cffload.c (cff_charset_done): Free `cids' array.
-       (cff_font_load): Create cids array only for CID-keyed fonts which
-       are subsetted.
-
-       * src/cff/cffobjs.c (cff_face_init): Check the availability of
-       the PSNames modules for non-pure CFFs also.
-       Set FT_FACE_FLAG_GLYPH_NAMES for a non-pure CFF also if it isn't
-       CID-keyed.
-
-       * src/cff/rules.mk (CFF_DRV_H): Add cfftypes.h.
-
-2003-12-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_init_face): Don't set
-       FT_FACE_FLAG_GLYPH_NAMES if the font contains a version 3.0 `post'
-       table.
-
-       * docs/CHANGES: Updated.
-
-2003-12-17  Masatake YAMATO  <jet@gyve.org>
-
-       Add new function FT_Get_CMap_Language_ID to extract the language ID
-       for TrueType/sfnt fonts.
-
-       * include/freetype/internal/services/svttcmap.h: New file.
-       * include/freetype/internal/ftserv.h (FT_SERVICE_TT_CMAP_H): Add
-       svttcmap.h.
-
-       * src/sfnt/sfdriver.c: Include ttcmap0.h.
-       (tt_service_get_cmap_info): New service.
-       (sfnt_services): Updated.
-
-       * src/sfnt/ttcmap0.c (tt_cmap*_get_info): New functions.
-       (tt_cmap*_class_rec): Add tt_cmap*_get_info members.
-       (tt_get_cmap_info): New function.
-       * src/sfnt/ttcmap0.h: Include FT_SERVICE_TT_CMAP_H.
-       (TT_CMap_ClassRec): New field `get_cmap_info'.
-       (tt_get_cmap_info): New declaration.
-
-       * src/base/ftobjs.c: Include FT_SERVICE_TT_CMAP_H.
-       (FT_Get_CMap_Language_ID): New function implementation.
-       * include/freetype/tttables.h (FT_Get_CMap_Language_ID): New
-       function declaration.
-
-2003-12-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttcmap.c, src/sfnt/ttcmap.h: Removed.  Obsolete.
-
-       * include/freetype/internal/sfnt.h (SFNT_Interface): Remove
-       obsolete fields `load_charmap' and `free_charmap'.
-       (TT_CharMap_Load_Func, TT_CharMap_Free_Func): Removed.
-       * src/sfnt/sfnt.c: Don't include ttcmap.c.
-       * src/sfnt/rules.mk (SFNT_DRV_SRC): Don't include ttcmap.c.
-       * src/sfnt/ttload.c: Don't include ttcmap.h.
-       * src/sfnt/sfdriver.c: Don't include ttcmap.h.
-       (sfnt_interface): Updated.
-
-       * include/freetype/internal/tttypes.h (TT_TableDirRec,
-       TT_CMapDirRec, TT_CMapDirEntryRec, TT_CMap0, TT_CMap2SubHeaderRec,
-       TT_CMap2Rec, TT_CMap4Segment, TT_CMap4Rec, TT_CMap6,
-       TT_CMapGroupRec, TT_CMap8_12Rec, TT_CMap10Rec, TT_CharMap_Func,
-       TT_CharNext_Func, TT_CMapTableRec, TT_CharMapRec): Removed.
-       Obsolete.
-       * src/cff/cffobjs.h (CFF_CharMapRec): Removed.  Obsolete.
-
-2003-12-15  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2003-12-15  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * builds/atari/*: New directory for building FreeType 2 on Atari
-       with the PureC compiler.
-
-2003-12-12  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add
-       cast.
-       * src/cff/cffdrivr.c (cff_ps_has_glyph_names): Assure that return
-       value is either 0 or 1.
-
-2003-12-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffdrivr.c (cff_get_glyph_name): Improve error message.
-       (cff_get_name_index): Return if no PSNames service is available.
-       (cff_ps_has_glyph_names): Handle CID-keyed fonts correctly.
-       * src/cff/cfftypes.h (CFF_CharsetRec): New field `cids', used for
-       CID-keyed fonts.  This is the inverse mapping of `sids'.
-       * src/cff/cffload.c (cff_charset_load): New argument `invert'.
-       Initialize charset->cids if `invert' is set.
-       (cff_font_load): In call to cff_charset_load, set `invert' to true
-       for CID-keyed fonts.
-       * src/cff/cffgload.c (cff_slot_load): Handle glyph index as CID
-       and map it to the real glyph index.
-
-       * docs/CHANGES: Updated.
-
-2003-12-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_face_init): Don't set
-       FT_FACE_FLAG_GLYPH_NAMES for CID-keyed fonts.
-       Don't construct a cmap for CID-keyed fonts.
-
-2003-12-10  Werner Lemberg  <wl@gnu.org>
-
-       Use implementation specific SID value 0xFFFF to indicate that
-       a dictionary element is missing.
-
-       * src/cff/cffload.c (cff_subfont_load): Initialize all fields
-       which hold SIDs to 0xFFFF.
-       (cff_index_get_sid_string): Handle SID value 0xFFFF.
-       Handle case where `psnames' is zero.
-       (cff_font_load): Updated.
-       Don't load encoding for CID-keyed CFFs.
-
-       * src/cff/cffobjs.c (cff_face_init): Updated.
-       Don't check for PSNames module if font is CID-keyed.
-       Compute style name properly (using the same algorithm as in the
-       CID driver).
-       Fix computation of style flags.
-
-       * src/cff/cfftoken.h: Comment out handling of base_font_name.
-       Rename `postscript' field to `embedded_postscript'
-       * src/cff/cfftypes.h (CFF_FontRecDictRec): Remove `base_font_name'
-       and `postscript'.
-
-2003-12-10  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/pcf/pcfdrivr.c (pcf_get_charset_id): New function (a clone
-       of the similar BDF function).
-       (pcf_service_bdf): Use it.
-
-2003-12-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Set FT_FACE_FLAG_GLYPH_NAMES
-       only if a `post' table is present.
-
-2003-12-09  George Williams  <gww@silcom.com>
-
-       * src/base/ftobjs.c (load_mac_face): Recent versions of Linux
-       support Mac's HFS+ file system, thus enable code to read /rsrc on
-       non-Macintosh platforms also.
-
-2003-12-08  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/psaux.h (PS_TableRec): Change type
-       of `lengths' to FT_PtrDist.
-       (T1_DecoderRec): Change type of `subrs_len' to FT_PtrDist.
-       * include/freetype/internal/t1types.h (T1_FontRec): Change type
-       of `subrs_len' and `charstrings_len' to FT_PtrDist.
-
-       * src/base/ftobjs.c (Mac_Read_POST_Resource): Replace `junk'
-       variable with better solution.
-       (IsMacResource): Remove unused variable `map_len'.
-       Replace `junk' variable with better solution.
-       (FT_Open_Face) [!FT_MACINTOSH]: Add conditional
-       FT_CONFIG_OPTION_MAC_FONTS.
-
-2003-12-08  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * src/autohint/ahhint.c (ah_hinter_hint_edges,
-       ah_hinter_align_strong_points): Add some casts.
-
-       * src/base/ftoutln.c (FT_OrientationExtremumRec): Change type
-       of `pos' to FT_Long.
-
-       * src/base/ftobjs.c (Mac_Read_POST_Resource,
-       Mac_Read_sfnt_Resource): Change type of `len' to FT_Long.
-
-       * src/type42/t42parse.c (t42_parse_dict): Add cast for `n_keywords'.
-
-2003-12-07  Werner Lemberg  <wl@gnu.org>
-
-       * docs/raster.txt: New file, taken from FreeType 1 and completely
-       revised.
-
-2003-12-04  Masatake YAMATO  <jet@gyve.org>
-
-       * src/type1/t1driver.c (Get_Interface): Remove FT_UNUSED for
-       t1_interface.  t1_interface is used.
-
-2003-11-27  David Turner  <david@freetype.org>
-
-       * src/pfr/pfrdrivr.c (pfr_get_metrics): Revert incorrect change of
-       2003-11-23: For PFR fonts, metrics->x_scale and metrics->y_scale are
-       the scaling values for outline units, not for metric units.
-
-2003-11-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftcalc.c, include/freetype/internal/ftcalc.h
-       (FT_MulDiv_No_Round): Surround code with `#ifdef
-       TT_CONFIG_OPTION_BYTECODE_INTERPRETER ... #endif'.
-
-2003-11-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftcalc.c (FT_MulDiv_No_Round): New function (32 and
-       64 bit version).
-       * include/freetype/internal/ftcalc.h: Updated.
-
-       * src/truetype/ttinterp.c (TT_MULDIV_NO_ROUND): New macro.
-       (TT_INT64): Removed.
-       (DO_DIV): Use TT_MULDIV_NO_ROUND.
-
-       * src/pfr/pfrdrivr.c (pfr_get_metrics): Directly use
-       metrics->x_scale and metrics->y_scale.
-
-2003-11-22  Rogier van Dalen  <R.C.van.Dalen@umail.leidenuniv.nl>
-
-       * src/truetype/ttinterp.c (CUR_Func_move_orig): New macro.
-       (Direct_Move_Orig, Direct_Move_Orig_X, Direct_Move_Orig_Y): New
-       functions.  Similar to Direct_Move, Direct_Move_X, and
-       Direct_Move_Y but without touching.
-       (Compute_Funcs): Use new functions.
-
-       (Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid,
-       Round_Up_To_Grid, Round_To_Double_Grid, Round_Super,
-       Round_Super_45): Fix rounding of value zero.
-
-       (DO_DIV): Don't use TT_MULDIV.
-
-       (Ins_SHC): This instruction actually touches the points.
-       (Ins_MSIRP): Fix undocumented behaviour.
-
-       * src/truetype/ttinterp.h (TT_ExecContextRec): Updated.
-
-2003-11-22  Werner Lemberg  <wl@gnu.org>
-
-       * docs/VERSION.DLL, docs/CHANGES: Updated.
-
-       * src/base/ftobjs.c (FT_Set_Char_Size): Make metrics->x_scale and
-       metrics->y_scale really precise.
-
-       (FT_Load_Glyph): Update computation of linearHoriAdvance and
-       linearVertAdvance.
-
-       * src/truetype/ttinterp.c (Update_Max): Use FT_REALLOC.
-
-2003-11-22  David Turner  <david@freetype.org>
-
-       * src/autofit/*: More updates.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8.
-       * builds/unix/configure.ac (version_info): Set to 9:6:3.
-       * README: Updated.
-
-2003-11-13  John A. Boyd Jr.  <jaboydjr@netwalk.com>
-
-       * src/bdf/bdfdrivr.c (bdf_interpret_style), src/pcf/pcfread.c
-       (pcf_interpret_style): Replace spaces with dashes in properties
-       SETWIDTH_NAME and ADD_STYLE_NAME to simplify parsing.
-
-2003-11-11  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2003-11-11  John A. Boyd Jr.  <jaboydjr@netwalk.com>
-
-       Handle SETWIDTH_NAME and ADD_STYLE_NAME properties for BDF and PCF
-       fonts.
-
-       * src/bdf/bdfdrivr.c (bdf_interpret_style): New auxiliary function.
-       (BDF_Face_Init): Don't handle style properties but call
-       bdf_interpret_style.
-
-       * src/pcf/pcfread.c (pcf_interpret_style): New auxiliary function.
-       (pcf_load_font): Don't handle style properties but call
-       pcf_interpret_style.
-
-2003-11-07  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.1.7 released.
-       =========================
-
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7.
-
-       * builds/unix/ft2unix.h: Fix comments.
-
-       * builds/unix/ftconfig.in: Synchronized with ANSI version.
-       Use `#undef' in templates as recommended in the autoconf
-       documentation.
-       Since real `#undef' lines don't survive during configuration, use
-       `/undef' instead; the postprocessing facility of the
-       AC_CONFIG_HEADERS autoconf macro converts them to `#undef'.
-
-       * builds/unix/install.mk (install): Install Unix version of
-       `ftconfig.h'.
-
-       * builds/unix/unix-cc.in (CFLAGS): Set FT_CONFIG_CONFIG_H macro
-       to include the correct `ftconfig.h' file.
-
-       * builds/unix/ft-munmap.m4 (FT_MUNMAP_DECL): Removed.
-       (FT_MUNMAP_PARAM): Updated syntax to autoconf 2.59.
-
-       * builds/unix/freetype2.m4: Updated syntax to autoconf 2.59.
-
-       * builds/unix/configure.ac: Use AC_CONFIG_HEADERS instead of
-       AC_CONFIG_HEADER to create ftconfig.h, and use second argument
-       to replace `/undef' with `#undef'.
-       Don't use FT_MUNMAP_DECL but AC_CHECK_DECLS to check for munmap.
-       Use AS_HELP_STRING in AC_ARG_WITH.
-       Update syntax to autoconf 2.59.
-
-       * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
-       --copy' from libtool 1.5.
-       * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
-       automake 1.7.8.
-       * builds/unix/configure: Regenerated with autoconf 2.59.
-       * builds/unix/config.guess, builds/unix/config.sub: Updated from
-       `config' CVS module at subversions.gnu.org
-       * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
-       `texinfo' CVS module at subversions.gnu.org.
-
-       * builds/vms/ftconfig.h: Synchronized with ANSI version.
-
-       * docs/CUSTOMIZE: Fix documentation error.
-       * docs/CHANGES, docs/VERSION.DLL, docs/release: Updated.
-
-       * builds/freetype.mk (refdoc): Updated --title.
-
-2003-11-07  David Turner  <david@freetype.org>
-
-
-       * Version 2.1.6 released.
-       =========================
-
-
-       * install: Removed.  Obsolete.
-
-2003-11-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfdriver.c: Include FT_SERVICE_SFNT_H.
-       (sfnt_service_sfnt_table): New service.
-       (sfnt_services): Updated.
-
-       * docs/license.txt: Reworded.
-
-2003-11-03  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/*: Add a guard to all public header files which
-       load FT_FREETYPE_H to reject freetype.h from FreeType 1.
-
-2003-11-02  Patrick Welche  <prlw1@newn.cam.ac.uk>
-
-       * builds/unix/freetype2.m4, builds/unix/ft-munmap.m4: Protect
-       first argument of AC_DEFUN with brackets to avoid possible
-       expansion.
-
-2003-11-02  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/cache/ftcglyph.h: Don't include stddef.h.
-
-       * include/freetype/freetype.h: Fix check for ft2build.h.
-
-2003-11-01  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h: Check that ft2build.h has been
-       loaded first.
-
-       * src/base/fttype1.c (FT_Get_PS_Font_Info): Fix incorrectly applied
-       patch.
-
-2003-10-31  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/base/fttype1.c (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names):
-       Fix parameter order in calls to FT_FACE_FIND_SERVICE.
-
-2003-10-31  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/ftserv.h
-       (FT_SERVICE_POSTSCRIPT_NAMES_H): Removed.  Unused.
-
-       * src/type42/t42drivr.c (t42_services): Updated.
-
-2003-10-29  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/bdftypes.h: Removed.  Obsolete.
-       * src/base/ftbdf.c: Updated.
-
-       * include/freetype/internal/cfftypes.h: Moved to...
-       * src/cff/cfftypes.h: This place since no other module needs to
-       know about those types.
-
-       * include/freetype/internal/t42types.h: Moved to...
-       * src/type42/t42types.h: This place since no other module needs to
-       know about those types.
-
-       * include/freetype/internal/services/svbdf.h: Include FT_BDF_H.
-
-       * include/freetype/internal/services/svpsname.h: Renamed to...
-       * include/freetype/internal/services/svpscmap.h: This.
-       Updated `FT_Service_PsNames' -> `FT_Service_PsCMaps' and
-       `POSTSCRIPT_NAMES' -> `POSTSCRIPT_CMAPS' everywhere.
-
-       * include/freetype/internal/services/svpsinfo.h: New file, providing
-       PostScript info service.
-
-       * include/freetype/internal/ftserv.h (FT_SERVICE_POSTSCRIPT_CMAPS_H,
-       FT_SERVICE_POSTSCRIPT_INFO_H): New macros for svpscmap.h and
-       svpsinfo.h.
-       * include/freetype/internal/internal.h (FT_INTERNAL_TYPE42_TYPES_H,
-       FT_INTERNAL_CFF_TYPES_H, FT_INTERNAL_BDF_TYPES_H): Removed.
-
-       * src/base/fttype1.c: Don't include FT_INTERNAL_TYPE1_TYPES_H and
-       FT_INTERNAL_TYPE42_TYPES_H but FT_INTERNAL_SERVICE_H and
-       FT_SERVICE_POSTSCRIPT_INFO_H.
-       (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names): Use new
-       POSTSCRIPT_INFO service.
-
-       * src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
-       (cff_ps_has_glyph_names): New function.
-       (cff_service_ps_info): New service.
-       (cff_services): Updated.
-
-       * src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h: Don't
-       include FT_INTERNAL_CFF_TYPES_H but cfftypes.h directly.
-
-       * src/cif/cidriver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
-       (cid_ps_get_font_info): New function.
-       (cid_service_ps_info): New service.
-       (cid_services): Updated.
-
-       * src/type1/t1driver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
-       (t1_ps_get_font_info, t1_ps_has_glyph_names): New functions.
-       (t1_service_ps_info): New service.
-       (t1_services): Updated.
-
-       * src/type42/t42drivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
-       (t42_ps_get_font_info, t42_ps_has_glyph_names): New functions.
-       (t42_service_ps_info): New service.
-
-       * src/type42/t42objs.h: Don't include FT_INTERNAL_TYPE42_TYPES_H
-       but t42types.h directly.
-
-       * src/psnames/psmodule.c (psnames_interface, psnames_services):
-       Renamed to...
-       (pscmaps_interface, pscmaps_services): This.
-       Updated all users.
-
-
-       * src/gzip/infblock.c (inflate_blocks): Remove compiler warning.
-
-2003-10-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_encoding): Handle `/Encoding [ ... ]'.
-
-       * src/type1/t1parse.c (T1_Get_Private_Dict): Test whether `eexec'
-       is real.
-
-       * src/type42/t42parse.c (t42_parse_encoding): Improve boundary
-       checking while parsing.
-
-       * docs/CHANGES: Updated.
-
-2003-10-21  Josselin Mouette  <joss@debian.org>
-
-       * include/freetype/internal/t1types.h (T1_FontRec): `paint_type'
-       and `stroke_width' aren't pointers.
-
-       * src/type42/t42objs.c (T42_Face_Done), src/type1/t1objs.c
-       (T1_Face_Done): Don't free `paint_type' and `stroke_width'.
-
-2003-10-20  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/winfonts/winfnt.c (fnt_cmap_class): Fix position of `const'.
-
-2003-10-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahhint.c (ah_hinter_load_glyph): Patch from
-       2003-08-18 introduced a severe bug (FT_Render_Glyph was called
-       twice under some circumstances, causing strange results).  This
-       is fixed now by clearing the FT_LOAD_RENDER bit of `load_flags'.
-
-       * src/base/ftpfr.c (FT_Get_PFR_Metrics): Initialize `error'.
-       * src/psaux/psobjs.c (ps_tobytes): Initialize `n'.
-       * src/type42/t42parse.c (t42_parse_sfnts): Initialize `string_size'.
-
-2003-10-16  Werner Lemberg  <wl@gnu.org>
-
-       Completely revised Type 42 parser.  It now handles both fonts
-       produced with ttftot42 (tested version 0.3.1) and
-       TrueTypeToType42.ps (tested version May 2001; it is necessary to
-       fix the broken header comment to be `%!PS-TrueTypeFont...').
-
-       * src/type42/t42objs.c (T42_GlyphSlot_Load): Change fourth
-       parameter to `FT_UInt'.
-       * src/type42/t42objs.h: Updated.
-
-       * src/type42/t42parse.h (T42_ParserRec): Change type of `in_memory'
-       to FT_Bool.
-       (T42_Loader): Change type of `num_chars' and `num_glyphs' to
-       FT_UInt.
-       Add `swap_table' element.
-       * src/type42/t42parse.c (T42_KEYWORD_COUNT, T1_ToFixed,
-       T1_ToCoordArray, T1_ToTokenArray): Removed.
-       (T1_ToBytes): New macro.
-       (t42_is_alpha, t42_hexval): Removed.
-       (t42_is_space): Handle `\0'.
-       (t42_parse_encoding): Updated to use new PostScript parser routines
-       from psaux.
-       Handle `/Encoding [ ... ]' also.
-       (T42_Load_Status): New enumeration.
-       (t42_parse_sfnts): Updated to use new PostScript parser routines
-       from psaux.
-       (t42_parse_charstrings): Updated to use new PostScript parser
-       routines from psaux.
-       Handle `/CharStrings << ... >>' also.
-       Don't expect that /.notdef is the first element in dictionary.  Copy
-       code from type1 module to handle this.
-       (t42_parse_dict): Updated to use new PostScript parser routines
-       from psaux.
-       Remove code for synthetic fonts (which can't occur in Type 42
-       fonts).
-       (t42_loader_done): Release `swap_table'.
-
-       * src/psaux/psobjs.c (skip_string): Increase `cur' properly.
-
-       * src/type1/t1load.c (parse_charstrings): Make test for `.notdef'
-       faster.
-
-2003-10-15  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/autohint/ahglobal.c (blue_chars), src/winfonts/winfnt.c
-       (fnt_cmap_class_rec, fnt_cmap_class), src/bdf/bdflib.c (empty,
-       _num_bdf_properties), src/gzip/infutil.c (inflate_mask),
-       src/gzip/inffixed.h (fixed_bl, fixed_bd, fixed_tl, fixed_td),
-       src/gzip/inftrees.h (inflate_trees_fixed), srf/gzip/inftrees.c
-       (inflate_trees_fixed): Decorate with more `const' to avoid
-       writable global variables which are disallowed on ARM.
-
-2003-10-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_font_matrix, parse_charstrings): Remove
-       code specially for synthetic fonts; this is handled elsewhere.
-       (parse_encoding): Remove code specially for synthetic fonts; this is
-       handled elsewhere.
-       Improve boundary checking while parsing.
-       (parse_dict): Improve boundary checking while parsing.
-       Use ft_memcmp to simplify code.
-
-2003-10-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_subrs, parse_dict): Handle synthetic
-       fonts properly.
-       (parse_charstrings): Copy correct number of characters into
-       `name_table'.
-
-2003-10-06  Werner Lemberg  <wl@gnu.org>
-
-       Heavy modification of the PS parser to handle comments and strings
-       correctly.  This doesn't slow down the loading of PS fonts
-       significantly since charstrings aren't affected.
-
-       * include/freetype/config/ftstdlib.h (ft_xdigit): Renamed to...
-       (ft_isxdigit): This.  Updated all callers.
-       (ft_isdigit): New alias to `isdigit'.
-
-       * include/freetype/internal/psaux.h (PS_Parser_FuncsRec): Renamed
-       `skip_alpha' to `skip_PS_token'.
-       Add parameter to `to_bytes' and change some argument types.
-
-       * src/psaux/psauxmod.c (ps_parser_funcs): Updated.
-       * src/psaux/psobjs.c (ft_char_table): New array to map character
-       codes (ASCII and EBCDIC) of digits to numbers.
-       (OP): New auxiliary macro holding either `>=' or `<' depending on
-       the character encoding.
-       (skip_comment): New function.
-       (skip_spaces): Use it.
-       (skip_alpha): Removed.
-       (skip_literal_string, skip_string): New functions.
-       (ps_parser_skip_PS_token): New function.  This is a better
-       replacement of...
-       (ps_parser_skip_alpha): Removed.
-       (ps_parser_to_token, ps_parser_to_token_array): Updated.
-       (T1Radix): Rewritten, using `ft_char_table'.
-       (t1_toint): Renamed to...
-       (ps_toint): This.  Update all callers.
-       Use `ft_char_table'.
-       (ps_tobytes): Add parameter to handle delimiters and change some
-       argument types.
-       Use `ft_char_table'.
-       (t1_tofixed): Renamed to...
-       (ps_tofixed): This.  Update all callers.
-       Use `ft_char_table'.
-       (t1_tocoordarray): Renamed and updated to...
-       (ps_tocoordarray): This.  Update all callers.
-       (t1_tofixedarray): Renamed and updated to...
-       (ps_tofixedarray): This.  Update all callers.
-       (t1_tobool): Renamed to...
-       (ps_tobool): This.  Update all callers.
-       (ps_parser_load_field): Updated.
-       (ps_parser_load_field_table): Use `T1_MAX_TABLE_ELEMENTS'
-       everywhere.
-       (ps_parser_to_int, ps_parser_to_fixed, ps_parser_to_coord_array,
-       ps_parser_to_fixed_array): Skip spaces.  Updated.
-       (ps_parser_to_bytes): Add parameter to handle delimiters and change
-       some argument types.  Updated.
-       * src/psaux/psobjs.h: Updated.
-
-       * src/cid/cidload.c (cid_parse_dict): Updated.
-       * src/cid/cidparse.c (cid_parser_new): Check whether the `StartData'
-       token was really found.
-       * src/cid/cidparse.h (cid_parser_skip_alpha): Updated and renamed
-       to...
-       (cid_parser_skip_PS_token): This.
-
-       * src/type1/t1parse.h (T1_ParserRec): Use `FT_Bool' for boolean
-       fields.
-       (T1_Skip_Alpha): Replaced with...
-       (T1_Skip_PS_Token): This new macro.
-       * src/type1/t1parse.c (hexa_value): Removed.
-       (T1_Get_Private_Dict): Use `ft_isxdigit' and
-       `psaux->ps_parser_funcs_to_bytes' for handling ASCII hexadecimal
-       encoding.
-       After decrypting, replace the four random bytes at the beginning
-       with whitespace.
-       * src/type1/t1load.c (t1_allocate_blend): Use proper error values.
-       (parser_blend_design_positions, parse_blend_design_map,
-       parse_weight_vector): Updated.
-       (is_space): Handle `\f' also.
-       (is_name_char): Removed.
-       (read_binary_data): Updated.
-       (parse_encoding): Use `ft_isdigit'.
-       Updated.
-       (parse_subrs): Updated.
-       (TABLE_EXTEND): New macro.
-       (parse_charstrings): Updated.
-       Provide a workaround for buggy fonts which have more entries in the
-       /CharStrings dictionary then expected; the function now adds some
-       slots and skips entries which still exceed the new limit.
-       (parse_dict): Updated.
-       Terminate on the token `closefile'.
-
-       * src/type42/t42parse.c (T1_Skip_Alpha): Replaced with...
-       (T1_Skip_PS_Token): This new macro.  Updated all callers.
-       (t42_parse_encoding): Use `ft_isdigit'.
-
-
-       * src/base/ftmm.c (ft_face_get_mm_service): Return FT_Err_OK if
-       success.
-
-2003-10-05  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftmodule.h: Renamed to...
-       * include/freetype/ftmodapi.h: This to avoid duplicate file names.
-       * include/freetype/config/ftheader.h (FT_MODULE_H): Updated.
-
-2003-10-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftoutln.c (FT_OrientationExtremumRec,
-       FT_Outline_Get_Orientation): Trivial typo fixes to make it compile.
-
-2003-10-02  Markus F.X.J. Oberhumer  <markus@oberhumer.com>
-
-       * src/winfonts/winfnt.c (FT_WinFNT_HeaderRec): `color_table_offset'
-       has four bytes, not two.
-       Fix all users.
-       (fnt_font_load, FNT_Load_Glyph): Add more font validity tests.
-
-2003-10-01  David Turner  <david@freetype.org>
-
-       * src/autofit/*: Adding first source files of the new multi-script
-       `auto-fitter'.
-
-       * include/freetype/ftoutln.h (FT_Orientation): New enumeration.
-       (FT_Outline_Get_Orientation): New declaration.
-
-       * src/base/ftoutln.c (FT_OrientationExtremumRec): New structure.
-       (ft_orientation_extremum_compute): New auxiliary function.
-       (FT_Outline_Get_Orientation): New function to compute the fill
-       orientation of a given glyph outline.
-
-       * include/freetype/internal/ftserv.h (FT_FACE_LOOKUP_SERVICE): Fixed
-       trivial bug which could crash the font engine when a cached service
-       pointer was retrieved.
-
-2003-09-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidload.c (cid_parse_dict): Skip token if no keyword is
-       found.
-
-       * src/type1/t1parse.c (IS_T1_WHITESPACE, IS_T1_LINESPACE,
-       IS_T1_SPACE): Removed.
-       (PFB_Tag): Removed.
-       (read_pfb_tag): Don't use PFB_Tag.
-
-       * src/type42/t42parse.c (t42_is_space): Handle `\f' also.
-       (t42_parse_encoding): Handle synthetic fonts.
-
-2003-09-29  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/t1types.h: Don't include
-       FT_INTERNAL_OBJECTS_H but FT_INTERNAL_SERVICE_H.
-       * src/truetype/ttobjs.c: Don't include
-       FT_SERVICE_POSTSCRIPT_NAMES_H.
-
-2003-09-29  David Turner  <david@freetype.org>
-
-       Added new service to handle glyph name dictionaries, replacing the
-       old internal header named `psnames.h' by `services/svpsname.h'.
-       Note that this is different from `services/svpostnm.h' which only
-       handles the retrieval of PostScript font names for a given face.
-       (Should we merge these two services into a single header?)
-
-       * include/freetype/internal/psnames.h: Removed.  Most of its
-       contents is moved to...
-       * include/freetype/internal/services/svpsname.h: New file.
-
-       * include/freetype/internal/services/svpostnm.h
-       (FT_SERVICE_ID_POSTSCRIPT_NAME): Replaced with...
-       (FT_SERVICE_ID_POSTSCRIPT_FONT_NAME): New macro.
-       (PsName): Service named changed to...
-       (PsFontName): This.
-       Updated `FT_Service_PsName' -> `FT_Service_PsFontName' and
-       `POSTSCRIPT_NAME' -> `POSTSCRIPT_FONT_NAME' everywhere.
-
-       * include/freetype/internal/internal.h
-       (FT_INTERNAL_POSTSCRIPT_NAMES_H): Removed.
-       * include/freetype/internal/psaux.h: Include
-       FT_SERVICE_POSTSCRIPT_NAMES_H.
-       (T1_DecoderRec): Updated type of `psnames'.
-       * include/freetype/internal/t1types.h: Don't include
-       FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
-       Include FT_INTERNAL_OBJECTS_H.
-       * include/freetype/internal/t42types.h: Don't include
-       FT_INTERNAL_POSTSCRIPT_NAMES_H.
-       * include/freetype/internal/tttypes.h (TT_FaceRec): Updated.
-
-       * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE): Changed
-       order of parameters.  All callers updated.
-       (FT_FACE_FIND_GLOBAL_SERVICE): New macro to look up a service
-       globally, checking all modules.
-       (FT_ServiceCacheRec): Updated.
-       (FT_SERVICE_POSTSCRIPT_NAMES_H): New macro for accessing
-       `svpsname.h'.
-
-       * include/freetype/internal/ftobjs.h, src/base/ftobjs.c
-       (ft_module_get_service): New function.
-
-       * src/cff/cffdrivr.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
-       but FT_SERVICE_POSTSCRIPT_NAMES_H.
-       (cff_get_glyph_name, cff_get_name_index): Use new POSTSCRIPT_NAMES
-       service.
-       * src/cff/cffcmap.c (cff_cmap_unicode_init): Updated.
-       * src/cff/cffload.c, src/cff/cffload.h:  Don't include
-       FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
-       (cff_index_get_sid_string): Updated.
-       * src/cff/cffobjs.c:  Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
-       but FT_SERVICE_POSTSCRIPT_NAMES_H.
-       (cff_face_init): Use new POSTSCRIPT_NAMES service.
-       * src/cff/cffobjs.h:  Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
-       but FT_SERVICE_POSTSCRIPT_NAMES_H.
-
-       * src/cid/cidobjs.c:  Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
-       but FT_SERVICE_POSTSCRIPT_NAMES_H.
-       (cid_face_init): Use new POSTSCRIPT_NAMES service.
-       * src/cid/cidriver.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H.
-
-       * src/psaux/t1cmap.c (t1_cmap_std_init, t1_cmap_unicode_init): Use
-       new POSTSCRIPT_NAMES service.
-       * src/psaux/t1decode.h (t1_lookup_glyph_by_stdcharcode,
-       t1_decode_init): Use new POSTSCRIPT_NAMES service.
-       * src/psaux/t1cmap.h, src/psaux/t1decode.h: Dont' include
-       FT_INTERNAL_POSTSCRIPT_NAMES_H.
-
-       * src/psnames/psmodule.c:  Don't include
-       FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
-       (ps_build_unicode_table): Renamed to...
-       (ps_unicodes_init): This.
-       (ps_lookup_unicode): Renamed to...
-       (ps_unicodes_char_index): This.
-       (ps_next_unicode): Renamed to...
-       (ps_unicodes_char_next): This.
-       (psnames_interface): Updated.
-       (psnames_services): New services list.
-       (psnames_get_service): New function.
-       (psnames_module_class): Updated.
-
-       * src/sfnt/sfobjs.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
-       but FT_SERVICE_POSTSCRIPT_NAMES_H.
-       (sfnt_init_face): Use new POSTSCRIPT_NAMES service.
-       * src/sfnt/ttpost.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
-       but FT_SERVICE_POSTSCRIPT_NAMES_H.
-       (tt_face_get_ps_name): Updated.
-
-       * src/truetype/ttobjs.c:  Don't include
-       FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
-
-       * src/type1/t1driver.c:  Don't include
-       FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
-       * src/type1/t1objs.c:  Don't include
-       FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
-       (T1_Face_Init): Use new POSTSCRIPT_NAMES service.
-
-       * src/type42/t42drivr.c (t42_get_ps_name): Renamed to...
-       (t42_get_ps_font_name): This.
-       (t42_service_ps_name): Renamed to...
-       (t42_service_ps_font_name): This.
-       (t42_services): Updated.
-       * src/type42/t42objs.c (T42_Face_Init): Use new POSTSCRIPT_NAMES
-       service.
-       * src/type42/t42objs.h:  Don't include
-       FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
-
-
-       * src/base/ftglyph.c (FT_Get_Glyph): Don't access `slot' before
-       testing its validity.  Reported by Henry Maddocks
-       <maddocks@metservice.com>.
-
-2003-09-21  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE):
-       Fix compilation warning (s/pptr/Pptr/).
-
-       * include/freetype/internal/internal.h (FT_INTERNAL_PFR_H,
-       FT_INTERNAL_FNT_TYPES_H): Removed.
-
-2003-09-21  David Turner  <david@freetype.org>
-
-       Migrating the PFR and WINFNT drivers to the new service-based
-       internal API.
-
-       * include/freetype/internal/fnttypes.h: Removed.  Most of its data
-       are moved to winfnt.h and...
-       * include/freetype/internal/services/svwinfnt.h: New file.
-
-       * include/freetype/internal/pfr.h: Removed.  Most of its data are
-       moved to...
-       * include/freetype/internal/services/svpfr.h: New file.
-
-       * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
-       FT_FACE_LOOKUP_SERVICE): Simplify fix of 2003-09-16 by removing
-       pointer type argument.
-       Updated all callers.
-       Update macro names of services header files.
-
-       * src/base/ftobjs.c (FT_Get_Name_Index): Simplified code.
-
-       * src/base/ftpfr.c: Include FT_SERVICE_PFR_H instead of
-       FT_INTERNAL_PFR_H.
-       (ft_pfr_check, FT_Get_PFR_Metrics, FT_Get_PFR_Kerning,
-       FT_Get_PFR_Advance): Use services provided in `PFR_METRICS'.
-
-       * src/base/ftwinfnt.c: Include FT_SERVICE_WINFNT_H instead of
-       FT_INTERNAL_FNT_TYPES_H.
-       (FT_Get_WinFNT_Header): Use service provided in `WINFNT'.
-
-       * src/pfr/pfrdrivr.c: Include FT_SERVICE_PFR_H and
-       FT_SERVICE_XFREE86_NAME_H instead of FT_INTERNAL_PFR_H.
-       (pfr_service_bdf): Updated.
-       (pfr_services): New services list.
-       (pfr_get_service): New function.
-       (pfr_driver_class): Updated.
-
-       * src/winfonts/winfnt.c: Include FT_SERVICE_WINFNT_H and
-       FT_SERVICE_XFREE86_NAME_H instead of FT_INTERNAL_FNT_TYPES_H.
-       (winfnt_get_header, winfnt_get_service): New functions.
-       (winfnt_service_rec): New structure providing WINFNT services.
-       (winfnt_services): New services list.
-       (winfnt_driver_class): Updated.
-       * src/winfonts/winfnt.h: Add most of the removed fnttypes.h data.
-
-       * src/sfnt/sfdriver.c (sfnt_service_ps_name): Fix typo.
-
-       * src/type1/t1driver.c (t1_service_ps_name): Fix typo.
-
-       * src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
-       src/psaux/psobjs.c, src/sfnt/sfobjs.c, src/truetype/ttobjs.c,
-       src/type1/t1objs.c, src/type42/t42objs.c: Removing various compiler
-       warnings.
-
-2003-09-19  David Bevan  <dbevan@emtex.com>
-
-       * src/type1/t1parse.c (pfb_tag_fields): Removed.
-       (read_pfb_tag): Fix code so that it doesn't fail on end-of-file
-       indicator (0x8003).
-       * docs/CHANGES: Updated.
-
-2003-09-16  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
-       FT_FACE_LOOKUP_SERVICE): Add parameter to pass pointer type.
-       Ugly, I know, but this is needed for compilation with C++ --
-       maybe someone knows a better solution?
-       Updated all callers.
-
-       * src/base/ftobjs.c (FT_Get_Name_Index, FT_Get_Glyph_Name): Remove
-       C++ compiler warnings.
-
-       * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property):
-       Fix order of arguments passed to FT_FACE_FIND_SERVICE.
-
-2003-09-15  Werner Lemberg  <wl@gnu.org>
-
-       Avoid header files with identical names.
-
-       * include/freetype/internal/services/bdf.h: Renamed to...
-       * include/freetype/internal/services/svbdf.h: This.
-       Add copyright notice.
-       * include/freetype/internal/services/glyfdict.h: Renamed to...
-       * include/freetype/internal/services/svgldict.h: This.
-       Add copyright notice.
-       * include/freetype/internal/services/multmast.h: Renamed to...
-       * include/freetype/internal/services/svmm.h: This.
-       Add copyright notice.
-       Add FT_BEGIN_HEADER and FT_END_HEADER.
-       * include/freetype/internal/services/sfnt.h: Renamed to...
-       * include/freetype/internal/services/svsfnt.h: This.
-       Add copyright notice.
-       * include/freetype/internal/services/postname.h: Renamed to...
-       * include/freetype/internal/services/svpostnm.h: This.
-       Add copyright notice.
-       * include/freetype/internal/services/xf86name.h: Renamed to...
-       * include/freetype/internal/services/svxf86nm.h: This.
-       Add copyright notice.
-
-       * include/freetype/internal/ftserv.h: Add FT_BEGIN_HEADER and
-       FT_END_HEADER.
-       Add copyright notice.
-       Update macro names of services header files.
-
-       * builds/freetype.mk (SERVICES_DIR): New variable.
-       (BASE_H): Add services header files.
-
-2003-09-11  Werner Lemberg  <wl@gnu.org>
-
-       * builds/toplevel.mk (distclean): Remove `builds/unix/freetype2.pc'.
-
-       * src/cff/cffdrivr.c: Don't load headers twice.
-
-       * include/freetype/internal/ftserv.h (FT_SERVICE_SFNT_H): New macro.
-       * src/base/ftobjs.c: Include FT_SERVICE_SFNT_H.
-
-       * src/cff/cffcmap.c: Include `cfferrs.h'.
-       * src/pfr/pfrdrivr.c: Include `pfrerror.h'.
-       * src/sfnt/sfdriver.c: Include `sferrors.h'.
-       * src/psaux/psobjs.h: Add declaration for `ps_parser_to_bytes'.
-
-2003-09-11  David Turner  <david@freetype.org>
-
-       Introducing the concept of `module services'.  This is the first
-       step towards a massive simplification of the engine's internals, in
-       order to get rid of various numbers of hacks.
-
-       Note that these changes will break source & binary compatibility for
-       authors of external font drivers.
-
-       * include/freetype/config/ftconfig.h (FT_BEGIN_STMNT, FT_END_STMNT,
-       FT_DUMMY_STMNT): New macros.
-
-       * include/freetype/internal/ftserv.h: New file, containing the new
-       structures and macros to provide `services'.
-
-       * include/freetype/internal/internal.h (FT_INTERNAL_EXTENSION_H,
-       FT_INTERNAL_EXTEND_H, FT_INTERNAL_HASH_H, FT_INTERNAL_OBJECT_H):
-       Removed, obsolete.
-       (FT_INTERNAL_SERVICE_H): New macro for `ftserv.h'.
-
-       * include/freetype/internal/services/bdf.h,
-       include/freetype/internal/services/glyfdict.h,
-       include/freetype/internal/services/postname.h,
-       include/freetype/internal/services/xf86name.h: New files.
-
-       * include/freetype/ftmm.h (FT_Get_MM_Func, FT_Set_MM_Design_Func,
-       FT_Set_MM_Blend_Func): Function pointers moved (in modified form)
-       to...
-       * include/freetype/internal/services/multmast.h: New file.
-
-       * include/freetype/internal/sfnt.h (SFNT_Interface): `get_interface'
-       is now of type `FT_Module_Requester'.
-       (SFNT_Get_Interface_Func, SFNT_Load_Table_Func): Function pointers
-       moved (in modified form) to...
-       * include/freetype/internal/services/sfnt.h: New file.
-
-       * include/freetype/tttables.h (FT_Get_Sfnt_Table_Func): Function
-       pointer moved (in modified form) to `services/sfnt.h'.
-
-       * include/freetype/ftmodule.h (FT_Module_Interface): Make it a
-       a typedef to `FT_Pointer'.
-
-       * include/freetype/internal/tttypes.h (TT_FaceRec): Add
-       `postscript_name'.
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove
-       `postscript_name'.
-       Add `services' element.
-       (FT_LibraryRec): Remove `meta_class'.
-
-       * src/base/ftbdf.c: Include FT_SERVICE_BDF_H.
-       (test_font_type): Removed.
-       (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Use services
-       provided in `FT_SERVICE_ID_BDF'.
-
-       * src/base/ftmm.c: Include FT_SERVICE_MULTIPLE_MASTERS_H.
-       (ft_face_get_mm_service): New auxiliary function to get services
-       from `FT_SERVICE_ID_MULTI_MASTERS'.
-       (FT_Get_Multi_Master, FT_Set_MM_Design_Coordinates,
-       FT_Set_MM_Blend_Coordinates): Use `ft_face_get_mm_service'.
-
-       * src/base/ftobjs.c: Include FT_SERVICE_POSTSCRIPT_NAME_H and
-       FT_SERVICE_GLYPH_DICT_H.
-       (ft_service_list_lookup): New function to get a specific service.
-       (destroy_face): Updated.
-       (Mac_Read_POST_Resource): Simplify some code.
-       (IsMacResource): Fix warnings.
-       (FT_Get_Name_Index, FT_Get_Glyph_Name): Use services provided in
-       `FT_SERVICE_ID_GLYPH_DICT'.
-       (FT_Get_Postscript_Name): Use service provided in
-       `FT_SERVICE_ID_POSTSCRIPT_NAME'.
-       (FT_Get_Sfnt_Table, FT_Load_Sfnt_Table): Use services provided in
-       `FT_SERVICE_ID_SFNT_TABLE'.
-
-       * src/base/ftxf86.c: Include FT_SERVICE_XFREE86_NAME_H.
-       (FT_Get_X11_Font_Format): Use service provided in
-       `FT_SERVICE_ID_XF86_NAME'.
-
-       * src/bdf/bdfdrivr.c: Include FT_SERVICE_BDF_H and
-       FT_SERVICE_XFREE86_NAME_H.
-       (bdf_get_charset_id): New function.
-       (bdf_service_bdf): New structure providing BDF services.
-       (bdf_services): New services list.
-       (bdf_driver_requester): Use `ft_service_list_lookup'.
-
-       * src/cff/cffdrivr.c: Include FT_SERVICE_XFREE86_NAME_H and
-       FT_SERVICE_GLYPH_DICT_H.
-       (cff_service_glyph_dict): New structure providing CFF services.
-       (cff_services): New services list.
-       (cff_get_interface): Use `ft_service_list_lookup'.
-
-       * src/cid/cidriver.c: Include FT_SERVICE_POSTSCRIPT_NAME_H and
-       FT_SERVICE_XFREE86_NAME_H.
-       (cid_service_ps_name): New structure providing CID services.
-       (cid_services): New services list.
-       (cid_get_interface): Use `ft_service_list_lookup'.
-
-       * src/pcf/pcfdrivr.c: Include FT_SERVICE_BDF_H and
-       FT_SERVICE_XFREE86_NAME_H.
-       (pcf_service_bdf): New structure providing PCF services.
-       (pcf_services): New services list.
-       (pcf_driver_requester): Use `ft_service_list_lookup'.
-
-       * src/sfnt/sfdriver.c: Include FT_SERVICE_GLYPH_DICT_H and
-       FT_SERVICE_POSTSCRIPT_NAME_H.
-       (get_sfnt_glyph_name): Renamed to...
-       (sfnt_get_glyph_name): This.
-       (get_sfnt_postscript_name): Renamed to...
-       (sfnt_get_ps_name): This.
-       Updated.
-       (sfnt_service_glyph_dict, sfnt_service_ps_name): New structures
-       providing services.
-       (sfnt_services): New services list.
-       (sfnt_get_interface): Use `ft_service_list_lookup'.
-
-       * src/truetype/ttdriver.c: Include FT_SERVICE_XFREE86_NAME_H.
-       (tt_services): New services list.
-       (tt_get_interface): Use `ft_service_list_lookup'.
-
-       * src/type1/t1driver.c: Include FT_SERVICE_MULTIPLE_MASTERS_H,
-       FT_SERVICE_GLYPH_DICT_H, FT_SERVICE_XFREE86_NAME_H, and
-       FT_SERVICE_POSTSCRIPT_NAME_H.
-       (t1_service_glyph_dict, t1_service_ps_name,
-       t1_service_multi_masters): New structures providing Type 1 services.
-       (t1_services): New services list.
-       (Get_Interface): Use `ft_service_list_lookup'.
-
-       * src/type42/t42drivr.c: Include FT_SERVICE_XFREE86_NAME_H,
-       FT_SERVICE_GLYPH_DICT_H, and FT_SERVICE_POSTSCRIPT_NAME_H.
-       (t42_service_glyph_dict, t42_service_ps_name): New strucures
-       providing Type 42 services.
-       (t42_services): New services list.
-       (T42_Get_Interface): Use `ft_service_list_lookup'.
-
-
-       * README, docs/CHANGES: Updating version numbers for 2.1.6, and
-       removing obsolete warnings in the documentation.
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6.
-       * builds/unix/configure.ac (version_info): Set to 9:5:3.
-       * builds/unix/configure: Regenerated.
-
-       * include/freetype/internal/ftcore.h,
-       include/freetype/internal/ftexcept.h,
-       include/freetype/internal/fthash.h,
-       include/freetype/internal/ftobject.h: Removed.  Obsolete.
-
-2003-09-09  David Turner  <david@freetype.org>
-
-       Fixing PFR kerning support.  The tables within the font file contain
-       (charcode,charcode) kerning pairs, we need to convert them to
-       (gindex,gindex).
-
-       * src/base/ftpfr.c (ft_pfr_check): Fix serious typo.
-       * src/pfr/prfload.c: Remove dead code.
-       (pfr_get_gindex, pfr_compare_kern_pairs, pfr_sort_kerning_pairs):
-       New functions.
-       (pfr_phy_font_done): Free `kern_pairs'.
-       (pfr_phy_font_load): Call `pfr_sort_kerning_pairs'.
-       * src/pfr/pfrobjs.c (pfr_face_get_kerning): Fix kerning extraction.
-       * src/pfr/pfrtypes.h (PFR_KERN_PAIR_INDEX): New macro.
-       (PFR_KernPairRec): Make `kerning' an FT_Int.
-       (PFR_PhyFontRec): New element `kern_pairs'.
-       (PFR_KernFlags): Values of PFR_KERN_2BYTE_CHAR and
-       PFR_KERN_2BYTE_ADJ were erroneously reversed.
-
-       * include/freetype/ftoption.h: Commenting out the macro
-       TT_CONFIG_OPTION_BYTECODE_INTERPRETER.
-
-2003-09-02  David Turner  <david@freetype.org>
-
-
-       * Version 2.1.5 released.
-       =========================
-
-
-2003-08-31  Manish Singh  <yosh@gimp.org>
-
-       * src/bdf/bdflib.c (_bdf_readstream): Don't use FT_MEM_COPY but
-       FT_MEM_MOVE.
-
-2003-08-30  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h (FT_ENCODING_SJIS, FT_ENCODING_GB2312,
-       FT_ENCODING_BIG5, FT_ENCODING_WANSUNG, FT_ENCODING_JOHAB): New
-       enumerations of FT_Encoding.  The FT_ENCODING_MS_* variants except
-       FT_ENCODING_MS_SYMBOL are now deprecated.
-       Updated all users.
-       * docs/CHANGES: Document it.
-
-2003-08-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Accept lowercase characters
-       for spacing.
-
-2003-08-27  Mike FABIAN  <mfabian@suse.de>
-
-       * src/pcf/pcfread.c (pcf_load_font), src/bdf/bdfdrivr.c
-       (BDF_Face_Init): Accept lowercase characters for slant and weight.
-
-2003-08-18  David Turner  <david@freetype.org>
-
-       * include/freetype/config/ftoption.h: Disabling TrueType bytecode
-       interpreter until the UNPATENTED_HINTING works as advertised.
-
-       * src/autohint/ahhint.c (ah_hinter_load_glyph): Use `|' for
-       setting `load_flags'.
-
-       * Jamfile: Adding the `refdoc' target to the Jamfile in order to
-       build the API Reference in `docs/reference' automatically.
-
-       * include/freetype/t1tables.h (PS_FontInfoRec), src/cid/cidtoken.h,
-       src/type1/t1tokens.h, src/type42/t42parse.c: Resetting the types of
-       `italic_angle', `underline_position', and `underline_thickness' to
-       their previous values (i.e., long, short, and ushort) in order to
-       avoid breaking binary compatibility.
-
-       * include/freetype/ttunpat.h: Fixing documentation comment.
-
-       * include/freetype/config/ftoption.h, devel/ftoption.h
-       (TT_CONFIG_OPTION_OPTION_COMPILE_UNPATENTED_HINTING): Replaced
-       with...
-       (TT_CONFIG_OPTION_UNPATENTED_HINTING): This.  Updated all users.
-       (TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING): Removed.
-
-       * include/freetype/internal/ftobjs.h (FT_DEBUG_HOOK_TYPE1): Removed.
-       (FT_DEBUG_HOOK_UNPATENTED_HINTING): New macro.  Use this with
-       `FT_Set_Debug_Hook' to get the same effect as the removed
-       TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING.
-
-       * src/truetype/ttobjs.c (tt_face_init): Use
-       `FT_DEBUG_HOOK_UNPATENTED_HINTING'.
-
-2003-08-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1gload.c (T1_Load_Glyph), src/cff/cffgload.c
-       (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph): Fix
-       previous change.
-
-2003-08-05  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1gload.c (T1_Load_Glyph), src/cff/cffgload.c
-       (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph): Apply
-       font matrix to advance width also.
-       * docs/CHANGES: Updated.
-
-2003-07-26  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.ac (version_info): Set to 9:4:3.
-       * builds/unix/configure: Updated.
-       * docs/CHANGES, docs/VERSION.DLL: Updated.
-
-       * include/freetype/freetype.h (FT_GlyphSlot): Change 2003-06-16
-       also breaks binary compatibility.  Reintroduce an unsigned integer
-       at the old position of `flags' called `reserved'.
-
-2003-07-25  Werner Lemberg  <wl@gnu.org>
-
-       Make API reference valid HTML 4.01 transitional.
-
-       * src/tools/docmaker/tohtml.py (html_header_1): Add doctype
-       and charset.
-       (html_header_2): Fix style elements and add some more.
-       Fix syntax.
-       (block_header, block_footer, description_header, description_footer,
-       marker_header, marker_footer, source_header, source_footer,
-       chapter_header): Don't use <center>...</center> but `align=center'
-       table attribute.
-       (chapter_inter, chapter_footer): Add <li> and use special <ul>
-       class.
-       Use double quotes around table widths given in percent.
-       (keyword_prefix, keyword_suffix): Don't change font colour directly
-       but use a new <span> class.
-       (section_synopsis_header, section_synopsis_footer): Don't change
-       colour.
-       (code_header, code_footer): Don't change font colour directly but
-       use a special <pre> class.
-       (print_html_field): <tr> gets the `valign' attribute, not <table>.
-       (print_html_field_list): Ditto.
-       (index_exit): Don't use <center>...</center> but `align=center'
-       table attribute.
-       (section_enter): Ditto.
-       (toc_exit): Don't emit </table>.
-       (block_enter): Use <h4><a>, not <a><h4>.
-       (__init__): Fix tag order in self.html_footer.
-
-2003-07-25  David Turner  <david@freetype.org>
-
-       This change reimplements fix from 2003-05-30 without breaking
-       binary compatibility.
-
-       * include/freetype/t1tables.h (PS_FontInfoRec): `italic_angle',
-       `is_fixed_pitch', `underline_position', `underline_thickness' are
-       reverted to be normal values.
-
-       * include/freetype/internal/psaux.h (T1_FieldType): Remove
-       `T1_FIELD_TYPE_BOOL_P', `T1_FIELD_TYPE_INTEGER_P',
-       `T1_FIELD_TYPE_FIXED_P', `T1_FIELD_TYPE_FIXED_1000_P'.
-       (T1_FIELD_TYPE_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P,
-       T1_FIELD_FIXED_1000_P): Removed.
-       (T1_FIELD_TYPE_BOOL): Renamed to...
-       (T1_FIELD_BOOL): New macro.  Updated all callers.
-
-       * src/type42/t42parse.c: `italic_angle', `is_fixed_pitch',
-       `underline_position', `underline_thickness', `paint_type',
-       `stroke_width' are reverted to be normal values.
-       (T42_KEYWORD_COUNT): New macro.
-       (t42_parse_dict): New array `keyword_flags' to mark that a value has
-       already been assigned to a dictionary entry.
-       * src/type42/t42objs.c (T42_Face_Init, T42_Face_Done): Updated.
-
-       * src/cid/cidtoken.h: `italic_angle', `is_fixed_pitch',
-       `underline_position', `underline_thickness' are reverted to be
-       normal values.
-       * src/cid/cidobjs.c (cid_face_done, cid_face_init): Updated.
-
-       * src/psaux/psobjs.c (ps_parser_load_field): Updated.
-
-       * src/type1/t1tokens.h: `italic_angle', `is_fixed_pitch',
-       `underline_position', `underline_thickness', `paint_type',
-       `stroke_width' are reverted to be normal values.
-       * src/type1/t1objs.c (T1_Face_Done, T1_Face_Init): Updated.
-       * src/type1/t1load.c (T1_FIELD_COUNT): New macro.
-       (parse_dict): Add parameter for keyword flags.
-       Record only first instance of a field.
-       (T1_Open_Face): New array `keyword_flags'.
-
-2003-07-24  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
-       * builds/unix/configure.ac (version_info): Set to 10:0:3.
-       * builds/unix/configure: Updated.
-       * builds/freetype.mk (refdoc): Fix --title.
-
-       * docs/CHANGES, docs/VERSION.DLL, README: Updated.
-
-       * src/tools/docmaker/sources.py (re_crossref): Fix regular
-       expression to handle trailing punctuation characters.
-       * src/tools/docmaker/tohtml.py (make_html_word): Updated.
-
-       * docs/release: New file.
-
-2003-07-23  YAMANO-UCHI Hidetoshi  <mer@din.or.jp>
-
-       * include/freetype/internal/psaux.h (PS_Parser_FuncsRec): New
-       member function `to_bytes'.
-
-       * src/psaux/psauxmod.c (ps_parser_funcs): New member
-       `ps_parser_to_bytes'.
-       (psaux_module_class): Increase version to 0x20000L.
-
-       * src/psaux/psobjs.c (IS_T1_LINESPACE): Add \f.
-       (IS_T1_NULLSPACE): New macro.
-       (IS_T1_SPACE): Add it.
-       (skip_spaces, skip_alpha): New functions.
-       (ps_parser_skip_spaces, ps_parser_skip_alpha): Use them.
-       (ps_tobytes, ps_parser_to_bytes): New functions.
-
-2003-07-07  Werner Lemberg  <wl@gnu.org>
-
-       * builds/freetype.mk (DOC_DIR): New variable.
-       (refdoc): Use *_DIR variables.
-       (distclean): Remove documentation files.
-
-       * builds/detect.mk (std_setup, dos_setup): Mention `make refdoc'.
-
-       * configure: Set DOC_DIR variable.
-
-2003-07-07  Patrik Hägglund  <patrik.hagglund@bredband.net>
-
-       * builds/freetype.mk (refdoc): New target to build the
-       documentation.
-       (.PHONY): Updated.
-
-       * include/freetype/freetype.h: Improve documentation of FT_CharMap.
-       * include/freetype/ftimage,h: Fix documentation of FT_OUTLINE_FLAGS.
-       * include/freetype/tttables.h: Document FT_Sfnt_Tag.
-
-2003-07-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfread.c
-       (pcf_load_font): Fix computation of height if PIXEL_SIZE property is
-       missing.
-
-2003-07-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftcsbits.c (ftc_sbit_node_compare): Only add `size' if
-       there is no error.  Reported by Knut St. Osmundsen
-       <bird-freetype@anduin.net>.
-
-2003-06-30  Werner Lemberg  <wl@gnu.org>
-
-       A new try to synchronize bitmap font access.
-
-       * include/freetype/freetype.h (FT_Bitmap_Size): `height' is now
-       defined to return the baseline-to-baseline distance.  This was
-       already the value returned by the BDF and PCF drivers.
-
-       The `width' field now gives the average width.  I wasn't able to
-       find something better.  It should be taken as informative only.
-
-       New fields `size', `x_ppem', and `y_ppem'.
-
-       * src/pcf/pcfread.c (pcf_load_font): Updated to properly fill
-       FT_Bitmap_Size.
-       Do proper rounding and conversion from 72.27 to 72 points.
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Updated to properly fill
-       FT_Bitmap_Size.
-       Do proper rounding and conversion from 72.27 to 72 points.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Updated to properly fill
-       FT_Bitmap_Size.
-
-       * src/winfonts/winfnt.c (FNT_Face_Init): Updated to properly fill
-       FT_Bitmap_Size.
-
-2003-06-29  Werner Lemberg  <wl@gnu.org>
-
-       Redesigning the FNT driver to return multiple faces, not multiple
-       strikes.  At least one font (app850.fon from WinME) contains
-       different FNT charmaps for its subfonts.  Consequently, the previous
-       design of having multiple bitmap strikes in a single font face fails
-       since we have only one charmap per face.
-
-       * include/freetype/internal/fnttypes.h (FNT_Size_Rec): Removed.
-       (FNT_FaceRec): Remove `num_fonts' field and replace `fonts' with
-       `font'.
-
-       * src/base/ftwinfnt.c (FT_Get_WinFNT_Header): Updated.
-
-       * src/winfonts/winfnt.c (fnt_font_load): Don't set pixel_width equal
-       to pixel_height.
-       (fnt_face_done_fonts): Removed.
-       (fnt_face_get_dll_fonts): Renamed to...
-       (fnt_face_get_dll_font): This.  Add second function argument to
-       select face index.
-       Updated to load just one subfont.
-       (fnt_font_done, FNT_Face_Done): Updated.
-       (FNT_Face_Init): Handle `face_index'.
-       Updated.
-       (FNT_Size_Set_Pixels): Simplified; similar to BDF and PCF, the
-       bitmap width is now ignored.
-       (FNT_Load_Glyph): Updated.
-       Fix glyph index computation.
-       (winfnt_driver_class): Updated.
-
-2003-06-25  Owen Taylor  <otaylor@redhat.com>
-
-       * src/sfnt/ttload.c (tt_face_load_hdmx): Don't assign
-       num_records until we actually decide to load the table,
-       otherwise, we'll segfault in tt_face_free_hdmx.
-
-2003-06-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffdrivr.c (cff_get_glyph_name): Protect against zero
-       glyph name pointer.  Reported by Mikey Anbary <manbary@vizrt.com>.
-
-2003-06-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/glnames.py: Updated to AGL 2.0.
-       * src/psnames/pstables.h: Regenerated.
-
-2003-06-22  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/cache/ftcglyph.h, include/freetype/ttnameid.h,
-       src/base/ftcalc.c, src/base/fttrigon.c, src/cff/cffgload.c,
-       src/otlayout/otlgsub.c, src/pshinter/pshrec.c,
-       src/psnames/psmodule.c, src/sfnt/sfobjs.c, src/truetype/ttdriver.c:
-       Decorate constants with `U' and `L' if appropriate.
-
-       * include/freetype/ftmoderr.h: Updated to include recent module
-       additions.
-
-       * src/pshinter/pshnterr.h (FT_ERR_BASE): Define as
-       `FT_Mod_Err_PShinter'.
-       * src/type42/t42error.h (FT_ERR_BASE): Define as
-       `FT_Mod_Err_Type42'.
-
-       * src/pshinter/pshrec.h (PS_HINTS_MAGIC): Removed.  Not used.
-
-       * include/freetype/config/ftconfig.h [__MWERKS__]: Define FT_LONG64
-       and FT_INT64.
-
-2003-06-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/winfonts/winfnt.c (FNT_Load_Glyph): Use first_char in
-       computation of glyph_index.
-       (FNT_Size_Set_Pixels): To find a strike, first check pixel_height
-       only, then try to find a better hit by comparing pixel_width also.
-       Without this fix it isn't possible to access all strikes.
-       Also compute metrics.max_advance to be in sync with other bitmap
-       drivers.
-
-       * src/base/ftobjs.c (FT_Set_Char_Size): Remove redundant code.
-       (FT_Set_Pixel_Size): Assign value to `metrics' after validation of
-       arguments.
-
-2003-06-20  Werner Lemberg  <wl@gnu.org>
-
-       Synchronize computation of height and width for bitmap strikes.  The
-       `width' field in the FT_Bitmap_Size structure is now only useful to
-       enumerate different strikes.  The `max_advance' field of the
-       FT_Size_Metrics structure should be used to get the (maximum) width
-       of a strike.
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Don't use AVERAGE_WIDTH for
-       computing `available_sizes->width' but make it always equal to
-       `available_sizes->height'.
-
-       * src/pcf/pcfread.c (pcf_load_font): Don't use RESOLUTION_X for
-       computing `available_sizes->width' but make it always equal to
-       `available_sizes->height'.
-
-       * src/truetype/ttdriver.c (Set_Pixel_Sizes): Pass only single
-       argument to function.
-
-       * src/psnames/psmodule.c (ps_unicode_value): Handle `.' after
-       `uniXXXX' and `uXXXX[X[X]]'.
-
-2003-06-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdfdrivr.c: s/FT_Err_/BDF_Err/.
-       * src/cache/ftccache.c, src/cache/ftcsbits.c, src/cache/ftlru.c:
-       s/FT_Err_/FTC_Err_/.
-       * src/cff/cffcmap.c: s/FT_Err_/CFF_Err_/.
-       * src/pcf/pcfdrivr.c: s/FT_Err_/PCF_Err_/.
-       * src/psaux/t1cmap.c: Include psauxerr.h.
-       s/FT_Err_/PSaux_Err_/.
-       * src/pshinter/pshnterr.h: New file.
-       * src/pshinter/rules.mk: Updated.
-       * src/pshinter/pshalgo.c, src/pshinter/pshrec.c: Include pshnterr.h.
-       s/FT_Err_/PSH_Err_/.
-       * src/pfr/pfrdrivr.c, src/pfr/pfrobjs.c, src/pfr/pfrsbit.c:
-       s/FT_Err_/PFR_Err_/.
-       * src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
-       src/sfnt/ttload.c: s/FT_Err_/SFNT_Err_/.
-       * src/truetype/ttgload.c: s/FT_Err_/TT_Err_/.
-       * src/gzip/ftgzip.c: Load FT_MODULE_ERRORS_H and define
-       FT_ERR_PREFIX and FT_ERR_BASE.
-       s/FT_Err_/Gzip_Err_/.
-
-2003-06-19  Dirck Blaskey  <listtarget@danbala.com>
-
-       * src/cff/cffload (cff_encoding_load): `nleft' must be FT_UInt,
-       otherwise adding 1 might wrap the result.
-
-2003-06-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/psnames/psmodule.c (ps_unicode_value): Add support to
-       recognize `uXXXX[X[X]]' glyph names.
-       Don't handle glyph names starting with `uni' which have more than
-       four digits.
-
-2003-06-16  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h (FT_Open_Flags): Replaced with
-       #defines for the constants.
-       (FT_Open_Args): Change type of `flags' to FT_UInt.
-       (FT_GlyphSlot): Move `flags' to FT_Slot_Internal.
-
-       * include/freetype/ftimage.h (FT_Outline_Flags, FT_Raster_Flag):
-       Replaced with #defines for the constants.
-
-       * include/freetype/internal/ftobjs.h (FT_Slot_Internal): New
-       field `flags' (from FT_GlyphSlot).
-       Updated all affected source files.
-       (FT_GLYPH_OWN_BITMAP): New macro (from ftgloadr.h).
-
-       * include/freetype/internal/ftgloadr.h (FT_GLYPH_OWN_BITMAP): Moved
-       to ftobjs.h.
-
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Use dummy
-       FT_GlyphSlot_Internal object.
-
-2003-06-15  Werner Lemberg  <wl@gnu.org>
-
-       * builds/compiler/gcc.mk, builds/compiler/gcc-dev.mk (CFLAGS):
-       Add -fno-strict-aliasing to get rid of zillion warnings from gcc
-       version 3.3.
-
-2003-06-14  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftglyph.h (ft_glyph_bbox_unscaled,
-       ft_glyph_bbox_subpixels, ft_glyph_bbox_gridfit,
-       ft_glyph_bbox_truncate, ft_glyph_bbox_pixels): Replaced with
-       FT_GLYPH_BBOX_UNSCALED, FT_GLYPH_BBOX_SUBPIXELS,
-       FT_GLYPH_BBIX_GRIDFIT, FT_GLYPH_BBOX_TRUNCATE, FT_GLYPH_BBOX_PIXELS.
-       The lowercase variants are now (deprecated aliases) to the uppercase
-       versions.
-       Updated all other files.
-
-       * include/freetype/ftmodule.h (ft_module_font_driver,
-       ft_module_renderer, ft_module_hinter, ft_module_styler,
-       ft_module_driver_scalable, ft_module_driver_no_outlines,
-       ft_module_driver_has_hinter): Replaced with FT_MODULE_FONT_DRIVER,
-       FT_MODULE_RENDERER, FT_MODULE_HINTER, FT_MODULE_STYLER,
-       FT_MODULE_DRIVER_SCALABLE, FT_MODULE_DRIVER_NO_OUTLINES,
-       FT_MODULE_DRIVER_HAS_HINTER.
-       The lowercase variants are now (deprecated aliases) to the uppercase
-       versions.
-       Updated all other files.
-
-       * src/base/ftglyph.c (FT_Glyph_Get_CBox): Handle bbox_mode better
-       as enumeration.
-
-       * src/pcf/pcfdrivr.c (pcf_driver_class), src/winfonts/winfnt.c
-       (winfnt_driver_class), src/bdf/bdfdrivr.c (bdf_driver_class): Add
-       the FT_MODULE_DRIVER_NO_OUTLINES flag.
-
-2003-06-13  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/pfr/pfrobjs.c (pfr_slot_load): Apply font matrix.
-
-2003-06-13  Werner Lemberg  <wl@gnu.org>
-
-       * builds/dos/detect.mk: Test not only for `Dos' but for `DOS' also.
-
-       * builds/dos/dos-emx.mk, builds/compiler/emx.mk: New files for
-       EMX gcc compiler.
-       * builds/dos/detect.mk: Add target `emx'.
-
-       * builds/compiler/watcom.mk (LINK_LIBRARY): GNU Make for DOS doesn't
-       like a trailing semicolon; add a dummy command.
-
-       * src/cid/cidload.c: Remove parse_font_bbox code (already enclosed
-       with #if 0 ... #endif).
-
-       * src/type1/t1tokens.h: Handle /FontName.
-       * src/type1/t1load.c (parse_font_name): Removed.
-       Remove parse_font_bbox code (already enclosed with #if 0 ...
-       #endif).
-
-       * src/type42/t42parse.c (t42_parse_font_name): Removed.
-       Remove t42_parse_font_bbox code (already enclosed with #if 0 ...
-       #endif).
-       (t42_keywords): Handle /FontName with T1_FIELD_KEY.
-
-2003-06-12  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/psaux.h (T1_FieldType): Add
-       T1_FIELD_TYPE_KEY.
-       (T1_FIELD_KEY): New macro.
-       * src/psaux/psobjs.c (ps_parser_load_field): Handle
-       T1_FIELD_TYPE_KEY.
-
-       * src/cid/cidtoken.h: Use T1_FIELD_KEY for /CIDFontName.
-
-2003-06-11  Alexander Malmberg  <alexander@malmberg.org>
-
-       * src/cache/ftlru.c (FT_LruList_Remove_Selection): Decrease
-       number of nodes.
-       (FT_LruList_Lookup): Fix assertion for out-of-memory case.
-
-2003-06-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidload.c (cid_decrypt): Removed.
-       (cid_read_subrs): Use t1_decrypt from psaux module.
-       * src/cid/cidload.h: Updated.
-       * src/cid/cidgload.c (cid_load_glyph): Use t1_decrypt from psaux
-       module.
-
-2003-06-10  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidobjs.c: Apply change 2003-05-31 from <Ron.Dev@gmx.de>.
-       Compute style flags.
-       Fix computation of root->height.
-       * src/cid/cidtoken.h: Handle FontBBox.
-       * src/cid/cidload.c (cid_load_keyword): Handle
-       T1_FIELD_LOCATION_BBOX.
-       (parse_font_bbox): Commented out.
-       (cid_field_record): Comment out element for parsing FontBBox.
-
-       * src/type42/t42parse.c (t42_parse_font_bbox): Commented out.
-       (t42_keywords): Handle FontBBox with T1_FIELD_BBOX, not with
-       T1_FIELD_CALLBACK.
-       (t42_parse_font_bbox): Commented out.
-       (t42_load_keyword): Handle T1_FIELD_LOCATION_BBOX.
-       * src/type42/t42objs.c (T42_Face_Init): Apply change 2003-05-31
-       from <Ron.Dev@gmx.de>.
-
-2003-06-09  George Williams  <gww@silcom.com>
-
-       * src/truetype/ttinterp.c (SetSuperRound) <0x30>: Follow Apple's
-       TrueType specification.
-       (Ins_MDRP, Ins_MIRP): Fix single width cut-in test.
-
-2003-06-09  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/gzip/ftgzip.c: (inflate_mask): Replaced with...
-       (NO_INFLATE_MASK): This.
-       * src/gzip/infutil.h: Declare `inflate_mask' conditionally by
-       NO_INFLATE_MASK.
-
-2003-06-09  Alexis S. L. Carvalho  <alexis@cecm.usp.br>
-
-       * src/gzip/ftgzip.c (ft_gzip_file_fill_output): Handle Z_STREAM_END
-       correctly.
-
-2003-06-09  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * src/pshinter/pshglob.c (psh_globals_new): Change calculation of
-       dim->stdw.count to avoid compiler problem.
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Move the block
-       variables to the beginning of the function to avoid compiler
-       problems.
-       Add casts necessary for 16bit compilers.
-
-2003-06-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/rules.mk (PFR_DRV_SRC): Add pfrsbit.c.
-       (PFR_DRV_H): Add pfrtypes.h.
-
-       * include/freetype/config/ftconfig.h: s/__MWKS__/__MWERKS__/.
-
-2003-06-08  Karl Schultz  <kschultz@rsinc.com>
-
-       * src/pfr/pfrsbit.c (pfr_bitwriter_init): Change type of third
-       argument to FT_Bool.
-       (pfr_lookup_bitmap_data): Change type of third and fourth argument
-       to FT_UInt.  Updated caller.
-       (pfr_load_bitmap_bits): Change type of fourth argument to FT_Bool.
-
-2003-06-08  Werner Lemberg  <wl@gnu.org>
-
-       Completely revised FreeType's make management.
-
-       . In all makefiles `/' is used as the path separator.  The
-         conversion to the real path separators is done as late as
-         possible using $(subst ...).
-
-       . $(HOSTSEP) no longer exists.  Now, $(SEP) gives the path separator
-         for the operating system, and the new $(COMPILER_SEP) the path
-         separator for the compiler tools.
-
-       . $(BUILD) has been renamed to $(BUILD_DIR).  In general, all
-         directory variables end with `_DIR'.  The variants ending in `_'
-         (like `BASE_' have been removed).
-
-       The following ChangeLog entries only describe changes which are
-       not related to the redesign.
-
-       * builds/beos/beos-def.mk (BUILD_DIR): Fix typo.
-       * builds/compiler/watcom.mk (LINK_LIBRARY): Fix linker call to avoid
-       overlong arguments as suggested by J. Ali Harlow
-       <ali@avrc.city.ac.uk>.
-       * builds/dos/dos-wat.mk: New file.
-       * builds/freetype.mk (FREETYPE_H): Include header files from the
-       `devel' subdirectory.
-
-       * builds/os2/os2-dev.mk, builds/unix/unixddef.mk,
-       builds/unix/unixddef.mk, builds/win32/w32-bccd.mk,
-       builds/win32/w32-dev.mk (BUILD_DIR): Fix path.
-
-       * builds/unix/configure.ac, builds/unix/configure: Updated.
-       * builds/unix/unix-def.in (DISTCLEAN): Add `freetype2.pc'.
-
-2003-06-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftmac.c (FT_New_Face_From_SFNT): s/rlen/sfnt_size/ to
-       make it compile.
-
-       * devel/ftoption.h: Updated.
-
-2003-06-07  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * include/freetype/internal/psaux.h, src/truetype/ttgload.h:
-       s/index/idx/ to fix compiler warnings.
-
-       * src/sfnt/ttcmap0.c (tt_face_build_cmaps): Use more `volatile' to
-       fix compiler warning.
-
-       * src/gzip/ftgzip.c (BUILDFIXED): Removed.
-       * src/gzip/inftrees.c (inflate_trees_fixed) [!BUILDFIXED]: Use
-       FT_UNUSED to remove compiler warning.
-
-2003-06-06  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftstroker.h: Renamed to...
-       * include/freetype/ftstroke.h: This.
-
-       * src/base/ftstroker.c: Renamed to...
-       * src/base/ftstroke.c: This.
-
-       * include/freetype/config/ftheader.h (FT_STROKER_H): Updated.
-
-       * src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk:
-       Updated.
-
-       * src/pcf/pcfdriver.c: Renamed to...
-       * src/pcf/pcfdrivr.c: This.
-       * src/pcf/pcfdriver.h: Renamed to...
-       * src/pcf/pcfdrivr.h: This.
-
-       * src/pcf/Jamfile, src/pcf/rules.mk: Updated.
-
-2003-06-05  Wenlin Institute (Tom Bishop)  <wenlin@wenlin.com>
-
-       * src/base/ftmac.c (file_spec_from_path) [TARGET_API_MAC_CARBON]:
-       Add `#if !defined(__MWERKS__)'.
-
-2003-06-05  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/psaux.h (T1_FieldType): Add
-       T1_FIELD_TYPE_FIXED_1000 and T1_FIELD_TYPE_FIXED_1000_P.
-       (T1_FIELD_FIXED_1000, T1_FIELD_FIXED_1000_P): New macros.
-       * src/psaux/psobjs.c (ps_parser_load_field): Handle
-       T1_FIELD_TYPE_FIXED_1000 and T1_FIELD_TYPE_FIXED_1000_P.
-
-       * src/cff/cffparse.c (cff_kind_fixed_thousand): New enumeration.
-       (CFF_FIELD_FIXED_1000): New macro.
-       (cff_parser_run): Handle cff_kind_fixed_thousand.
-       * src/cff/cfftoken.h: Use CFF_FIELD_FIXED_1000 for blue_scale.
-       * src/cff/cffload (cff_subfont_load): Fix default values of
-       expansion_factor and blue_scale.
-
-       * src/cif/cidtoken.h, src/type1/t1tokens.h: Use T1_FIELD_FIXED_1000
-       for blue_scale.
-
-       * src/pshinter/pshglob.c (psh_globals_new): Fix default value of
-       blue_scale.
-
-2003-06-04  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * include/freetype/internal/ftdriver.h,
-       include/freetype/internal/ftobjs.h,
-       include/freetype/internal/psaux.h, src/cid/cidgload.c,
-       src/psaux/psobjs.c, src/psaux/t1decode.c, src/psaux/psobjs.h,
-       src/pshinter/pshrec.c, src/pshinter/pshalgo.c,
-       src/psnames/psmodule.c, src/raster/ftraster.c, src/sfnt/sfobjs.c,
-       src/smooth/ftgrays.c, src/smooth/ftsmooth.c, src/truetype/ttobjs.c,
-       src/truetype/ttdriver.c, src/truetype/ttgload.c, src/type1/t1afm.c,
-       src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1load.c,
-       src/type1/t1objs.c, src/type42/t42parse.c, src/type42/t42parse.h:
-       Many casts and slight argument type changes to make it work with
-       a 16bit compiler.
-
-2003-06-04  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftoption.h: Defining
-       TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING by default is a bad idea
-       since some fonts (e.g. Arial) produce worse results than without
-       hinting.  Reverted.
-
-2003-06-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph)
-       [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Call
-       FT_GlyphLoader_CheckPoints before adding phantom points.  This fixes
-       a segfault bug with fonts (e.g. htst3.ttf) which have nested
-       subglyphs more than one level deep.  Reported by Anthony Fok.
-
-       * include/freetype/config/ftoption.h: Define
-       TT_CONFIG_OPTION_BYTECODE_INTERPRETER,
-       TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING, and
-       TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING to make it the new
-       default.
-
-2003-06-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahhint.c (ah_hinter_hint_edges): Removed.  Just a
-       wrapper for ah_hint_edges.
-       (ah_hint_edges): Renamed to...
-       (ah_hinter_hint_edges): This.
-
-       * src/base/ftobjs.c (FT_Set_Hint_Flags): Removed.  Unused.
-
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec),
-       include/freetype/internal/psaux.h (T1_DecoderRec),
-       src/cff/cffgload.h (CFF_Builder): Remove `hint_flags' field.
-       Unused.
-
-       * src/cff/cffgload.c (cff_builder_init): Updated.
-       (cff_decoder_parse_charstrings) <cff_op_endchar>: Call hinter->apply
-       with decoder->hint_mode instead of builder->hint_flags.
-       * src/psaux/t1decode.c (t1_decoder_init): Updated.
-
-       * src/base/ftstroker.c (ft_stroke_border_export): s/index/idx/.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Commented out code which
-       increased root->height by 15% if the line gap was zero.  There exist
-       fonts (containing e.g. form drawing characters) which intentionally
-       have a zero line gap value.
-
-       * src/truetype/ttinterp.c (Free_Project, CUR_Func_freeProj):
-       Removed.  Unused.
-       Updated all callers.
-
-2003-06-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_face_init): Use symbolic names for
-       Adobe specific encoding IDs (there was a wrong EID value for custom
-       encoding).
-
-       * src/cff/cffcmap.h (CFF_CMapStdRec): Remove `count'.
-       * src/cff/cffcmap.c (cff_cmap_encoding_init,
-       cff_cmap_encoding_done): Updated.
-       (cff_cmap_encoding_char_index, cff_cmap_encoding_char_next): Use
-       256 as limit for character code.
-
-2003-06-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/winfonts/winfnt.c (FNT_Load_Glyph): Revert change from
-       2003-03-20.
-
-2003-05-31  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/fttrigon.h (FT_Vector_Normalize): Removed.
-
-2003-05-31    <Ron.Dev@gmx.de>
-
-       * src/type1/t1objs.c (T1_Face_Init): Improve algorithm for guessing
-       the font style by ignoring spaces and hyphens.
-
-       * builds/unix/freetype2.in: Fix `Version' field.
-
-2003-05-30  Werner Lemberg  <wl@gnu.org>
-
-       Avoid overwriting of numeric font dictionary entries for synthetic
-       fonts.  Additionally, some entries were handled as `integer' instead
-       of `number'.
-
-       * include/freetype/internal/psaux.h (T1_FieldType): Add
-       T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
-       T1_FIELD_TYPE_FIXED_P.
-       (T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
-       * src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
-
-       * include/freetype/internal/cfftypes.h (CFF_FontRecDict),
-       src/cff/cfftoken.h: Change type of underline_position and
-       underline_thickness to FT_Fixed.
-       * src/cff/cffload.c (cff_subfont_load): Fix default values of
-       underline_position and underline_thickness.
-       * src/cff/cffobjs.c (cff_face_init): Set underline_position
-       and underline_thickness in `root'.
-
-       * include/freetype/internal/t1types.h (T1_Font): Change point_type
-       and stroke_width to pointers.
-       * include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
-       is_fixed_pitch, underline_position, and underline_thickness to
-       pointers.
-       * src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
-       underline_position, and underline_thickness to pointers.  Change
-       the type of the latter two to `fixed'.
-       Change type of stroke_width to `fixed' and make it a pointer.
-       Change paint_type to pointer.
-       * src/type1/t1objs.c (T1_Face_Done): Updated.
-       (T1_Face_Init): Updated.
-       Fix assignment of underline_position and underline_thickness.
-
-       * src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
-       underline_position, and underline_thickness to pointers.  Change
-       the type of the latter two to `fixed'.
-       Change type of stroke_width to `fixed'.
-       * src/cid/cidobjs.c (cid_face_done): Updated.
-       (cid_face_init): Updated.
-       Fix assignment of underline_position and underline_thickness.
-
-       * src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
-       underline_position, and underline_thickness to pointers.  Change the
-       type of the latter two to `fixed'.
-       Change type of stroke_width to `fixed' and make it a pointer.
-       Change paint_type to pointer.
-       * src/type42/t42objs.c (T42_Face_Init): Updated.
-       Fix assignment of underline_position and underline_thickness.
-       (T42_Face_Done): Updated.
-
-       * src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
-       * src/pshinter/pshglob.c, src/pshinter/pshglob.h
-       (psh_globals_set_scale): Make it a local function.
-
-       * test/gview.c: Fix renaming ps3->ps typo.
-       Formatting.
-
-2003-05-29  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshalgo1.[ch], src/pshinter/pshalgo2.[ch]: Removed.
-       * src/pshinter/pshalgo.h: Removed.
-
-       * src/pshinter/pshalgo3.[ch]: Renamed to...
-       * src/pshinter/pshalgo.[ch]: New files.
-       s/PSH3/PSH/.
-       s/psh3/psh/.
-       s/ps3/ps/.
-
-       * src/pshinter/pshrec.c, src/pshinter/pshinter.c: Updated.
-       * src/pshinter/rules.mk, src/pshinter/Jamfile: Updated.
-
-       * src/pshinter/pshglob.[ch] (psh_dimension_snap_width): Commented
-       out.
-
-       * tests/gview.c: Remove code for pshalgo1 and pshalgo2.
-       Updated.
-
-2003-05-28  Martin Zinser  <zinser@decus.de>
-
-       * vms_make.com: Reworked support for shareable images on VMS.  The
-       first version was kind of a hack; the current implementation of the
-       procedure to extract the required symbols is much cleaner.
-
-       Reworked creation of MMS files, avoiding a number of temporary files
-       which were created in the previous version.
-
-       Further work on creating descrip.mms files on the fly.
-
-       * builds/vms/descrip.mms, src/autohint/descrip.mms,
-       src/type1/descrip.mms: Removed.
-
-2003-05-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshalgo3.c (psh3_glyph_compute_extrema): Skip
-       contours with only a single point to avoid segfault.
-
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Activate code for
-       handling `origin'.
-
-2003-05-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahtypes.h (AH_OPTION_NO_STRONG_INTERPOLATION):
-       Removed since unused.
-
-2003-05-21  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftstdlib.h (ft_strcat): New wrapper macro
-       for strcat.
-
-       * src/base/ftmac.c (create_lwfn_name): s/isupper/ft_isupper/.
-       (parse_font): s/memcpy/ft_memcpy/.
-       (is_dfont) [TARGET_API_MAC_CARBON]: s/memcmp/ft_memcmp/.
-       * src/base/ftobjs.c (load_mac_face) [FT_MACINTOSH]:
-       s/strlen/ft_strlen/.
-       s/strcat/ft_strcat/.
-       s/strcpy/ft_strcpy/.
-       * src/gzip/zutil.h: s/memset/ft_memset/.
-       s/memcmp/ft_memcmp/.
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdriver.c
-       (PCF_Face_Init): Test for charset registry case-insensitively.
-
-       * src/gzip/ftgzip.c (ft_gzip_fil_io): Revert change from yesterday;
-       it has already been fixed differently.
-
-       * src/truetype/ttinterp.c (DO_SFVTL): Add missing braces around
-       if-clause.
-
-2003-05-21  Martin Zinser  <zinser@decus.de>
-
-       * t1load.c (parse_blend_axis_types): Fix compiler warning.
-
-       * descrip.mms: Removed.  Now created by...
-
-       * vms_make.com: New file.
-
-2003-05-21  Weiqi Gao  <weiqigao@networkusa.net>
-
-       * src/gzip/ftgzip.c (ft_gzip_file_io): Avoid zero value of `delta'
-       to prevent infinite loop.
-
-2003-05-21  Lars Clausen  <lrclause@cs.uiuc.edu>
-
-       * docs/VERSION.DLL: Provide better autoconf snippet to check
-       FreeType version.
-
-2003-05-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (open_face): Free `internal' not
-       `face->internal' in case of error to avoid possible segfault.
-
-       * src/pshinter/pshalgo3.c (ps3_hints_apply): Check whether we
-       actually have an outline.
-
-2003-05-20  David Chester  <davidchester@qmx.net>
-
-       * src/pshinter/pshalgo3.c (ps3_hints_apply): Try to optimize
-       y_scale so that the top of non-capital letters is aligned on a pixel
-       boundary whenever possible.
-
-       * src/autohint/ahhint.c (ah_hint_edges): Make sure that lowercase
-       m's maintain their symmetry.
-
-2003-05-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahhint.c (ah_hinter_load_glyph): Oops!  David's
-       patch from yesterday has been resolved already in a different
-       way.  Reverted.
-
-2003-05-19  David Chester  <davidchester@qmx.net>
-
-       * src/autohint/ahhint.c (ah_hinter_load_glyph): Don't scale
-       y_scale locally but face->size->metrics.y_scale.
-
-2003-05-19  David Turner  <david@freetype.org>
-
-       * src/sfnt/ttcmap0.c (tt_cmap4_char_next): Select proper start
-       value for `hi' to avoid infinite loop.
-
-2003-05-18  Yong Sun  <sunyong@njstar.com>
-
-       * src/raster/ftraster.c (Insert_Y_Turn): Fix overflow test.
-
-2003-05-18  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftoption.h [FT_CONFIG_OPTION_MAC_FONTS]:
-       New macro.
-       * src/base/ftobjs.c: Use it to control mac font support on non-mac
-       platforms.
-
-2003-05-17  George Williams  <gww@silcom.com>
-
-       Implement partial support of Mac fonts on non-Mac platforms.
-
-       * src/base/ftobjs.c (memory_stream_close, new_memory_stream,
-       open_face_from_buffer, Mac_Read_POST_Resource,
-       Mac_Read_sfnt_Resource, IsMacResource, IsMacBinary, load_mac_face)
-       [!FT_MACINTOSH]: New functions.
-       (FT_Open_Face) [!FT_MACINTOSH]: Use load_mac_face.
-
-2003-05-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Scale linear advance width only
-       if FT_FACE_FLAG_SCALABLE is set (otherwise we have a division by
-       zero since FNT and friends don't define `face->units_per_EM').
-
-2003-05-15  David Turner  <david@freetype.org>
-
-       * src/base/fttrigon.c (FT_Vector_Rotate): Avoid rounding errors
-       for small values.
-
-2003-05-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahtypes.h (AH_PointRec): Remove unused `in_angle'
-       and `out_angle' fields.
-
-2003-05-14  George Williams  <gww@silcom.com>
-
-       * src/base/ftmac.c (FT_New_Face_From_SFNT): Handle CFF files also.
-
-2003-05-14  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h: Fix typo in comment
-       (FT_HAS_FIXED_SIZES).
-
-2003-05-10  Dan Williams  <dan@bigw.org>
-
-       * builds/unix/aclocal.m4: Comment out definition of
-       `allow_undefined_flag' for Darwin 1.3.
-       * builds/unix/configure.ac: Add option --with-old-mac-fonts.
-       * builds/unix/ltmain.sh: Fix version numbering for Darwin 1.3.
-       * builds/unix/configure: Regenerated.
-
-       * include/freetype/config/ftconfig.h: Fix conditions for defining
-       `FT_MACINTOSH'.
-       * src/base/ftbase.c: Include `ftmac.c' conditionally.
-       * src/base/ftmac.c: Handle __GNUC__.
-
-2003-05-07  YAMANO-UCHI Hidetoshi  <mer@din.or.jp>
-
-       * src/cid/cidload.c (is_alpha): Removed.
-       (cid_parse_dict): Use `cid_parser_skip_alpha' instead of `is_alpha'.
-
-2003-05-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahoptim.c, src/autohint/ahoptim.h: Obsolete, removed.
-
-2003-05-07  David Turner  <david@freetype.org>
-
-       * src/autohint/ahglyph.c (ah_setup_uv): Exchange `for' loop and
-       `switch' statement to make it run faster.
-       (ah_outline_compute_segments): Reset `segment->score' and
-       `segment->link'.
-       (ah_outline_link_segments): Provide alternative code which does
-       the same but runs much faster.
-       Handle major direction also.
-       (ah_outline_compute_edges): Scale `edge_distance_threshold' down
-       after rounding instead of scaling comparison value in loop.
-
-       * src/autohint/ahhint.c (ah_hinter_align_stong_points): Provide
-       alternative code which runs faster.
-       Handle `before->scale == 0'.
-
-       * src/autohint/ahtypes.h (AH_SegmentRec): Move some fields down.
-       (AH_EdgeRec): Move some fields in structure.
-       New field `scale'.
-
-       * src/sfnt/ttcmap0.c (tt_cmap4_char_next): Use binary search.
-
-2003-05-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahoptim.c (LOG): Renamed to...
-       (AH_OPTIM_LOG): This.
-       (AH_Dump_Springs): Fix log message format.
-
-       * src/autohint/ahhint.c (ah_hint_edges_3): Renamed to...
-       (ah_hint_edges): This.
-
-2002-05-02  Keith Packard  <keithp@keithp.com>
-
-       * src/bdf/bdfdrivr.c (BDF_Set_Pixel_Size): Initialize `max_advance'.
-
-2003-05-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahglyph.c (ah_test_extrema): Renamed to...
-       (ah_test_extremum): This.
-
-2003-04-28  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.ac: Generate `freetype.pc' from
-       `freetype.in'.
-       * builds/unix/configure: Regenerated.
-       * builds/unix/install.mk (install, uninstall): Handle `freetype.pc'.
-
-2003-04-28  Gustavo J. A. M. Carneiro  <gjc@inescporto.pt>
-
-       * builds/unix/freetype2.in: New file.  Contains building information
-       for the `pkg-config' package.
-
-2003-04-28  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Fix boundary check for
-       `glyph_index'.
-
-2003-04-25:  Graham Asher  <graham.asher@btinternet.com>
-
-       Added the optional unpatented hinting system for TrueType.  It
-       allows typefaces which need hinting to produce correct glyph forms
-       (e.g., Chinese typefaces from Dynalab) to work acceptably without
-       infringing Apple patents.  This system is compiled only if
-       TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING is defined in
-       ftoption.h.
-
-       * include/freetype/ttunpat.h: New file.  Defines
-       FT_PARAM_TAG_UNPATENTED_HINTING.
-
-       * include/freetype/config/ftheader.h (FT_TRUETYPE_UNPATENTED_H): New
-       macro to use when including ttunpat.h.
-
-       * include/freetype/config/ftoption.h
-       (TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING,
-       TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING): New configuration macros
-       (not defined, but in comments) for the unpatented hinting system.
-
-       * include/freetype/internal/tttypes.h (TT_FaceRec)
-       [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: New element `FT_Bool
-       unpatented_hinting'.
-
-       * src/truetype/ttinterp.c (NO_APPLE_PATENT, APPLE_THRESHOLD):
-       Removed.
-       (GUESS_VECTOR): New macro.
-       (TT_Run_Context) [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]:
-       Set `both_x_axis'.
-       (tt_default_graphics_state)
-       [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Updated.
-       (Current_Ratio) [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]:
-       Handle `unpatented_hinting'.
-       (Direct_Move) [NO_APPLE_PATENT]: Removed.
-       [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Insert assertion.
-       (Project, FreeProject)
-       [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Insert assertion.
-       (Compute_Funcs) [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]:
-       Implement unpatented hinting.
-       (DO_SPVTCA, DO_SFVTCA, DO_SPVTL, DO_SFVTL, DO_SPVFS, DO_SFVFS,
-       Ins_SDPVTL): Call `GUESS_VECTOR'.
-       (DO_GPV, DO_GFV) [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]:
-       Handle `unpatented_hinting'.
-       (Compute_Point_Displacement) [NO_APPLE_PATENT]: Removed.
-       [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Implement unpatented
-       hinting.
-       (Move_Zp2_Point, Ins_SHPIX, Ins_DELTAP, Ins_DELTAC)
-       [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Implement unpatented
-       hinting.
-       (TT_RunIns): Updated.
-
-       * src/truetype/ttobjs.c
-       [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Include
-       FT_TRUETYPE_UNPATENTED_H.
-       (tt_face_init) [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING,
-       TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING]: Check
-       FT_PARAM_TAG_UNPATENTED_HINTING.
-
-       * src/truetype/ttobjs.h (TT_GraphicsState)
-       [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Add `both_x_axis'.
-
-2003-04-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdflib.c (hash_bucket, hash_lookup): Use `const' for first
-       argument.
-       (bdf_get_font_property): Use `const' for third argument.
-       Updated all callers.
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Set pixel width and height
-       similar to the PCF driver.
-       * src/bdf/bdf.h (_hashnode): Use `const' for `key'.
-       Updated.
-
-       * src/gzip/ftgzip.c: C++ doesn't like that the array `inflate_mask'
-       is declared twice.  It is perhaps better to modify the zlib source
-       files directly instead of this hack.
-       (zcalloc, zfree, ft_gzip_stream_close, ft_gzip_stream_io): Add casts
-       to make build with g++ successful.
-
-2003-04-24  Manish Singh  <yosh@gimp.org>
-
-       * src/cid/cidobjs.c (cid_face_init), src/type1/t1objs.c
-       (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Split on `-'
-       also for searching the style name.
-
-2003-04-24  David Turner  <david@freetype.org>
-
-       * src/pcf/pcfread.c (pcf_load_font): Fixed the computation of
-       face->num_glyphs.  We must increase the value by 1 to respect the
-       convention that glyph index 0 always corresponds to the `missing
-       glyph'.
-
-2003-04-24  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/unix-cc.in (CFLAGS): Add @CPPFLAGS@.
-
-2003-04-24  Dieter Baron  <dillo@netbsd.org>
-
-       * builds/unix/freetype-config.in (cflags): Emit FreeType 2's include
-       files first.  Otherwise there are conflicts with FreeType 1
-       installed simultaneously.
-
-2003-04-23  Werner Lemberg  <wl@gnu.org>
-
-       Fixing bugs reported by Nelson Beebe.
-
-       * src/base/ftstroker.c (FT_Stroker_ParseOutline): Remove unused
-       variable `in_path'.
-
-       * src/base/ftobjs (ft_glyphslot_set_bitmap): Change type of
-       second argument to `FT_Byte*'.
-       * include/freetype/internal/ftobjs.h: Updated.
-
-       * src/bdf/bdflib.c (_bdf_readstream): Remove unused variable `res'.
-       (_bdf_parse_glyphs): Remove unused variable `next'.
-       Mark `call_data' as unused.
-
-       * src/cache/ftlru.c (FT_LruList_Lookup): Remove unused variable
-       `plast'.
-
-       * src/pcf/pcfread.c (pcf_seek_to_table_type): Slight recoding to
-       actually use `error'.
-       (pcf_load_font): Remove unused variable `avgw'.
-
-       * src/pfr/pfrobjs.c (pfr_face_get_kerning): Change return type
-       to `void'.
-       Mark `error' as unused.
-       * src/pfr/pfrobjs.h: Updated.
-       * src/pfr/pfrdrivr.c (pfr_get_kerning): Updated.
-
-       * src/sfnt/ttload.c (sfnt_dir_check): Remove unused variable
-       `format_tag'.
-
-       * src/sfnt/ttcmap0.c (tt_cmap6_validate, tt_cmap10_validate): Remove
-       unused variable `start'.
-       (tt_cmap10_char_next): Remove unused variable `result'
-
-       * src/sfnt/sfobjs.c (tt_face_get_name): Mark `error' as unused.
-
-       * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Mark `error' as
-       unused.
-
-       * src/type1/t1objs.c (T1_Face_Init): Remove unused variable
-       `pshinter'.
-
-       * src/type1/t1gload.c (T1_Load_Glyph): Use `glyph_data_loaded'
-       only for FT_CONFIG_OPTION_INCREMENTAL.
-
-2003-04-23  Akito Hirai  <akito@kde.gr.jp>
-
-       * src/sfnt/ttcmap0.c (tt_cmap4_validate): Provide a weak variant
-       of the glyph ID bounding check if FT_VALIDATE_TIGHT is not active.
-       Without this change, many CJK fonts from Dynalab are rejected.
-
-2003-04-23  Joe Marcus Clarke  <marcus@FreeBSD.org>
-
-       * src/base/ftbdf.c (FT_Get_BDF_Property): Check for valid
-       `get_interface'.
-
-2003-04-23  Paul Miller  <paulm@profoundeffects.com>
-
-       * src/base/ftmac.c (parse_fond): Fix handling of style names.
-
-2003-04-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/pfrload.c (pfr_extra_item_load_font_id): Use FT_PtrDist
-       instead of FT_Uint for `len'.
-
-2003-04-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/gzip/ftgzip.c (zcalloc) [!FT_CONFIG_OPTION_SYSTEM_ZLIB]:
-       Convert K&R format to modern C usage.
-       (FT_Stream_OpenGzip): Use long constant.
-
-2003-04-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftccache.c (ftc_cache_lookup): Remove shadow declaration
-       of `manager'.
-
-2003-04-20  Werner Lemberg  <wl@gnu.org>
-
-       * doc/INSTALL.UNX: Cleaned up.
-
-2003-04-09  Torrey Lyons  <torrey@mrcla.com>
-
-       * src/base/ftmac.c (open_face_from_buffer): Removed a double-free
-       bug that had nasty consequences when trying to open an `invalid'
-       font on a Mac.
-
-2003-04-09  Mike Fabian  <mfabian@suse.de>
-
-       * src/bdf/bdfdrivr.h (BDF_encoding_el), src/pcf/pcf.h
-       (PCF_EncodingRec): Changed FT_Short to FT_UShort in order to be able
-       to access more than 32768 glyphs in fonts.
-
-2003-04-08  David Turner  <david@freetype.org>
-
-
-       * Version 2.1.4 released.
-       =========================
-
-
-2003-04-03  Martin Muskens  <mmuskens@aurelon.com>
-
-       * src/type1/t1load.c (T1_Open_Face): Fixed the code to make it
-       handle special cases where a font only contains a `.notdef' glyph
-       (happens in PDF-embedded fonts).  Otherwise, FT_Panic was called.
-
-2003-03-27  David Turner  <david@freetype.org>
-
-       * README: Udpated.
-
-       * README.UNX: Removed (now replaced by docs/INSTALL.UNX).
-
-       * src/pshinter/pshalgo3.c: The hinter now performs as in 2.1.3 and
-       will ignore stem quantization only when FT_LOAD_TARGET_SMOOTH is
-       used.
-       (psh3_dimension_quantize_len): Enabled.
-       (psh3_hint_align): Enable commented code.
-       (psh3_hint_align_light): Commented out.
-
-       * src/base/ftobjs.c (FT_Set_Char_Size): Changed the default
-       computations to include rounding in all cases; this is required to
-       provide accurate kerning data when native TrueType hinting is
-       enabled.
-
-       * src/type1/t1load.c (is_name_char): The Type 1 loader now accepts
-       more general names according to the PostScript specification (the
-       previous one was too restrictive).
-       (parse_font_name, parse_encoding, parse_charstrings, parse_dict):
-       Use `is_name_char'.
-       (parse_subrs): Handle empty arrays.
-
-2003-03-20  David Turner  <david@freetype.org>
-
-       Serious rewriting of the documentation.
-
-       * docs/BUGS, docs/BUILD: Removed.
-       * docs/DEBUG.TXT: Renamed to...
-       * docs/DEBUG: This.
-       * docs/CUSTOMIZE, docs/TRUETYPE, docs/UPGRADE.UNX: New files.
-       * docs/INSTALL.ANY, docs/INSTALL.UNX, docs/INSTALL.GNU New files,
-       containing platform specific information previously in INSTALL.
-       * docs/readme.vms: Renamed to...
-       * docs/INSTALL.VMS: This.
-
-       * docs/*: Updated.
-
-       Introduced three new functions to deal with glyph bitmaps within
-       FT_GlyphSlot objects:
-
-         ft_glyphslot_free_bitmap
-         ft_glyphslot_alloc_bitmap
-         ft_glyphslot_set_bitmap
-
-       These functions are much more convenient to use than managing the
-       FT_GLYPH_OWN_BITMAP flag manually.
-
-       * include/freetype/internal/ftobjs.h (ft_glyphslot_free_bitmap,
-       ft_glyphslot_alloc_bitmap, ft_glyphslot_set_bitmap): New functions.
-       * src/base/ftobjs.c: Implement them.
-       (ft_glyphslot_done): Use ft_glyphslot_free_bitmap.
-
-       * src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/pcf/pcfdriver.c
-       (PCF_Glyph_Load): Remove unused variable `memory'.
-       Use `ft_glyphslot_*' functions.
-       Don't set `FT_GLYPH_OWN_BITMAP'.
-
-       * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Use
-       `ft_glyphslot_alloc_bitmap'.
-
-       * src/sfnt/ttsbit.c (Load_SBit_Image): Change 5th argument to type
-       `FT_GlyphSlot'.
-       Adding argument `depth' to handle recursive calls.
-       Use `ft_glyphslot_alloc_bitmap'.
-       (tt_face_load_sbit_image): Remove unused variable `memory'.
-       Don't handle `FT_GLYPH_OWN_BITMAP'.
-       Update call to Load_SBit_Image.
-
-       * src/type42/t42objs.c (ft_glyphslot_clear): Renamed to...
-       (t42_glyphslot_clear): This.  Updated caller.
-       Call `ft_glyphslot_free_bitmap'.
-
-       * src/winfonts/winfnt.c (FNT_Load_Glyph): Use
-       `ft_glyphslot_set_bitmap'.
-       Don't handle `FT_GLYPH_OWN_BITMAP'.
-
-       * src/cache/ftlru.c (FT_LruList_Lookup): Fixed an invalid assertion
-       check.
-
-       * src/autohint/ahglyph.c (ah_outline_load): Add two scaling
-       arguments.
-       * src/autohint/ahglyph.h: Updated.
-       * src/autohint/ahhint.c (ah_hinter_load): Updated.
-       * src/autohint/ahglobal.c (ah_hinter_compute_widths): Updated.
-
-       * src/cache/ftccache.c (ftc_family_done): Fixed small bug that could
-       crash the cache in rare circumstances (mostly with broken fonts).
-
-2003-03-15  David Turner  <david@freetype.org>
-
-       * src/truetype/ttdriver.c (Set_Char_Sizes): Fixed a small rounding
-       bug.  Actually, it seems that previous versions of FreeType didn't
-       perform TrueType rounding exactly as appropriate.
-
-2003-03-14  David Turner  <david@freetype.org>
-
-       * src/truetype/ttdriver.c (Set_Char_Sizes): Fixing the small
-       TrueType native rendering glitches; they came from a small rounding
-       error.
-
-2003-03-13  David Turner  <david@freetype.org>
-
-       Added new environment variables to control memory debugging with
-       FreeType.  See the description of `FT2_DEBUG_MEMORY',
-       `FT2_ALLOC_TOTAL_MAX' and `FT2_ALLOC_COUNT_MAX' in DEBUG.TXT.
-
-       * src/base/ftdbgmem.c (FT_MemTableRec): Add `alloc_count',
-       `bound_total', `alloc_total_max', `bound_count', `alloc_count_max'.
-       (ft_mem_debug_alloc): Handle new variables.
-       (ft_mem_debug_init): s/FT_DEBUG_MEMORY/FT2_DEBUG_MEMORY/.
-       Handle new environment variables.
-       * docs/DEBUG.TXT: Updated.
-
-       Fixed the cache sub-system to correctly deal with out-of-memory
-       conditions.
-
-       * src/cache/ftccache.c (ftc_node_destroy): Comment out generic
-       check.
-       (ftc_cache_lookup): Implement loop.
-       * src/cache/ftccmap.c: Define FT_COMPONENT.
-       * src/cache/ftcsbits.c (ftc_sbit_node_load): Handle
-       FT_Err_Out_Of_Memory.
-       * src/cache/ftlru.c: Include FT_INTERNAL_DEBUG_H.
-       (FT_LruList_Lookup): Implement loop.
-
-       * src/pfr/pfrobjs.c (pfr_face_done): Fix memory leak.
-       (pfr_face_init): Fixing compiler warnings.
-
-       * src/psaux/psobjs.c (reallocate_t1_table): Fixed a bug (memory
-       leak) that only happened when a try to resize an array would end in
-       an out-of-memory condition.
-
-       * src/smooth/ftgrays.c (gray_convert_glyph): Removed compiler
-       warnings / volatile bug.
-
-       * src/truetype/ttobjs.c (tt_glyphzone_done): Removed segmentation
-       fault that happened in tight memory environments.
-
-2003-02-28  Pixel  <pixel@mandrakesoft.com>
-
-       * src/gzip/ftgzip.c (ft_gzip_file_done): Fixed memory leak: The ZLib
-       stream was not properly finalized.
-
-2003-02-25  Anthony Fok  <anthony@thizlinux.com>
-
-       * src/cache/ftccmap.c: Include FT_TRUETYPE_IDS_H.
-       (ftc_cmap_family_init): The cmap cache now
-       supports UCS-4 charmaps when available in Asian fonts.
-
-       * src/sfnt/ttload.c, src/base/ftobjs.c: Changed `asian' to `Asian'
-       in comments.
-
-2003-02-25  David Turner  <david@freetype.org>
-
-       * src/gzip/ftgzip.c (ft_gzip_file_fill_output): Fixed a bug that
-       caused FreeType to loop endlessly when trying to read certain
-       compressed gzip files.  The following test reveals the bug:
-
-         touch 0123456789 ; gzip 0123456789 ; ftdump 0123456789.gz
-
-       Several fixes to the PFR font driver:
-
-       - The list of available embedded bitmaps was not correctly set in
-         the root FT_FaceRec structure describing the face.
-
-       - The glyph loader always tried to load the outlines when
-         FT_LOAD_SBITS_ONLY was specified.
-
-       - The table loaded now scans for *undocumented* elements of a
-         physical font's auxiliary data record.  This is necessary to
-         retrieve the `real' family and style names.
-
-       NOTE THAT THESE CHANGES THE FAMILY NAME OF MANY PFR FONTS!
-
-       * src/pfr/pfrload.c (pfr_aux_name_load): New function.
-       (pfr_phy_font_done): Free `family_name' and `style_name' also.
-       Remove unused variables.
-       (pfr_phy_font_load): Extract useful information from the auxiliary
-       bytes.
-
-       * src/pfr/pfrobjs.c (pfr_face_done): Set pointers to NULL.
-       (pfr_face_init): Provide fallback values for `family_name' and
-       `style_name'.
-       Handle strikes.
-       (pfr_slot_load): Handle FT_LOAD_SBITS_ONLY.
-       * src/pfr/pfrtypes.h (PFR_PhyFontRec): Add fields `ascent',
-       `descent', `leading', `family_name', and `style_name'.
-
-       * src/truetype/ttdriver.c (Set_Char_Sizes): Fixed a rounding bug
-       when computing the scale factors for a given character size in
-       points with resolution.
-
-       * devel/ft2build.h, devel/ftoption.h: New files (in a new directory)
-       which are special development versions of include/ft2build.h and
-       include/freetype/config/ftoption.h, respectively.
-
-2003-02-18  David Turner  <david@freetype.org>
-
-       Fixing the slight distortion problem that occurred due to the latest
-       auto-hinter changes.
-
-       * src/base/ftobjs.c (ft_recompute_scaled_metrics): Fix rounding.
-
-       * src/truetype/ttdriver.c (Set_Char_Sizes): New variable `metrics2'.
-       [!TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Removed.
-
-       * src/truetype/ttobjs.h (TT_SizeRec): New field `metrics'.
-       * src/truetype/ttobjs.c (Reset_Outline_Size): Fix initialization of
-       `metrics'.
-       [FT_CONFIG_CHESTER_ASCENDER]: Code removed.
-       (Reset_SBit_Size): Fix initialization of `metrics'.
-
-       * src/truetype/ttinterp.c (TT_Load_Context): Fix initialization of
-       `exec->metrics'.
-
-       * src/autohint/ahhint.c (ah_hinter_load): Disabled the advance width
-       `correction' which seemed to provide more trouble than benefits.
-
-2003-02-13  Graham Asher  <graham.asher@btinternet.com>
-
-       Changed the incremental loading interface in a way that makes it
-       simpler and allows glyph metrics to be changed (e.g., by adding a
-       constant, as required by CFF fonts) rather than just overridden.
-       This was required to make the GhostScript-to-FreeType bridge work.
-
-       * src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_INCREMENTAL]:
-       Allow metrics to be overridden.
-       * src/cid/cidgload.c (cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL]:
-       Ditto.
-
-       * src/truetype/ttgload.c (load_truetype_glyph)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Simplify.
-       (compute_glyph_metrics) [FT_CONFIG_OPTION_INCREMENTAL]: Code block
-       moved down.
-
-       * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
-
-       * include/freetype/ftincrem.h: Updated.
-
-2003-01-31  David Turner  <david@freetype.org>
-
-       * docs/CHANGES, docs/VERSION.DLL, docs/TODO: Updating documentation
-       for the 2.1.4 release.
-
-       * builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/index.html: Updating the project file for
-       2.1.4.
-
-       * src/gzip/adler32.c, src/gzip/ftgzip.c, src/gzip/infblock.c,
-       src/gzip/infcodes.c, src/gzip/inflate.c, src/gzip/inftrees.c,
-       src/gzip/infutil.c: Removed old-style (K&R)function definitions.
-       This avoids warnings with Visual C++ at its most pedantic mode.
-
-       * src/pfr/pfrsbit.c: Removed compiler warnings.
-
-       * src/cache/ftccmap.c (ftc_cmap_family_init): Changed an FT_ERROR
-       into an FT_TRACE1 since it caused `ftview' and others to dump too
-       much junk when trying to display a waterfall with a font without a
-       Unicode charmap (e.g.  SYMBOL.TTF).
-
-       Implemented FT_CONFIG_CHESTER_BLUE_SCALE, corresponding to the last
-       patch from David Chester, but with a much simpler (and saner)
-       implementation.
-
-       * src/autohint/ahhint.c (ah_hinter_load_glyph)
-       [FT_CONFIG_CHESTER_BLUE_SCALE]: Try to optimize the y_scale so that
-       the top of non-capital letters is aligned on a pixel boundary
-       whenever possible.
-
-       * src/base/ftobjs.c (FT_Set_Char_Size)
-       [FT_CONFIG_CHESTER_BLUE_SCALE]: Round differently.
-       * src/truetype/ttdriver.c (Set_Char_Sizes)
-       [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Do some rounding only
-       if this macro is defined.
-
-       * src/truetype/ttobjs.c (Reset_Outline_Size)
-       [FT_CONFIG_CHESTER_ASCENDER]: Round differently.
-
-       * src/pshinter/pshalgo3.c: Improved the Postscript hinter.  Getting
-       rid of stem snapping seems to work well here (though the stems are
-       still slightly moved to increase contrast).
-       (psh3_dimension_quantize_len): Commented out.
-       (psh3_hint_align_light): New function.
-       (psh3_hint_align): Comment out some code.
-
-       THIS IMPROVES ANTI-ALIASED RENDERING, BUT MONOCHROME AND LCD MODES
-       STILL SUCK.
-
-2003-01-22  David Chester  <davidchester@qmx.net>
-
-       * src/autohint/ahhint.c (ah_compute_stem_width): Small fix to the
-       stem width optimization.
-
-2003-01-22  David Turner  <david@freetype.org>
-
-       Adding a new API `FT_Get_BDF_Property' to retrieve the BDF
-       properties of a given PCF or BDF font.
-
-       * include/freetype/ftbdf.h (FT_PropertyType): New enumeration.
-       (BDF_Property, BDF_PropertyRec): New structure.
-       FT_Get_BDF_Property): New function.
-       * include/freetype/internal/bdftypes.h: Include FT_BDF_H.
-       (BDF_GetPropertyFunc): New function pointer.
-
-       * src/base/ftbdf.c (test_font_type): New helper function.
-       (FT_Get_BDF_Charset_ID): Use `test_font_type'.
-       (FT_Get_BDF_Property): New function.
-
-       * src/bdf/bdfdrivr.c: Include FT_BDF_H.
-       (bdf_get_bdf_property, bdf_driver_requester): New functions.
-       (bdf_driver_class): Use `bdf_driver_requester'.
-
-       * src/pcf/pcfdrivr.c: Include FT_BDF_H.
-       (pcf_get_bdf_property, pdc_driver_requester): New functions
-       (pcf_driver_class): Use `pcf_driver_requester'.
-
-       * src/pcf/pcfread.c: Include `pcfread.h'.
-       (pcf_find_property): Decorate it with FT_LOCAL_DEF.
-       * src/pcf/pcfread.h: New file, providing `pcf_find_property'.
-
-       * src/sfnt/ttload.c (sfnt_dir_check): Relaxed the `head' table size
-       verification to accept a few broken fonts who pad the size
-       incorrectly (the table should be padded, but its `size' field
-       shouldn't according to the specification).
-
-2003-01-18  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
-       --copy' from libtool 1.4.3.
-       * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
-       automake 1.7.1.
-       * builds/unix/configure: Regenerated with autoconf 2.54.
-       * builds/unix/config.guess, builds/unix/config.sub: Updated from
-       `config' CVS module at subversions.gnu.org.
-       * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
-       `automake' CVS module at subversions.gnu.org.
-
-2003-01-15  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h: Fixed documentation for
-       FT_Size_Metrics.
-
-2003-01-15  James Su  <suzhe@turbolinux.com.cn>
-
-       * src/gzip/ftgzip.c (ft_gzip_check_header): Bugfix: couldn't read
-       certain gzip-ed font files (typo: `&&' -> `&').
-
-2003-01-15  Huw D M Davies  <h.davies1@physics.ox.ac.uk>
-
-       Added a Windows .FNT specific API (mostly for Wine).  Also fixed a
-       nasty bug in the header loader which would cause invalid memory
-       overwrites.
-
-       * include/freetype/config/ftheader.h (FT_WINFONTS_H): New macro
-       for ftwinfnt.h.
-       * include/freetype/internal/fnttypes.h: Include FT_WINFONTS_H.
-       (FNT_FontRec): Updated.
-       Move Windows FNT definition to...
-       * include/freetype/ftwinfnt.h: This new file.
-       (FT_WinFNT_HeaderRec): Rename `reserved2' to `reserved1'.
-       * src/base/ftwinfnt.c: New file, providing `FT_Get_WinFNT_Header'.
-       * src/winfonts/winfnt.c (winfnt_header_fields): Updated.
-       Rename `reserved2' to `reserved1'.
-       (fnt_font_load): Updated.
-
-       * src/base/Jamfile, src/base/descrip.mms, src/base/rules.mk:
-       Updated.
-
-2003-01-14  Graham Asher  <graham.asher@btinternet.com>
-
-       * include/freetype/ftglyph.h, src/base/ftglyph.c: Added `const' to
-       the type of the first argument to FT_Matrix_Multiply, which isn't
-       changed -- this adds documentation and convenience.
-
-2003-01-13  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/sfnt/ttload.c (tt_face_load_metrics)
-       [FT_CONFIG_OPTION_INCREMENTAL]: TrueType typefaces without
-       horizontal metrics (without the `hmtx' table) are now tolerated if
-       an incremental interface has been specified that has a
-       get_glyph_metrics function, implying that metrics will be supplied
-       from outside.  This happens for certain Type 42 fonts passed from
-       GhostScript.
-
-2003-01-11  David Chester  <davidchester@qmx.net>
-
-       Patches to the auto-hinter in order to slightly improve the output.
-       Note that everything is controlled through the new
-       FT_CONFIG_OPTION_CHESTER_HINTS defined in `ftoption.h'.  There are
-       also individual FT_CONFIG_CHESTER_XXX macros to control individual
-       `features'.
-
-       Note that all improvements are enabled by default, but can be
-       tweaked for optimization and testing purposes.  The configuration
-       macros will most likely disappear in the short future.
-
-       * include/freetype/config/ftoption.h
-       (FT_CONFIG_OPTION_CHESTER_HINTS): New macro.
-       (FT_CONFIG_CHESTER_{SMALL_F,ASCENDER,SERIF,STEM,BLUE_SCALE})
-       [FT_CONFIG_OPTION_CHESTER_HINTS]: New macros to control individual
-       features.
-
-       * src/autohint/ahglobal.c (blue_chars) [FT_CONFIG_CHESTER_SMALL_F]:
-       Add blue zone for `fijkdbh'.
-       * src/autohint/ahglobal.h (AH_IS_TOP_BLUE)
-       [FT_CONFIG_CHESTER_SMALL_F]: Use `AH_BLUE_SMALL_F_TOP'.
-       * src/autohint/ahglyph.c (ah_outline_compute_edges)
-       [FT_CONFIG_CHESTER_SERIF]: Use `AH_EDGE_SERIF'.
-       (ah_outline_compute_blue_edges) [FT_CONFIG_CHESTER_SMALL_F]:
-       Increase threshold for `best_dist'.
-       * src/autohint/ahhint.c (ah_compute_stem_width)
-       [FT_CONFIG_CHESTER_SERIF]: Provide new version for improved serif
-       handling.
-       (ah_align_linked_edge) [FT_CONFIG_CHESTER_SERIF]: Use special
-       version of `ah_compute_stem_width'.
-       (ah_hint_edges_3) [FT_CONFIG_CHESTER_STEM]: A new algorithm for stem
-       alignment when stem widths are less than 1.5 pixels wide centers the
-       stem slightly off-center of the center of a pixel (this increases
-       sharpness and consistency).
-       [FT_CONFIG_CHESTER_SERIF]: Use special version of
-       `ah_compute_stem_width'.
-       * src/autohint/ahtypes.h [FT_CONFIG_CHESTER_SMALL_F]: Add
-       `AH_BLUE_SMALL_F_TOP'.
-
-2003-01-11  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/fnttypes.h (WinFNT_HeaderRec): Increase
-       size of `reserved2' to avoid memory overwrites.
-
-2003-01-08  Huw Davies  <huw@codeweavers.com>
-
-       * src/winfonts/winfnt.c (winfnt_header_fields): Read 16 bytes into
-       `reserved2', not `reserved'.
-
-       * src/base/ftobjs.c (find_unicode_charmap): Fixed the error code
-       returned when the font doesn't contain a Unicode charmap.  This
-       allows FT2 to load `symbol.ttf' and a few others correctly since the
-       last release.
-       (open_face): Fix return value.
-
-2003-01-08  Owen Taylor  <owen@redhat.com>
-
-       Implemented the FT_RENDER_MODE_LIGHT hinting mode in the auto and
-       postscript hinters.
-
-       * src/autohint/ahtypes.h (AH_HinterRec): Add `do_stem_adjust'.
-       * src/autohint/ahhint.c (ah_compute_stem_width): Handle
-       hinter->do_stem_adjust.
-       (ah_hinter_load_glyph): Set hinter->do_stem_adjust.
-
-       * src/pshinter/pshalgo3.h (PSH3_GlyphRec): Add `do_stem_adjust'.
-       * src/pshinter/pshalgo3.c (psh3_hint_align): Use `do_stem_adjust'.
-       (ps3_hints_apply): Handle FT_RENDER_MODE_LIGHT.
-
-       * include/freetype/freetype.h (FT_Render_Mode): Add
-       FT_RENDER_MODE_LIGHT.
-
-       * src/truetype/ttgload.c: Fixing the TrueType loader to handle
-       invalid composites correctly by limiting the recursion depth.
-       (TT_MAX_COMPOSITE_RECURSE): New macro.
-       (load_truetype_glyph): Add argument `recurse_count'.
-       Load a composite only if the numbers of contours is -1, emit error
-       otherwise.
-       (TT_Load_Glyph): Updated.
-
-2003-01-08  David Turner  <david@freetype.org>
-
-       * Jamrules, Jamfile, Jamfile.in, src/*/Jamfile: Small changes to
-       support the compilation of FreeType 2 as part of larger projects
-       with their own configuration options (only with Jam).
-
-2003-01-07  David Turner  <david@freetype.org>
-
-       * src/base/ftstroker.c: Probably the last bug-fixes to the stroker;
-       the API is likely to change, however.
-       (ft_stroke_border_close): Don't record empty paths.
-       (ft_stroke_border_get_counts): Increase `num_points' also in for loop.
-       (ft_stroke_border_export): Don't increase `write' twice in for loops.
-       (ft_stroker_outside): Handle `phi' together with `theta'.
-       (FT_Stroker_ParseOutline): New function.
-
-       * src/base/fttrigon.c (FT_Angle_Diff): Fixing function: It returned
-       invalid values for large negative angle differences (resulting in
-       incorrect stroker computations, among other things).
-
-       * src/cache/ftccache.c (ftc_node_hash_unlink): Removing incorrect
-       assertion, and changing code to avoid hash table size contraction.
-
-       * src/base/Jamfile, src/base/rules.mk, src/base/descrip.mms: Adding
-       `ftstroker' to default build, as optional component.
-
-2002-12-26  David Turner  <david@freetype.org>
-
-       * src/gzip/adler32.c, src/gzip/infblock.c, src/gzip/inflate.c,
-       src/gzip/inftrees.c, src/gzip/zconf.h, src/gzip/zlib.h,
-       src/gzip/zutil.h: Updates to allow compilation without compiler
-       warnings with LCC-Win32.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
-       * builds/unix/configure.ac (version_info): Increased to 9:3:3.
-       * builds/unix/configure: Regenerated.
-       * docs/VERSION.DLL: Updated.
-
-2002-12-23  Anthony Fok  <anthony@thizlinux.com>
-
-       * builds/unix/configure.ac, builds/unix/unix-cc.in (LINK_LIBRARY),
-       builds/unix/unix-def.in (SYSTEM_ZLIB): Small fix to configure
-       sub-system on Unix to allow other programs to correctly link with
-       zlib when needed.
-
-2002-12-19  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/sfnt.h (SFNT_Load_Table_Func): New
-       function pointer.
-
-       * include/freetype/tttables.h (FT_Load_Sfnt_Table): New function.
-       * src/base/ftobjs.c: Implement it.
-
-       * src/sfnt/sfdriver.c (sfnt_get_interface): Handle `load_sfnt'
-       module request.
-
-2002-12-17  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c (find_unicode_charmap): Added some comments to
-       better explain what's happening there.
-       (open_face): Included Graham Asher's fix to prevent faces without
-       Unicode charmaps from loading.
-
-       * src/winfonts/winfnt.c: Included George Williams's fix to support
-       version 2 fonts correctly.
-       (winfnt_header_fields): Updated.
-       (fnt_font_load): Handle version 2 fonts.
-       (FNT_Load_Glyph): Updated.
-
-2002-12-16  David Turner  <david@freetype.org>
-
-       * docs/VERSION.DLL: Updating document to better explain the
-       differences between the three version numbers being used on Unix, as
-       well as providing an autoconf fragment provided by Lars Clausen.
-
-       * src/smooth/ftgrays.c (gray_render_conic): Fixed small bug that
-       prevented Bézier arcs with negative vertical coordinates to be
-       rendered appropriately.
-
-2002-12-02  Antoine Leca  <Antoine-Freetype@Leca-Marti.org>
-
-       * src/base/ftobjs.c: Modified the logic to get Unicode charmaps.
-       Now it loads UCS-4 charmaps when there is one.
-       (find_unicode_charmap): New function.
-       (open_face): Refer to the above one.
-       (FT_Select_Charmap): Idem.
-
-2002-11-29  Antoine Leca  <Antoine-Freetype@Leca-Marti.org>
-
-       * include/freetype/ftgzip.h: Correct the name of the controlling
-       macro (was __FTXF86_H__ ...).
-
-2002-11-27  Vincent Caron  <v.caron@zerodeux.net>
-
-       * builds/unix/unix-def.in, builds/unix/freetype-config.in,
-       builds/unix/configure.ac, src/gzip/rules.mk, src/gzip/ftgzip.c
-       [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Adding support for system zlib
-       installations if available on the target platform (Unix only).
-
-2002-11-23  David Turner  <david@freetype.org>
-
-       * src/cff/cffload.c (cff_charset_load, cff_encoding_load): Modified
-       charset loader to accept pre-defined charsets, even when the font
-       contains fewer glyphs.  Also enforced more checks to ensure that we
-       never overflow the character codes array in the encoding.
-
-2002-11-22  Antoine Leca  <Antoine-Freetype@Leca-Marti.org>
-
-       * include/freetype/ttnameid.h: Updated to latest OpenType
-       specification.
-
-2002-11-18  David Turner  <david@freetype.org>
-
-
-       * Version 2.1.3 released.
-       =========================
-
-
-2002-11-07  David Turner  <david@freetype.org>
-
-       * src/cache/ftcsbit.c (ftc_sbit_node_load): Fixed a small bug that
-       caused problems with embedded bitmaps.
-
-       * src/otlayout/otlayout.h, src/otlyaout/otlconf.h,
-       src/otlayout/otlgsub.c, src/otlayout/otlgsub.h,
-       src/otlayout/otlparse.c, src/otlayout/otlparse.h,
-       src/otlayout/otlutils.h: Updating the OpenType Layout code, adding
-       support for the first GSUB lookups.  Nothing that really compiles
-       for now though.
-
-       * src/autohint/ahhint.c (ah_align_serif_edge): Disabled serif stem
-       width quantization.  It produces slightly better shapes though this
-       is not distinguishable with many fonts.
-       Remove other dead code.
-
-       * src/Jamfile, src/*/Jamfile: Simplified.
-       Use $(FT2_SRC_DIR).
-
-2002-11-06  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h (FT_LOAD_TARGET_LIGHT): New macro.
-       (FT_LOAD_TARGET, FT_LOAD_TARGET_MODE): Use `& 15' instead of `& 7'.
-
-2002-11-05  David Turner  <david@freetype.org>
-
-       * include/freetype/config/ftoption.h, src/gzip/ftgzip.c: Added
-       support for the FT_CONFIG_OPTION_SYSTEM_ZLIB option, used to specify
-       the use of system-wide zlib.
-
-       Note that this macro, as well as
-       TT_CONFIG_OPTION_BYTECODE_INTERPRETER, is not #undef-ed anymore.
-       This allows the build system to define them depending on the
-       configuration (typically by adding -D flags at compile time).
-
-       * src/sfnt/ttcmap0.c (tt_face_build_cmaps): Removed compiler
-       warnings in optimized mode relative to the `volatile' local
-       variables.  This was not a compiler bug after all, but the fact that
-       a pointer to a volatile variable is not the same as a volatile
-       pointer to a variable :-)
-
-       The fix was to change
-         `volatile FT_Byte* p'
-       into
-         `FT_Byte* volatile p'.
-
-       * src/pfr/pfrload.c (pfr_phy_font_load), src/pfr/pfrdrivr.c
-       (pfr_get_metrics), src/gzip/inftrees.c: Removed compiler warnings in
-       optimized modes.
-
-       * src/gzip/*.[hc]: Modified our zlib copy in order to prevent
-       exporting any zlib function names outside of the component.  This
-       prevents linking problems on some platforms, when applications want
-       to link FreeType _and_ zlib together.
-
-2002-11-05  Juliusz  <jch@pps.jussieu.fr>
-
-       * src/psaux/psobjs.c (ps_table_add): Modified increment loop in
-       order to implement exponential behaviour.
-
-2002-11-01  David Turner  <david@freetype.org>
-
-       Added PFR-specific public API.  Fixed the kerning retrievel routine
-       (it returned invalid values when the outline and metrics resolution
-       differ).
-
-       * include/freetype/ftpfr.h, include/freetype/internal/pfr.h: New
-       files.
-
-       * include/freetype/internal/internal.h (FT_INTERNAL_PFR_H): New
-       macro for pfr.h.
-
-       * src/base/ftpfr.c: New file.
-       * src/base/Jamfile, src/base/descrip.mms: Updated.
-
-       * src/pfr/pfrdrivr.c: Include FT_INTERNAL_PFR_H.
-       (pfr_get_kerning, pfr_get_advance, pfr_get_metrics): New functions.
-       (pfr_service_rec): New format interface.
-       (pfr_driver_class): Use `pfr_service_rec'.
-       Replace `pfr_face_get_kerning' with `pfr_get_kerning'.
-       * src/pfr/pfrobjs.c: Remove dead code.
-
-       * src/base/ftobjs.c (ft_glyphslot_clear): Small internal fix to
-       better support bitmap-based font formats.
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Fix handling of
-       `scale'.
-       Fix arguments to `FT_Vector_From_Polar'.
-
-2002-10-31  David Turner  <david@freetype.org>
-
-       Add support for automatic handling of gzip-compressed PCF files.
-
-       * src/gzip/*: New files, taken from the zlib package (except
-       ftgzip.c).
-
-       * include/freetype/ftgzip.h, src/gzip/ftgzip.c: New files.
-       * include/freetype/config/ftheader.h (FT_GZIP_H): New macro for
-       `ftgzip.h'.
-
-       * src/pcf/pcfdriver.c: Include FT_GZIP_H and FT_ERRORS_H.
-       (PCF_Face_Init): If normal open fails, try to open gzip stream.
-       (PCF_Face_Done): Close gzip stream.
-
-       * include/freetype/internal/pcftypes.h (PCF_Public_FaceRec),
-       src/pcf/pcf.h (PCF_FaceRec): Add `gzip_stream' and `gzip_source'.
-
-       * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_USE_ZLIB):
-       New macro.
-       (T1_CONFIG_OPTION_DISABLE_HINTER, FT_CONFIG_OPTION_USE_CMAPS
-       FT_CONFIG_OPTION_NO_CONVENIENCE_FUNCS,
-       FT_CONFIG_OPTION_ALTERNATE_GLYPH_FORMATS): Removed.
-
-       (FT_EXPORT, FT_EXPORT_DEF, FT_DEBUG_LEVEL_ERROR,
-       FT_DEBUG_LEVEL_TRACE, FT_DEBUG_MEMORY): Comment out definitions so
-       that platform specific configuration file can override.
-
-       * include/freetype/internal/ftstream.h: Include FT_SYSTEM_H.
-
-2002-10-30  David Turner  <david@freetype.org>
-
-       * FreeType 2.1.3rc3 released.
-
-2002-10-25  David Turner  <david@freetype.org>
-
-       * include/freetype/ftcache.h (FT_POINTER_TO_ULONG): New macro.
-       (FTC_FACE_ID_HASH): Rewritten, using FT_POINTER_TO_ULONG.
-
-2002-10-22  Giuseppe Ghibò  <ghibo@mandrakesoft.com>
-
-       * include/freetype/freetype.h (FT_Encoding): Fix entry for latin-2.
-
-2002-10-07  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h (FT_Open_Face): Use `const' for `args'
-       (suggested by Graham).
-       * src/base/ftobjs.c (FT_Open_Face): Updated.
-       (ft_input_stream_new): Ditto.
-
-2002-10-05  David Turner  <david@freetype.org>
-
-       Adding support for embedded bitmaps to the PFR driver, and rewriting
-       its kerning loader/handler to use all kerning pairs in a physical
-       font (and not just the first item).
-
-       * src/pfr/pfr.c: Include `pfrsbit.c'.
-       * src/pfr/pfrgload.c: Include `pfrsbit.h'.
-       * src/pfr/pfrload.c (pfr_extra_item_load_kerning_pairs): Rewritten.
-       (pfr_phy_font_done, pfr_phy_font_load): Updated.
-       * src/pfr/pfrobks.c: Include `pfrsbit.h'.
-       (pfr_face_init): Handle kerning and embedded bitmaps.
-       (pfr_slot_load): Load embedded bitmaps.
-       (PFR_KERN_INDEX): Removed.
-       (pfr_face_get_kerning): Rewritten.
-       * src/pfr/pfrsbit.c, src/pfr/pfrsbit.h: New files.
-       * src/pfr/pfrtypes.h (PFR_KernItemRec): New structure.
-       (PFR_KERN_INDEX): New macro.
-       (PFR_PhyFontRec): Add items for kerning and embedded bitmaps.
-       * src/pfr/Jamfile (_sources) [FT2_MULTI]: Add `pfrsbit'.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Don't load bitmap fonts if
-       FT_LOAD_NO_RECURSE is set.
-       Load embedded bitmaps only if FT_LOAD_NO_BITMAP isn't set.
-
-       * src/tools/docmaker/content.py, src/tools/docmaker/sources.py,
-       src/tools/docmaker/tohtml.py: Fixing a few nasty bugs.
-
-       * src/sfnt/ttcmap0.c (tt_cmap4_validate): The validator for format 4
-       sub-tables is now capable of dealing with invalid `length' fields at
-       the start of the sub-table.  This allows fonts like `mg______.ttf'
-       (i.e.  Marriage) to return accurate charmaps.
-
-       * docs/CHANGES: Updated.
-
-2002-10-05  Werner Lemberg  <wl@gnu.org>
-
-       * src/smooth/ftgrays.c (SUBPIXELS): Add cast to `TPos'.
-       Update all callers.
-       (TRUNC): Add cast to `TCoord'.
-       Update all callers.
-       (TRaster): Use `TPos' for min_ex, max_ex, min_ey, max_ey, and
-       last_ey.
-       Update all casts.
-       (gray_render_line): Fix casts for `p' and `first'.
-
-2002-10-02  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/bdf/bdflib.c (bdf_load_font): Allocate the _bdf_parse_t
-       structure with FT_ALLOC instead of using the stack.
-
-2002-09-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/include/freetype/internal/tttypes.h (num_sbit_strikes,
-       num_sbit_scales): Use `FT_ULong'.
-       * src/sfnt/sfobjs.c (sfnt_load_face): Updated accordingly.
-       * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Ditto.
-       (find_sbit_image): Remove cast.
-       * src/raster/ftrend1.c (ft_raster1_render): Fix cast.
-
-2002-09-27  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * src/sfnt/ttload.c (tt_face_load_names): Use cast.
-       * src/sfnt/ttcmap.c (code_to_next2): Use long constant.
-       (code_to_index4): Use cast.
-       (code_to_index8_12): Fix cast.
-       * src/sfnt/ttcmap0.c (tt_cmap4_char_next, tt_cmap8_char_index,
-       tt_cmap12_char_index): Use cast for `result'.
-       (tt_face_build_cmaps): Use cast.
-       * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_ucs4): Use cast for
-       `code'.
-       (sfnt_load_face): Use FT_Int32 for `flags'.
-
-       * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line,
-       gray_compute_cbox, gray_convert_glyph, gray_raster_reset): Add casts
-       to `TCoord' and `int'.
-       More 16bit fixes.
-       s/FT_Pos/TPos/.
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Add casts.
-
-2002-09-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttpost.c (load_post_names, tt_face_free_ps_names,
-       tt_face_get_ps_name): Replace switch statement with if clauses to
-       make it more portable.
-
-       * src/cff/cffobjs.c (cff_face_init): Ditto.
-
-       * include/freetype/ftmodule.h (FT_Module_Class): Use `FT_Long' for
-       `module_size'.
-       * include/freetype/ftrender.h (FT_Glyph_Class_): Use `FT_Long' for
-       `glyph_size'.
-
-       * src/base/ftobjs.c (FT_Render_Glyph): Change second parameter to
-       `FT_Render_Mode'.
-       (FT_Render_Glyph_Internal): Change third parameter to
-       `FT_Render_Mode'.
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Change second parameter
-       to `FT_Render_Mode'.
-
-       * src/raster/ftrend1.c (ft_raster1_render): Change third parameter
-       to `FT_Render_Mode'.
-       * src/smooth/ftsmooth.c (ft_smooth_render, ft_smooth_render_lcd,
-       ft_smooth_render_lcd_v): Ditto.
-       (ft_smooth_render_generic): Change third and fifth parameter to
-       `FT_Render_Mode'.
-
-       * include/freetype/freetype.h, include/freetype/internal/ftobjs.h,
-       include/freetype/ftglyph.h: Updated.
-
-       * src/cff/cffdrivr.c (Load_Glyph), src/pcf/pcfdriver.c
-       (PCF_Glyph_Load), src/pfr/pfrobjs.c (pfr_slot_load),
-       src/winfonts/winfnt.c (FNT_Load_Glyph), src/t42/t42objs.c
-       (T42_GlyphSlot_Load), src/bdf/bdfdrivr.c (BDF_Glyph_Load): Change
-       fourth parameter to `FT_Int32'.
-
-       * src/pfr/pfrobjs.c (pfr_face_init): Add two missing parameters
-       and declare them as unused.
-
-       * src/cid/cidparse.h (CID_Parser): Use FT_Long for `postscript_len'.
-
-       * src/psnames/psnames.h (PS_Unicode_Value_Func): Change return
-       value to FT_UInt32.
-       * src/psnames/psmodule.c (ps_unicode_value, ps_build_unicode_table):
-       Updated accordingly.
-
-2002-09-26  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * src/cff/cffdrivr.c (Get_Kerning): Use FT_Long for `middle'.
-       (cff_get_glyph_name): Use cast for result of ft_strlen.
-       * src/cff/cffparse.c (cff_parse_real): User cast for assigning
-       `exp'.
-       * src/cff/cffload.c (cff_index_get_pointers): Use FT_ULong for
-       some local variables.
-       (cff_charset_load, cff_encoding_load): Use casts to FT_UInt for some
-       switch statements.
-       (cff_font_load): Use cast in call to CFF_Load_FD_Select.
-       * src/cff/cffobjs.c (cff_size_init): Use more casts.
-       (cff_face_init): Use FT_Int32 for `flags'.
-       * src/cff/cffgload.c (cff_operator_seac): Use cast for assigning
-       `adx' and `ady'.
-       (cff_decoder_parse_charstrings): Use FT_ULong for third parameter.
-       Use more casts.
-       * src/cff/cffcmap.c (cff_cmap_unicode_init): Use cast for `count'.
-
-       * src/cid/cidload.c (cid_read_subrs): Use FT_ULong for `len'.
-       * src/cid/cidgload.c (cid_load_glyph): Add missing cast for
-       `cid_get_offset'.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <18>: Use
-       cast for `num_points'.
-       (t1_decoder_init): Use cast for assigning `decoder->num_glyphs'.
-
-       * src/base/ftdebug.c (ft_debug_init): Use FT_Int.
-       * include/freetype/internal/ftdriver.h (FT_Slot_LoadFunc): Use
-       `FT_Int32' for fourth parameter.
-       * src/base/ftobjs.c (open_face): Use cast for calling
-       clazz->init_face.
-
-       * src/raster/ftraster.c (Set_High_Precision): Use `1' instead of
-       `1L'.
-       (Finalize_Profile_Table, Line_Up, ft_black_init): Use casts.
-       * src/raster/ftrend1.c (ft_raster1_render): Ditto.
-
-       * src/sfnt/sfnt_dir_check: Compare `magic' with unsigned long
-       constant.
-
-2002-09-26  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/include/freetype/config/ftmodule.h: Updated.
-
-2002-09-25  David Turner  <david@freetype.org>
-
-       * src/autohint/ahtypes.h (AH_HINT_METRICS): Disabling metrics
-       hinting in the auto-hinter.  This produces much better anti-aliased
-       text.
-
-       * docs/CHANGES: Updating the changes documentation.
-
-2002-09-25  Anthony Fok  <anthony@thizlinux.com>
-
-       * src/sfnt/ttcmap0.c (tt_cmap4_validate, tt_cmap4_char_index,
-       tt_cmap4_char_next): Added support for opens___.ttf (it contains a
-       charmap that uses offset=0xFFFFU instead of 0x0000 to indicate a
-       missing glyph).
-
-2002-09-21  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       * src/truetype/ttdriver.c (Load_Glyph): Fourth parameter must be
-       FT_Int32.
-       * src/truetype/ttgload.c, src/truetype/ttgload.h (TT_Load_Glyph):
-       Ditto.
-
-2002-09-19  Wolfgang Domröse  <porthos.domroese@harz.de>
-
-       More 16bit fixes.
-
-       * src/autohint/ahglobal.c (sort_values): Use FT_Pos for `swap'.
-       (ah_hinter_compute_widths): Use FT_Pos for `dist'.
-       Use AH_MAX_WIDTHS.
-       * src/autohint/ahglyph.c (ah_outline_scale_blue_edges): Use FT_Pos
-       for `delta'.
-       (ah_outline_compute_edges): Replace some ints with FT_Int and
-       FT_Pos.
-       (ah_test_extrema): Clean up code.
-       (ah_get_orientation): Use 4 FT_Int variables instead of FT_BBox to
-       hold indices.
-       * src/autohint/ahtypes.h (AH_SegmentRec): Change type of `score'
-       to FT_Pos.
-
-2002-09-19  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/config.guess, builds/unix/config.sub: Updated to
-       recent versions.
-
-2002-09-18  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c (FT_Library_Version): Bugfix.
-
-       * FreeType 2.1.3rc2 (release candidate 2) is released!
-
-2002-09-17  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h, include/freetype/ftimage.h,
-       include/freetype/ftstroker.h, include/freetype/ftsysio.h,
-       include/freetype/ftsysmem.h, include/freetype/ttnameid.h: Updating
-       the in-source documentation.
-
-       * src/tools/docmaker/tohtml.py: Updating the HTML formatter in the
-       DocMaker tool.
-
-       * src/tools/docmaker.py: Removed.
-
-2002-09-17  Werner Lemberg  <wl@gnu.org>
-
-       More 16bit fixes.
-
-       * src/psaux/psobjs.c (reallocate_t1_table): Use FT_Long for
-       second parameter.
-
-2002-09-16  Werner Lemberg  <wl@gnu.org>
-
-       16bit fixes from Wolfgang Domröse.
-
-       * src/type1/t1parse.h (T1_ParserRec): Change type of `base_len'
-       and `private_len' to FT_Long.
-       * src/type1/t1parse.c (T1_Get_Private_Dict): Remove cast for
-       `private_len'.
-       * src/type1/t1load.c: Use FT_Int cast for most calls of T1_ToInt.
-       Use FT_PtrDist where appropriate.
-       (parse_encoding): Use FT_Long for `count' and `n'.
-       (read_binary_data): Use FT_Long* for second parameter.
-       * src/type1/t1afm.c (afm_atoindex): Use FT_PtrDist.
-
-       * src/cache/ftcsbits.c (ftc_sbit_node_load): Remove unused label.
-       * src/pshinter/pshalgo3.c (psh3_hint_align): Remove unused variable.
-
-2002-09-14  Werner Lemberg  <wl@gnu.org>
-
-       Making ftgrays.c compile stand-alone again.
-
-       * include/freetype/ftimage.h: Include ft2build.h only if _STANDALONE_
-       isn't defined.
-       * src/smooth/ftgrays.c [_STANDALONE_]: Define ft_memset,
-       FT_BEGIN_HEADER, FT_END_HEADER.
-       (FT_MEM_ZERO): Define.
-       (TRaster) [GRAYS_USE_GAMMA]: Use `unsigned char' instead of FT_Byte.
-       (gray_render_span, gray_init_gamma): Don't use `FT_UInt'.
-       Don't cast with `FT_Byte'.
-       (grays_init_gamma): Don't use `FT_UInt'.
-
-2002-09-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftinit.c (FT_Add_Default_Modules): Improve error message.
-       * src/pcf/pcfdriver.c (PCF_Face_Done): Improve tracing message.
-       * include/freetype/config/ftoption.h (FT_MAX_MODULES): Increased
-       to 32.
-
-2002-09-10  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.ac (version_info): Set to 9:2:3.
-       * builds/unix/configure: Regenerated.
-       * docs/VERSION.DLL: Updated.
-
-2002-09-09  David Turner  <david@freetype.org>
-
-       * src/pshinter/pshalgo2.c (psh2_glyph_find_strong_points),
-       src/pshinter/pshalgo3.c (psh3_glyph_find_strong_points): Adding fix
-       to prevent seg fault when hints are provided in an empty glyph.
-
-       * src/cache/ftccache.i (GEN_CACHE_LOOKUP) [FT_DEBUG_LEVEL_ERROR]:
-       Removed conditional code.  This fixes a bug that prevented
-       compilation in debug mode of template instantiation.
-
-       * include/freetype/ftimage.h: Removed incorrect `zft_' definitions
-       and updated constants documentation comments.
-
-       * src/cff/cffparse.c (cff_parser_run): Fixed the CFF table loader.
-       It didn't accept empty arrays, and this prevented the loading of
-       certain fonts.
-
-       * include/freetype/freetype.h (FT_FaceRec): Updating documentation
-       comment.  The `descender' value is always *negative*, not positive.
-
-2002-09-09  Owen Taylor  <owen@redhat.com>
-
-       * src/pcf/pcfdriver.c (PCF_Glyph_Load): Fixing incorrect computation
-       of bitmap metrics.
-
-2002-09-08  David Turner  <david@freetype.org>
-
-       Various updates to correctly support sub-pixel rendering.
-
-       * include/freetype/config/ftmodule.h: Add two renderers for LCD.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Updated.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_lcd,
-       ft_smooth_render_lcd_v): Set FT_PIXEL_MODE_LCD and
-       FT_PIXEL_MODE_LCD_V, respectively.
-
-       * include/freetype/cache/ftcimage.h (FTC_ImageTypeRec): New
-       structure.
-       Updated all users.
-       (FTC_ImageDesc): Removed.
-       (FTC_ImageCache_Lookup): Second parameter is now of type
-       `FTC_ImageType'.
-       Updated all users.
-       (FTC_IMAGE_DESC_COMPARE): Updated and renamed to...
-       (FTC_IMAGE_TYPE_COMPARE): This.
-       (FTC_IMAGE_DESC_HASH): Updated and renamed to...
-       (FTC_IMAGE_TYPE_HASH): This.
-
-       * include/freetype/cache/ftcsbits.h (FTC_SBitRec): Field `num_grays'
-       replaced with `max_grays'.
-       `pitch' is now FT_Short.
-       (FTC_SBitCache_Lookup): Second parameter is now of type
-       `FTC_ImageType'.
-       Updated all users.
-
-       * src/cache/ftcimage.c (FTC_ImageQueryRec, FTC_ImageFamilyRec):
-       Updated.
-       (ftc_image_node_init): Updated.
-       Moved code to convert type flags to load flags to...
-       (FTC_Image_Cache_Lookup): This function.
-       (ftc_image_family_init): Updated.
-
-       * src/cache/ftcsbit.c (FTC_SBitQueryRec, FTC_SBitFamilyRec):
-       Updated.
-       (ftc_sbit_node_load): Updated.
-       Moved code to convert type flags to load flags to...
-       (FTC_SBitCache_Lookup): This function.
-
-       * src/autohint/ahtypes.h (AH_HinterRec): Replace `no_*_hints' with
-       `do_*_snapping'.
-       Update all users (with negation).
-       * src/autohint/ahhint.c (ah_compute_stem_width): Fix threshold for
-       `dist' for `delta' < 40.
-
-       * src/pshinter/pshalgo3.h (PSH3_GlyphRec): Replace `no_*_hints' with
-       `do_*_snapping'.
-       Update all users (with negation).
-       * src/pshinter/pshalgo3.c (psh3_dimension_quantize_len): New
-       function.
-       (psh3_hint_align): Use it.
-       Improve hinting code.
-       [STRONGER]: Removed.
-       (STRONGER): Removed.
-
-       * include/freetype/freetype.h (FT_Set_Hint_Flags, FT_HINT_*):
-       Removed.
-
-2002-09-05  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidobjs.c (CID_Size_Init): Renamed to...
-       (cid_size_init): This.
-       * src/psaux/psobjs.c (T1_Builder_Add_Point1): Renamed to...
-       (t1_builder_add_point1): This.
-
-       Updated all affected code.
-
-       * src/pshinter/pshalgo3.c (psh3_hint_align): Fix compiler warnings.
-       * src/type1/t1gload.c (T1_Compute_Max_Advance): Ditto.
-
-2002-09-04  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h: Corrected the definition of
-       ft_encoding_symbol to be FT_ENCODING_MS_SYMBOL (instead of
-       the erroneous FT_ENCODING_SYMBOL).
-
-       * builds/unix/unix-def.in (datadir): Initialize it (thanks to
-       Anthony Fok).
-
-2002-08-29  David Turner  <david@freetype.org>
-
-       Slight modification to the Postscript hinter to slightly increase
-       the contrast of smooth hinting.  This is very similar to what the
-       auto-hinter does when it comes to stem width computations.  However,
-       it produces better results with well-hinted fonts.
-
-       * include/freetype/internal/psaux.h (T1_Decoder_FuncsRec): Add hint
-       mode to `init' member function.
-       (T1_DecoderRec): Add hint mode.
-       * include/freetype/internal/pshints (T1_Hints_ApplyFunc,
-       T2_Hints_ApplyFunc): Pass `hint_mode', not `hint_flags'.
-       * src/psaux/t1decode.c (t1_decoder_init): Add hint mode argument.
-       * src/pshinter/pshalgo1.c (ps1_hints_apply): Pass hint mode, not
-       hint flags.
-       * src/pshinter/pshalgo2.c (ps2_hints_apply): Ditto.
-       * src/pshinter/pshalgo3.c (ps3_hints_apply): Ditto.
-       (STRONGER): New macro.
-       (psh3_hint_align, psh3_hint_table_align_hints): Pass `glyph' instead
-       of `hint_flags'.
-       Implement announced changes.
-       * src/pshinter/pshalgo3.h (PSH3_GlyphRec): Add flags to control
-       vertical and horizontal hints and snapping.
-
-       * README, docs/CHANGES: Updating for the 2.1.3 release.
-
-2002-08-27  David Turner  <david@freetype.org>
-
-       * Massive re-formatting changes to many, many source files.  I don't
-       want to list them all here.  The operations performed were all
-       logical transformations of the sources:
-
-       - trying to convert all enums and constants to CAPITALIZED_STYLE,
-         #with define definitions like
-
-           #define my_old_constants   MY_NEW_CONSTANT
-
-       - big, big update of the documentation comments
-
-       * include/freetype/freetype.h, src/base/ftobjs.c,
-       src/smooth/ftsmooth.c, include/freetype/ftimage.h: Adding support
-       for LCD-optimized rendering though the new constants/enums:
-
-         FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
-         FT_PIXEL_MODE_LCD,  FT_PIXEL_MODE_LCD_V
-
-       This is still work in progress, don't expect everything to work
-       correctly though most of the features have been implemented.
-
-       * Adding new FT_LOAD_XXX flags, used to specify both hinting and
-       rendering targets:
-
-         FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
-         FT_LOAD_TARGET_MONO   :: monochrome bitmaps
-         FT_LOAD_TARGET_LCD    :: horizontal RGB/BGR decimated
-                                  hinting & rendering
-         FT_LOAD_TARGET_LCD_V  :: vertical RGB/BGR decimated
-                                  hinting & rendering
-
-       Note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
-       behaviour of the font engine is _unchanged_.
-
-       * include/freetype/ftimage.h
-       (FT_Outline_{Move,Line,Conic,Cubic}To_Func): Renamed to...
-       (FT_Outline_{Move,Line,Conic,Cubic}ToFunc): This.
-       (FT_Raster_Span_Func): Renamed to ...
-       (FT_SpanFunc): This.
-       (FT_Raster_{New,Done,Reset,Set_Mode,Render}_Func): Renamed to ...
-       (FT_Raster_{New,Done,Reset,SetMode,Render}Func}: This.
-
-       Updated all affected code.
-
-       * include/freetype/ftrender.h
-       (FT_Glyph_{Init,Done,Transform,BBox,Copy,Prepare}_Func): Renamed
-       to ...
-       (FT_Glyph_{Init,Done,Transform,GetBBox,Copy,Prepare}Func): This.
-       (FTRenderer_{render,transform,getCBox,setMode}): Renamed to ...
-       (FT_Renderer_{RenderFunc,TransformFunc,GetCBoxFunc,SeteModeFunc}):
-       This.
-
-       Updated all affected code.
-
-       * src/autohint/ahtypes.h (AH_Point, AH_Segment, AH_Edge, AH_Globals,
-       AH_Face_Globals, AH_Outline, AH_Hinter): These typedefs are now
-       pointers to the corresponding `*Rec' structures.  All source files
-       have been updated accordingly.
-
-       * src/cff/cffgload.c (cff_decoder_init): Add hint mode as parameter.
-       * src/cff/cffgload.h (CFF_Decoder): Add `hint_mode' element.
-
-       * src/cid/cidgload.c (CID_Compute_Max_Advance): Renamed to...
-       (cid_face_compute_max_advance): This.
-       (CID_Load_Glyph): Renamed to...
-       (cid_slot_load_glyph): This.
-       * src/cid/cidload.c (CID_Open_Face): Renamed to...
-       (cid_face_open): This.
-       * src/cid/cidobjs.c (CID_GlyphSlot_{Done,Init}): Renamed to...
-       (cid_slot_{done,init}): This.
-       (CID_Size_{Get_Globals_Funcs,Done,Reset): Renamed to...
-       (cid_size_{get_globals_funcs,done,reset): This.
-       (CID_Face_{Done,Init}): Renamed to...
-       (cid_face_{done,init}): This.
-       (CID_Driver_{Done,Init}: Renamed to...
-       (cid_driver_{done,init}: This.
-       * src/cid/cidparse.c (CID_{New,Done}_Parser): Renamed to...
-       (cid_parser_{new,done}): This.
-       * src/cid/cidparse.h (CID_Skip_{Spaces,Alpha}): Renamed to...
-       (cid_parser_skip_{spaces,alpha}): This.
-       (CID_To{Int,Fixed,CoordArray,FixedArray,Token,TokenArray}): Renamed
-       to...
-       (cid_parser_to_{int,fixed,coord_array,fixed_array,token,token_array}):
-       This.
-       (CID_Load_{Field,Field_Table): Renamed to...
-       (cid_parser_load_{field,field_table}): This.
-       * src/cid/cidriver.c (CID_Get_Interface): Renamed to...
-       (cid_get_interface): This.
-
-       Updated all affected code.
-
-       * src/psaux/psobjs.c (PS_Table_*): Renamed to...
-       (ps_table_*): This.
-       (T1_Builder_*): Renamed to...
-       (t1_builder_*): This.
-       * src/psaux/t1decode.c (T1_Decoder_*): Renamed to...
-       (t1_decoder_*): This.
-
-       * src/psnames/psmodule.c (PS_*): Renamed to...
-       (ps_*): This.
-
-       Updated all affected code.
-
-       * src/sfnt/sfdriver (SFNT_Get_Interface): Renamed to...
-       (sfnt_get_interface): This.
-       * src/sfnt/sfobjs.c (SFNT_*): Renamed to...
-       (sfnt_*): This.
-       * src/sfnt/ttcmap.c (TT_CharMap_{Load,Free}): Renamed to...
-       (tt_face_{load,free}_charmap): This.
-       * src/sfnt/ttcmap0.c (TT_Build_CMaps): Renamed to...
-       (tt_face_build_cmaps): This.
-       * src/sfnt/ttload.c (TT_*): Renamed to...
-       (tt_face_*): This.
-       * src/sfnt/ttpost.c (TT_Post_Default_Names): Renamed to...
-       (tt_post_default_names): This.
-       (Load_*): Renamed to...
-       (load_*): This.
-       (TT_*): Renamed to...
-       (tt_face_*): This.
-       * src/sfnt/ttsbit.c (TT_*): Renamed to...
-       (tt_face_*): This.
-       ({Find,Load,Crop}_*): Renamed to...
-       ({find,load,crop}_*): This.
-
-       Updated all affected code.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render): Renamed to...
-       (ft_smooth_render_generic): This.
-       Make function more generic by adding vertical and horizontal scaling
-       factors.
-       (ft_smooth_render, ft_smooth_render_lcd, ft_smooth_render_lcd_v):
-       New functions.
-
-       (ft_smooth_locd_renderer_class, ft_smooth_lcdv_renderer_class): New
-       classes.
-
-       * src/truetype/ttobjs.c (TT_{Done,New}_GlyphZone): Renamed to...
-       (tt_glyphzone_{done,new}): This.
-       (TT_{Face,Size,Driver}_*): Renamed to...
-       (tt_{face,size,driver}_*): This.
-       * src/truetype/ttpload.c (TT_Load_Locations): Renamed to...
-       (tt_face_load_loca): This.
-       (TT_Load_Programs): Renamed to...
-       (tt_face_load_fpgm): This.
-       (TT_*): Renamed to...
-       (tt_face_*): This.
-
-2002-08-27  Werner Lemberg  <wl@gnu.org>
-
-       * docs/VERSION.DLL: New file.
-
-2002-08-23  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/cff/cffgload.c (cff_operator_seac)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Incremental fonts (actually not
-       incremental in the case of CFF but just using callbacks to get glyph
-       recipes) pass the character code, not the glyph index, to the
-       get_glyph_data function; they have no valid charset table.
-
-       * src/cff/cffload.c (cff_font_load): Removed special cases for
-       FT_CONFIG_OPTION_INCREMENTAL, which are no longer necessary; CFF
-       fonts provided via the incremental interface now have to conform
-       more closely to the CFF font format.
-
-       * src/cff/cffload.h (cff_font_load): Removed argument now unneeded.
-
-       * src/cff/cffobjs.c (cff_face_init): Changed call to cff_font_load
-       to conform with new signature.
-
-2002-08-22  David Turner  <david@freetype.org>
-
-       * src/base/ftobject.c, src/base/ftsynth.c, src/base/ftstroker.c,
-       src/bdf/bdfdrivr.c: Removed compiler warnings.
-
-2002-08-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshalgo3.c (psh3_glyph_compute_inflections,
-       psh3_glyph_compute_extrema, psh3_hint_table_find_strong_point): Fix
-       compiler warnings and resolve shadowing of local variables.
-
-2002-08-21  David Turner  <david@freetype.org>
-
-       The automatic and Postscript hinter now automatically detect
-       inflection points in glyph outlines and treats them specially.  This
-       is very useful to prevent nasty effect like the disappearing
-       diagonals of `S' and `s' in many, many fonts.
-
-       * src/autohint/ahtypes.h (ah_flag_inflection): New macro.
-       * src/autohint/ahangles.c (ah_angle_diff): New function.
-       * src/autohint/ahangles.h: Updated.
-       * src/autohint/ahglyph.c (ah_outline_compute_inflections): New
-       function.
-       (ah_outline_detect_features): Use it.
-       * src/autohint/ahhint.c (ah_hinter_align_strong_points)
-       [!AH_OPTION_NO_WEAK_INTERPOLATION]: Handle inflection.
-
-       * src/tools/docmaker/docmaker.py, src/tools/docmaker/utils.py,
-       src/tools/docmaker/tohtml.py: Updating the DocMaker tool.
-
-       * include/freetype/freetype.h: Changing the type of the `load_flags'
-       parameter from `FT_Int' to `FT_Int32', this in order to support more
-       options.  This should only break binary and/or source compatibility
-       on 16-bit platforms (Atari?).
-       (FT_LOAD_NO_AUTOHINT): New macro.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Updated.
-       Handle FT_LOAD_NO_AUTOHINT.
-       (FT_Load_Char): Updated.
-
-       * src/pshinter/pshalgo3.c, src/base/ftobjs.c, src/base/ftobject.c,
-       src/autohint/ahglyph.c, include/freetype/freetype.h: Fixing typos
-       and removing compiler warnings.
-
-2002-08-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (TT_Get_Metrics): Add guard for k = 0.
-
-2002-08-20  David Turner  <david@freetype.org>
-
-       * src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.c,
-       src/pshinter/pshglob.c, src/pshinter/pshrec.c,
-       src/autohint/ahmodule.c [DEBUG_HINTER]: Removing compiler warnings
-       (only used in development builds anyway).
-
-       Improve support of local extrema and stem edge points.
-
-       * src/pshinter/pshalgo3.h (PSH3_Hint_TableRec): Use PSH3_ZoneRec
-       for `zones'.
-       (PSH3_DIR_UP, PSH3_DIR_DOWN): Exchange values.
-       (PSH3_DIR_HORIZONTAL, PSH3_DIR_VERTICAL): New macros.
-       (PSH3_DIR_COMPARE, PSH3_DIR_IS_HORIZONTAL, PSH3_IS_VERTICAL): New
-       macros.
-       (PSH3_POINT_INFLEX): New enum.
-       (psh3_point_{is,set}_{off,inflex}): New macros.
-       (PSH3_POINT_{EXTREMUM,POSITIVE,NEGATIVE,EDGE_MIN,EDGE_MAX): New
-       enum values.
-       (psh3_point_{is,set}_{extremum,positive,negative,edge_min,edge_max}):
-       New macros.
-       (PSH3_PointRec): New members `flags2' and `org_v'.
-       (PSH3_POINT_EQUAL_ARG, PSH3_POINT_ANGLE): New macros.
-
-       * src/pshinter/pshalgo3.c [DEBUG_HINTER]: Removing compiler
-       warnings.
-       (COMPUTE_INFLEXS): New macro.
-       (psh3_hint_align): Simplify some basic arithmetic computations.
-       (psh3_point_is_extremum): Removed.
-       (psh3_glyph_compute_inflections) [COMPUTE_INFLEXS]: New function.
-       (psh3_glyph_init) [COMPUTE_INFLEXS]: Use it.
-       (psh3_glyph_compute_extrema): New function.
-       (PSH3_STRONG_THRESHOLD): Increased to 30.
-       (psh3_hint_table_find_strong_point): Improved.
-       (psh3_glyph_find_strong_points,
-       psh3_glyph_interpolate_strong_points): Updated.
-       (psh3_hints_apply): Use psh3_glyph_compute_extrema.
-
-       * test/gview.c (draw_ps3_hint, ps3_draw_control_points): New
-       functions.
-       Other small updates.
-
-       * Jamfile: Small updates.
-
-2002-08-18  Arkadiusz Miskiewicz  <misiek@pld.ORG.PL>
-
-       * builds/unix/install.mk (install, uninstall): Add $(DESTDIR) to
-       make life easier for package maintainers.
-
-2002-08-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/pcf/pcfdriver.c (PCF_Glyph_Load): Fix computation of
-       horiBearingX.
-       * src/bdf/bdfdrivr.c (BDF_GlyphLoad): Fix computation of
-       horiBearingY.
-
-2002-08-16  George Williams  <gww@silcom.com>
-
-       Add support for Apple composite glyphs.
-
-       * include/freetype/config/ftoption.h
-       (TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED): New macro.
-
-       * src/truetype/ttgload.c (OVERLAP_COMPOUND, SCALED_COMPONENT_OFFSET,
-       UNSCALED_COMPONENT_OFFSET): New macros for additional OpenType
-       glyph loading flags.
-       (load_truetype_glyph): Implement it.
-
-2002-08-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_free_glyph_data),
-       src/cff/cffload.c (cff_font_load): Use FT_UNUSED.
-
-2002-08-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Initialize `error'.
-       * src/sfnt/sfobjs.c (SFNT_Load_Face): Fix compiler warning.
-
-2002-08-15  Graham Asher  <graham.asher@btinternet.com>
-
-       Implemented the incremental font loading system for the CFF driver.
-       Tested using the GhostScript-to-FreeType bridge (under development).
-
-       * src/cff/cffgload.c (cff_get_glyph_data, cff_free_glyph_data): New
-       functions.
-       (cff_operator_seac, cff_compute_max_advance, cff_slot_load): Use
-       them.
-       * src/cff/cffload.c (cff_font_load): Add `face' parameter.
-       Load charset and encoding only if there are glyphs.
-       [FT_CONFIG_OPTION_INCREMENTAL]: Incremental fonts don't need
-       character recipes.
-       * src/cff/cffload.h, src/cff/cffobjs.c: Updated.
-
-       * src/cid/cidgload.c (cid_load_glyph)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Corrected the incremental font
-       loading implementation to use the new system introduced on
-       2002-08-01.
-
-2002-08-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffcmap.c: Remove compiler warnings.
-       * src/cache/ftccache.c, src/cache/ftccache.i,
-       src/pfr/pfrload.c, src/pfr/pfrgload.c: s/index/idx/.
-       * src/cff/cffload.c: s/select/fdselect/.
-       * src/raster/ftraster.c: s/wait/waiting/.
-
-2002-08-01  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/type1/t1load.c (T1_Open_Face): Tolerate a face with no
-       charstrings if there is an incremental loading interface.  Type 1
-       faces supplied by PostScript interpreters like GhostScript will
-       typically not provide any charstrings at load time, so this is
-       essential if they are to work.
-
-2002-08-01  Graham Asher  <graham.asher@btinternet.com>
-
-       Modified incremental loading interface to be closer to David's
-       preferences.  The header freetype.h is not now affected, the
-       interface is specified via an FT_Parameter, the pointer to the
-       interface is hidden in an internal part of the face record, and all
-       the definitions are in ftincrem.h.
-
-       * include/freetype/freetype.h [FT_CONFIG_OPTION_INCREMENTAL]:
-       Removed.
-       * include/freetype/internal/ftobjs.h [FT_CONFIG_OPTION_INCREMENTAL]:
-       Include FT_INCREMENTAL_H.
-       (FT_Face_InternalRec) [FT_CONFIG_OPTION_INCREMENTAL]: Add
-       `incremental_interface'.
-
-       * src/base/ftobjs.c (open_face, FT_Open_Face)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
-       * src/sfnt/sfobjs.c (SFNT_Load_Face) [FT_CONFIG_OPTION_INCREMENTAL]:
-       Updated.
-
-       * src/truetype/ttgload.c (load_truetype_glyph)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
-       Free loaded glyph data properly.
-       (compute_glyph_metrics, TT_Load_Glyph)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
-       * src/truetype/ttobjs.c (TT_Face_Init)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
-
-       * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
-       (T1_Parse_Glyph) [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
-       Free loaded glyph data properly.
-       (T1_Load_Glyph): Updated.
-       [FT_CONFIG_OPTION_INCREMENTAL]: Free loaded glyph data properly.
-
-2002-07-30  David Turner  <david@freetype.org>
-
-       * include/freetype/ftincrem.h: Adding new experimental header file
-       to demonstrate a `cleaner' API to support incremental font loading.
-
-       * include/freetype/config/ftheader.h (FT_INCREMENTAL_H): New macro.
-
-       * src/tools/docmaker/*: Adding new (more advanced) version of
-       the DocMaker tool, using Python's sophisticated regexps.
-
-2002-07-28  Werner Lemberg  <wl@gnu.org>
-
-       s/ft_memset/FT_MEM_SET/.
-       s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate.
-
-2002-07-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttload.c (sfnt_dir_check): Make it work with TTCs.
-
-2002-07-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph)
-       [FT_CONFIG_OPTION_INCREMENTAL]: s/memset/ft_memset/.
-
-       * src/autohint/ahhint.c (ah_hint_edges_3): Fix compiler warning.
-       * src/cff/cffload.c (cff_encoding_load): Remove `memory' variable.
-       * src/cff/cffcmap.c (cff_cmap_encoding_init): Remove `psnames'
-       variable.
-       * src/truetype/ttgload.c (load_truetype_glyph): Remove statement
-       without effect.
-       * src/truetype/ttdriver (Get_Char_Index, Get_Next_Char): Removed.
-
-       * src/pshinter/pshalgo3.c (psh3_hint_table_record,
-       psh3_hint_table_init, psh3_hint_table_activate_mask): Fix error
-       message.
-
-2002-07-24  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/truetype/ttobjs.c: Fix for bug reported by Sven Neumann
-       [sven@gimp.org] on the FreeType development forum: `If
-       FT_CONFIG_OPTION_INCREMENTAL is undefined (this is the default), the
-       TrueType loader crashes in line 852 of src/truetype/ttgload.c when
-       it tries to access face->glyph_locations.'
-
-2002-07-18  Graham Asher  <graham.asher@btinternet.com>
-
-       Added types and structures to support incremental typeface loading.
-       The FT_Incremental_Interface structure, defined in freetype.h, is
-       designed to be passed to FT_Open_Face to provide callback functions
-       to obtain glyph recipes and metrics, for fonts like those passed
-       from PostScript that do not necessarily provide all, or any, glyph
-       information, when first opened.
-
-       * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_INCREMENTAL):
-       New configuration macro to enable incremental face loading.  By
-       default it is not defined.
-
-       * include/freetype/freetype.h (FT_Basic_Glyph_Metrics,
-       FT_Get_Glyph_Data_Func, FT_Get_Glyph_Metrics_Func,
-       FT_Incremental_Interface_Funcs, FT_Incremental_Interface)
-       [FT_CONFIG_OPTION_INCREMENTAL]: New.
-       (FT_Open_Args, FT_FaceRec) [FT_CONFIG_OPTION_INCREMENTAL]: New field
-       `incremental_interface'.
-       (FT_Open_Flags) [FT_CONFIG_OPTION_INCREMENTAL]: New enum
-       `ft_open_incremental'.
-
-       * include/freetype/fttypes.h: Include FT_CONFIG_CONFIG_H.
-       (FT_Data): New structure to represent binary data.
-
-       * src/base/ftobjs.c (open_face) [FT_CONFIG_OPTION_INCREMENTAL]:
-       Add parameter for incremental loading.
-       (FT_Open_Face) [FT_CONFIG_OPTION_INCREMENTAL]: Use incremental
-       interface.
-
-       * src/truetype/ttgload.c (load_truetype_glyph)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Added the incremental loading system
-       for the TrueType driver.
-       (compute_glyph_metrics): Return FT_Error.
-       [FT_CONFIG_OPTION_INCREMENTAL]: Check for overriding metrics.
-       (TT_Load_Glyph) [FT_CONFIG_OPTION_INCREMENTAL]: Don't look for
-       the glyph table while handling an incremental font.
-       Get glyph offset.
-
-       * src/truetype/ttobjs.c (TT_Face_Init)
-       [FT_CONFIG_OPTION_INCOREMENTAL]: Added the incremental loading
-       system for the TrueType driver.
-
-       * src/cid/cidgload.c (cid_load_glyph)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Added the incremental loading system
-       for the CID driver.
-
-       * src/sfnt/sfobjs.c (SFNT_Load_Face) [FT_CONFIG_OPTION_INCREMENTAL]:
-       Changes to support incremental Type 42 fonts: Assume a font has
-       glyphs if it has an incremental interface object.
-
-       * src/type1/t1gload.c (T1_Parse_Glyph): Renamed to...
-       (T1_Parse_Glyph_And_Get_Char_String): This.
-       [FT_CONFIG_OPTION_INCREMENTAL]: Added support for incrementally
-       loaded Type 1 faces.
-       (T1_Parse_Glyph): New function.
-       (T1_Load_Glyph): Updated.
-
-2002-07-17  David Turner  <david@freetype.org>
-
-       Cleaning up the cache sub-system code; linear hashing is now the
-       default.
-
-       * include/freetype/cache/ftccache.h, src/cache/ftccache.i,
-       src/cache/ftccache.c [!FTC_CACHE_USE_LINEAR_HASHING]: Removed.
-       (FTC_CACHE_USE_LINEAR_HASHING: Removed also.
-
-       FT_CONFIG_OPTION_USE_CMAPS is now the default.
-
-       * include/freetype/internal/ftdriver.h (FT_Driver_ClassRec): Remove
-       `get_char_index' and `get_next_char'.
-
-       * include/freetype/config/ftoption.h,
-       include/freetype/internal/tttypes.h, src/base/ftobjs.c,
-       src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/pcf/pcfdrivr.c,
-       src/pfr/pfrdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
-       src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
-       src/type42/t42objs.c, src/winfonts/winfnt.c
-       [!FT_CONFIG_OPTION_USE_CMAPS]: Removed.  The new cmap code is now
-       the default.
-
-       * src/type42/t42objs.c (T42_CMap_CharIndex, T42_CMap_CharNext):
-       Removed.
-       * src/type42/t42objs.h: Updated.
-
-       * src/cid/cidriver.c (Cid_Get_Char_Index, Cid_Get_Next_Char):
-       Removed.
-       (t1_cid_driver_class): Updated.
-       * src/truetype/ttdriver.c (tt_driver_class): Updated.
-       * src/type1/t1driver.c (Get_Char_Index, Get_Next_Char): Removed
-       (t1_driver_class): Updated.
-       * src/type42/t42drivr.c (t42_driver_class): Updated.
-
-       * src/base/ftobjs.c (open_face): Select Unicode cmap by default.
-
-       * src/sfnt/ttload.c (TT_Load_SFNT_Header): Fixed a recent bug that
-       prevented OpenType fonts to be recognized by FreeType.
-
-2002-07-11  David Turner  <david@freetype.org>
-
-       Changing the SFNT loader to check for SFNT-based font files
-       differently.  We now ignore the range `helper' fields and check the
-       `head' table's magic number instead.
-
-       * include/freetype/internal/tttypes.h (SFNT_HeaderRec): Add `offset'
-       field.
-
-       * src/sfnt/ttload.c (sfnt_dir_check): New function.
-       (TT_Load_SFNT_HeaderRec): Renamed to...
-       (TT_Load_SFNT_Header): This.
-       Implement new functionality.
-       * src/sfnt/ttload.h: Updated.
-       * src/sfnt/sfdriver.c (sfnt_interface): Updated.
-
-       * src/base/ftobject.c, src/base/fthash.c: Updated object sub-system
-       and dynamic hash table implementation (still experimental, don't
-       use).
-       * include/freetype/internal/fthash.h: Updated.
-       * include/freetype/internal/ftobjs.h (FT_LibraryRec): New member
-       `meta_class'.
-
-       Fixing a bug in the Type 1 loader that prevented valid font bounding
-       boxes to be loaded from multiple master fonts.
-
-       * include/freetype/t1tables.h (PS_BlendRec): Add `bboxes' field.
-
-       * include/freetype/internal/psaux.h (T1_FieldType): Add
-       `T1_FIELD_TYPE_BBOX'.
-       (T1_FieldLocation): Add `T1_FIELD_LOCATION_BBOX'.
-       (T1_FIELD_BBOX): New macro.
-
-       * src/psaux/psobjs.c (PS_Parser_LoadField): Handle T1_FIELD_TYPE_BBOX.
-       * src/type1/t1load.c (t1_allocate_blend): Create blend->bboxes.
-       (T1_Done_Blend): Free blend->bboxes.
-       (t1_load_keyword): Handle T1_FIELD_LOCATION_BBOX.
-       (parse_font_bbox): Commented out.
-       (t1_keywords): Comment out `parse_font_bbox'.
-       * src/type1/t1tokens.h: Define `FontBBox' field.
-
-2002-07-10  David Turner  <david@freetype.org>
-
-       * src/cff/cffobjs.c: Small fix to select the Unicode charmap by
-       default when needed.
-       Small fix to allow OpenType fonts to support Adobe charmaps when
-       needed.
-
-       * src/cff/cffcmap.c, src/cff/cffcmap.h: New files to support
-       charmaps for CFF fonts.
-
-       * src/cff/cff.c, src/cff/Jamfile, src/cff/rules.mk: Updated.
-
-       * include/freetype/internal/cfftypes.h (CFF_EncodingRec): Use
-       fixed-length arrays for `sids' and `codes'.  Add `count' member.
-       (CFF_FontRec): Add `psnames' member.
-
-       * src/cff/cffdrivr.c, src/cff/cffload.c, src/cff/cffload.h,
-       src/cff/cffobjs.c, src/cff/cffobjs.h, src/cff/cffparse.c,
-       src/cffparse.h, src/cff/cffgload.c, src/cff/cffgload.h: Adding
-       support for CFF charmaps, reformatting the sources, and removing
-       some bugs in the Encoding and Charset loaders.
-       Many fonts renamed to use lowercase only:
-
-         CFF_Builder_Init -> cff_builder_init
-         CFF_Builder_Done -> cff_builder_done
-         CFF_Init_Decoder -> cff_decoder_init
-         CFF_Parse_CharStrings -> cff_decoder_parse_charstrings
-         CFF_Load_Glyph -> cff_slot_load
-         CFF_Init_Decoder -> cff_decoder_init
-         CFF_Prepare_Decoder -> cff_decoder_prepare
-         CFF_Get_Standard_Encoding -> cff_get_standard_encoding
-         CFF_Access_Element -> cff_index_access_element
-         CFF_Forget_Element -> cff_index_forget_element
-         CFF_Get_Name -> cff_index_get_name
-         CFF_Get_String -> cff_index_get_sid_string
-         CFF_Get_FD -> cff_fd_select_get
-         CFF_Done_Charset -> cff_charset_done
-         CFF_Load_Charset -> cff_charset_load
-         CFF_Done_Encoding -> cff_encoding_done
-         CFF_Load_Encoding -> cff_encoding_load
-         CFF_Done_SubFont -> cff_subfont_done
-         CFF_Load_Font -> cff_font_load
-         CFF_Done_Font -> cff_font_done
-         CFF_Size_Get_Global_Funcs -> cff_size_get_global_funcs
-         CFF_Size_Done -> cff_size_done
-         CFF_Size_Init -> cff_size_init
-         CFF_Size_Reset -> cff_size_reset
-         CFF_GlyphSlot_Done -> cff_slot_done
-         CFF_GlyphSlot_Init -> cff_slot_init
-         CFF_StrCopy -> cff_strcpy
-         CFF_Face_Init -> cff_face_init
-         CFF_Face_Done -> cff_face_done
-         CFF_Driver_Init -> cff_driver_init
-         CFF_Driver_Done -> cff_driver_done
-         CFF_Parser_Init -> cff_parser_init
-         CFF_Parser_Run -> cff_parser_run
-
-         add_point -> cff_builder_add_point
-         add_point1 -> cff_builder_add_point1
-         add_contour -> cff_builder_add_contour
-         close_contour -> cff_builder_close_contour
-         cff_explicit_index -> cff_index_get_pointers
-
-2002-07-09  Owen Taylor  <owen@redhat.com>
-
-       * src/pshinter/pshglob.c (psh_globals_new): Fixed a bug that
-       prevented the hinter from using correct standard width and height
-       values, resulting in hinting bugs with certain fonts (e.g. Utopia).
-
-2002-07-07  David Turner  <david@freetype.org>
-
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Added code to return
-       successfully when the function is called with a bitmap glyph (the
-       previous code simply returned with an error).
-
-       * docs/DEBUG.TXT: Adding debugging support documentation.
-
-       * src/base/ftdebug.c (ft_debug_init), builds/win32/ftdebug.c
-       (ft_debug_init), builds/amiga/src/ftdebug.c (ft_debug_init): Changed
-       the syntax of the FT2_DEBUG environment variable used to control
-       debugging output (i.e. logging and error messages).  It must now
-       look like:
-
-         any:6 memory:4 io:3   or
-         any:6,memory:4,io:3   or
-         any:6;memory:4;io:3
-
-2002-07-07  Owen Taylor  <owen@redhat.com>
-
-       * src/pshinter/pshglob.c (psh_blues_snap_stem): Adding support for
-       blue fuzz.
-       * src/pshinter/pshglob.h (PSH_BluesRec): Add `blue_fuzz' field.
-       * src/type1/t1load.c (T1_Open_Face): Initialize `blue_fuzz'.
-
-       Adding support for hinter-specific bit flags, and the new
-       FT_Set_Hint_Flags high-level API.
-
-       * include/freetype/freetype.h (FT_Set_Hint_Flags): New function.
-       (FT_HINT_NO_INTEGER_STEM, FT_HINT_NO_HSTEM_ALIGN,
-       FT_HINT_NO_VSTEM_ALIGN): New macros.
-
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Add
-       `hint_flags' member.
-
-       * src/base/ftobjs.c (FT_Set_Hint_Flags): New function.
-
-       * include/freetype/internal/psaux.h (T1_DecoderRec): Add `hint_flags'
-       member.
-
-       * include/freetype/internal/pshints.h (T1_Hints_ApplyFunc,
-       T2_Hints_ApplyFunc): Add parameter to pass hint flags.
-
-       * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings,
-       T1_Decoder_Init): Use decoder->hint_flags.
-       * src/cff/cffgload.h (CFF_Builder): Add `hint_flags' field.
-       * src/cff/cffgload.c (CFF_Builder_Init): Set builder->hint_flags.
-       (CFF_Parse_CharStrings): Updated.
-       * src/pshinter/pshalgo1.c (ps1_hints_apply): Add parameter to handle
-       hint flags (unused).
-       * src/pshinter/pshalgo1.h: Updated.
-       * src/pshinter/pshalgo2.c (ps2_hints_apply): Add parameter to handle
-       hint flags (unused).
-       * src/pshinter/pshalgo2.h: Updated.
-       * src/pshinter/pshalgo3.c (ps3_hints_apply): Add parameter to handle
-       hint flags.
-       * src/pshinter/pshalgo3.h: Updated.
-
-2002-07-04  David Turner  <david@freetype.org>
-
-       * src/pfr/pfrobjs.c (pfr_slot_load): Fixed a small bug that returned
-       incorrect advances when the outline resolution was different from
-       the metrics resolution.
-
-       * src/autohint/ahhint.c: Removing compiler warnings.
-
-       * src/autohint/ahglyph.c: s/FT_MEM_SET/FT_ZERO/ where appropriate.
-       (ah_outline_link_segments): Slight improvements to the serif
-       detection code.  More work is needed though.
-
-2002-07-03  David Turner  <david@freetype.org>
-
-       Small improvements to the automatic hinter.  Uneven stem-widths have
-       now disappeared and everything looks much better, even if there are
-       still issues with serifed fonts.
-
-       * src/autohint/ahtypes.h (AH_Globals): Added `stds' array.
-       * src/autohint/ahhint.c (OPTIM_STEM_SNAP): New #define.
-       (ah_snap_width): Commented out.
-       (ah_align_linked_edge): Renamed to...
-       (ah_compute_stem_width): This.
-       Don't allow uneven stem-widths.
-       (ah_align_linked_edge): New function.
-       (ah_align_serifed_edge): Don't strengthen serifs.
-       (ah_hint_edges_3, ah_hinter_scale_globals): Updated.
-
-2002-07-03  Owen Taylor  <owen@redhat.com>
-
-       Adding new algorithm based on Owen Taylor's recent work.
-
-       * src/pshinter/pshalgo3.c, src/pshinter/pshalgo3.h: New files.
-       * src/pshinter/pshalgo.h: Updated.
-       Use pshalgo3 by default.
-       * src/pshinter/pshinter.c: Include pshalgo3.c.
-
-       * src/pshinter/Jamfile, src/pshinter/rules.mk: Updated.
-
-2002-07-01  Owen Taylor  <owen@redhat.com>
-
-       * src/pshinter/pshalgo2.c (psh2_glyph_find_strong_points): Fix a bug
-       where, if a glyph has more than hint mask, the second mask gets
-       applied to points that should have been covered by the first mask.
-
-2002-07-01  Keith Packard  <keithp@keithp.com>
-
-       * src/sfnt/ttcmap0.c (tt_cmap8_char_next, tt_cmap12_char_next):
-       Fixing the cmap 8 and 12 parsing routines.
-
-2002-07-01  David Turner  <david@freetype.org>
-
-       * src/base/ftsynth.c: Include FT_TRIGONOMETRY_H.
-       (FT_Outline_Embolden): Renamed to...
-       (FT_GlyphSlot_Embolden): This.
-       Updated to new trigonometric functions.
-       (FT_Outline_Oblique): Renamed to...
-       (FT_GlyphSlot_Oblique): This.
-       (ft_norm): Removed.
-       * include/freetype/ftsynth.h: Updated.
-
-2002-06-26  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/ftobject.h: Updating the object
-       sub-system definitions (still experimental).
-
-       * src/base/fthash.c (ft_hash_remove): Fixing a small reallocation
-       bug.
-
-       * src/base/fttrigon.c (FT_Vector_From_Polar, FT_Angle_Diff): New
-       functions.
-       * include/freetype/fttrigon.h: Updated.
-
-
-       Adding path stroker component (work in progress).
-
-       * include/freetype/ftstroker.h, src/base/ftstroker.c: New files.
-       * src/base/Jamfile: Updated.
-
-       * include/freetype/config/ftheader.h (FT_STROKER_H): New macro.
-
-
-       * src/truetype/ttgload.c (TT_Load_Composite_Glyph),
-       src/base/ftoutln.c (FT_Vector_Transform): Fixed Werner's latest fix.
-       FT_Vector_Transform wasn't buggy, the TrueType composite loader was.
-
-2002-06-24  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
-
-2002-06-21  David Turner  <david@freetype.org>
-
-
-       * Version 2.1.2 released.
-       =========================
-
-
-2002-06-21  Roberto Alameda  <ojancano@geekmail.de>.
-
-       * include/freetype/internal/t42types.h (T42_Font): Removed since
-       it is already in t42objs.h.
-       (T42_Face): Use T1_FontRec.
-
-       * src/base/fttype1.c (FT_Get_PS_Font_Info): Updated.
-       (FT_Has_PS_Glyph_Names): Check for type42 driver name also.
-       * src/type42/t42objs.h: Include FT_INTERNAL_TYPE42_TYPES_H.
-       (T42_Face): Removed since it is already in t42types.h.
-
-2002-06-21  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/pfrgload.c (pfr_glyph_load_compound): Fix loading of composite
-       glyphs.
-
-2002-06-21  Sven Neumann  <sven@convergence.de>
-
-       * src/prf/pfrtypes.h (PFR_KernPair): New structure.
-       (PFR_PhyFont): Use it.
-       (PFR_KernFlags): New enumeration.
-       * src/pfr/pfrload.c (pfr_extra_item_load_kerning_pairs): New
-       function.
-       (pfr_phy_font_extra_items): Use it.
-       (pfr_phy_font_done): Updated.
-       * src/pfr/pfrobjs.c (pfr_face_init): Set kerning flag conditionally.
-       (pfr_face_get_kerning): New function.
-       * src/pfr/pfrobjs.h: Updated.
-       * src/pfr/pfrdrivr.c (pfr_driver_class): Updated.
-
-2002-06-21  David Turner  <david@freetype.org>
-
-       * README, docs/CHANGES: Preparing the 2.1.2 release.
-
-2002-06-19  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/base/fttype1.c: Include FT_INTERNAL_TYPE42_TYPES_H.
-       (t1_face_check_cast): Removed.
-       (FT_Get_PS_Font_Info): Make it work with CID and Type 42 drivers
-       also.
-
-2002-06-19  Sebastien BARRE  <http://barre.nom.fr/contact.html#email>
-
-       * src/type42/t42parse.c (t42_parse_sfnts): Fix compiler warning.
-
-2002-06-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftoutln.c (FT_Vector_Transform): Fix serious typo
-       (xy <-> yx).
-       * src/truetype/ttgload.c (load_truetype_glyph): Replace `|' with
-       `||' to make code easier to read.
-
-2002-06-18  Roberto Alameda  <ojancano@geekmail.de>.
-
-       * src/type42/t42objs.c (t42_check_size_change): Removed.
-       (T42_Size_SetChars, T42_Size_SetPixels): Use FT_Activate_Size
-       instead.
-       (T42_GlyphSlot_Load): Remove call to t42_check_size_change.
-
-2002-06-18  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/psaux/t1cmap.c (t1_cmap_custom_char_index,
-       t1_cmap_custom_char_next): Fix index computation -- indices start
-       with 0 and not with cmap->first.
-
-       Provide default charmaps.
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdriver.c
-       (PCF_Face_Init), src/pfr/pfrobjs.c (pfr_face_init),
-       src/type1/t1objs (T1_Face_Init), src/winfonts/winfnt.c
-       (FNT_Face_Init): Implement it.
-
-2002-06-17  Sven Neumann  <sven@gimp.org>
-
-       * src/pfr/pfrobjs.c (pfr_face_init): Fix typo.
-
-2002-06-16  Leonard Rosenthol  <leonardr@lazerware.com>
-
-       Updated Win32/VC++ projects to include the new PFR driver.
-
-       * builds/win32/visualc/freetype.dsp: Updated.
-
-2002-06-16  Anthony Fok  <fok@debian.org>
-
-       Install freetype2.m4.
-
-       * builds/unix/install.mk (install, uninstall): Handle it.
-
-2002-06-16  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       Same fix for PFR driver.
-
-       * src/pfr/pfrcmap.c (pfr_cmap_char_index, pfr_cmap_char_next):
-       Increase return value by 1.
-       * src/pfr/pfrobjs.c (pfr_slot_load): Decrease index by 1.
-
-2002-06-15  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       Fix glyph indices to make index zero always the undefined glyph.
-
-       * src/bdf/bdfdrivr.c (bdf_cmap_init): Don't decrease
-       cmap->num_encodings.
-       (bdf_cmap_char_index, bdf_cmap_char_next, BDF_Get_Char_Index):
-       Increase result by 1 for normal cases.
-       (BDF_Glyph_Load): Decrease index by 1.
-
-       * src/pcf/pcfdriver.c (pcf_cmap_char_index, pcf_cmap_char_next,
-       PCF_Char_Get_Index): Increase result by 1 for normal cases.
-       (PCF_Glyph_Load): Decrease index by 1.
-       * src/pcf/pcfread.c (pcf_get_encodings): Don't decrease j for
-       allocating `encoding'.
-
-       * src/base/ftobjs.c (FT_Load_Glyph, FT_Get_Glyph_Name): Fix
-       bounding tests.
-
-2002-06-14  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       Add new cmap support to BDF driver.
-
-       * src/bdf/bdfdrivr.c (BDF_CMapRec) [FT_CONFIG_OPTION_USE_CMAPS]:
-       New structure.
-       (bdf_cmap_init, bdf_cmap_done, bdf_cmap_char_index,
-       bdf_cmap_char_next) [FT_CONFIG_OPTION_USE_CMAPS]: New functions.
-       (BDF_Get_Char_Index) [!FT_CONFIG_OPTION_USE_CMAPS]: Use only
-       conditionally.
-       (BDF_Face_Init): Handle `AVERAGE_WIDTH' and `POINT_SIZE' keywords.
-       Implement new cmap handling.
-       (bdf_driver_class): Updated.
-
-2002-06-14  Werner Lemberg  <wl@gnu.org>
-
-       * Makefile, configure, */*.mk, builds/unix/unix-def.in,
-       docs/CHANGES, docs/INSTALL: s/TOP/TOP_DIR/.
-
-2002-06-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdflib.c: s/FT_Short/short/ for consistency.
-
-2002-06-11  David Turner  <david@freetype.org>
-
-       * builds/win32/ftdebug.c: Added a missing #endif.
-
-       * src/sfnt/ttload.c, src/bdf/bdflib.c: Removing compiler warnings.
-
-       Removed the bug in Type 42 driver that prevented un-hinted outlines
-       to be loaded.
-
-       * src/type42/t42objs.c (T42_Face_Init): Call FT_Done_Size.
-       (T42_Size_Init): Call FT_Activate_Size.
-       (t42_check_size_change): New function.
-       (T42_Size_SetChars, T42_Size_SetPixels): Use it.
-       (ft_glyphslot_clear): Replace FT_MEM_SET with FT_ZERO.
-       (T42_GlyphSlot_Load): Use t42_check_size_change.
-       Initialize more fields of `glyph'.
-
-       * builds/win32/visualc/freetype.dsp: Updated.
-
-2002-06-09  David Turner  <david@freetype.org>
-
-
-       * Version 2.1.1 released.
-       =========================
-
-
-2002-06-08  Juliusz Chroboczek  <jch@pps.jussieu.fr>
-
-       * include/freetype/internal/ftobjs.h, src/autohint/ahglyph.c,
-       src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/smooth/ftgrays.c: Don't
-       use `setjmp', `longjmp', and `jmp_buf' but `ft_setjmp', `ft_longjmp',
-       and `ft_jmp_buf'.
-       Removed direct references to <stdio.h> and <setjmp.h> when
-       appropriate, to eventually replace them with a
-       FT_CONFIG_STANDARD_LIBRARY_H.  Useful for the XFree86 Font Server
-       backend based on FT2.
-
-       * src/base/fttype1.c (FT_Has_PS_Glyph_Names): Fix return value.
-
-2002-06-08  David Turner  <david@freetype.org>
-
-       * src/pcf/pcfdriver.c (pcf_cmap_char_next): Fixed a bug that caused
-       the function to return invalid values.
-
-       * src/cache/ftccache.i: Removing a typo that prevented
-       the source's compilation.
-
-       * src/cache/ftccache.c (ftc_node_hash_unlink): Fixed a
-       bug that caused nasty memory overwrites.  The hash table's
-       buckets array wasn't correctly resized when shrunk.
-
-2002-06-08  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/smakefile, builds/amiga/makefile: Updated.
-
-2002-06-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftccache.c (ftc_node_hash_unlink, ftc_node_hash_link)
-       [FTC_CACHE_USE_LINEAR_HASHING]: Fix returned error code.
-       Fix debugging messages.
-       * src/cache/ftccache.i (GEN_CACHE_LOOKUP): Move declaration of
-       `family' and `hash' up to make it compilable with g++.
-
-       * src/type42/t42error.h: New file.
-       * src/type42/t42drivr.c, src/type42/t42objs.c,
-       src/type42/t42parse.c: Use t42 error codes.
-       * src/type42/rules.mk: Updated.
-
-       * src/base/ftnames.c: Include FT_INTERNAL_STREAM_H.
-
-2002-06-08  David Turner  <david@freetype.org>
-
-       * src/cache/ftccmap.c: GEN_CACHE_FAMILY_COMPARE,
-       GEN_CACHE_NODE_COMPARE, GEN_CACHE_LOOKUP) [FTC_CACHE_USE_INLINE]:
-       New macros.
-       (ftc_cmap_cache_lookup) [!FTC_CACHE_USE_INLINE]: Typedef to
-       ftc_cache_lookup.
-       (FTC_CMapCache_Lookup): Updated.
-
-       Adding various experimental optimizations to the cache manager.
-
-       * include/freetype/cache/ftccache.h (FTC_CACHE_USE_INLINE,
-       FTC_CACHE_USE_LINEAR_HASHING): New options.
-       (FTC_CacheRec) [FTC_CACHE_USE_LINEAR_HASHING]: New elements `p',
-       `mask', and `slack'.
-
-       * src/cache/ftccache.c (FTC_HASH_MAX_LOAD, FTC_HASH_MIN_LOAD,
-       FTC_HASH_SUB_LOAD) [FTC_CACHE_USE_LINEAR_HASHING,
-       FTC_HASH_INITIAL_SIZE]: New macros.
-       (ftc_node_mru_link, ftc_node_mru_up): Optimized.
-       (ftc_node_hash_unlink, ftc_node_hash_link)
-       [FTC_CACHE_USE_LINEAR_HASHING]: New variants.
-       (FTC_PRIMES_MIN, FTC_PRIMES_MAX, ftc_primes, ftc_prime_closest,
-       FTC_CACHE_RESIZE_TEST, ftc_cache_resize)
-       [!FTC_CACHE_USE_LINEAR_HASHING]: Define it conditionally.
-       (ftc_cache_init, ftc_cache_clear) [FTC_CACHE_USE_LINEAR_HASHING]:
-       Updated.
-       (ftc_cache_lookup) [FTC_CACHE_USE_LINEAR_HASHING]: Implement it.
-
-       * src/cache/ftccache.i: New file.
-
-       * src/cache/ftcsbits.c (GEN_CACHE_FAMILY_COMPARE,
-       GEN_CACHE_NODE_COMPARE, GEN_CACHE_LOOKUP) [FTC_CACHE_USE_INLINE]:
-       New macros.
-       (ftc_sbit_cache_lookup) [!FTC_CACHE_USE_INLINE]: Typedef to
-       ftc_cache_lookup.
-       (FTC_SBitCache_Lookup): Updated.
-
-       * src/type42/t42parse.c: Removing duplicate function.
-
-2002-06-07  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/base/ftobjs.c (FT_Render_Glyph_Internal): Changed definition
-       from FT_EXPORT_DEF to FT_BASE_DEF.
-
-2002-06-07  David Turner  <david@freetype.org>
-
-       Fixed the bug that prevented the correct display of fonts with
-       `ftview'.
-
-       * src/type42/t42drivr.c: Split into...
-       * src/type42/t42drivr.h, src/type42/t42parse.c,
-       src/type42/t42parse.h, src/type42/t42objs.h, src/type42/t42objs.c,
-       src/type42/type42.c: New files.
-
-       (t42_get_glyph_name, t42_get_ps_name, t42_get_name_index): Use
-       `face->type1'.
-
-       (Get_Interface): Renamed to...
-       (T42_Get_Interface): This.
-       Updated.
-       (T42_Open_Face, T42_Face_Done): Updated.
-       (T42_Face_Init): Add new cmap support.
-       Updated.
-       (T42_Driver_Init, T42_Driver_Done, T42_Size_Init, T42_Size_Done,
-       T42_GlyphSlot_Init, T42_GlyphSlot_Done): Updated.
-       (Get_Char_Index, Get_Next_Char): Renamed to...
-       (T42_CMap_CharIndex, T42_CMap_CharNext): This.
-       Updated.
-       (T42_Char_Size, T42_Pixel_Size): Renamed to...
-       (T42_Size_SetChars, T42_Size_SetPixels): This.
-       (T42_Load_Glyph): Renamed to...
-       (T42_GlyphSlot_Load): This.
-
-       (t42_init_loader, t42_done_loader): Renamed to...
-       (t42_loader_init, t42_loader_done): This.
-       (T42_New_Parser, T42_Finalize_Parser): Renamed to...
-       (t42_parser_init, t42_parser_done): This.
-       (parse_dict): Renamed to...
-       (t42_parse_dict): This.
-       (is_alpha, is_space, hexval): Renamed to...
-       (t42_is_alpha, t42_is_space, t42_hexval): This.
-       (parse_font_name, parse_font_bbox, parse_font_matrix,
-       parse_encoding, parse_sfnts, parse_charstrings, parse_dict):
-       Renamed to...
-       (t42_parse_font_name, t42_parse_font_bbox, t42_parse_font_matrix,
-       t42_parse_encoding, t42_parse_sfnts, t42_parse_charstrings,
-       t42_parse_dict): This.
-       Updated.
-
-       (t42_keywords): Updated.
-
-       * src/type42/Jamfile, src/type42/descrip.mms: Updated.
-
-2002-06-03  Werner Lemberg  <wl@gnu.org>
-
-       Add 8bpp support to BDF driver.
-
-       * src/bdf/bdflib.c (_bdf_parse_start): Handle 8bpp.
-       * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Ditto.
-       * src/bdf/README: Updated.
-
-2002-06-02  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/pfr/pfrload.c (pfr_phy_font_done): Free `blue_values' array.
-
-2002-05-29  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/bdf/bdflib.c (_bdf_readstream): Allocate `buf' dynamically.
-       (_bdf_parse_glyphs): Use correct size for allocating
-       `font->unencoded'.
-       (bdf_load_font): Free array conditionally.
-       Return proper error code in case of failure.
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Make it more robust against
-       unusual fonts.
-
-2002-05-29  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/descrip.mms, src/type42/descrip.mms: New files.
-       * descrip.mms (all): Updated.
-
-       * src/bdf/bdflib.c (_bdf_parse_glyphs): Fix typo which prevented
-       compilation.
-       * src/pshglob.c (psh_blues_scale_zones): Fix compiler warning.
-
-2002-05-28  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/makefile, builds/amiga/smakefile,
-       amiga/include/freetype/config/ftmodule.h: Updated to include
-       support for BDF and Type42 drivers.
-
-       * docs/modules.txt: Updated.
-
-2005-05-28  David Turner  <david@freetype.org>
-
-       * docs/CHANGES: Updating file for next release (2.1.1).
-
-       * src/bdf/bdflib.c: Removing compiler warnings.
-
-       * include/freetype/ftxf86.h, src/base/ftxf86.c: New files.
-       They provide a new API (FT_Get_X11_Font_Format) to retrieve an
-       X11-compatible string describing the font format of a given face.
-       This was put in a new optional base source file, corresponding to a
-       new public header (named FT_XFREE86_H since this function should
-       only be used within the XFree86 font server IMO).
-
-       * include/freetype/config/ftheader.h (FT_XFREE86_H): New macro (not
-       documented yet).
-
-       * src/base/fttype1.c: New file, providing two new API functions
-       (FT_Get_PS_Font_Info and FT_Has_PS_Glyph_Names).
-       * include/freetype/t1tables.h: Updated.
-
-       * src/base/Jamfile, src/base/rules.mk, src/base/descrip.mms:
-       Updating build control files for the new files `ftxf86.c' and
-       `fttype1.c' in src/base.
-
-       * src/pshinter/pshglob.c (psh_blues_scale_zones): Fixed a bug that
-       prevented family blue zones substitution from hapenning correctly.
-
-       * include/freetype/ftbdf.h FT_Get_BDF_Charset_ID): Adding
-       documentation comment.
-
-2002-05-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftnames.c (FT_Get_Sfnt_Name): Don't use FT_STREAM_READ_AT
-       but FT_STREAM_READ.
-       Declare `stream' variable.
-
-       * src/bdf/bdflib.c (_bdf_parse_glyphs): Replace floating point math
-       with calls to `FT_MulDiv'.
-
-2002-05-28  David Turner  <david@freetype.org>
-
-       Fixing the SFNT name table loader to support various buggy fonts.
-       It now ignores empty name entries, entries with invalid pointer
-       Offsets and certain fonts containing tables with broken
-       `storageOffset' fields.
-
-       Name strings are now loaded on demand, which reduces the memory
-       requirements for a given FT_Face tremendously (for example, the name
-       table of Arial.ttf is about 10Kb and contains 70 names).
-
-       This is a temporary fix.  The whole name table loader and interface
-       will be rewritten in a much more cleanly way shortly, once CSEH have
-       been introduced in the sources.
-
-       * include/freetype/internal/tttypes.h (TT_NameEntryRec): Change
-       type of `stringOffset' to FT_ULong.
-       (TT_NameTableRec): Change type of `numNameRecords' and
-       `storageOffset' to FT_UInt.
-       Replace `storage' with `stream'.
-       * src/base/ftnames.c (FT_Get_Sfnt_Name): Load name on demand.
-       * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Ditto.
-       Make code more robust.
-       * src/sfnt/sfobjs.c (TT_NameEntry_ConvertFunc): New typedef.
-       (tt_face_get_name): Use it.
-       Make code more robust.
-       * src/sfnt/ttload.c (TT_Load_Names): Use `static' for arrays.
-       Handle invalid `storageOffset' data better.
-       Set length fields to zero for invalid or ignored data.
-       Remove code within FT_DEBUG_LEVEL_TRACE.
-       (TT_Free_Names): Updated.
-
-2002-05-24  Tim Mooney  <enchanter@users.sourceforge.net>
-
-       * builds/unix/ft-munmap.m4: New file, extracted FT_MUNMAP_DECL and
-       FT_MUNMAP_PARAM from aclocal.m4 into here, so aclocal.m4 can be
-       rebuilt from sources.  Set macro serial to 1, and use third argument
-       to AC_DEFINE for our two custom symbols, so ftconfig.in could one day
-       be rebuilt with autoheader (not recommended now, ftconfig.in is a
-       custom source file)
-
-2002-05-22  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftheader.h (FT_BEZIER_H): Removed.
-       (FT_BDF_H): New macro for accessing `ftbdf.h'.
-
-       * src/type42/t42drivr.c (hexval): Fix typo.
-
-2002-05-21  Martin Muskens  <mmuskens@aurelon.com>
-
-       * src/psaux/psobjs.c (T1Radix): New function.
-       (t1_toint): Use it to handle numbers in radix format.
-
-       * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Add dummy
-       for undocumented, obsolete opcode 15.
-
-2002-05-21  David Turner  <david@freetype.org>
-
-       * src/bdf/bdflib.c: Removed compiler warning, and changed all tables
-       to the `static const' storage specifier (instead of simply
-       `static').
-
-       * src/type42/t42drivr.c (hexval): Use more efficient code.
-       Removing compiler warnings.
-       * src/bdf/bdfdrivr.c: Removing compiler warnings.
-
-       * include/freetype/internal/ftbdf.h, src/base/ftbdf.c,
-       src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk
-       (FT_Get_BDF_Charset_ID): New API to retrieve BDF-specific strings
-       from a face.  This is much cleaner than accessing the internal types
-       `BDF_Public_Face' defined in FT_INTERNAL_BDF_TYPES_H.
-
-2002-05-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/README: Mention Microsoft's SBIT tool.
-
-       * src/cff/cffdrivr.c, src/cid/cidriver.c, src/pcf/pcfdriver.c,
-       src/truetype/ttdriver.c, src/type1/t1driver.c,
-       src/winfonts/winfnt.c, src/type42/t42drivr.c, src/bdf/bdfdrivr.c
-       [FT_CONFIG_OPTION_DYNAMIC_DRIVERS]: Completely removed.  It has
-       been never used.
-
-2002-05-21  Roberto Alameda  <ojancano@geekmail.de>.
-
-       * src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/.
-       (parse_font_matrix): Remove unnecessary code.
-       (parse_sfnts): Initialize some variables.
-       (t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use
-       ft_module_driver_has_hinter conditionally.
-       Moved some type 42 specific structure definitions to...
-       * include/freetype/internal/t42types.h: New file.
-       * include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H):
-       New macro.
-
-2002-05-20  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field
-       `num_grays' for specifying the number of used gray levels.
-       * src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it.
-
-2002-05-19  Werner Lemberg  <wl@gnu.org>
-
-       Adding a driver for BDF fonts written by Francesco Zappa Nardelli
-       <Francesco.Zappa.Nardelli@ens.fr>.  Heavily modified by me to
-       better adapt it to FreeType, removing unneeded stuff.  Additionally,
-       it now supports Mark Leisher's BDF extension for anti-aliased
-       bitmap glyphs with 2 and 4 bpp.
-
-       * src/bdf/*: New driver.
-       * include/freetype/internal/bdftypes.h: New file.
-       * include/freetype/internal/fttrace.h: Added BDF driver components.
-       * include/freetype/fterrdef.h: Added error codes for BDF driver.
-       * include/freetype/config/ftmodule.h, src/Jamfile: Updated.
-       * include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H):
-       New macro.
-
-       * include/freetype/config/ftstdlib.h (ft_sprintf): New alias for
-       sprintf.
-
-2002-05-18  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/fttrace.h: Added Type 42 driver
-       component.
-       * src/type42/t42drivr.c: Use it.
-
-       * include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H):
-       New macro.
-
-2002-05-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/type42/Jamfile: New file.
-
-2002-05-14  Werner Lemberg  <wl@gnu.org>
-
-       Adding a driver for Type42 fonts written by Roberto Alameda
-       <ojancano@geekmail.de>.
-
-       * src/type42/*: New driver.
-       * include/freetype/config/ftmodule.h, src/Jamfile: Updated.
-       * include/freetype/config/ftstdlib.h (ft_xdigit, ft_memcmp,
-       ft_atoi): New aliases for xdigit, memcmp, and atoi, respectively.
-
-2002-05-12  Owen Taylor  <otaylor@redhat.com>
-
-       * src/sfnt/ttload.c (TT_LookUp_Table): Protect against tables
-       with a zero length value.
-
-2002-05-12  Michael Pfeiffer  <michael.pfeiffer@utanet.at>
-
-       * builds/beos/beos.mk: Include `link-std.mk'.
-
-2002-05-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.h (T1_Loader): Renamed to...
-       (T1_LoaderRec): This.
-       (T1_Loader): Now pointer to T1_LoaderRec.
-       * src/type1/t1load.c: Updated.
-
-       * include/freetype/internal/t1types.h, src/type1/t1load.c,
-       src/type1/t1objs.c:
-       s/T1_ENCODING_TYPE_EXPORT/T1_ENCODING_TYPE_EXPERT/.
-
-2002-05-06  Werner Lemberg  <wl@gnu.org>
-
-       * README: Add a note regarding libttf vs. libfreetype.
-
-2002-05-05  Werner Lemberg  <wl@gnu.org>
-
-       FreeType 2 can now be built in an external directory with the
-       configure script also.
-
-       * builds/freetype.mk (INCLUDES): Add `OBJ_DIR'.
-
-       * builds/unix/detect.mk (have_mk): New variable to test for
-       external build.
-       (unix-def.mk): Defined according to value of `have_mk'.
-       * builds/unix/unix.mk (have_mk): New variable to test for
-       external build.
-       Select include paths for unix-def.mk and unix-cc.mk according
-       to value of `have_mk'.
-       * builds/unix/unix-def.in (OBJ_BUILD): New variable.
-       (DISTCLEAN): Use it.
-       * builds/unix/unix-cc.in (LIBTOOL): Define default value only
-       if not yet defined.
-       * builds/unix/install.mk (install): Use `OBJ_BUILD' for installing
-       freetype-config.
-
-       * configure: Don't depend on bash features.
-       (ft2_dir, abs_curr_dir, abs_ft2_dir): New variables (code
-       partially taken from Autoconf).
-       Build a dummy Makefile if not building in source tree.
-
-       * docs/INSTALL: Document it.
-
-2002-05-04  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c (TT_Load_Glyph): Finally fixing the last
-       bug that prevented FreeType 2.x and FreeType 1.x to produce
-       bit-by-bit identical monochrome glyph bitmaps with native TrueType
-       hinting.  The culprit was a single-bit flag that wasn't set
-       correctly by the TrueType glyph loader.
-
-       * src/otlayout/otlayout.h, src/otlayout/otlbase.c,
-       src/otlayout/otlbase.h, src/otlayout/otlconf.h,
-       src/otlayout/otlgdef.c, src/otlayout/otlgdef.h,
-       src/otlayout/otlgpos.c, src/otlayout/otlgpos.h,
-       src/otlayout/otlgsub.c, src/otlayout/otlgsub.h,
-       src/otlayout/otljstf.c, src/otlayout/otljstf.h,
-       src/otlayout/otltable.c, src/otlayout/otltable.h,
-       src/otlayout/otltags.h: New OpenType Layout source files.  The
-       module is still incomplete.
-
-2002-05-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttcmap0.c (tt_cmap4_char_index): Fix serious typo
-       (0xFFFU -> 0xFFFFU).
-
-2002-05-01  Werner Lemberg  <wl@gnu.org>
-
-       * docs/INSTALL: Fix URL of makepp.
-
-2002-05-01  David Turner  <david@freetype.org>
-
-       * src/sfnt/sfobjs.c (tt_face_get_name): Fixing a bug that caused
-       FreeType to crash when certain broken fonts (e.g. `hya6gb.ttf')
-       were opened.
-
-       * src/sfnt/ttload.c (TT_Load_Names): Applied a small work-around to
-       manage fonts containing a broken name table (e.g. `hya6gb.ttf').
-
-       * src/sfnt/ttcmap0.c (tt_cmap4_validate): Fixed over-restrictive
-       validation test.  The charmap validator now accepts overlapping
-       ranges in format 4 charmaps.
-
-       * src/sfnt/ttcmap0.c (tt_cmap4_char_index): Switched to a binary
-       search algorithm.  Certain fonts contain more than 170 distinct
-       segments!
-
-       * include/freetype/config/ftstdlib.h: Adding an alias for the `exit'
-       function.  This will be used in the near future to panic in case of
-       unexpected exception (which shouldn't happen in theory).
-
-       * include/freetype/internal/fthash.h, src/base/fthash.c: New files.
-       This is generic implementation of dynamic hash tables using a linear
-       algorithm (to get rid of `stalls' during resizes).  In the future
-       this will be used in at least three parts of the library: the cache
-       sub-system, the object sub-system, and the memory debugger.
-
-       * src/base/Jamfile: Updated.
-
-       * include/freetype/internal/internal.h (FT_INTERNAL_HASH_H,
-       FT_INTERNAL_OBJECT_H): New macros.
-
-       * include/freetype/internal/ftcore.h: New file to group all new
-       definitions related to exception handling and memory management.  It
-       is very likely that this file will disappear or be renamed in the
-       future.
-
-       * include/freetype/internal/ftobject.h, include/freetype/ftsysmem.h:
-       Adding comments to better explain the object sub-system as well as
-       the new memory manager interface.
-
-2002-04-30  Wenlin Institute (Tom Bishop)  <wenlin@wenlin.com>
-
-       * src/base/ftmac.c (p2c_str): Removed.
-       (file_spec_from_path) [TARGET_API_MAC_CARBON]: Added support for
-       OS X.
-       (is_dfont) [TARGET_API_MAC_CARBON]: Define only for OS X.
-       Handle `nameLen' <= 6 also.
-       (parse_fond): Remove unused variable `name_table'.
-       Use functionality of old p2c_str directly.
-       Add safety checks.
-       (read_lwfn): Initialize `size_p'.
-       Check for size_p == NULL.
-       (new_memory_stream, open_face_from_buffer): Updated to FreeType 2.1.
-       (FT_New_Face_From_LWFN): Remove unused variable `memory'.
-       Remove some dead code.
-       (FT_New_Face_From_SFNT): Remove unused variable `stream'.
-       (FT_New_Face_From_dfont) [TARGET_API_MAC_CARBON]: Define only for
-       OS X.
-       (FT_New_Face_From_FOND): Remove unused variable `error'.
-       (ResourceForkSize): New function.
-       (FT_New_Face): Use it.
-       Handle empty resource forks.
-       Conditionalize some code for OS X.
-       Add code to call normal loader as a fallback.
-
-2002-04-30  Werner Lemberg  <wl@gnu.org>
-
-       `interface' is reserved on the Mac.
-
-       * include/freetype/ftoutln.h, include/freetype/internal/sfnt.h,
-       src/base/ftoutln.c: s/interface/func_interface/.
-       * src/base/ftbbox.c (FT_Outline_Get_BBox):
-       s/interface/bbox_interface/.
-       * src/cff/cffdrivr.c: s/interface/module_interface/.
-       * src/cff/cffload.c, src/cff/cffload.h:
-       s/interface/psnames_interface/.
-       * src/cid/cidriver.c: s/interface/cid_interface/.
-       * src/sfnt/sfdriver.c: s/interface/module_interface/.
-       * src/smooth/ftgrays.c: s/interface/func_interface/.
-       * src/truetype/ttdriver.c: s/interface/tt_interface/.
-       * src/type1/t1driver.c: s/interface/t1_interface/.
-
-       Some more variable renames to avoid troubles on the Mac.
-
-       * src/raster/ftraster.c:
-       s/Unknown|Ascending|Descending|Flat/\1_State/.
-       * src/smooth/ftgrays.c: s/TScan/TCoord/.
-
-       Other changes for the Mac.
-
-       * include/freetype/config/ftconfig.h: Define FT_MACINTOSH for
-       Mac platforms.
-       * src/base/ftobjs.c: s/macintosh/FT_MACINTOSH/.
-
-       * src/raster/ftrend1.c (ft_raster1_render): Make `pitch' always
-       an even number.
-
-2002-04-29  Jouk Jansen  <joukj@hrem.stm.tudelft.nl>
-
-       * descrip.mms (all): Add pfr driver.
-
-2002-04-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/pfrerror.h: New file.
-       * include/freetype/ftmoderr.h: Add PFR error codes.
-       * src/pfr/pfrgload.c: Include pfrerror.h.
-       Use PCF error codes.
-       (pfr_extra_item_load_stem_snaps): Fix debug message.
-       * src/pfr/pfrgload.c: Include pfrerror.h.
-       Use PCF error codes.
-       (pfr_extra_item_load_bitmap_info, pfr_glyph_load_simple,
-       pfr_glyph_load_compound): Fix debug message.
-       * src/pfr/pfrobjs.c: Include pfrerror.h.
-       Use PCF error codes.
-       (pfr_face_init): Return PFR_Err_Unknown_File_Format.
-       * src/pfr/rules.mk (PFR_DRV_H): Include pfrerror.h.
-
-       * src/pcf/pcfdriver.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_CMAPS]:
-       `root' -> `face->root'.
-       * src/sfnt/ttcmap0.c (TT_Build_CMaps) [!FT_CONFIG_OPTION_USE_CMAPS]:
-       Removed.
-       * src/sfnt/ttcmap0.c: Declare TT_Build_CMaps only for
-       FT_CONFIG_OPTION_USE_CMAPS.
-
-2002-04-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftccache.c (ftc_cache_lookup),
-       src/cache/ftccmap.c (ftc_cmap_family_init),
-       src/cache/ftcmanag.c (ftc_family_table_alloc),
-       src/cache/ftcsbits.c (FTC_SBit_Cache_Lookup): Use FTC_Err_*.
-       src/cache/ftcimage.c (FTC_Image_Cache_Lookup): Use FTC_Err_*.
-       (FTC_ImageCache_Lookup): Fix handling of invalid arguments.
-
-2002-04-22  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.ac: Set `version_info' to 9:1:3 (FT2
-       version 2.0.9 has 9:0:3).
-       * builds/unix/configure: Regenerated (using autoconf 2.53).
-
-2002-04-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/pfrload.c (pfr_extra_items_farse): Fix debug message.
-       (pfr_phy_font_load): s/size/Size/ for local variable to avoid
-       compiler warning.
-       * src/pfr/pfrobjs.c (pfr_face_init): Fix debug message.
-       (pfr_slot_load): Remove redundant local variable.
-
-2002-04-19  David Turner  <david@freetype.org>
-
-       Adding a PFR font driver to the FreeType sources.  Note that it
-       doesn't support embedded bitmaps or kerning tables yet.
-
-       src/pfr/*: New files.
-
-       * include/freetype/config/ftmodule.h,
-       include/freetype/internal/fttrace.h, src/Jamefile: Updated.
-
-       * src/type1/t1gload.h (T1_Load_Glyph), src/type1/t1gload.c
-       (T1_Load_Glyph): Fixed incorrect parameter sign-ness in callback
-       function.
-
-       * include/freetype/internal/ftmemory.h (FT_MEM_ZERO, FT_ZERO): New
-       macros.
-
-       * include/freetype/internal/ftstream.h (FT_NEXT_OFF3, FT_NEXT_UOFF3,
-       FT_NEXT_OFF3_LE, FT_NEXT_UOFF3_LE): New macros to parse in-memory
-       24-bit integers.
-
-2002-04-18  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c, builds/win32/ftdebug.c,
-       builds/amiga/src/base/ftdebug.c: Version 2.1.0 couldn't be linked
-       against applications in Win32 and Amiga builds due to changes to
-       `src/base/ftdebug.c' that were not properly propagated to
-       `builds/win32' and `builds/amiga'.  This has been fixed.
-
-       * include/freetype/internal/ftobject.h,
-       include/freetype/internal/ftexcept.h, include/freetype/ftsysmem.h,
-       include/freetype/ftsysio.h, src/base/ftsysmem.c, src/base/ftsysio.c:
-       New experimental files.
-
-2002-04-17  David Turner  <david@freetype.org>
-
-
-       * Version 2.1.0 released.
-       =========================
-
-
-2002-04-17  Michael Jansson  <mjan@em2-solutions.com>
-
-       * src/type1/t1gload.c (T1_Compute_Max_Advance): Fixed a small bug
-       that prevented the function to return the correct value.
-
-2002-04-16  Francesco Zappa Nardelli  <Francesco.Zappa.Nardelli@ens.fr>
-
-       * src/pcf/pcfread (pcf_get_accell): Fix parsing of accelerator
-       tables.
-
-2002-04-15  David Turner  <david@freetype.org>
-
-       * docs/FTL.txt: Formatting.
-
-       * include/freetype/config/ftoption.h: Reduce the size of the
-       render pool from 32kByte to 16kByte.
-
-       * src/pcf/pcfread.c (pcf_seek_to_table_type): Remove compiler
-       warning.
-
-       * include/freetype/config/ftoption.h (FT_MAX_EXTENSIONS): Removed.
-
-       * docs/CHANGES: Preparing 2.1.0 release.
-
-2002-04-13  Werner LEMBERG  <wl@gnu.org>
-
-       * src/cff/cffgload.c (CFF_Parse_CharStrings): s/rand/Rand/ to avoid
-       compiler warning.
-
-2002-04-12  David Turner  <david@freetype.org>
-
-       * README.UNX: Updated the Unix-specific quick-compilation guide to
-       warn about the GNU Make requirement at compile time.
-
-       * include/freetype/config/ftstdlib.h,
-       include/freetype/config/ftconfig.h,
-       include/freetype/config/ftheader.h,
-       include/freetype/internal/ftmemory.h,
-       include/freetype/internal/ftobjs.h,
-
-       src/autohint/ahoptim.c,
-
-       src/base/ftdbgmem.c, src/base/ftdebug.c, src/base/ftmac.c,
-       src/base/ftobjs.c, src/base/ftsystem.c,
-
-       src/cache/ftcimage.c, src/cache/ftcsbits.c,
-
-       src/cff/cffdriver.c, src/cff/cffload.c, src/cff/cffobjs.c,
-
-       src/cid/cidload.c, src/cid/cidparse.c, src/cid/cidriver.c,
-
-       src/pcf/pcfdriver.c, src/pcf/pcfread.c,
-
-       src/psaux/t1cmap.c, src/psaux/t1decode.c,
-
-       src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.c,
-       src/pshinter/pshrec.c,
-
-       src/psnames/psmodule.c,
-
-       src/raster/ftraster.c,
-
-       src/sfnt/sfdriver.c, src/sfnt/ttload.c,
-
-       src/smooth/ftgrays.c,
-
-       src/type1/t1afm.c, src/type1/t1driver.c, src/type1/t1gload.c,
-       src/type1/t1load.c, src/type1/t1objs.c, src/type1/t1parse.c,
-
-       builds/unix/ftconfig.in, builds/vms/ftconfig.h,
-
-       builds/amiga/src/base/ftdebug.c:
-
-       Added the new configuration file `ftstdlib.h' used to define
-       aliases for all ISO C library functions used by the engine
-       (e.g. strlen, qsort, setjmp, etc.).
-
-       This eases the porting of FreeType 2 to environments like
-       XFree86 modules/extensions.
-
-       Also removed many #include <string.h>, #include <stdlib.h>, etc.
-       from the engine's sources where they are not needed.
-
-       * src/sfnt/ttpost.c: Use macro name for psnames.h.
-
-2002-04-12  Vincent Caron  <v.caron@zerodeux.net>
-
-       * configure, builds/detect.mk: Updated the build system to print
-       a warning message in case GNU Make isn't used to build the library.
-
-2002-04-11  David Turner  <david@freetype.org>
-
-       * README, docs/CHANGES, Jamfile.in: Updates for the 2.1.0 release.
-
-       * docs/FTL.txt: Updated license text to provide a preferred
-       disclaimer and adjust copyright dates/extents.
-
-       * include/freetype/cache/ftcglyph.h: Removing obsolete (and
-       confusing) comment.
-
-       * Jamfile.in: New file.
-
-2002-04-11  Maxim Shemanarev  <mcseemagg@yahoo.com>
-
-       * src/smooth/ftgrays.c (gray_hline): Minor optimization.
-
-2002-04-02  Werner Lemberg  <wl@gnu.org>
-
-       Fixes from the stable branch:
-
-       * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_OLD_CALCS):
-       Removed.
-       [FT_CONFIG_OPTION_OLD_CALCS]: Removed.
-       * include/freetype/internal/ftcalc.h, src/base/ftcalc.c
-       [FT_CONFIG_OPTION_OLD_CALCS]: Removed.
-
-       * src/base/fttrigon.c (FT_Vector_Length): Change algorithm to match
-       output of FreeType 1.
-
-       * src/pshinter/pshglob.c (psh_globals_scale_widths): Fixed a small
-       bug that created un-even stem widths when hinting Postscript fonts.
-
-       * src/type1/t1driver.c, src/type1/t1parse.c: 16bit fixes.
-
-2002-04-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c: 16bit fixes.
-       (TT_Load_Simple_Glyph): Improve debug messages.
-       (load_truetype_glyph): Remove dead code.
-       * src/truetype/ttinterp.c: 16bit fixes.
-       * src/truetype/ttobjs.c: Ditto.
-
-       * include/freetype/ftsnames.h, include/freetype/internal/sfnt.h,
-       src/cff/cffload.h, src/psaux/psobjs.h, src/truetype/ttinterp.[ch],
-       src/sfnt/ttpost.h: s/index/idx/.
-
-2002-03-31  Yao Zhang  <yaoz@vidar.niaaa.nih.gov>
-
-       * src/truetype/ttobjs.c (TT_Size_Init): Fix typo.
-
-2002-03-31  Werner Lemberg  <wl@gnu.org>
-
-       * src/otlayout/otlcommn.c, src/otlayout/otlcommn.h: s/index/idx/.
-       * src/psaux/t1cmap.c: Ditto.
-       * src/sfnt/ttcmap0.c: Ditto.
-
-       * include/freetype/internal/tttypes.h,
-       include/freetype/internal/sfnt.h (TT_Goto_Table_Func): Renamed to ...
-       (TT_Loader_GotoTableFunc): This.
-       * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Fix debug
-       messages.
-       * src/psnames/psmodule.c (psnames_interface)
-       [!FT_CONFIG_OPTION_ADOBE_GLYPH_LIST]: Fix typo.
-       * src/sfnt/sfdriver.c (get_sfnt_table): 16bit fix.
-       * src/sfnt/ttcmap.c: 16bit fixes (0xFFFF -> 0xFFFFU).
-       * src/sfnt/ttcmap0.c: 16bit fixes.
-       (TT_Build_CMaps): Simplify debug messages.
-       (tt_cmap12_char_next): Fix offset.
-       * src/sfnt/ttload.c (TT_Load_Names, TT_Load_CMap): Fix debug
-       messages.
-       (TT_Load_OS2): 16bit fix.
-
-2002-03-30  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/tttypes.h: Adding comments to some of
-       the TT_FaceRec fields.
-
-       * src/sfnt/ttcmap0.c (TT_Build_CMaps): Removed compiler warnings.
-
-       * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_{utf16,ucs4,other}:
-       New functions.
-       (tt_face_get_name): Use them to properly extract an ascii font name.
-
-2002-03-30  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/t1tables.h (t1_blend_max): Fix typo.
-       * src/base/ftstream.c: Simplify FT_ERROR calls.
-       * src/cff/cffdrivr.c (cff_get_glyph_name): Fix debug message.
-
-       * src/cff/cffobjs.c (CFF_Driver_Init, CFF_Driver_Done)
-       [TT_CONFIG_OPTION_EXTEND_ENGINE]: Removed.
-       * src/cff/sfobjs.c (SFNT_Load_Face)
-       [TT_CONFIG_OPTION_EXTEND_ENGINE]: Ditto.
-       * src/truetype/ttobjs.c (TT_Init_Driver, TT_Done_Driver)
-       [TT_CONFIG_OPTION_EXTEND_ENGINE]: Ditto.
-
-       * src/truetype/ttdriver.c, src/truetype/ttobjs.c,
-       src/truetype/ttobjs.h: Renaming driver functions to the
-       FT_<Subject>_<Action> scheme:
-
-         TT_Init_Driver => TT_Driver_Init
-         TT_Done_Driver => TT_Driver_Done
-         TT_Init_Face   => TT_Face_Init
-         TT_Done_Face   => TT_Face_Done
-         TT_Init_Size   => TT_Size_Init
-         TT_Done_Size   => TT_Size_Done
-         TT_Reset_Size  => TT_Size_Reset
-
-2002-03-29  Werner Lemberg  <wl@gnu.org>
-
-       * builds/vms/ftconfig.h: Rename LOCAL_DEF and LOCAL_FUNC to
-       FT_LOCAL and FT_LOCAL_DEF, respectively, as with other ftconfig.h
-       files.
-       * builds/unix/ftconfig.in: Add argument to FT_LOCAL and
-       FT_LOCAL_DEF.
-       * src/truetype/ttinterp.c: s/FT_Assert/FT_ASSERT/.
-       * builds/unix/configure.ac: Temporarily deactivate creation of
-       ../../Jamfile.
-       * builds/unix/configure: Updated.
-
-2002-03-28  KUSANO Takayuki  <AE5T-KSN@asahi-net.or.jp>
-
-       * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Fix serious typos.
-
-2002-03-28  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/psaux.h (PSAux_ServiceRec): Fix
-       compiler warnings.
-       * include/freetype/internal/t1types.h (T1_FaceRec): Use `const' for
-       some members.
-       * src/base/ftapi.c (FT_New_Memory_Stream): Fix typos.
-       * src/psaux/t1cmap.c (t1_cmap_std_init, t1_cmap_unicode_init): Add
-       cast.
-       (t1_cmap_{standard,expert,custom,unicode}_class_rec): Use
-       `FT_CALLBACK_TABLE_DEF'.
-       * src/psaux/t1cmap.h: Updated.
-       * src/sfnt/ttcmap0.c (TT_Build_CMaps): Use `ft_encoding_none'
-       instead of zero.
-       * src/type1/t1objs.c (T1_Face_Init): Use casts.
-
-2002-03-26  David Turner  <david@freetype.org>
-
-       * src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c:
-       Fixed a small bug in the FT_CMaps support code.
-
-2002-03-25  David Turner  <david@freetype.org>
-
-       * src/truetype/ttinterp.c (Norm): Replaced with...
-       (TT_VecLen): This.
-       (TT_MulFix14, TT_DotFix14): New functions.
-       (Project, Dual_Project, Free_Project, Compute_Point_Displacement,
-       Ins_SHPIX, Ins_MIAP, Ins_MIRP): Use them.
-       [FT_CONFIG_OPTION_OLD_CALCS]: Removed all code.
-
-2002-03-22  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/type1/t1objs.c:
-       Various fixes to make the FT_CMaps support work correctly (more
-       tests are still needed).
-
-       * include/freetype/internal/ftobjs.h, src/sfnt/Jamfile,
-       src/sfnt/rules.mk, src/sfnt/sfnt.c, src/sfnt/sfobjs.c,
-       src/sfnt/ttload.c, src/sfnt/ttcmap0.c, src/sfnt/ttcmap0.h: Updated
-       the SFNT charmap support to use FT_CMaps.
-
-       * include/freetype/fterrdef.h: New file.
-       * include/freetype/fterrors.h: Include it.  It contains all error
-       codes.
-       * include/freetype/config/ftheader.h (FT_ERROR_DEFINITIONS_H): New
-       macro.
-
-       * include/freetype/internal/ftmemory.h, and a lot of other files:
-       Changed the names of memory macros.  Examples:
-
-         MEM_Set   => FT_MEM_SET
-         MEM_Copy  => FT_MEM_COPY
-         MEM_Move  => FT_MEM_MOVE
-
-         ALLOC     => FT_ALLOC
-         FREE      => FT_FREE
-         REALLOC   = >FT_REALLOC
-
-       FT_NEW was introduced to allocate a new object from a _typed_
-       pointer.
-
-       Note that ALLOC_ARRAY and REALLOC_ARRAY have been replaced by
-       FT_NEW_ARRAY and FT_RENEW_ARRAY which take _typed_ pointer
-       arguments.
-
-       This results in _lots_ of sources being changed, but makes the code
-       more generic and less error-prone.
-
-       * include/freetype/internal/ftstream.h, src/base/ftstream.c,
-       src/cff/cffload.c, src/pcf/pcfread.c, src/sfnt/ttcmap.c,
-       src/sfnt/ttcmap0.c, src/sfnt/ttload.c, src/sfnt/ttpost.c,
-       src/sfnt/ttsbit.c, src/truetype/ttgload.c, src/truetype/ttpload.c,
-       src/winfonts/winfnt.c: Changed the definitions of stream macros.
-       Examples:
-
-         NEXT_Byte     => FT_NEXT_BYTE
-         NEXT_Short    => FT_NEXT_SHORT
-         NEXT_UShortLE => FT_NEXT_USHORT_LE
-         READ_Short    => FT_READ_SHORT
-         GET_Long      => FT_GET_LONG
-         etc.
-
-       Also introduced the FT_PEEK_XXXX functions.
-
-       * src/cff/cffobjs.c (CFF_Build_Unicode_Charmap): Removed commented
-       out function.
-       (find_encoding): Removed.
-       (CFF_Face_Init): Remove charmap support.
-
-       * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_USE_CMAPS,
-       TT_CONFIG_CMAP_FORMAT{0,2,4,6,8,10,12}): New macros to fine-tune
-       support of cmaps.
-
-2002-03-21  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c, src/pcf/pcfdriver.c, src/pcf/pcfread.c: Updated
-       to new FT_CMap definitions.
-
-       * src/psaux/t1cmap.h, src/psaux/t1cmap.c, src/type1/t1cmap.h,
-       src/type1/t1cmap.c: Updating and moving the Type 1 FT_CMap support
-       from `src/type1' to `src/psaux' since it is going to be shared by
-       the Type 1 and CID font drivers.
-
-       * src/psaux/Jamfile, src/psaux/psaux.c, src/psaux/psauxmod.c,
-       src/psaux/rules.mk, include/freetype/internal/psaux.h: Added support
-       for Type 1 FT_CMaps.
-
-2002-03-20  David Turner  <david@freetype.org>
-
-       * src/base/ftgloadr.c (FT_GlyphLoader_CheckSubGlyphs): Fixed a
-       memory allocation bug that was due to un-careful renaming of the
-       FT_SubGlyph type.
-
-       * src/base/ftdbgmem.c (ft_mem_table_destroy): Fixed a small bug that
-       caused the library to crash with Electric Fence when memory
-       debugging is used.
-
-       * Renaming stream macros.  Examples:
-
-         FILE_Skip    => FT_STREAM_SKIP
-         FILE_Read    => FT_STREAM_READ
-         ACCESS_Frame => FT_FRAME_ENTER
-         FORGET_Frame => FT_FRAME_EXIT
-         etc.
-
-       * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Fixed memory leak.
-
-       * include/freetype/internal/ftobjs.h: Changing the definition of
-       FT_CMap_CharNextFunc slightly.
-
-       * src/cff/*.c: Updating CFF type definitions.
-
-2002-03-14  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/autohint.h, src/autohint/ahmodule.c,
-       src/base/ftapi.c, src/base/ftobjs.c: Updating the type definitions
-       for the auto-hinter module.
-
-         FT_AutoHinter_Interface  => FT_AutoHinter_ServiceRec
-         FT_AutoHinter_Interface* => FT_AutoHinter_Service
-         etc.
-
-         FT_AutoHinter_Get_Global_Func  => FT_AutoHinter_GlobalGetFunc
-         FT_AutoHinter_Done_Global_Func => FT_AutoHinter_GlobalDoneFunc
-         etc.
-
-       * ahloader.h [_STANDALONE_]: Removed all conditional code.
-
-       * include/freetype/internal/cfftypes.h, src/cff/*.c: Updating the
-       type definitions of the CFF font driver.
-
-         CFF_Font  => CFF_FontRec
-         CFF_Font* => CFF_Font
-         etc.
-
-       * include/freetype/internal/fnttypes.h, src/winfonts/*.c: Updating
-       type definitions of the Windows FNT font driver.
-
-       * include/freetype/internal/ftdriver.h,
-       include/freetype/internal/ftobjs.h, src/base/ftapi.c,
-       src/base/ftobjs.c, src/cff/cffdrivr.c, src/cff/cffdrivr.h,
-       src/cid/cidriver.c, src/cid/cidriver.h, src/pcf/pcfdriver.c,
-       src/pcf/pcfdriver.h, src/truetype/ttdriver.c,
-       src/truetype/ttdriver.h, src/type1/t1driver.c, src/type1/t1driver.h,
-       src/winfonts/winfnt.c, src/winfonts/winfnt.h: Updating type
-       definitions for font drivers.
-
-         FTDriver_initFace      => FT_Face_InitFunc
-         FTDriver_initGlyphSlot => FT_Slot_InitFunc
-         etc.
-
-       * src/cid/cidobjs.c (CID_Face_Init): Remove dead code.
-
-       * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: Updated a
-       few face method definitions:
-
-         FT_PSName_Requester     => FT_Face_GetPostscriptNameFunc
-         FT_Glyph_Name_Requester => FT_Face_GetGlyphNameFunc
-         FT_Name_Index_Requester => FT_Face_GetGlyphNameIndexFunc
-
-       * src/base/ftapi.c: New file.  It contains backwards compatibility
-       functions.
-
-       * include/freetype/internal/psaux.h, src/cid/cidload.c,
-       src/cidtoken.h, src/psaux/psobjs.c, src/psaux/psobjs.h,
-       src/psaux/t1decode.c, stc/type1/t1load.c, src/type1/t1tokens.h:
-       Updated common PostScript type definitions.
-       Renamed all enumeration values like to uppercase variants:
-
-         t1_token_any      => T1_TOKEN_TYPE_ANY
-         t1_field_cid_info => T1_FIELD_LOCATION_CID_INFO
-         etc.
-
-       * include/freetype/internal/psglobals.h: Removed.
-       * include/freetype/internal/pshints.h, src/pshinter/pshglob.h:
-       Updated.
-
-       * include/freetype/internal/tttypes.h,
-       include/freetype/internal/sfnt.h, src/base/ftnames.c,
-       src/cff/cffdrivr.c, src/sfnt/*.c, src/truetype/*.c: Updated
-       SFNT/TrueType type definitions.
-
-       * include/freetype/freetype.h, include/freetype/internal/ftgloadr.h:
-       Updating type definitions for the glyph loader.
-
-2002-03-13  Antoine Leca  <antoine@oriolnet.com>
-
-       * include/freetype/config/ftoption.h: Changed the automatic
-       detection of Microsoft C compilers to automatically support 64-bit
-       integers only since revision 9.00 (i.e. >= Visual C++ 2.0).
-
-2002-03-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftutil.c (FT_Realloc): Use MEM_Set instead of memset.
-
-2002-03-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new,
-       ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free,
-       ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug,
-       FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings.
-       * src/base/ftcalc.c (FT_MulFix): Ditto.
-       * src/cff/cffdrivr.c (cff_get_name_index): Ditto.
-       * src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init,
-       CFF_GlyphSlot_Init): Ditto.
-       * src/cid/cidobjs.c (CID_GlyphSlot_Init,
-       CID_Size_Get_Globals_Funcs): Ditto.
-       * src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init):
-       Ditto.
-       * src/pshinter/pshmod.c (pshinter_interface): Use `static const'.
-       * src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused
-       variables.
-
-       * include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed
-       to...
-       (T1_Builder_FuncsRec): This.
-       (T1_Builder_Funcs): New typedef.
-       (PSAux_Interface): Remove compiler warnings.
-       * src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h
-       (t1_builder_funcs): Updated.
-
-       * src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ...
-       (PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines.
-       (PSH_AlignmentRec): Updated.
-
-       * include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix
-       typo.
-       * include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto.
-       * src/base/ftstream (FT_Get_Char): Rename to...
-       (FT_Stream_Get_Char): This.
-
-       * src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is
-       a built-in function in gcc, causing warning messages with gcc 3.0.
-       * src/autohint/ahglyph.c (ah_outline_load): Ditto.
-       * src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto.
-       * src/cache/ftcmanag.c (ftc_family_table_alloc,
-       ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache):
-       Ditto.
-       * src/cff/cffload.c (cff_new_index, cff_done_index,
-       cff_explicit_index, CFF_Access_Element, CFF_Forget_Element,
-       CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font,
-       CFF_Done_Font): Ditto.
-       * src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto.
-       * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
-       * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit,
-       ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3,
-       * src/pshinter/pshalgo1.c (psh1_hint_table_record,
-       psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto.
-       * src/pshinter/pshalgo2.c (psh2_hint_table_record,
-       psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto.
-       * src/sfnt/ttpost.c (Load_Format_20, Load_Format_25,
-       TT_Get_PS_Name): Ditto.
-       * src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics,
-       load_truetype_glyph): Ditto.
-       * src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto.
-       * src/type1/t1afm.c (T1_Get_Kerning): Ditto.
-       * include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
-
-2002-03-06  David Turner  <david@freetype.org>
-
-       * src/type1/t1objs.c (T1_Face_Init), src/cid/cidobjs.c
-       (CID_Face_Init): Fixed another bug related to the
-       ascender/descender/text height of Postscript fonts.
-
-       * src/pshinter/pshalgo2.c (print_zone): Renamed to ...
-       (psh2_print_zone): This.
-       * src/pshinter/pshalgo1.c (print_zone): Renamed to ...
-       (psh1_print_zone): This.
-
-       * include/freetype/freetype.h, include/freetype/internal/ftobjs.h,
-       src/base/ftobjs.c: Adding the new FT_Library_Version API to return
-       the library's current version in dynamic links.
-       * src/base/ftinit.c (FT_Init_FreeType): Updated.
-
-2002-03-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshglob.h (PSH_DimensionRec): s/std/stdw/.
-       * src/pshinter/pshglob.c (psh_global_scale_widths,
-       psh_dimension_snap_width, psh_globals_destroy, psh_globals_new):
-       Ditto.
-
-2002-03-05  David Turner  <david@freetype.org>
-
-       * src/type1/t1objs.c (T1_Face_Init), src/cff/cffobjs.c
-       (CFF_Face_Init), src/cid/cidobjs.c (CID_Face_Init): Removing the bug
-       that returned global BBox values in 16.16 fixed format (instead of
-       integer font units).
-
-       * src/cid/cidriver.c (cid_get_postscript_name): Fixed a bug that
-       caused the CID driver to return Postscript font names with a leading
-       slash (`/') as in `/MOEKai-Regular'.
-
-       * src/sfnt/ttload.c (TT_Load_Names), src/sfnt/sfobjs.c (Get_Name),
-       src/sfnt/sfdriver.c (get_sfnt_postscript_name): Fixed the loader so
-       that it accepts broken fonts like `foxjump.ttf', which made FreeType
-       crash when trying to load them.
-
-       Also improved the name table parser to be able to load
-       Windows-encoded entries before Macintosh or Unicode ones, since it
-       seems some fonts don't have reliable values here anyway.
-
-       * include/freetype/internal/psnames.h: Add typedef for
-       `PSNames_Service'.
-
-2002-03-05  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/aclocal.m4, builds/unix/ltmain.sh: Update to libtool
-       1.4.2.
-       Apply a small patch for AIX to make shared libraries work (this
-       patch is already in the CVS version of libtool).
-
-       * builds/unix/config.sub, builds/unix/config.guess: Updated to
-       recent versions.
-
-       * builds/unix/configure.ac: Fix typo
-       (AC_CONFIG_FILE->AC_CONFIG_FILES).
-
-       * builds/unix/configure: Regenerated.
-
-2002-02-28  David Turner  <david@freetype.org>
-
-       * include/freetype/ftconfig.h: Changed `FT_LOCAL xxxx' to
-       `FT_LOCAL( xxxx )' everywhere in the source.  The same goes for
-       `FT_LOCAL_DEF xxxx' which is translated to `FT_LOCAL_DEF( xxxxx )'.
-
-       * include/freetype/freetype.h (FREETYPE_MINOR, FREETYPE_PATCH):
-       Changing version to 2.1.0 to indicate an unstable branch.
-       Added the declarations of FT_Get_First_Char and FT_Get_Next_Char.
-
-       * src/base/ftobjs.c: Implement FT_Get_First_Char and
-       FT_Get_Next_Char.
-
-       * include/freetype/t1tables.h: Renaming structure types.  This
-
-         typedef  T1_Struct_
-         {
-         } T1_Struct;
-
-       becomes
-
-         typedef  PS_StructRec_
-         {
-         } PS_StructRec, *PS_Struct;
-
-         typedef PS_StructRec  T1_Struct;  /* backwards-compatibility */
-
-       Hence, we increase the coherency of the source code by effectively
-       using the `Rec' prefix for structure types.
-
-2002-02-27  David Turner  <david@freetype.org>
-
-       * src/sfnt/ttload.c (TT_Load_Names): Simplifying and securing the
-       names table loader.  Invalid individual name entries are now handled
-       correctly.  This allows the loading of very buggy fonts like
-       `foxjump.ttf' without allocating tons of memory and causing crashes.
-
-       * src/otlayout/otlcommon.h, src/otlayout/otlcommon.c: Adding (still
-       experimental) code for OpenType Layout tables validation and
-       parsing.
-
-       * src/type1/t1cmap.h, src/type1/t1cmap.c: Adding (still
-       experimental) code for Type 1 charmap processing.
-
-       * src/sfnt/ttcmap0.c: New file.  It contains a new, still
-       experimental SFNT charmap processing support.
-
-       * include/freetype/internal/ftobjs.h: Adding validation support as
-       well as internal charmap object definitions (FT_CMap != FT_CharMap).
-
-2002-02-24  David Turner  <david@freetype.org>
-
-       * Renaming stream functions to the FT_<Subject>_<Action> scheme:
-
-         FT_Seek_Stream    => FT_Stream_Seek
-         FT_Skip_Stream    => FT_Stream_Skip
-         FT_Read_Stream    => FT_Stream_Read
-         FT_Read_Stream_At => FT_Stream_Read_At
-         FT_Access_Frame   => FT_Stream_Enter_Frame
-         FT_Forget_Frame   => FT_Stream_Exit_Frame
-         FT_Extract_Frame  => FT_Stream_Extract_Frame
-         FT_Release_Frame  => FT_Stream_Release_Frame
-         FT_Get_XXXX       => FT_Stream_Get_XXXX
-         FT_Read_XXXX      => FT_Stream_Read_XXXX
-
-         FT_New_Stream( filename, stream ) =>
-           FT_Stream_Open( stream, filename )
-
-           (The function doesn't create the FT_Stream structure, it simply
-           initializes it for reading.)
-
-         FT_New_Memory_Stream( library, FT_Byte*  base, size, stream ) =>
-           FT_Stream_Open_Memory( stream, const FT_Byte* base, size )
-
-         FT_Done_Stream  => FT_Stream_Close
-         FT_Stream_IO    => FT_Stream_IOFunc
-         FT_Stream_Close => FT_Stream_CloseFunc
-
-         ft_close_stream => ft_ansi_stream_close (in base/ftsystem.c only)
-         ft_io_stream    => ft_ansi_stream_io    (in base/ftsystem.c only)
-
-       * src/base/ftutil.c: New file.  Contains all memory and list
-       management code (previously in `ftobjs.c' and `ftlist.c',
-       respectively).
-
-       * include/freetype/internal/ftobjs.h: Moving all code related to
-       glyph loaders to ...
-       * include/freetype/internal/ftgloadr.h: This new file.
-       `FT_GlyphLoader' is now a pointer to the structure
-       `FT_GlyphLoaderRec'.
-       (ft_glyph_own_bitmap): Renamed to ...
-       (FT_GLYPH_OWN_BITMAP): This.
-       * src/base/ftobjs.c: Moving all code related to glyph loaders
-       to ...
-       * src/base/ftgloadr.c: This new file.
-
-2002-02-22  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/ftdebug.h (FT_Trace): Remove comma in
-       enum to avoid compiler warnings.
-
-2002-02-21  David Turner  <david@freetype.org>
-
-       Modified the debug sub-system initialization.  Trace levels can now
-       be specified within the `FT2_DEBUG' environment variable.  See the
-       comments within `ftdebug.c' for more details.
-
-       * src/base/ftdebug.c: (FT_SetTraceLevel): Removed.
-       (ft_debug_init): New function.
-       (ft_debug_dummy): Removed.
-       Updated to changes in ftdebug.h
-
-       * include/freetype/internal/ftdebug.h: Always define
-       FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE is defined.
-       (FT_Assert): Renamed to ...
-       (FT_ASSERT): This.
-       Some stuff from ftdebug.h has been moved to ...
-
-       * include/freetype/internal/fttrace.h: New file, to define the trace
-       levels used for debugging.  It is used both to define enums and
-       toggle names for FT2_DEBUG.
-
-       * include/freetype/internal/internal.h: Updated.
-
-       * src/base/ftobjs.c, src/base/ftstream.c: Updated.
-
-       * include/freetype/internal/ftextend.h, src/base/ftextend.c:
-       Removed.  Both files are now completely obsolete.
-       * src/base/Jamfile, src/base/rules.mk: Updated.
-
-       * include/freetype/fterrors.h: Adding `#undef FT_ERR_CAT' and
-       `#undef FT_ERR_XCAT' to avoid warnings with certain compilers (like
-       LCC).
-
-       * src/pshinter/pshalgo2.c (print_zone): Renamed to ...
-       (psh2_print_zone): This to avoid errors during compilation of debug
-       library.
-
-       * src/smooth/ftgrays.c (FT_COMPONENT): Change definition to as
-       `trace_smooth'.
-
-2002-02-20  David Turner  <david@freetype.org>
-
-       * README: Adding `devel@freetype.org' address for bug reports.
-
-2002-02-20  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/install.mk (check): New dummy target.
-       (.PHONY): Add it.
-
-2002-02-19  Werner Lemberg  <wl@gnu.org>
-
-       * builds/freetype.mk (FT_CFLAGS): Use $(INCLUDE_FLAGS) first.
-
-       * src/cache/ftccache.c (ftc_cache_resize): Mark `error' as unused
-       to avoid compiler warning.
-       * src/cff/cffload.c (CFF_Get_String): Ditto.
-       * src/cff/cffobjs.c (CFF_StrCopy): Ditto.
-       * src/psaux/psobjs.c (PS_Table_Done): Ditto.
-       * src/pcf/pcfread.c (pcf_seek_to_table_type): Ditto.
-       * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Ditto.
-       (pcf_get_bitmaps): The same for `sizebitmaps'.
-       * src/psaux/t1decode.c (T1_Decode_Parse_Charstrings): The same for
-       `orig_y'.
-       (t1operator_seac): Comment out more dead code.
-       * src/pshinter/pshalgo2.c (ps2_hints_apply): Add `DEBUG_HINTER'
-       conditional.
-       * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
-       load_truetype_glyph): Add `TT_CONFIG_OPTION_BYTECODE_INTERPRETER'
-       conditional.
-
-2002-02-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/autohint/ahglyph.c (ah_outline_link_segments): Remove unused
-       variables.
-       * src/autohint/ahhint.c (ah_align_serif_edge): Use FT_UNUSED instead
-       of UNUSED.
-       * src/autohint/ahmodule.c (ft_autohinter_reset): Ditto.
-       * src/pshinter/pshrec.c (ps_mask_table_merge): Fix typo in variable
-       swapping code.
-       * src/pshinter/pshglob.h (PSH_Blue_Align): Add PSH_BLUE_ALIGN_NONE.
-       * src/pshinter/pshglob.c (psh_blues_snap_stem): Use it.
-       * src/pshinter/pshalgo1.c (psh1_hint_table_optimize): Ditto.
-       * src/pshinter/pshalgo2.c (psh2_hint_align): Ditto.
-       * include/freetype/internal/ftobjs.h (UNUSED): Removed.
-
-2002-02-10  Roberto Alameda  <ojancano@geekmail.de>
-
-       Add support for ISOLatin1 PS encoding.
-
-       * include/freetype/freetype.h (ft_encoding_latin_1): New tag
-       (`lat1').
-       * include/freetype/internal/t1types.h (T1_Encoding_Type): Add
-       `t1_encoding_isolatin1'.
-       * src/type1/t1driver.c (Get_Char_Index, Get_Next_Char): Handle
-       ft_encoding_latin_1.
-       * src/type1/t1load.c (parse_encoding): Handle `ISOLatin1Encoding'.
-       * src/type1/t1objs.c (T1_Face_Init): Handle `t1_encoding_isolatin1'.
-
-----------------------------------------------------------------------------
-
-Copyright 2002, 2003, 2004, 2005, 2007, 2008 by
-David Turner, Robert Wilhelm, and Werner Lemberg.
-
-This file is part of the FreeType project, and may only be used, modified,
-and distributed under the terms of the FreeType project license,
-LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-indicate that you have read the license and understand and accept it
-fully.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/reactos/lib/3rdparty/freetype/ChangeLog.22 b/reactos/lib/3rdparty/freetype/ChangeLog.22
deleted file mode 100644 (file)
index 4144288..0000000
+++ /dev/null
@@ -1,2837 +0,0 @@
-2006-05-12  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.2.1 released.
-       =========================
-
-
-       Tag sources with `VER-2-2-1'.
-
-2006-05-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/docmaker/sources.py (re_source_keywords): Add word
-       boundary markers.
-       * src/tools/docmaker/content.py (re_field): Allow `.' in field names
-       (but not at the beginning or end).
-       * src/tools/docmaker/tohtml.py (html_header_1): Use `utf-8' charset.
-       (block_footer): Split into...
-       (block_footer_start, block_footer_middle, block_footer_end): This to
-       add navigation buttons.
-       (HtmlFormatter::block_exit): Updated.
-
-       * include/freetype/*: Many minor documentation improvements (adding
-       links, spelling errors, etc.).
-
-2006-05-11  Werner Lemberg  <wl@gnu.org>
-
-       * README: Minor updates.
-
-       * include/freetype/*: s/scale/scaling value/ where appropriate.
-       Many other minor documentation improvements.
-
-       * src/tools/docmaker/sources.py (re_italic, re_bold): Handle
-       trailing punctuation.
-       * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word): Add
-       warning message for undefined cross references.
-       Update handling of re_italic and re_bold.
-
-2006-05-11  Masatake YAMATO  <jet@gyve.org>
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Check errno only if
-       read system call returns -1.
-       Remove a redundant parenthesis.
-
-2006-05-10  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Avoid infinite loop if
-       given an empty, un-mmap()able file.  Reported and suggested fix in
-       Savannah bug #16555.
-
-       * builds/freetype.mk (refdoc): Write-protect the `docmaker'
-       directory to suppress generation of .pyc files.  According to the
-       Python docs there isn't a more elegant solution (currently).
-
-       * builds/toplevel.mk (dist): New target which builds .tar.gz,
-       .tar.bz2, and .zip files.  Note that the version number is still
-       hard-coded.
-       (do-dist): Sub-target of `dist'.
-       (CONFIG_GUESS, CONFIG_SUB): New variables.
-       (.PHONY): Updated.
-
-2006-05-09  Rajeev Pahuja  <rpahuja@esri.com>
-
-       * builds/win32/visualc/freetype.sln,
-       builds/win32/visualc/freetype.vcproj: Upgraded to VS.NET 2005 from
-       VS.NET 2003
-       Added files ftbbox.c, fttype1.c, ftwinfnt.c, ftsynth.c.
-
-       * builds/win32/visualc/index.html: Updated.
-
-2006-05-07  Werner Lemberg  <wl@gnu.org>
-
-       Put version information into the configure script.  Reported by Paul
-       Watson <pwatson@redlinepy.com>.
-
-       * builds/unix/configure.ac: Renamed to...
-       * builds/unix/configure.raw: This which now serves (with appropriate
-       modifications) as a template for configure.ac.
-
-       * version.sed: New script.
-
-       * autogen.sh: Generate configure.ac from configure.raw, using
-       FREETYPE_MAJOR, FREETYPE_MINOR, and FREETYPE_PATCH from freetype.h.
-
-2006-05-06  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
-       * builds/unix/configure.ac (version_info): Set to 9:10:3.
-
-       * builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj, builds/freetype.mk (refdoc),
-       Jamfile (RefDoc), README: s/220/221/, s/2.2.0/2.2.1/.
-       Minor updates.
-
-       * docs/CHANGES, docs/VERSION.DLL, docs/PROBLEMS, README.CVS:
-       Updated.
-
-       * builds/unix/install-sh: Updated from `texinfo' CVS module at
-       savannah.gnu.org.
-
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
-
-2006-05-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/lzw/ftlzw2.c: Renamed to...
-       * src/lzw/ftlzw.c: This.
-
-       * src/lzw/Jamfile, src/lzw/rules.mk: Updated.
-
-       * builds/mac/FreeType.m68k_cfm.make.txt,
-       builds/mac/FreeType.m68k_far.make.txt,
-       builds/mac/FreeType.ppc_carbon.make.txt,
-       builds/mac/FreeType.ppc_classic.make.txt: Updated.
-
-2006-05-03  David Turner  <david@freetype.org>
-
-       Allow compilation again with C++ compilers.
-
-       * include/freetype/internal/ftmemory.h (FT_ASSIGNP,
-       FT_ASSIGNP_INNER): New macros which do the actual assignment, and
-       which exist in two variants (for C and C++).
-       Update callers accordingly.
-
-2006-05-03  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftoption.h (FT_STRICT_ALIASING): Removed.
-
-2006-05-02  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/ftmemory.h: s/new/newsz/ (for C++).
-       (FT_ALLOC): Remove redundant redefinition.
-
-       * builds/compiler/gcc-dev.mk (CFLAGS) [g++]: Don't use
-       `-Wstrict-prototypes'.
-
-       * src/base/ftstream.c (FT_Stream_EnterFrame): Add cast.
-
-       * include/freetype/config/ftconfig.h (FT_BASE_DEF) [__cplusplus]:
-       Remove `extern'.
-
-2006-05-02  David Turner  <david@freetype.org>
-
-       Update the memory management functions and macros to safely deal
-       with array size buffer overflows.  This corresponds to attempts to
-       allocate arrays that are too large.  For an example, consider the
-       following code:
-
-         count = read_uint32_from_file(); array = malloc( sizeof ( Item ) *
-         count ); for ( nn = 0; nn < count; nn++ )
-           array[nn] = read_item_from_file();
-
-       If `count' is larger than `FT_UINT_MAX/sizeof(Item)', the
-       multiplication overflows, and the array allocated os smaller than
-       the data read from the file.  In this case, the heap will be
-       trashed, and this can be used as a denial-of-service attack, or make
-       the engine crash later.
-
-       The FT_ARRAY_NEW and FT_ARRAY_RENEW macros now ensure that the new
-       count is no larger than `FT_INT_MAX/item_size', otherwise a new
-       error code `FT_Err_Array_Too_Large' will be returned.
-
-       Note that the memory debugger now works again when FT_DEBUG_MEMORY
-       is defined.  FT_STRICT_ALIASING has disappeared; the corresponding
-       code is now the default.
-
-
-       * include/freetype/config/ftconfig.h (FT_BASE_DEF) [!__cplusplus]:
-       Don't use `extern'.
-
-       * include/freetype/fterrdef.h (FT_Err_Array_Too_Large): New error
-       code.
-
-       * include/freetype/internal/ftmemory.h (FT_DEBUG_INNER)
-       [FT_DEBUG_MEMORY]: New macro.
-       (ft_mem_realloc, ft_mem_qrealloc): Pass new object size count also.
-       (ft_mem_alloc_debug, ft_mem_qalloc_debug, ft_mem_realloc_debug,
-       ft_mem_qrealloc_debug, ft_mem_free_debug): Removed.
-       (FT_MEM_ALLOC, FT_MEM_REALLOC, FT_MEM_QALLOC, FT_MEM_QREALLOC,
-       FT_MEM_FREE): Redefine.
-       (FT_MEM_NEW_ARRAY, FT_MEM_RENEW_ARRAY, FT_MEM_QNEW_ARRAY,
-       FT_MEM_QRENEW_ARRAY): Redefine.
-       (FT_ALLOC_MULT, FT_REALLOC_MULT, FT_MEM_QALLOC_MULT,
-       FT_MEM_QREALLOC_MULT): New macros.  Update callers where
-       appropriate.
-       (FT_MEM_SET_ERROR): Slightly redefine.
-
-
-       * src/base/ftdbgmem.c (_ft_debug_file, _ft_debug_lineno)
-       [FT_DEBUG_MEMORY]: New global variables, replacing...
-       (FT_MemTable_Rec) [FT_DEBUG_MEMORY]: Remove `filename' and
-       `line_no'.  Update all callers.
-       (ft_mem_debug_alloc) [FT_DEBUG_MEMORY]: Avoid possible integer
-       overflow.
-       (ft_mem_alloc_debug, ft_mem_realloc_debug, ft_mem_qalloc_debug,
-       ft_mem_qrealloc_debug, ft_mem_free_debug): Removed.
-
-       * src/base/ftmac.c (read_lwfn): Catch integer overflow.
-       * src/base/ftrfork.c (raccess_guess_darwin_hfsplus): Ditto.
-       * src/base/ftutil.c: Remove special code for FT_STRICT_ALIASING.
-       (ft_mem_alloc, ft_mem_realloc, ft_mem_qrealloc): Rewrite.
-
-
-       * include/freetype/ftstream.h (FT_FRAME_ENTER, FT_FRAME_EXIT,
-       FT_FRAME_EXTRACT, FT_FRAME_RELEASE): Use FT_DEBUG_INNER to report the
-       place where the frames were entered, extracted, exited or released
-       in the memory debugger.
-
-       * src/base/ftstream.c (FT_Stream_ReleaseFrame) [FT_DEBUG_MEMORY]:
-       Call ft_mem_free.
-       (FT_Stream_EnterFrame) [FT_DEBUG_MEMORY]: Use ft_mem_qalloc.
-       (FT_Stream_ExitFrame) [FT_DEBUG_MEMORY]: Use ft_mem_free.
-
-2006-04-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (Mac_Read_POST_Resource): Correct pfb_pos
-       initialization, remove extra cast to copy to pfb_lenpos.  This fixes
-       parsing of PFB fonts with MacOS resource fork (bug introduced
-       2003-09-11).  Patch provided by Huib-Jan Imbens <ft@imbens.nl>.
-
-2006-04-29  Werner Lemberg  <wl@gnu.org>
-
-       Further C library abstraction.  Based on a patch from
-       msn2@bidyut.com.
-
-       * include/freetype/config/ftstdlib.h (FT_CHAR_BIT, FT_FILE,
-       ft_fopen, ft_fclose, ft_fseek, ft_ftell, ft_fread, ft_smalloc,
-       ft_scalloc, ft_srealloc, ft_sfree, ft_labs): New wrapper macros for
-       C library functions.  Update all users accordingly (and catch some
-       other places where the C library function was used instead of the
-       wrapper functions).
-
-       * src/base/ftsystem.c: Don't include stdio.h and stdlib.h.
-       * src/gzip/zutil.h [MSDOS && !(__TURBOC__ || __BORLANDC__)]: Don't
-       include malloc.h.
-
-
-       * builds/unix/unix-def.in (datarootdir): Define, for autoconf 2.59c
-       and forthcoming versions.
-
-2006-04-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/lzw/ftlzw.c, src/lzw/zopen.c, src/lzw/zopen.h: Removed,
-       obsolete.
-
-2006-04-27  yi luo  <luoyi.ly@gmail.com>
-
-       * builds/win32/visualc/freetype.vcproj: Updated.
-
-2006-04-26  David Turner  <david@freetype.org>
-
-
-       * Version 2.2 released.
-       =======================
-
-
-       Tag sources with `VER-2-2-0'.
-
-2006-04-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psobjs.c (shift_elements): Don't use FT_Long but
-       FT_PtrDiff for `delta'.  Reported by Céline PILLET
-       <Celine.Pillet@Tagginfo.com>.
-
-2006-04-21  David Turner  <david@freetype.org>
-
-       * include/freetype/ftincrem.h: Documentation updates.
-       (FT_Incremental_Interface): New typedef.
-
-       * include/freetype/ftmodapi.h, include/freetype/ftglyph.h:
-       Documentation updates.
-
-       * include/freetype/freetype.h: Documentation update.
-       (FT_HAS_FAST_GLYPHS): Always set to 0.
-
-       * include/freetype/ftstroke.h, src/base/ftstroke.c (FT_Stroker_New):
-       Take an FT_Library argument instead of FT_Memory.
-
-       * src/sfnt/ttcmap.c: Remove compiler warnings (gcc-4.0.2).
-
-2006-04-13  David Turner  <david@freetype.org>
-
-       * src/autofit/afloader.c (af_loader_init, af_loader_load_g): Remove
-       superfluous code in the auto-fitter's loader.
-
-2006-04-05  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/makefile, builds/amiga/makefile.os4,
-       builds/amiga/smakefile: Added FT2_BUILD_LIBRARY define.
-
-2006-04-03  luoyi  <luoyi.ly@gmail.com>
-
-       * builds/compiler/intelc.mk (TE): New variable.
-       (ANSIFLAGS): Updated.
-
-2006-04-03  Werner Lemberg  <wl@gnu.org>
-
-       * builds/exports.mk (clean_symbols_list, clean_apinames): Removed.
-       (CLEAN): Add $(EXPORTS_LIST) and $(APINAMES_EXE).
-       (.PHONY): Updated.
-
-       * configure.ac: Minor fixes to improve --help output.
-
-
-       * docs/PROBLEMS: New file.
-
-2006-04-01  David Turner  <david@freetype.org>
-
-       * docs/CHANGES: Updated.
-
-       * include/freetype/ftcache.h, include/freetype/config/ftheader.h:
-       Update documentation comments.
-
-2006-04-01  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/install.mk (uninstall): Don't handle `cache'
-       directory which no longer exists.
-
-2006-03-29  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * src/psaux/psconv.c: Changed some variables which are expected to
-       hold negative values from `char' to `FT_Char' to allow building with
-       a compiler where `char' is unsigned by default.
-
-2006-03-27  David Turner  <david@freetype.org>
-
-       * src/sfnt/ttkern.c (tt_face_get_kerning): Fix a serious bug that
-       causes some programs to go into an infinite loop when dealing with
-       fonts that don't have a properly sorted kerning sub-table.
-
-2006-03-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdflib.c (ERRMSG4): New macro.
-       (_bdf_parse_glyphs): Handle invalid BBX values.
-
-       * include/freetype/fterrdef.h (FT_Err_Bbx_Too_Big): New error
-       macro.
-
-2006-03-23  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-
-       * src/tools/docmaker/tohtml.py (html_header_2): Add horizontal
-       padding between table elements.
-       (html_header_1): The `DOCTYPE' comment must be in uppercase.
-       (make_html_para): Convert `...' quotations into real left and
-       right single quotes.
-       Use `para_header' and `para_footer'.
-
-       * src/tools/docmaker/sources.py (re_bold, re_italic): Accept "'"
-       also.
-
-2006-03-23  David Turner <david@freetype.org>
-
-       Add FT_Get_SubGlyph_Info API to retrieve subglyph data.  Note that
-       we do not expose the FT_SubGlyphRec structure.
-
-       * include/freetype/internal/ftgloadr.h (FT_SUBGLYPH_FLAGS_*): Moved
-       to...
-       * include/freetype/freetype.h (FT_SUBGLYPH_FLAGS_*): Here.
-       (FT_Get_SybGlyph_Info): New declaration.
-
-       * src/base/ftobjs.c (FT_Get_SubGlyph_Info): New function.
-
-
-       * src/autofit/afloader.c (af_loader_load_g): Compute lsb_delta and
-       rsb_delta correctly in edge cases.
-
-2006-03-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftccache.c, (ftc_node_mru_up, FTC_Cache_Lookup)
-       [!FTC_INLINE]: Compile conditionally.
-       * src/cache/ftccache.h: Updated.
-
-       * src/cache/ftcglyph.c (FTC_GNode_Init, FTC_GNode_UnselectFamily,
-       FTC_GNode_Done, FTC_GNode_Compare, FTC_Family_Init, FTC_GCache_New):
-       s/FT_EXPORT/FT_LOCAL/.
-       (FTC_GCache_Init, FTC_GCache_Done): Commented out.
-       (FTC_GCache_Lookup) [!FTC_INLINE]: Compile conditionally.
-       s/FT_EXPORT/FT_LOCAL/.
-       * src/cache/ftcglyph.h: Updated.
-
-       * src/cache/ftcimage.c (FTC_INode_Free, FTC_INode_New):
-       s/FT_EXPORT/FT_LOCAL/.
-       (FTC_INode_Weight): Commented out.
-       * src/cache/ftcimage.h: Updated.
-
-       * src/cache/ftmanag.c (FTC_Manager_Compress,
-       FTC_Manager_RegisterCache, FTC_Manager_FlushN):
-       s/FT_EXPORT/FT_LOCAL/.
-       * src/cache/ftmanag.h: Updated.
-
-       * src/cache/ftcsbits.c (FTC_SNode_Free, FTC_SNode_New,
-       FTC_SNode_Compare): s/FT_EXPORT/FT_LOCAL/.
-       (FTC_SNode_Weight): Commented out.
-       * src/cache/ftcsbits.h: Updated.
-
-2006-03-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftccache.c, src/cache/ftccache.h (FTC_Node_Destroy):
-       Remove, unused.
-
-       * src/cache/ftccmap.h: Remove, unused.
-
-       * src/cache/rules.mk (CACHE_DRV_H): Remove ftccmap.h.
-
-2006-03-21  Zhe Su  <james.su@gmail.com>
-
-       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Improve
-       algorithm.
-
-2006-03-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cfftypes.h (CFF_CharsetRec): Add `max_cid' member.
-
-       * src/cff/cffload.c (cff_charset_load): Set `charset->max_cid'.
-
-       * src/cff/cffgload.c (cff_slot_load): Change type of third parameter
-       to `FT_UInt'.
-       Check range of `glyph_index'.
-       * src/cff/cffgload.h: Updated.
-
-
-       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Handle invalid offset
-       correctly.
-
-
-       * builds/freetype.mk (refdoc), docs/CHANGES, Jamfile (RefDoc),
-       README: s/2.1.10/2.2/.
-
-2006-03-21  David Turner  <david@freetype.org>
-
-       * src/autofit/aflatin.c (af_latin_metrics_scale): Fix small bug
-       that crashes the auto-hinter (introduced by previous patch).
-
-2006-03-20  Werner Lemberg  <wl@gnu.org>
-
-       * builds/freetype.mk (CACHE_DIR, CACHE_H): Remove.
-       (FREETYPE_H): Updated.
-
-       * src/cache/rules.mk (CACHE_H_DIR): Remove.
-       (CACHE_DRV_H): Updated.
-
-2006-03-20  David Turner  <david@freetype.org>
-
-       * include/freetype/cache/ftccache.h,
-       include/freetype/cache/ftccmap.h, include/freetype/cache/ftcglyph.h
-       include/freetype/cache/ftcimage.h include/freetype/cache/ftcmanag.h
-       include/freetype/cache/ftcmru.h include/freetype/cache/ftcsbits.h:
-       Move to...
-
-       * src/cache/ftccache.h, src/cache/ftcglyph.h, src/cache/ftcimage.h,
-       src/cache/ftcsbits.h, src/cache/ftcmanag.h, src/cache/ftccmap.h,
-       src/cache/ftcmru.h: This new location.
-       Update declarations according to the changes in the corresponding
-       source files.
-
-       Note that these files are not used by FreeType clients; all public
-       APIs of the cache module have been already moved to
-       `include/freetype/ftcache.h', and all FT_CACHE_INTERNAL_XXXX_H
-       macros resolve to it.
-
-       Reason for the move is to allow modifications of the internals
-       without interferences with rogue clients.  Note that there are no
-       known clients that access the cache internals at the moment.
-
-       * builds/unix/install.mk (install): Don't install headers from
-       $(CACHE_H).
-       Remove `freetype/cache' from the target directory.
-
-       * include/freetype/config/ftheader.h (FT_CACHE_MANAGER_H,
-       FT_CACHE_INTERNAL_MRU_H, FT_CACHE_INTERNAL_MANAGER_H,
-       FT_CACHE_INTERNAL_CACHE_H, FT_CACHE_INTERNAL_GLYPH_H,
-       FT_CACHE_INTERNAL_IMAGE_H, FT_CACHE_INTERNAL_SBITS_H): Point to
-       FT_CACHE_H.
-
-       * src/cache/ftcbasic.c, src/cache/ftccache.h, src/cache/ftccback.h,
-       src/cache/ftccmap.c, src/cache/ftcglyph.c, src/cache/ftcglyph.h,
-       src/cache/ftcimage.c, src/cache/ftcimage.h, src/cache/ftcmanag.c,
-       src/cache/ftcmanag.h, src/cache/ftcmru.h, src/cache/ftcsbits.c,
-       src/cache/ftcsbits.h: Don't use the FT_CACHE_INTERNAL_XXX_H macros
-       but include the headers directly (which are now in `src/cache').
-
-       * src/cache/ftccache.c:  Don't use the FT_CACHE_INTERNAL_XXX_H
-       macros but include the headers directly.
-       (FTC_Cache_Init, FTC_Cache_Done, FTC_Cache_NewNode,
-       FTC_Cache_Lookup, FTC_Cache_RemoveFaceID): Declare as FT_LOCAL_DEF.
-
-       * src/cache/ftccache.c:  Don't use the FT_CACHE_INTERNAL_XXX_H
-       macros but include the headers directly.
-       (FTC_MruNode_Prepend, FTC_MruNode_Up, FTC_MruNode_Remove,
-       FTC_MruList_Init, FTC_MruList_Reset, FTC_MruList_Done,
-       FTC_MruList_New, FTC_MruList_Remove, FTC_MruList_RemoveSelection):
-       Declare as FT_LOCAL_DEF.
-       (FTC_MruListFind, FTC_MruList_Lookup) [!FTC_INLINE]: Compile
-       conditionally.
-       Declare as FT_LOCAL_DEF.
-
-
-       * builds/win32/visualc/freetype.dsp: Update project file, add
-       missing base source files (ftstroke.c, ftxf86.c, etc.).
-
-
-       * src/autofit/afcjk.c, src/autofit/aflatin.c, src/base/ftobjs.c,
-       src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrobjs.c,
-       src/sfnt/sfobjs.c, src/sfnt/ttmtx.c, src/type1/t1afm.c,
-       src/type1/t1objs.c: Remove compiler warnings when building with
-       Visual C++ 6 and /W4.
-
-       * src/autofit/aflatin.c (af_latin_hints_init): Disable horizontal
-       hinting for italic/oblique fonts.
-
-
-
-       * src/truetype/ttpload.c, src/truetype/ttpload.h
-       (tt_face_get_device_metrics): Change second argument to `FT_UInt'.
-
-2006-03-06  David Turner  <david@freetype.org>
-
-       * src/cache/ftcmanag.c (FTC_Manager_Lookup_Size): Prevent crashes in
-       Mozilla/FireFox print preview in Ubuntu Hoary.
-
-2006-02-28  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftutil.c (ft_mem_qalloc) [FT_STRICT_ALIASING]: Do not
-       return error when size == 0.
-
-2006-02-28  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftobjs.c (FT_Done_Library): Remove modules in reverse
-       order so that type42 module is removed before truetype module.  This
-       avoids double free in some occasions.
-
-2006-02-28  David Turner  <david@freetype.org>
-
-       * Release candidate VER-2-2-0-RC4.
-       ----------------------------------
-
-       * docs/CHANGES: Documentation updates.
-
-2006-02-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * modules.cfg (BASE_EXTENSIONS): Compile in ftgxval.c by default to
-       build ftvalid in ft2demos.  It works as dummy ABI if gxvalid is not
-       built.
-
-2006-02-27  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/cache/ftccache.h
-       [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove declaration of
-       ftc_node_done.
-
-       * src/cache/ftccache.c (ftc_node_destroy)
-       [!FT_CONFIG_OPTION_OLD_INTERNALS]: Mark as FT_LOCAL_DEF.  This
-       should now fix all possible compilation options.
-
-2006-02-27  David Turner  <david@freetype.org>
-
-       * src/base/ftutil.c (ft_mem_alloc, ft_mem_qalloc, ft_mem_realloc,
-       ft_mem_qrealloc): Return an error if a negative size is passed in
-       parameters.
-
-       * src/cache/ftccache.c (ftc_node_destroy): Mark as FT_BASE_DEF since
-       it needs to be exported for rogue clients.
-
-       * src/pshinter/pshglob.c (psh_blues_set_zones_0): Prevent problems
-       with malformed fonts which have an odd number of blue values (these
-       are broken according to the specs).
-
-       * src/cff/cffload.c (cff_subfont_load), src/type1/t1load.c
-       (T1_Open_Face): Modify the loaders to force even-ness of
-       `num_blue_values'.
-
-       (cff_index_access_element): Ignore invalid entries in index files.
-
-2006-02-27  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftobjs.c (FT_Set_Char_Size): Check the case where width
-       or height is 0.
-
-2006-02-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/mac/FreeType.m68k_cfm.make.txt,
-       builds/mac/FreeType.m68k_far.make.txt,
-       builds/mac/FreeType.ppc_carbon.make.txt,
-       builds/mac/FreeType.ppc_classic.make.txt: Update to new header
-       inclusion introduced on 2006-02-16.
-
-2006-02-27  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftobjs.c (GRID_FIT_METRICS): New macro.
-       (ft_glyphslot_grid_fit_metrics, FT_Load_Glyph) [GRID_FIT_METRICS]:
-       Re-enable glyph metrics grid-fitting.  It is now done in the base
-       layer.
-       (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Make sure the width and
-       height are not too small or too large, just like we were doing in
-       2.1.10.
-
-       * src/autofit/afloader.c (af_loader_load_g): The vertical metrics
-       are not scaled.
-
-2006-02-26  Werner Lemberg  <wl@gnu.org>
-
-       * docs/release: Minor additions and clarifications.
-
-       * docs/CHANGES: Updated to reflect many fixes for backwards
-       compatibility.  Still incomplete.
-
-2006-02-26  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c (ft_recompute_scaled_metrics): Re-enable
-       conservative rounding of metrics to avoid breaking clients like
-       Pango (see http://bugzilla.gnome.org/show_bug.cgi?id=327852).
-
-2006-02-25  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
-
-       * src/cache/ftccache.c (ftc_node_destroy): Use FT_LOCAL_DEF (again).
-
-2006-02-25  David Turner  <david@freetype.org>
-
-       Fix compiler warnings as well as C++ compilation problems.
-       Add missing prototypes.
-
-       * src/autofit/afcjk.c, src/base/ftobjs.c, src/base/ftutil.c,
-       src/bdf/bdfdrivr.c, src/cff/cffcmap.c, src/cff/cffobjs.c,
-       src/psaux/afmparse.c,, src/psaux/t1cmap.c, src/smooth/ftgrays.c
-       src/tools/apinames.c, src/truetype/ttdriver.c: Add various casts,
-       initialize variables, and decorate functions with FT_CALLBACK_DEF,
-       etc., to fix compiler warnings (and C++ compiling errors).
-
-       * src/cache/ftcbasic.c: Fix `-Wmissing-prototypes' warnings with
-       gcc.
-
-       * builds/unix/ftsystem.c: Don't include FT_INTERNAL_OBJECTS_H but
-       FT_INTERNAL_STREAM_H.
-
-       * src/base/ftsystem.c: Include FT_INTERNAL_STREAM_H.
-
-       * include/freetype/config/ftheader.h (FT_PFR_H): New macro.
-
-       * include/freetype/config/ftoption.h (FT_STRICT_ALIASING): Don't
-       define for C++.
-
-       * include/freetype/internal/services/svotval.h: Don't include
-       FT_OPENTYPE_VALIDATE_H but FT_INTERNAL_VALIDATE_H.
-
-       * include/freetype/internal/services/svpfr.h: Include FT_PFR_H.
-
-       * src/gzip/ftgzip.c: Include FT_GZIP_H.
-
-       * src/lzw/ftlzw.c, src/lzw/ftlzw2.c: Include FT_LZW_H.
-
-       * src/sfnt/ttbdf.c (tt_face_load_bdf_props): Rearrange code.
-
-2006-02-24  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftoutln.c (FT_OUTLINE_GET_CONTOUR, ft_contour_has,
-       ft_contour_enclosed, ft_outline_get_orientation): Commented out.  We
-       have to wait until `FT_GlyphSlot_Own_Bitmap' is stabilized.
-       (FT_Outline_Embolden): Use `FT_Outline_Get_Orientation'.
-
-2006-02-24  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): Update
-       documentation.
-
-       * include/freetype/ftsynth.h (FT_GlyphSlot_Own_Bitmap),
-       src/base/ftsynth.c (FT_GlyphSlot_Own_Bitmap): New function to make
-       sure a glyph slot owns its bitmap.  It is also marked experimental
-       and due to change.
-       (FT_GlyphSlot_Embolden): Undo the last change.  It turns out that
-       rendering the outline confuses some applications.
-
-2006-02-24  David Turner  <david@freetype.org>
-
-       * Release candidate VER-2-2-0-RC3.
-       ----------------------------------
-
-       * src/cache/ftcbasic.c: Correct compatibility hack bug.
-
-2006-02-24  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/freetype.h (FT_Size_RequestRec): Change the type
-       of `width' and `height' to `FT_Long'.
-       (enum FT_Size_Request_Type), src/base/ftobjs.c (FT_Request_Metrics):
-       New request type `FT_SIZE_REQUEST_TYPE_SCALES' to specify the scales
-       directly.
-
-2006-02-23  David Turner  <david@freetype.org>
-
-       Two BDF patches from Debian libfreetype6 for 2.1.10.
-
-       * src/bdf/bdflib.c (_bdf_parse_glyphs): Fix a bug with zero-width
-       glyphs.
-       Fix a problem with large encodings.
-
-
-       Fix binary compatibility issues for gnustep-back (GNUstep backend
-       module) which still crashes under Sarge.
-
-       * src/cache/ftccmap.c (FTC_OldCMapType, FTC_OldCMapIdRec,
-       FTC_OldCMapDesc) [FT_CONFIG_OPTION_OLD_INTERNALS]: New data
-       structures and enumerations.
-       (FTC_CMapCache_Lookup) [FT_CONFIG_OPTION_OLD_INTERNALS]: New
-       compatibility code.
-
-       * src/cache/ftcbasic.c: Fix a silly bug that prevented our `hack' to
-       support rogue clients compiled against 2.1.7 to work correctly.
-       This probably explains the GNUstep crashes with the second release
-       candidate.
-
-2006-02-23  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/ftoutln.h (enum FT_Orientation): New value
-       `FT_ORIENTATION_NONE'.
-
-       * src/base/ftoutln.c (FT_OUTLINE_GET_CONTOUR, ft_contour_has,
-       ft_contour_enclosed, ft_outline_get_orientation): Another version of
-       `FT_Outline_Get_Orientation'.  This version differs from the public
-       one in that each part (contour not enclosed in another contour) of the
-       outline is checked for orientation.
-       (FT_Outline_Embolden): Use `ft_outline_get_orientation'.
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Render the outline and
-       use bitmap's embolden routine when the outline one failed.
-
-2006-02-22  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * modules.cfg: Compile in ftotval.c and ftxf86.c by default for ABI
-       compatibility.
-
-       * src/sfnt/sfobjs.c (sfnt_done_face): Fix a memory leak.
-
-       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_bit_aligned,
-       tt_sbit_decoder_load_byte_aligned) [FT_OPTIMIZE_MEMORY]: Fix sbit
-       loading.  (Only tested with bit aligned sbit with x_pos == 0.)
-
-       * src/truetype/ttpload.c (tt_face_load_hdmx,
-       tt_face_get_device_metrics) [FT_OPTIMIZE_MEMORY]: `hdmx' is not
-       actually used.
-
-2006-02-21  David Turner  <david@freetype.org>
-
-       Add a new API named FT_Get_TrueType_Engine_Type to determine whether
-       we have a patented, unpatented, or unimplemented TrueType bytecode
-       interpreter.
-
-       The FT_Get_Module_Flags API was removed consequently.
-
-       * include/freetype/ftmodapi.h (FT_Module_Get_Flags): Removed.
-       Replaced with...
-       (FT_Get_TrueType_Engine_Type): This.
-       (FT_TrueTypeEngineType): New enumeration.
-
-       * include/freetype/internal/ftserv.h (FT_SERVICE_TRUETYPE_ENGINE_H):
-       New macro.
-
-       * src/base/ftobjs.c: Include FT_SERVICE_TRUETYPE_ENGINE_H.
-       (FT_Module_Get_Flags): Removed.  Replaced with...
-       (FT_Get_TrueType_Engine_Type): This.
-
-       * src/truetype/ttdriver.c: Include FT_SERVICE_TRUETYPE_ENGINE_H.
-       (tt_service_truetype_engine): New service structure.
-       (tt_services): Register it.
-
-       * include/freetype/internal/services/svtteng.h: New file.
-
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Fix silly bug that prevented
-       embedded bitmaps from being correctly listed and used.
-
-
-       * src/sfnt/ttmtx.c (tt_face_load_hmtx): Disable memory optimization
-       if FT_CONFIG_OPTION_OLD_INTERNALS is used.  The is necessary because
-       libXfont is directly accessing the HMTX data, unfortunately.
-       Fix some compiler warnings.
-       (tt_face_get_metrics): Ditto.
-
-
-       * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Fix handling of
-       character advances.
-
-2006-02-20  David Turner  <david@freetype.org>
-
-       Support binary compatibility with the X.Org server's Xfont library.
-       Note that this change unfortunately prevents memory optimizations
-       for the embedded bitmap loader.
-
-       * include/freetype/internal/sfnt.h (SFNT_Interface): Move
-       `set_sbit_strike' and `load_sbit_metrics' fields to the location of
-       version 2.1.8.
-
-       * src/sfnt/sfdriver.c (tt_face_set_sbit_strike_stub): Call
-       FT_Size_Request.
-       (sfnt_interface): Updated.
-
-       * src/sfnt/ttsbit.c [FT_CONFIG_OPTION_OLD_INTERNALS]: Don't load
-       ttsbit0.c.
-       (tt_load_sbit_metrics): Make `sbit_small_metrics_fields' static.
-
-       * src/sfnt/ttsbit.h: Updated.
-
-2006-02-17  David Turner  <david@freetype.org>
-
-       * builds/unix/unix-cc.in (LINK_LIBRARY): Don't filter out exported
-       functions anymore.  This ensures that all FT_BASE internal functions
-       are available for dynamic linking.
-
-       * include/freetype/ftcache.h (FTC_IMAGE_TYPE_COMPARE,
-       FTC_IMAGE_TYPE_HASH), src/cache/ftcbasic.c (FTC_OldFontRec,
-       FTC_OldImageDescRec, FTC_ImageCache_Lookup, FTC_Image_Cache_New,
-       FTC_OldImage_Desc, FTC_OLD_IMAGE_FORMAT, ftc_old_image_xxx,
-       ftc_image_type_from_old_desc, FTC_Image_Cache_Lookup,
-       FTC_SBitCache_Lookup, FTC_SBit_Cache_New, FTC_SBit_Cache_Lookup)
-       [FT_CONFIG_OPTION_OLD_INTERNALS]: Try to revive old functions of the
-       cache sub-system.  We try to recognize old legacy signatures with a
-       gross hack (hope it works).
-
-2006-02-17  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
-
-2006-02-16  David Turner  <david@freetype.org>
-
-       Massive changes to the internals to respect the internal object
-       layouts and exported functions of FreeType 2.1.7.  Note that the
-       cache sub-system cannot be fully retrofitted, unfortunately.
-
-       * include/freetype/config/ftoption.h
-       (FT_CONFIG_OPTION_OLD_INTERNALS): New macro.
-
-       * include/freetype/ftcache.h, include/freetype/cache/ftccache.h,
-       include/freetype/cache/ftccmap.h,
-       include/freetype/internal/ftcalc.h,
-       include/freetype/internal/ftdriver.h,
-       include/freetype/internal/ftmemory.h,
-       include/freetype/internal/ftobjs.h,
-       include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
-       include/freetype/internal/t1types.h,
-       include/freetype/internal/tttypes.h, src/base/ftcalc.c,
-       src/base/ftdbgmem.c, src/base/ftobjs.c, src/base/ftutil.c,
-       src/bdf/bdfdrivr.c, src/cache/ftccache.c, src/cache/ftccback.h,
-       src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
-       src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
-       src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
-       src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:
-       Use FT_CONFIG_OPTION_OLD_INTERNALS to revive old functions and data
-       structures.
-
-       Move newly added structure elements to the end of the affected
-       structure and add stub fields (if FT_CONFIG_OPTION_OLD_INTERNALS is
-       defined) to assure binary compatibility with older FreeType
-       versions.
-       Use FT_CONFIG_OPTION_OLD_INTERNALS to add function stubs for old
-       functions:
-
-         ft_stub_set_char_sizes
-         ft_stub_set_pixel_sizes
-
-       Rename the following internal functions to provide the old function
-       names as stubs:
-
-         FT_Alloc          -> ft_mem_alloc
-         FT_QAlloc         -> ft_mem_qalloc
-         FT_Realloc        -> ft_mem_realloc
-         FT_QRealloc       -> ft_mem_qrealloc
-         FT_Free           -> ft_mem_free
-         FT_Alloc_Debug    -> ft_mem_alloc_debug
-         FT_QAlloc_Debug   -> ft_mem_qalloc_debug
-         FT_Realloc_Debug  -> ft_mem_realloc_debug
-         FT_QRealloc_Debug -> ft_mem_qrealloc_debug
-         FT_Free_Debug     -> ft_mem_free_debug
-
-2006-02-15  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove
-       unused `max_points' and `max_contours'.
-
-       * src/cid/cidobjs.c (cid_face_init), src/type1/t1objs.c
-       (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Update.
-
-       * include/freetype/internal/tttypes.h (TT_FaceRec): Remove unused
-       `max_components'.
-
-       * src/truetype/ttinterp.h (TT_ExecContextRec): Remove unused
-       `loadSize' and `loadStack'.
-
-       * src/truetype/ttinterp.c (TT_Done_Context, TT_Load_Context),
-       src/sfnt/ttload.c (tt_face_load_maxp): Update.
-
-       * src/cff/cffobjs.h (cff_size_select), src/sfnt/sfdriver.c
-       (sfnt_interface), src/truetype/ttdriver.c (tt_size_request): Fix
-       compiler errors/warnings when TT_CONFIG_OPTION_EMBEDDED_BITMAPS is not
-       defined.
-
-       * src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_get_metrics): Fix
-       possible segment faults for the non-FT_OPTIMIZE_MEMORY'ed versions.
-       (finally!)
-
-
-       For most OpenType tables, `tt_face_load_xxxx' simply loads the table
-       and `face->root' is set later in `sfnt_load_face'.  Here, we try to
-       make this work for _all_ tables.  Also improve tracing messages.
-
-       * src/sfnt/ttsbit.c, src/sfnt/ttsbit0.c, src/sfnt/ttload.c,
-       src/sfnt/ttmtx.c: all `tt_face_load_xxxx' should load the table and
-       then exit.  Error handling or setting face->root is done later in
-       `sfnt_load_face'.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Work harder.
-       Mac bitmap-only fonts are not scalable.
-       Check that `face->header.Units_Per_EM' is not zero.
-       (LOAD_, LOADM_): Emit pretty trace messages.
-
-       * src/sfnt/ttsbit0.c (tt_face_load_strike_metrics): Read metrics
-       from `eblc'.
-
-       * src/sfnt/ttcmap.c (tt_face_build_cmaps), src/sfnt/ttpost.c
-       (load_format_20, load_format_25, tt_face_get_ps_name): Use
-       face->max_profile.numGlyphs, instead of face->root.num_glyphs.
-
-2006-02-14  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftoutln.h (FT_Outline_Embolden): Mention in
-       documentation that negative strength values are possible.
-       Give an example call.
-
-       * include/freetype/freetype.h (FT_GlyphSlotRec): Improve
-       documentation of `outline' field.
-
-       * src/sfnt/sfobjc.s: Inckude FT_INTERNAL_DEBUG_H.
-       * src/sfnt/sfdriver.c: Include ttmtx.h.
-
-       * src/autofit/afcjk.c: Include aftypes.h and aflatin.h.
-
-2006-02-14  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/sfnt/ttmtx.c (tt_face_get_metrics): Typo.
-
-2006-02-14  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/sfnt/ttmtx.c (tt_face_load_hhea, tt_face_load_hmtx): Simply
-       return error if table is missing.
-       Check table length in non-FT_OPTIMIZE_MEMORY'ed `tt_face_load_hmtx'.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Take care of missing metrics
-       tables.  The last change makes Mac bitmap-only font not load and
-       this fixes it.
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fix compilation
-       error when FT_CONFIG_OPTION_INCREMENTAL is defined.
-
-2006-02-13  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       Clean up the SFNT_Interface.  In this final pass, `load_hmtx' is
-       split from `load_hhea'.
-
-       * include/freetype/internal/sfnt.h, src/sfnt/sfdriver.c,
-       src/sfnt/ttmtx.c, src/sfnt/ttmtx.h: Split `hmtx' from `hhea'.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Update.
-
-2006-02-13  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/sfnt/ttmtx.h, src/sfnt/ttmtx.c: Why are there two copies of
-       code...
-
-2006-02-13  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       Clean up the SFNT_Interface.  In this pass, we want to treat the
-       font directory (offset table and table directory) as a normal table
-       like the others.  This also means that TTCs are no longer recognized
-       there but in `init_face'.
-
-       * include/freetype/internal/sfnt.h (SFNT_Interface),
-       src/sfnt/sfdriver.c: `load_sfnt_header' and `load_directory' are
-       combined and renamed to `load_font_dir'.
-
-       * src/sfnt/ttload.h, src/sfnt/ttload.c:
-       s/sfnt_dir_check/check_table_dir/.
-       `sfnt_init' is moved to sfobjs.c and renamed to `sfnt_open_font'.
-       `tt_face_load_sfnt_header' and `tt_face_load_directory' are combined
-       and renamed to `tt_face_load_font_dir'.
-
-       * src/sfnt/sfobjs.c (sfnt_init_face): Recognize TTC here.
-
-2006-02-13  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       Clean up the SFNT_Interface.  Table loading functions are now named
-       after the tables' tags; `hdmx' is TrueType-specific and thus the
-       code is moved to the truetype module; `get_metrics' is moved here
-       from the truetype module so that the code can be shared with the cff
-       module.
-
-       This pass involves no real changes.  That is, the code is moved
-       verbatim mostly.  The only exception is the return value of
-       `tt_face_get_metrics'.
-
-       * include/freetype/internal/sfnt.h, src/sfnt/rules.mk,
-       src/sfnt/sfdriver.c, src/sfnt/sfnt.c, src/sfnt/sfobjs.c,
-       src/sfnt/ttload.c, src/sfnt/ttload.h, src/sfnt/ttsbit.c,
-       src/sfnt/ttsbit.h, src/sfnt/ttsbit0.c: Clean up the SFNT_Interface.
-
-       * src/sfnt/ttmtx.c, src/sfnt/ttmtx.h: New files.  Metrics-related
-       tables' loading and parsing code is moved to here.
-       Move `tt_face_get_metrics' here from the truetype module.  The
-       return value is changed from `void' to `FT_Error'.
-
-       * include/freetype/internal/fttrace.h: New trace: ttmtx.
-
-       * src/truetype/ttpload.c, src/truetype/ttpload.h: `hdmx' loading and
-       parsing code is moved here.
-       New function `tt_face_load_prep' split from `tt_face_load_fpgm'.
-       `tt_face_load_fpgm' returns `FT_Err_Ok' if `fpgm' doesn't exist.
-
-       * src/cff/cffgload.c, src/cff/cffobjs.c: Update.
-
-       * src/truetype/ttgload.c, src/truetype/ttobjs.c: Update.
-
-2006-02-11  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/autofit/afcjk.c (af_cjk_metrics_init): Fix a stupid bug...
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_widths): Use
-       AF_LatinMetricsRec as the dummy metrics because we cast the metrics
-       to it later in `af_latin_hints_link_segments'.
-
-2006-02-11  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/config/ftoption.h (AF_CONFIG_OPTION_CJK): #define
-       to enable autofit CJK script support.  (#define'd by default.)
-
-       * src/autofit/aflatin.h (AF_LATIN_CONSTANT): New macro.
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_widths): Make sure
-       that `edge_distance_threshold' is always set.
-       (af_latin_hints_link_segments): Potential divide-by-zero bug.
-       Use latin constant in the scoring formula.
-
-       * src/autofit/afcjk.c: Minor updates due to the above three changes.
-
-       * docs/TODO, docs/CHANGES: Updated.
-
-2006-02-09  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       Introduce experimental autofit CJK module based on akito's autohint
-       patch.  You need to #define AF_MOD_CJK in afcjk.c to enable it.
-
-       * src/autofit/afglobal.c, src/autofit/afcjk.h, src/autofit/afcjk.c,
-       src/autofit/rules.mk, src/autofit/autofit.c, src/autofit/aftypes.h:
-       Add CJK module based on akito's autohint patch.
-
-       * src/autofit/afhints.h (AF_SegmentRec): New field `len' for the
-       overlap length of the segments.
-       (AF_SEGMENT_LEN, AF_SEGMENT_DIST): New macros.
-
-       * src/autofit/aflatin.h (af_latin_metrics_init_widths),
-       src/autofit/aflatin.c (af_latin_metrics_init_widths): Made
-       `FT_LOCAL'.
-       Use the character given by the caller.
-       (af_latin_metrics_init_widths, af_latin_hints_link_segments): Scale
-       the thresholds.
-
-       * src/autofit/afloader.c (af_loader_load_g): Respect
-       AF_SCALER_FLAG_NO_ADVANCE.
-
-2006-02-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidparse.c (cid_parse_new): Remove shadowing variable.
-
-2006-02-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/cid/cidparse.c (cid_parse_new): Fix for abnormally short or
-       broken CIDFont.  Reported by Taek Kwan(TK) Lee (see ft-devel
-       2005-11-02).
-
-2006-02-08  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.ac: Fix bug for `--with-old-mac-fonts'
-       option on UNIX platform.  It has been broken since 2006-01-11.
-
-2006-02-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/otvalid/module.mk: s/otvalid_module_class/otv_module_class/.
-       * src/gxvalid/module.mk: s/gxvalid_module_class/gxv_module_class/.
-
-       * builds/unix/unixddef.mk: Actually do define PLATFORM (fixing
-       change from 2006-01-31).
-       (TOP_DIR, OBJ_DIR): Update.
-
-       * builds/unix/install.mk (install): Fix path for ftmodule.h.
-
-       * Makefile, *.mk, builds/unix/unix-cc.in, builds/unix-def.in: Use
-       `?=' where appropriate.
-
-       * builds/detect.mk (TOP_DIR), builds/os2/os2-dev.mk (TOP_DIR),
-       builds/win32/w32-dev.mk (TOP_DIR): Removed.  Defined elsewhere.
-
-2006-01-31  Werner Lemberg  <wl@gnu.org>
-
-       Implement new, simplified module selection.  With GNU make it is now
-       sufficient to modify a single file, `modules.cfg', to control the
-       inclusion of modules and base extension files.
-
-       This change also fixes the creation of ftmodule.h; it now depends on
-       `modules.cfg' and thus is rebuilt only if necessary.
-
-       Finally, a version of `ftoption.h' in OBJ_DIR is preferred over the
-       default location.
-
-       * modules.cfg: New file.
-
-       * builds/freetype.mk: Don't include `modules.mk'.
-       Include all `rules.mk' files as specified in `modules.cfg'.
-       (FTOPTION_FLAG, FTOPTION_H): New variables.
-       (FT_CFLAGS): Add macro definition for FT_CONFIG_MODULES_H.
-       Add FTOPTION_FLAG.
-       ($(FT_INIT_OBJ)): Don't use FT_MODULE_LIST.
-       (CONFIG_H): Add FTMODULE_H and FTOPTION_H.
-       (INCLUDES): Add DEVEL_DIR.
-       (INCLUDE_FLAGS, FTSYS_SRC, FTSYS_OBJ, FTDEBUG_SRC, FTDEBUG_OBJ,
-       OBJ_M, OBJ_S): Use `:=', not `='.
-       (remove_ftmodule_h): New phony target to delete `ftmodule.h'.
-       (distclean): Add remove_ftmodule_h.
-
-       * builds/modules.mk: (MODULE_LIST): Removed.
-       (make_module_list, clean_module_list): Replace targets
-       with...
-       (FTMODULE_H_INIT, FTMODULE_H_CREATE, FTMODULE_H_DONE): New
-       variables.  Reason for the change is that it is not possible to have
-       a phony prerequisite which is run only if the target file must be
-       rebuilt (phony prerequisites act like subroutines and are *always*
-       executed).  We only want to rebuild `ftmodule.h' if `module.cfg' is
-       changed.
-       Update all callers.
-       ($FTMODULE_H)): Rule to create `ftmodule.h', depending on
-       `modules.cfg'.
-
-       * builds/toplevel.mk: Rewrite and simplify module handling.
-       (MODULES_CFG, FTMODULE_H): New variables.
-       Include MODULES_CFG.
-       (MODULES): New variable to include all `module.mk' and `rules.mk'
-       files.  We no longer use make's `wildcard' function for this.
-
-       * Makefile (USE_MODULES): Remove.  Update all users.
-       (OBJ_DIR): Define it here.
-
-       * src/*/module.mk: Change
-
-           make_module_list: foo
-           foo: ...
-
-       to
-
-           FTMODULE_H_COMMANDS += FOO
-           define FOO
-           ...
-           endef
-
-       in all files.  `FTMODULE_H_COMMANDS' is used in `FTMODULE_H_CREATE'.
-
-       * src/base/rules.mk (BASE_EXT_SRC): Use BASE_EXTENSIONS.
-
-       * builds/unix/detect.mk (setup): Always execute `configure' script.
-       (have_mk): Rename to...
-       (have_Makefile): This.
-       Don't use `strip' function.
-
-       * builds/unix/unix.mk: Include `install.mk' only if BUILD_PROJECT is
-       defined.
-       (have_mk): Don't use `strip' function.
-       Test for unix-def.mk in OBJ_DIR, not BUILD_DIR (and invert the test
-       accordingly).
-
-       * builds/unix/install.mk (install, uninstall): Handle `ftmodule.h'.
-
-       * builds/os2/os2-dev.mk, builds/unix/unix-dev.mk,
-       builds/win32/w32-bccd.mk, builds/win32/w32-dev.mk: Don't define
-       BUILD_DIR but DEVEL_DIR for development header files.
-
-       * builds/ansi/ansi-def.mk (TOP_DIR, OBJ_DIR),
-       builds/beos/beos-def.mk (TOP_DIR, OBJ_DIR), builds/unix/unix-def.in
-       (TOP_DIR, OBJ_DIR): Removed.  Defined elsewhere.
-
-       * builds/dos/dos-def.mk (OBJ_DIR), builds/os2/os2-def.mk (OBJ_DIR),
-       builds/win32/win32-def.mk (OBJ_DIR): Removed.  Defined elsewhere.
-
-       * builds/unix/unixddef.mk: Don't define BUILD_DIR but DEVEL_DIR for
-       development header files.
-       Don't define PLATFORM.
-
-       * configure: Copy `modules.cfg' to builddir if builddir != srcdir.
-       Update snippet taken from autoconf's m4sh.m4 to current CVS version.
-       Be more verbose.
-
-       * include/freetype/config/ftmodule.h: Add comments -- this file is
-       no longer used if FreeType is built with GNU make.
-
-       * docs/CHANGES, docs/CUSTOMIZE, docs/INSTALL, docs/INSTALL.ANY,
-       docs/INSTALL.GNU, docs/INSTALL.UNX: Document new build mechanism.
-       Other minor updates.
-
-       * modules.txt: Removed.  Contents included in `modules.cfg'.
-
-
-       * include/freetype/internal/ftmemory.h (FT_QAlloc_Debug,
-       FT_Free_Debug) [FT_STRICT_ALIASING]: Fix typos.
-
-       * src/base/ftdbgmem.c (FT_Alloc_Debug, FT_Realloc_Debug,
-       FT_QAlloc_Debug, FT_QRealloc_Debug, FT_Free_Debug)
-       [FT_STRICT_ALIASING]: Implement.
-
-2006-01-31  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
-       (cid_face_init), src/pfr/pfrobjs.c (pfr_face_init),
-       src/type1/t1objs.c (T1_Face_Init): Set face->height to MAX(1.2 *
-       units_per_EM, ascender - descender).
-
-2006-01-31  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/internal/t1types.h (AFM_FontInfo),
-       src/psaux/afmparse.c, src/tools/test_afm.c: Read `FontBBox',
-       `Ascender', and `Descender' from an AFM.
-
-       * src/type1/t1afm.c (T1_Read_Metrics): Use the metrics from the AFM.
-
-       * include/freetype/freetype.h (FT_FaceRec): Mention that fields may
-       be changed after file attachment.
-
-2006-01-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/*/module.mk (.PHONY): Add.
-
-2006-01-27  Werner Lemberg  <wl@gnu.org>
-
-       * README, docs/FTL.TXT: Fix email address for bug reports.
-       Other minor formatting.
-
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
-
-       * src/autofit/module.mk (add_autofit_module), src/bdf/module.mk
-       (add_bdf_module), src/type42/module.mk (add_type42_driver): Fix
-       whitespace.
-
-       * src/smooth/module.mk (add_smooth_renderer): Add lcd and lcdv
-       renderer classes.
-
-2006-01-27  David Turner  <david@freetype.org>
-
-       * builds/unix/configure.ac: Fix build problem on Cygwin.
-
-       * builds/unix/install.mk (install): Don't install the internal
-       headers, and remove existing ones if found in the target install
-       directory.
-
-       * src/autofit/afwarp.c: Add simple #ifdef to prevent compilation
-       if the warp hinter isn't active (it shouldn't, still experimental).
-
-       * Jamfile, include/freetype/config/ftmodule.h: Remove `gxvalid'
-       and `otvalid' from the list of modules that are linked statically
-       to a given FreeType library.  Functionality has been moved to the
-       `ftvalid' CVS module.
-
-       Note also that current Make-based build system still compiles the
-       modules though.
-
-       * include/freetype/config/ftoption.h (FT_STRICT_ALIASING): New macro
-       which controls the definitions of the memory management functions to
-       avoid warnings with recent versions of GCC.  This macro is only here
-       to be disabled, in case we detect problems with the new scheme.
-
-       NOTE: Disable macro to use the memory debugger -- this will be fixed
-             later!
-
-       * include/freetype/internal/ftmemory.h, src/base/ftutil.c (FT_Alloc,
-       FT_QAlloc, FT_Realloc, FT_QRealloc, FT_Free) [FT_STRICT_ALIASING]:
-       New versions.
-
-
-       * builds/win32/visualc/freetype.dsp: Updating project file to
-       define FT2_BUILD_LIBRARY, and remove gxvalid + otvalid modules from
-       compilation.
-
-
-       * builds/freetype.mk (FT_CFLAGS), Jamfile (DEFINES): Define the
-       macro FT2_BUILD_LIBRARY when compiling the library.
-
-       * include/freetype/config/ftheader.h: Remove inclusions of internal
-       headers except if the macro FT2_BUILD_LIBRARY is defined.
-
-
-       * include/freetype/internal/psaux.h (AFM_KernPair, AFM_TrackKern,
-       AFM_FontInfo): Move structure declarations to...
-       * include/freetype/internal/t1types.h: This file.
-
-
-       * (many files): Fix compiler warnings.
-       Various minor reorganizations.
-
-
-       * src/cff/cffload.c (cff_font_done): Don't free static array
-       `subfonts'.
-
-       * src/otvalid/otvcommn.c (otv_ClassDef_validate),
-       src/otvalid/otvgpos.c (otv_x_sxy): Fix debugging information.
-
-
-       Get rid of writable static variables (i.e., the string table) in
-       afmparse, and fix compilation in FT2_MULTI mode.
-
-       * src/psaux/afmparse.c: Include ft2build.h and FT_FREETYPE_H.
-       (AFM_MAX_ARGUMENTS): Define...
-       * src/psaux/afmparse.h: Here.
-       * src/psaux/Jamfile (_sources): Add afmparse.
-
-       * src/psaux/psconv.c: Include psconv.h.
-
-       * src/type1/t1afm.c: Don't include FT_INTERNAL_TYPE1_TYPES_H but
-       FT_INTERNAL_POSTSCRIPT_AUX_H.
-       * src/type1/t1afm.h: Include FT_INTERNAL_TYPE1_TYPES_H.
-
-2006-01-23  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/freetype.h (FT_Select_Size): Rename the second
-       argument from `idx' to `strike_index'.
-       (FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
-       this enum.
-
-       * include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
-       FT_REQUEST_HEIGHT): New macros to get the width and height of a
-       request, in fractional pixels.
-
-       * include/freetype/internal/ftobjs.h (FT_Select_Metrics,
-       FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
-       FT_Request_Metrics): New base functions to set the font metrics.  They
-       were part of FT_Select_Size/FT_Request_Size and are made independent
-       functions so that metrics are not set again and again.
-
-       * src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
-       only when driver's size_select/size_request is NULL.  That is, drivers
-       should set the metrics themselves.
-       (FT_Match_Size): Round before matching.  This was what we did and it
-       does cause some problems without rounding.
-
-       * src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
-       (tt_size_select): Set the font metrics.
-       s/index/strike_index/.
-       The scaled metrics are always preferred over strikes' metrics, even
-       when some strike is selected.  This is done because the strikes'
-       metrics are not reliable, e.g., the sign of the descender is wrong for
-       some fonts.
-
-       * src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
-       (tt_size_request): Set the font metrics.
-       Call cff_size_select/tt_size_select when some strike is matched.
-
-       * src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
-       src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
-       src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
-       Set the font metrics.
-       s/index/strike_index/.
-
-       * src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
-       files were committed.  Just a catch-up.
-       (PS_Conv_ToFixed): Remove the `goto'.
-       (PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
-
-       * src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
-       tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
-       (tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
-       advertised metrics in `available_sizes' are different from those
-       actually used.
-
-2006-01-23  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/psaux/psaux.c src/psaux/psauxmod.c src/type1/t1driver.c: Make
-       AFM parser optional, controlled by `T1_CONFIG_OPTION_NO_AFM'.
-
-2006-01-22  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
-       `texinfo' CVS module at savannah.gnu.org.
-
-2006-01-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/rules.mk (AUTOF_DRV_SRC): Add afwarp.c.
-
-       * src/autofit/afloader.c (af_loader_load_g): Move AF_USE_WARPER up
-       to avoid compiler warnings.
-
-       * src/autofit/afwarp.c (af_warper_compute_line_best): Remove
-       shadowing variable declarations.
-       Fix warning parameters and replace printf with AF_LOG.
-       (af_warper_compute): Remove unused variable.
-
-2006-01-20  David Turner  <david@freetype.org>
-
-       Adding experimental implementation of `warp hinting' (new hinting
-       algorithm for gray-level and LCD rendering).  It is disabled by
-       default, you need to #define AF_USE_WARPER in aftypes.h.
-
-       * src/autofit/afhints.c (af_glyph_hints_scale_dim) [AF_USE_WARPER]:
-       New function.
-       * src/autofit/afhints.h: Updated.
-
-       * src/autofit/aflatin.c [AF_USE_WARPER]: Include afwarp.h.
-       (af_latin_hints_init) [AF_USE_WARPER]: Reset mode to
-       FT_RENDER_MODE_NORMAL if an LCD mode is selected.
-       (af_latin_hints_apply) [AF_USE_WARPER]: Call af_warper_compute
-       appropriately.
-
-       * src/autofit/afloader.c (af_loader_load_g) [!AF_USER_WARPER]:
-       Isolate code for adjusting metrics.
-
-       * src/autofit/aftypes.h (AF_USE_WARPER): New macro (commented out by
-       default).
-
-       * src/autofit/afwarp.c, src/autofit/afwarp.h: New files.
-
-       * src/autofit/autofit.c [AF_USE_WARPER]: Include afwarp.c.
-
-       * src/autofit/Jamfile (_sources): Add afwarp.
-
-2006-01-19  David Turner  <david@freetype.org>
-
-       * src/sfnt/ttsbit0.c (tt_face_load_strike_metrics): Fix small bug
-       that prevented compilation when FT_OPTIMIZE_MEMORY is defined.
-
-2006-01-19  Brian Weed  <bw@imaginengine.com>
-
-       * builds/win32/visualc/freetype.dsp: Updated.
-
-2006-01-17  Werner Lemberg  <wl@gnu.org>
-
-       Use pscmap service in CFF module.
-
-       * src/cff/cffcmap.c (cff_cmap_uni_pair_compare): Removed.
-       (cff_sid_to_glyph_name): New function.
-       (cff_cmap_unicode_init, cff_cmap_unicode_done,
-       cff_cmap_unicode_char_index, cff_cmap_unicode_char next): Use pscmap
-       service.
-       (cff_cmap_unicode_class_rec): Updated.
-       * src/cff/cffcmap.h (CFF_CMapUnicode, CFF_CMap_UniPair): Removed.
-
-
-       * src/psnames/psmodule.c (ps_unicodes_char_next): Fix `unicode'
-       return value.
-
-
-       * src/psaux/afmparse.c (afm_parser_read_vals): Use double casting
-       to avoid compiler warnings regarding type-punning.
-
-2006-01-16  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/psaux/afmparse.c, src/psaux/afmparse.h: New files which
-       implement an AFM parser.
-
-       * src/psaux/psconv.c, src/psaux/psconv.h: New files to provide
-       conversion functions (e.g., PS real number => FT_Fixed) for the
-       PS_Parser and AFM_Parser.  Some of the functions are taken, with
-       some modifications, from the file psobjs.c.
-
-       * src/psaux/psobjs.c: Use functions from psconv.c.
-
-       * include/freetype/internal/psaux.h, src/psaux/psauxmod.c: Add
-       `AFM_Parser' to the `psaux' service.
-
-       * src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Include
-       those new files.
-
-       * src/tools/test_afm.c: A test program for AFM parser.
-
-       * include/freetype/internal/services/svkern.h: New file providing a
-       `Kerning' service.  It is currently only used to get the track
-       kerning information.
-
-       * include/freetype/internal/ftserv.h (FT_SERVICE_KERNING_H): New
-       macro.
-
-       * src/type1/t1driver.c, src/type1/t1objs.c, src/type1/t1afm.c,
-       src/type1/t1afm.h: Update to use the AFM parser.
-       Provide the `Kerning' service.
-
-       * include/freetype/freetype.h, src/base/ftobjs.c: New API
-       `FT_Get_Track_Kerning'.
-
-2006-01-15  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/internal/ftobjs.h, src/base/ftobjs.c,
-       src/bdf/bdfdrivr.c, src/cff/cffgload.c, src/cid/cidgload.c,
-       src/pcf/pcfdrivr.c, src/type1/t1gload.c, src/winfonts/winfnt.c:
-       s/ft_fake_vertical_metrics/ft_synthesize_vertical_metrics/.
-
-       * docs/CHANGES: Mention that vertical metrics are synthesized for
-       fonts not having this info.
-
-2006-01-15  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/internal/ftobjs.h (ft_fake_vertical_metrics),
-       src/base/ftobjs.c (ft_fake_vertical_metrics): New function to fake
-       vertical metrics.
-
-       * src/cff/cffgload.c, src/cid/cidgload.c, src/pcf/pcfdrivr.c,
-       src/type1/t1gload.c, src/winfonts/winfnt.c: Fake vertical metrics,
-       which are monotone.
-
-       * src/truetype/ttgload.c (compute_glyph_metrics): Some fixes and
-       formattings in vertical metrics faking.  There is still room for
-       improvements (and so does the CFF module).
-
-2006-01-15  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/pcf/pcfdrivr.c
-       (PCF_Glyph_Load), src/winfonts/winfnt.c (FNT_Load_Glyph): Don't set
-       the linear advance fields as they are only used by the outline
-       glyphs.
-
-       * include/freetype/freetype.h: Documentation updates and
-       clarifications.
-       The meaning of FT_LOAD_FORCE_AUTOHINT is changed so that no real
-       change need be made to the code.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Resolve flag dependencies and
-       decide whether to use the auto-hinter according to documentation.
-       There should to be no real difference.
-       Some checks (e.g., is text height positive?) after the glyph is
-       loaded.
-       (FT_Select_Size, FT_Request_Size): Scales are set to wrong values.
-       Be careful that scales won't be negative.
-
-2006-01-14  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * docs/CHANGES: Mention the size selection change.
-
-       * src/bdf/bdfdrivr.c (BDF_Size_Request, BDF_Size_Select),
-       src/pcf/pcfdrivr.c (PCF_Size_Request, PCF_Size_Select),
-       src/winfonts/winfnt.c (FNT_Size_Request, FNT_Size_Select): Do size
-       matching for requests of type NOMINAL and REAL_DIM.
-
-       * src/winfonts/winfnt.c (FNT_Face_Init): Print trace message when
-       `pixel_height' is used for nominal height.
-
-       * src/base/ftobjs.c (FT_Request_Size): Call `FT_Match_Size' if the
-       face is bitmap only and driver doesn't provide `request_size'.  This
-       is added merely for completion as no driver satisfies the conditions.
-
-2006-01-13  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       Introduce new size selection interface.
-
-       * include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec):
-       Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
-       `select_size'.
-
-       * include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
-       FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
-       (FT_Select_Size, FT_Request_Size): API additions to export the new
-       size selection interface.
-
-       * src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
-       `FT_Request_Size'.
-
-       * include/freetype/internal/ftobjs.h (FT_Match_Size),
-       src/base/ftobjs.c (FT_Match_Size): New function to match a size
-       request against `available_sizes'.  Drivers supporting bitmap strikes
-       can use this function to implement `request_size'.
-
-       * src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
-       src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
-       src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
-       src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
-       Update to new size selection interface.
-
-       * src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
-       src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
-       src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
-       selection interface.
-       Make `strike_index' FT_ULong and always defined.
-       Use `load_strike_metrics' provided by SFNT interface.
-
-2006-01-13  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/internal/sfnt.h (SFNT_Interface): New method
-       `load_strike_metrics' used to load the strike's metrics.
-
-       * src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
-       src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
-
-       * src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
-
-       * src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
-       nominal size unless it is obviously incorrect.
-
-       * include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
-       FNT driver.
-
-2006-01-12  Werner Lemberg  <wl@gnu.org>
-
-       Prepare use of pscmap service within CFF module.
-
-       * include/freetype/internal/services/svpscmap.h: Include
-       FT_INTERNAL_OBJECTS_H.
-       (PS_Unicode_Index_Func): Removed.  Unused.
-       (PS_Macintosh_Name_Func): Renamed to...
-       (PS_Macintosh_NameFunc): This.
-       Update all callers.
-       (PS_Adobe_Std_Strings_Func): Renamed to...
-       (PS_Adobe_Std_StringsFunc): This.
-       Update all callers.
-       (PS_UnicodesRec): This is the former `PS_Unicodes' structure.
-       Add `cmap' member.
-       Update all callers.
-       (PS_Unicodes): This is now a typedef'd pointer to PS_UnicodesRec.
-       Update all callers.
-       (PS_Glyph_NameFunc): New typedef.
-       (PS_Unicodes_InitFunc): Change arguments to expect a function
-       and generic data pointer which returns a glyph name from a given
-       index.
-
-       * src/psnames/psmodule.c (ps_unicodes_init, ps_unicodes_char_index,
-       ps_unicodes_char_next, pscmaps_interface): Updated.
-
-       * include/freetype/internal/t1types.h (T1_FaceRec): Updated.
-
-       * src/psaux/t1cmap.h (T1_CmapStdRec): Updated.
-       (T1_CmapUnicode, T1_CmapUnicodeRec): Removed.
-
-       * src/psaux/t1cmap.c (t1_get_glyph_name): New callback function.
-       (t1_cmap_unicode_init, t1_cmap_unicode_done,
-       t1_cmap_unicode_char_index, t1_cmap_unicode_char_next,
-       t1_cmap_unicode_class_rec): Updated.
-
-       * src/type42/t42types.h (T42_FaceRec): Updated.
-
-2006-01-11  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/ftmac.h: Add declaration of new functions
-       FT_New_Face_From_FSRef and FT_GetFile_From_Mac_ATS_Name that
-       were introduced by the jumbo patch on  2006-01-11.
-
-2006-01-11  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #15056 and use pscmap service in psaux module.
-
-       * include/freetype/internal/services/svpscmap.h (PS_UniMap): Use
-       FT_UInt32 for `glyph_index'.
-       (PS_Unicodes_InitFunc): Use FT_String for `glyph_names'.
-       (PS_Unicodes_CharIndexFunc): Use FT_UInt32 for `unicode'.
-       (PS_Unicodes_CharNextFunc): Make second argument a pointer to
-       FT_UInt32.
-
-       * src/psnames/psmodule.c (VARIANT_BIT, BASE_GLYPH): New macros.
-       (ps_unicode_value): Set VARIANT_BIT in return value if glyph is a
-       variant glyph (this is, it has non-leading `.' in its name).
-       (compare_uni_maps): Sort base glyphs before variant glyphs.
-       (ps_unicodes_init): Use FT_String for `glyph_names' argument.
-       Reallocate only if number of used entries is much smaller.
-       Updated to handle variant glyphs.
-       (ps_unicodes_char_index, ps_unicodes_char_next): Prefer base glyphs
-       over variant glyphs.
-       Simplify code.
-
-       * src/psaux/t1cmap.c (t1_cmap_uni_pair_compare): Removed.
-       (t1_cmap_unicode_init, t1_cmap_unicode_char_index,
-       t1_cmap_unicode_char_next): Use pscmap service.
-       (t1_cmap_unicode_done): Updated.
-
-       * src/psaux/t1cmap.h (T1_CMapUniPair): Removed.
-       (T1_CMapUnicode): Use PS_Unicodes structure.
-
-2006-01-11  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Jumbo patch to fix `deprecated' warning of cross-build for Tiger on
-       Intel, as reported by Sean McBride <sean@rogue-research.com> on
-       2005-08-24.
-
-       * src/base/ftmac.c: Heavy change to build without deprecated Carbon
-       functions on Tiger.
-
-       * builds/unix/configure.ac: Add options and autochecks for Carbon
-       functions availabilities, for MacOS X.
-
-       * builds/mac/ascii2mpw.py: Add converter for character `\305'.
-       * builds/mac/FreeType.m68k_{far|cfm}.make.txt: Add conditional
-       macros to avoid unavailable functions.
-       ftmac.c must be compiled without `-strict ansi', because it disables
-       cpp macro to use ToolBox system call.
-
-       * builds/mac/FreeType.ppc_{classic|carbon}.make.txt: Add conditional
-       macros to avoid unavailable functions.
-
-       * builds/mac/README: Detailed notes on function availabilities.
-
-       * docs/CHANGES: Notes about (possible) incompatibilities.
-
-2006-01-08  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2006-01-08  Huw D M Davies  <h.davies1@physics.ox.ac.uk>
-
-       * include/freetype/ftmodapi.h (FT_Module_Get_Flags): New
-       declaration.
-
-       * src/base/ftobjs.c (FT_Module_Get_Flags): New function.
-
-2006-01-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/pcf/pcfread.c (pcf_get_bitmaps): Remove unused variable
-       `bitmaps'.  Reported by Yu Lei <yulei0@gmail.com>.
-
-       * src/base/ftutil.c (ft_highpow2): s/FT_BASE/FT_BASE_DEF/.
-       Reported by Niels Boldt <nielsboldt@gmail.com>.
-
-2005-12-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/sfnt/sfnt/ttbdf.c: Add newline '\n' to the end of file, for
-       MPW compiler.
-
-2005-12-23  David Turner  <david@freetype.org>
-
-       * Jamfile (RefDoc), docs/reference/README: Fix it so that `jam
-       refdoc' works correctly to generate the API reference in
-       `docs/reference'.
-
-       * src/tools/docmaker/tohtml.py (print_html_field,
-       print_html_field_list): Update to output nicer fields lists in the
-       API reference.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): FT_LOAD_TARGET_LIGHT now
-       forces auto-hinting.
-
-       * freetype/freetype.h: Updating the documentation for
-       FT_LOAD_TARGET_XXX and FT_Render_Mode values.
-
-2005-12-23  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (FT_New_Face_From_Suitcase): Count scalable faces
-       in supported formats (sfnt, LWFN) only, and ignore bitmap faces in
-       unsupported formats (fbit, NFNT).  The number of available faces are
-       passed via face->num_faces.  If bitmap faces are embedded in sfnt
-       resource, face->num_fixed_size is correctly set.  In public API,
-       FT_New_Face() and FT_New_Face_From_FSSpec() count the faces as
-       FT_GetFile_From_Mac_Name(), which ignores NFNT resources.
-
-       * doc/CHANGES: Mention the changes.
-
-2005-12-17  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/truetype/ttinterp.c (Update_Max): Set current size of buffer
-       correctly (so that memory debug system won't panic).
-
-2005-12-16  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/internal/ftobjs.h (ft_glyphslot_grid_fit_metrics),
-       src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Removed.
-
-       * src/base/ftobjs.c (ft_recompute_scaled_metrics): Do not round.
-
-       * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
-       (cid_slot_load_glyph), src/truetype/ttgload.c (compute_glyph_metrics),
-       src/type1/t1gload.c (T1_Load_Glyph): Do not round glyph metrics.
-
-       * doc/CHANGES: Mention the changes.
-
-2005-12-13  David Turner  <david@freetype.org>
-
-       Change the implementation of the LIGHT hinting mode to completely
-       disable horizontal hinting.  This is an experimental effort to
-       integrate David Chester's latest patch without affecting the other
-       hinting modes as well.
-
-       Note that this doesn't force auto-hinting for all fonts, however.
-
-       * src/autofit/afhints.c (af_glyph_hints_reload): Don't set
-       scaler_fiags here but...
-       (af_glyph_hints_rescale): Here.
-
-       * src/autofit/aflatin.c (af_latin_hints_init): Disable horizontal
-       hinting for `light' hinting mode.
-
-
-       * Jamfile: Small fix to ensure that ftexport.sym is placed into the
-       same location as other generated objects (i.e., within the `objs'
-       directory of the current directory).
-
-
-       Add support for an embedded `BDF ' table within SFNT-based bitmap
-       font files.  This is used to store atoms & properties from the
-       original BDF fonts that were used to generate the font file.
-
-       The feature is controlled by TT_CONFIG_OPTION_BDF within
-       `ftoption.h' and is used to implement FT_Get_BDF_Property for these
-       font files.
-
-       At the moment, this is still experimental, the BDF table format
-       isn't cast into stone yet.
-
-       * include/freetype/config/ftoption.h (TT_CONFIG_OPTION_BDF): New
-       macro.
-
-       * include/freetype/config/ftstdlib.h (ft_memchr): New macro.
-
-       * include/freetype/internal/tttypes.h (TT_BDFRec, TT_BDF)
-       [TT_CONFIG_OPTION_BDF]: New structure.
-       (TT_FaceRec) [TT_CONFIG_OPTION_BDF]: New member `bdf'.
-
-       * include/freetype/ttags.h (TTAG_BDF): New macro.
-
-       * src/sfnt/Jamfile (_sources): Add ttbdf.
-
-       * src/sfnt/rules.mk (SFNT_DRV_SRC): Add ttbdf.c.
-
-       * src/sfnt/sfdriver.c [TT_CONFIG_OPTION_BDF]: Include ttbdf.h and
-       FT_SERVICE_BDF_H.
-       (sfnt_get_charset_it) [TT_CONFIG_OPTION_BDF]: New function.
-       (sfnt_service_bdf) [TT_CONFIG_OPTION_BDF]: New service.
-       (sfnt_services) [TT_CONFIG_OPTION_BDF]: Add sfnt_service_bdf.
-
-       * src/sfnt/sfnt.c [TT_CONFIG_OPTION_BDF]: Include ttbdf.c.
-
-       * src/sfnt/sfobjs.c [TT_CONFIG_OPTION_BDF]: Include ttbdf.h.
-       (sfnt_done_face) [TT_CONFIG_OPTION_BDF]: Call
-       tt_face_free_bdf_props.
-
-       * src/sfnt/ttbdf.h, src/sfnt/ttbdf.c: New files.
-
-2005-12-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjc.c (sfnt_init_face): Move tag check to...
-       * src/sfnt/ttload.c (sfnt_init): Here, before handling TTCs.
-
-2005-12-06  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/truetype/ttobjs.c (tt_size_init): size->ttmetrics.valid is
-       initialized twice.
-       size->strike_index is not initialized.
-
-2005-12-02  Taek Kwan(TK) Lee  <taeklee@gmail.com>
-
-       * src/type42/t42objs.c (T42_Face_Init): Replace call to
-       FT_New_Memory_Face with call to FT_Open_Face to pass `params'.
-
-2005-11-30  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Document ftdump's `-v' option.
-       Document latest charmap code changes.
-
-       * src/sfnt/ttcmap.c, src/sfnt/ttcmap.h:
-       s/TT_CMAP_FLAG_OVERLAPPED/TT_CMAP_FLAG_OVERLAPPING/.
-
-2005-11-30  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary,
-       tt_cmap12_char_map_binary): Fix compiler warnings.
-
-2005-11-29  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       Major update to distinguish between unsorted and overlapping
-       segments for cmap format 4.  For overlapping but sorted segments,
-       which is previously considered unsorted, we still use binary search.
-
-       * src/sfnt/ttcmap.h (TT_CMapRec_): Replace `unsorted' by `flags'.
-       (TT_CMAP_FLAG_UNSORTED, TT_CMAP_FLAG_OVERLAPPED): New macros.
-
-       * src/sfnt/ttcmap.c (OPT_CMAP4): Removed as it is always defined.
-       (TT_CMap4Rec_): Remove `old_charcode' and `table_length'.
-       (tt_cmap4_reset): Removed.
-       (tt_cmap4_init): Updated accordingly.
-       (tt_cmap4_next): Updated accordingly.
-       Take care of overlapping segments.
-       (tt_cmap4_validate): Make sure the subtable is large enough.
-       Do not check glyph_ids because some fonts set the length wrongly.
-       Also, if all segments have offset 0, glyph_ids is always invalid.
-       It does not cause any problem so far only because the check misses
-       equality.
-       Distinguish between unsorted and overlapping segments.
-       (tt_cmap4_char_map_linear, tt_cmap4_char_map_binary): New functions
-       to do `charcode => glyph index' by linear/binary search.
-       (tt_cmap4_char_index, tt_cmap4_char_next): Use
-       tt_cmap4_char_map_linear and tt_cmap4_char_map_binary.
-       (tt_face_build_cmaps): Treat the return value of validator as flags
-       for cmap.
-
-2005-11-29  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/sfnt/ttcmap.c (TT_CMap12Rec_, tt_cmap12_init, tt_cmap12_next):
-       New structures and functions for fast `next char'.
-       (tt_cmap12_char_map_binary): New function to do `charcode => glyph
-       index' by binary search.
-       (tt_cmap12_char_index, tt_cmap12_char_next): Use
-       tt_cmap12_char_map_binary.
-       (tt_face_build_cmaps): Check table and offset correctly (equality is
-       missing).
-
-2005-11-15  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/smakefile: Adjusted the compiler options
-       to the current sources, now really builds the gxvalid, gzip
-       and psnames modules.
-
-       * builds/amiga/src/base/ftsystem.c: The assumed Seek() position
-       in the file cache was off by one byte which could cause false
-       errors in font files.
-
-2005-11-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/mac/FreeType.m68k_far.make.txt,
-       builds/mac/FreeType.m68k_cfm.make.txt,
-       builds/mac/FreeType.ppc_classic.make.txt,
-       builds/mac/FreeType.ppc_carbon.make.txt:
-       Updated for MPW to build all available modules.
-
-2005-11-21  Håvard Wall  <haavardw@ifi.uio.no>
-
-       * src/bdf/bdfdrivr.c (bdf_interpret_style, BDF_Face_Done): Fix small
-       memory leak.
-
-2005-11-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttload.c (sfnt_init): Add tracing message.
-
-2005-11-21  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Image_offset was
-       added twice to image_start if image_format was 2 or 5.
-
-2005-11-21  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/sfnt/sfobjs.c (sfnt_init_face): Check that format_tag is known
-       before loading the table directory.
-
-       * src/sfnt/ttload.c (tt_face_load_sfnt_header,
-       tt_face_load_directory): Delay sfnt_dir_check from
-       tt_face_load_sfnt_header to tt_face_load_directory.
-
-2005-11-20  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/sfnt/ttload.c (sfnt_dir_check): Clean up and return correct
-       error code.
-       (sfnt_init): New function to fill in face->ttc_header.  A non-TTC font
-       is synthesized into a TTC font with one offset table.
-       (tt_face_load_sfnt_header): Use sfnt_init.
-       Fix an invalid access if the font is TTC and face_index is -1.
-
-2005-11-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number
-       of metrics instead of aborting.  Patch suggested by Derek Noonburg.
-
-       * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
-       (cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Scale
-       the glyph properly if no hinter is available.
-
-       * docs/CHANGES: Mention scaling bug.
-
-2005-11-18  susuzki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/ftgxval.h, src/base/ftgxval.c
-       (FT_TrueTypeGX_Free, FT_ClassicKern_Free): New functions to free
-       buffers allocated by gxvalid module.
-       * include/freetype/ftotval.h, src/base/ftotval.c
-       (FT_OpenType_Free): New function to free buffer allocated by
-       otvalid module.
-
-2005-11-18  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * builds/unix/ftsystem.c (FT_Stream_Open, FT_New_Memory,
-       FT_Done_Memory), builds/vms/ftsystem.c (FT_Stream_Open, FT_New_Memory,
-       FT_Done_Memory), builds/win32/ftdebug.c (FT_Message, FT_Panic):
-       s/FT_EXPORT/FT_BASE/.
-
-2005-11-17  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/src/base/ftdebug.c (FT_Trace_Get_Count,
-       FT_Trace_Get_Name, FT_Message, FT_Panic),
-       builds/amiga/src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory,
-       FT_Stream_Open): s/FT_EXPORT/FT_BASE/.
-
-2005-11-17  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/makefile, builds/amiga/makefile.os4,
-       builds/amiga/smakefile,
-       builds/amiga/include/freetype/config/ftmodule.h: Updated the Amiga
-       build files (added support for the gxvalid module).
-
-2005-11-17  Werner Lemberg  <wl@gnu.org>
-
-       Add vertical metrics support to OpenType CFF outlines.  Based on a
-       patch from Mike Moening <MikeM@RetekSolutions.com>.
-
-       * src/cff/cffgload.c (cff_face_get_vertical_metrics): New function.
-       (cff_slot_load): Use cff_face_get_vertical_metrics.
-
-       * docs/CHANGES: Updated.
-
-2005-11-17  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftcalc.c (FT_MulTo64): Commented out.
-
-       * include/freetype/internal/ftcalc.h (FT_SqrtFixed),
-       src/base/ftcalc.c (FT_SqrtFixed),
-       include/freetype/internal/ftdebug.h (FT_Trace_Get_Count,
-       FT_Trace_Get_Name, FT_Message, FT_Panic), src/base/ftdebug.c
-       (FT_Trace_Get_Count, FT_Trace_Get_Name, FT_Message, FT_Panic),
-       include/freetype/internal/ftobjs.h (FT_New_Memory, FT_Done_Memory),
-       include/freetype/internal/ftstream.h (FT_Stream_Open),
-       src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory, FT_Stream_Open):
-       s/FT_EXPORT/FT_BASE/.
-
-       * builds/exports.mk: Manually add TT_New_Context to EXPORTS_LIST
-       too.
-
-2005-11-15  David Turner  <david@freetype.org>
-
-       * src/base/fttrigon.c (ft_trig_prenorm): Fix a bug that created
-       invalid computations, resulting in very weird bugs in TrueType
-       bytecode hinted fonts.
-
-       * src/truetype/ttinterp.c (FT_UNUSED_EXEC): Don't perform a
-       structure copy each time.
-
-2005-11-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftccache.c (FTC_Cache_Clear), src/cache/ftcmanag.c
-       (FTC_Manager_Check): Remove FT_EXPORT_DEF tag.
-
-       * src/base/ftcalc.c (FT_Add64): Remove FT_EXPORT_DEF tag.
-       (FT_Div64by32, FT_Sqrt32): Commented out.  Unused.
-
-       * include/freetype/internal/ftcalc.h (SQRT_32): Removed.  Unused.
-       (FT_Sqrt32): Commented out.  Unused.
-
-       * include/freetype/cache/ftccache.h:
-       s/ftc_node_destroy/FTC_Node_Destroy/.
-
-       * src/cache/ftccback.h (ftc_node_destroy): New declaration.
-
-       * src/cache/ftccache.c (ftc_node_destroy): Use FT_LOCAL_DEF tag.
-       (FTC_Node_Destroy): New exported wrapper function for
-       ftc_node_destroy.
-
-       * src/cache/ftcmanag.c: Include ftccback.c.
-
-2005-11-10  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/afangles.c, src/autofit/aftypes.h (af_angle_diff):
-       Comment out.  Unused.
-
-       * builds/exports.mk ($(EXPORTS_LIST)): Add TT_RunIns.
-
-2005-11-10  Christian Biesinger  <cbiesinger@web.de>
-
-       * builds/beos/beos.mk: Call beos-def.mk before anything else to
-       define the separator.
-
-       * builds/unix/unix-cc.in (LINK_LIBRARY): Add `-no-undefined' flag.
-
-2005-11-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1afm.c (T1_Read_PFM): Zero offset means `no kerning
-       table available'.  From Sergey Tolstov <stolstov@esri.com>.
-
-2005-11-03  Ville Syrjälä  <syrjala@sci.fi>
-
-       * src/base/ftobjs.c (FT_Open_Face): Avoid possible memory leak.
-
-2005-11-02  Werner Lemberg  <wl@gnu.org>
-
-       Make compiling instructions in docs/CUSTOMIZE work again.
-
-       * builds/unix/unix-cc.in (CPPFLAGS): New variable.
-       (CFLAGS): Don't include @CPPFLAGS@.
-       * builds/freetype.mk (FT_CFLAGS): Add CPPFLAGS.
-
-2005-10-28  David Turner  <david@freetype.org>
-
-       Update build system to support the generation of a list of exported
-       symbols or Windows .DEF files by parsing the public headers with the
-       `apinames' tool located in src/tools/apinames.c.
-
-       Only tested on Unix at the moment.  On Windows, the .DEF file is
-       generated but isn't used yet to generate a DLL.
-
-       * builds/exports.mk: New file.
-
-       * builds/freetype.mk: Include exports.mk.
-       (dll): New target.
-       (clean_project_dos): Fix rule.
-
-       * builds/compiler/visualc.mk (TE), builds/dos/dos-def.mk (E),
-       builds/os2/os2-def.mk (E), builds/win32/win32-def.mk (E): New
-       variables for controlling executable extensions.
-
-       * builds/unix/unix-cc.in (EXPORTS_LIST, CCexe),
-       builds/win32/w32-bcc.mk, builds/win32/w32-gcc.mk,
-       builds/win32/w32-icc.mk, builds/win32/w32-icc.mk,
-       builds/win32/w32-mingw32.mk, builds/win32/w32-vcc,
-       builds/win32/w32-wat.mk (EXPORTS_LIST, EXPORT_OPTIONS,
-       APINAMES_OPTIONS): New targets for controlling the `apinames' tool.
-
-       * Jamfile (GenExportSymbols): Updated.
-
-
-       * src/pfr/pfrtypes.h, src/pfr/pfrload.c, src/pfr/pfrobjs.c
-       [!FT_OPTIMIZE_MEMORY]: Fold memory optimization code into
-       FT_OPTIMIZE_MEMORY chunks for better maintainability and simplicity.
-
-
-       * src/base/fttrigon.c (ft_trig_prenorm), src/base/ftcalc.c
-       (FT_MulFix): Performance optimizations.
-
-
-       * include/freetype/internal/ftgloadr.h (FT_GLYPHLOADER_CHECK_P,
-       FT_GLYPHLOADER_CHECK_C, FT_GLYPHLOADER_CHECK_POINTS): New macros for
-       checking points and contours.  Update callers to use
-       FT_GLYPHLOADER_CHECK_POINTS instead of FT_GlyphLoader_CheckPoints
-       at profile-detected hot-spots.
-
-       * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Set `adjust'
-       to 0 to not call `AdjustPoints' every time.
-
-
-       * src/autofit/aftypes.h (AF_ANGLE_DIFF): New macro to inline
-       FT_Angle_Diff.
-
-       * src/autofit/afhints.c (af_direction_compute): Re-implement.
-       (af_glyph_hints_compute_inflections, af_glyph_hints_reload): Use
-       AF_ANGLE_DIFF to speed up the detection of inflexions.
-
-
-       * src/tools/apinames.c: Include <string.h>.
-       (OutputFormat): New enumeration.
-       (names_dump): Add two parameters to control output format and DLL
-       name.
-       (names_dump_windef): Removed.  Code folded into `names_dump'.
-       (read_header_file): Use isalnum, not isalpha.  Otherwise function
-       names with digits aren't read correctly.
-       (usage): Updated.
-       (main): New option `-o' to control output file name.
-       New option `-d' to indicate DLL file name.
-       Extend `-w' flag to handle Borland and Watcom compilers and linkers.
-
-2005-10-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/mac/ftlib.prj, builds/mac/freetype.mak: Removed.
-       ftlib.prj is unmaintained and incompatible with current tree.
-       freetype.mak is unrecoverably broken.
-
-       * builds/mac/ftlib.prj.xml: Added.
-       Generated by Metrowerks CodeWarrior 9.0.
-
-       * builds/mac/FreeType.m68k_far.make.txt,
-       builds/mac/FreeType.m68k_cfm.make.txt,
-       builds/mac/FreeType.ppc_classic.make.txt,
-       builds/mac/FreeType.ppc_carbon.make.txt: Added.
-       Skeleton files of MPW makefiles.
-
-       * builds/mac/ascii2mpw.py: Added.
-       Python script to make MPW makefile from skeleton.
-
-       * builds/mac/README: Updated.
-       Almost rewritten to use new files.
-
-2005-10-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Fix invalid casts from NULL to integer typed
-       variables.  Advised by David Turner, Masatake YAMATO, Sean McBride,
-       and George Williams.
-
-2005-10-27  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftsysmem.h, include/freetype/ftsysio.h: Removed.
-       Obsolete.
-
-2005-10-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfdriver.c (sfnt_interface): Move out
-       `tt_face_get_kerning' from a #ifdef clause.  Reported by Tony J.
-       Ibbs <tibs@sj.co.uk>.
-
-2005-10-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftdbgmem.c (ft_mem_debug_realloc): Make it compile with
-       C++.
-
-2005-10-21  David Turner  <david@freetype.org>
-
-       * src/base/ftdbgmem.c (ft_mem_table_set, ft_mem_debug_realloc):
-       Another realloc memory counting bug fix.
-
-       * src/tools/Jamfile: Add missing file.
-
-       * src/lzw/Jamfile: Fix incorrect source file reference.
-
-2005-10-20  David Turner  <david@freetype.org>
-
-       * src/base/ftdbgmem.c (ft_mem_table_set, ft_mem_table_remove,
-       ft_mem_debug_alloc, ft_mem_debug_free, ft_mem_debug_realloc): Fixes
-       to better account for memory reallocations.
-
-       * src/lzw/ftlzw2.c, src/lzw/ftzopen.h, src/lzw/ftzopen.c,
-       src/lzw/rules.mk: First version of LZW loader re-implementation.
-       Apparently, this saves about 330 KB of heap memory when loading
-       timR24.pcf.Z.
-
-2005-10-20  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/ftbitmap.h (FT_Bitmap_Copy, FT_Bitmap_Embolden),
-       src/base/ftbdf.c (FT_Get_BDF_Property), src/cache/ftcmru.c
-       (FTC_MruList_Reset, FTC_MruList_Done, FTC_MruList_Lookup): Fix
-       FT_EXPORT/FT_EXPORT_DEF tagging.
-
-2005-10-19  Chia-I Wu  <b90201047@ntu.edu.tw>
-
-       * src/truetype/ttgload.c (TT_Load_Glyph): Allow size->ttmetrics to
-       be invalid when FT_LOAD_NO_SCALE is set.
-
-2005-10-17  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c (FT_Open_Face): Don't call FT_New_GlyphSlot and
-       FT_New_Size if we are opening a face with face_index < 0 (which is
-       only used for testing the format).
-
-       * src/gxvalid/gxvmort0.c (gxv_mort_subtable_type0_entry_validate):
-       Remove compiler warning.
-
-2005-10-16  David Turner  <david@freetype.org>
-
-       * src/tools/apinames.c: Add new tool to extract public API function
-       names from header files.
-
-2005-10-05  Werner Lemberg  <wl@gnu.org>
-
-       Add FT_FACE_FLAG_HINTER to indicate that a specific font driver has
-       a hinting engine of its own.
-
-       * include/freetype/freetype.h (FT_FACE_FLAG_HINTER): New macro.
-
-       * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
-       (cid_face_init), src/truetype/ttobjs.c (tt_face_init)
-       [TT_CONFIG_OPTION_BYTECODE_INTERPRETER], src/type1/t1objs.c
-       (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init)
-       [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Update face flags.
-
-       * docs/CHANGES: Document it.
-
-2005-09-27  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/freetype2.m4: Add license exception so that the file
-       can be used in any other autoconf script.
-
-2005-09-26  David Turner  <david@freetype.org>
-
-       * src/autofit/aflatin.c (af_latin_compute_stem_width): Fix bad
-       computation of the `vertical' flag, causing ugly things in LCD mode
-       and others.
-
-2005-09-23  David Turner  <david@freetype.org>
-
-       * src/autofit/aflatin.c (af_latin_hints_init): Fix a bug that
-       prevented internal hint mode bitflags from being computed correctly.
-
-       * src/base/Jamfile: Adding src/base/ftgxval.c.
-
-       * src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
-       src/gxvalid/gxvfeat.c, src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c,
-       src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
-       src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
-       src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c,
-       src/gxvalid/gxvmort5.c, src/gxvalid/gxvmorx.c,
-       src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
-       src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c,
-       src/gxvalid/gxvopbd.c, src/gxvalid/gxvprop.c,
-       src/truetype/ttgload.c: Remove _many_ compiler warnings when
-       compiling with Visual C++ at maximum level (/W4).
-
-       * src/autofit/afangles.c (af_angle_atan): Replaced CORDIC-based
-       implementation with one using lookup tables.  This simple thing
-       speeds up glyph loading by 18%, according to ftbench!
-
-       * src/sfnt/sfdriver.c (sfnt_get_interface): Don't check for
-       `get_sfnt' and `load_sfnt' module interfaces.
-
-2005-09-22  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Mention SING Glyphlet support.
-
-2005-09-22  David Turner  <david@freetype.org>
-
-       * src/base/Jamfile: Disable compilation of ftgxval module
-       temporarily.
-
-2005-09-19  David Somers  <dsomers@omz13.com>
-
-       * src/sfnt/ttload.c (sfnt_dir_check): Modified to allow a
-       font to have no `head' table if tables `SING' and `META' are
-       present; this is to support `SING Glyphlet'.
-
-       `SING Glyphlet' is an extension to OpenType developed by Adobe
-       primarily to facilitate adding supplemental glyphs to an OpenType
-       font (with emphasis on, but not necessarily limited to, gaiji to a
-       CJK font).  A SING Glyphlet Font is an OpenType font that contains
-       the outline(s), either in a `glyf' or `CFF' table, for a glyph;
-       `cmap', `BASE', and `GSUB' tables are present with the same format
-       and functionaliy as a regular OpenType font; there are no `name',
-       `head', `OS/2', and `post' tables; there are two new tables, `SING'
-       which contains details about the glyphlet, and `META' which contains
-       metadata.
-
-       Further information on the SING Glyphlet format can be found at:
-
-         http://www.adobe.com/products/indesign/sing_gaiji.html
-
-       * include/freetype/ttags.h (TTAG_SING, TTAG_META): New macros for
-       the OpenType tables `SING' and `META'.  These two tables are used in
-       SING Glyphlet Format fonts.
-
-2005-09-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Reactivate code to set
-       FT_FACE_FLAG_KERNING which has been commented out erroneously.
-
-       * docs/CHANGES: Document it.
-
-2005-09-05  Werner Lemberg  <wl@gnu.org>
-
-       Fixes for `make multi' and using C++ compiler.
-
-       * src/gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
-       gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
-       gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
-       (gxv_compare_ranges): Make it static.
-       (gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
-       gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
-       gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
-       trace messages.
-       (gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
-       (GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
-       GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
-       gxvcommn.h.
-
-       * src/gxvalid/gxvcommn.h: Add prototypes for
-       gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
-       gxv_XStateTable_validate, gxv_array_getlimits_byte,
-       gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
-       gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
-       gxv_odtect_validate.
-       (GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
-       GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
-       gxvcommn.c.
-
-       * src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
-       gxv_bsln_parts_fmt1_validate): Improve trace messages.
-
-       * src/gxvalid/gxvfeat.c: Split off predefined registry stuff to...
-       * src/gxvalid/gxvfeat.h: New file.
-
-       * src/gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
-       message.
-
-       * src/gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
-       (gxv_kern_subtable_fmt1_valueTable_load,
-       gxv_kern_subtable_fmt1_subtable_setup,
-       gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
-       (gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
-       Improve trace message.
-       (gxv_kern_validate_generic): Fix C++ compiler error.
-       Improve trace message.
-       (gxv_kern_validate_classic): Fix C++ compiler error.
-
-       * src/gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
-       with FT_LOCAL_DEF.
-
-       * src/gxvalid/gxvmort1.c
-       (gxv_mort_subtable_type1_substitutionTable_load,
-       gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
-       (gxv_mort_subtable_type1_substTable_validate): Improve trace
-       message.
-       (gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
-
-       * src/gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
-       gxv_mort_subtable_type2_subtable_setup,
-       gxv_mort_subtable_type2_ligActionOffset_validate,
-       gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
-       errors.
-       (gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
-
-       * src/gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
-       with FT_LOCAL_DEF.
-
-       * src/gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
-       gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
-       errors.
-       (gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
-
-       * src/gxvalid/gxvmort.c: Include gxvfeat.h.
-       (gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
-       Declare with FT_LOCAL_DEF.
-       (gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
-       messages.
-
-       * src/gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
-
-       * src/gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
-       with FT_LOCAL_DEF.
-
-       * src/gxvalid/gxvmorx1.c
-       (gxv_morx_subtable_type1_substitutionTable_load,
-       gxv_morx_subtable_type1_subtable_setup,
-       gxv_morx_subtable_type1_entry_validate,
-       gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
-       compiler errors.
-       (gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
-
-       * src/gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
-       gxv_morx_subtable_type2_subtable_setup,
-       gxv_morx_subtable_type2_ligActionIndex_validate,
-       gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
-       errors.
-       (gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
-       Fix typo.
-
-       * src/gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
-       with FT_LOCAL_DEF.
-
-       * src/gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
-       gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
-       (gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
-
-       * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
-       gxv_morx_validate): Improve trace message.
-
-       * src/gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
-       warnings.
-       (gxv_opbd_validate): Improve trace message.
-
-       * src/gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
-       appropriate.
-       (gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
-       message.
-
-       * src/gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
-       parameter.  Update all callers.
-       (gxv_trak_validate): Improve trace message.
-
-       * rules.mk (GXV_DRV_H): Add gxvfeat.h.
-
-2005-09-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/gxvalid/gxvbsln.c (GXV_BSLN_VALUE_EMPTY): Add `U'.
-
-       * src/gxvalid/gxmort1.c (GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE),
-       src/gxvalid/gxmort2.c (GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE): Fix
-       typo.
-
-       * src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
-       src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx4.c,
-       src/gxvalid/gxvmorx5.c, src/gxvalid/gxvmort.c: Improve trace
-       messages.
-       Decorate constants with `U' and `L' where appropriate.
-       Fix compiler warnings.
-
-2005-08-31  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fix typo.
-
-       * src/gxvalid/gxvbsln.c (gxv_bsln_validate): Fix trace message.
-
-       * src/gxvalid/gxvcommn.c (gxv_odtect_add_range): Use `const'.
-
-       * src/gxvalid/gxvfeat.c, src/gxvalid/gxvjust.c,
-       src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmod.c,
-       src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
-       src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c,
-       src/gxvalid/gxvmort5.c, src/gxvalid/gxvmort.c: Improve trace
-       messages.
-       Decorate constants with `U' and `L' where appropriate.
-       Fix compiler warnings.
-
-2005-08-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/gxvalid/README: Revised.
-       * src/gxvalid/gxvbsln.c: Fix compiler warnings.
-       * src/gxvalid/gxvcommn.c: Fix compiler warnings.
-       (gxv_XEntryTable_validate, gxv_compare_ranges): Remove unused
-       parameter.  Update all callers.
-       Improve trace messages.
-       Some formatting.
-
-2005-08-29  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h, include/freetype/ftchapters.h: Add
-       a preliminary section with some explanations about user allocation.
-
-       * src/tools/docmaker/tohtml.py (HtmlFormatter.section_enter):
-       Don't abort if there are no data types, functions, etc., in a
-       section.
-       Print synopsis only if we have a data type, function, etc.
-
-       * docs/INSTALL.ANY, docs/INSTALL, docs/INSTALL.UNX, docs/CUSTOMIZE,
-       docs/INSTALL.GNU, docs/TRUETYPE, docs/DEBUG, docs/UPGRADE.UNX,
-       docs/VERSION.DLL, docs/formats.txt: Revised, formatted.
-
-2005-08-28  George Williams  <gww@silcom.com>
-
-       * src/truetype/ttgload.c [TT_MAX_COMPOSITE_RECURSE]: Removed.
-       (load_truetype_glyph): Limit recursion depth by `maxComponentDepth'.
-
-2005-08-25  J. Ali Harlow  <ali@avrc.city.ac.uk>
-
-       * builds/unix/freetype2.in (CFlags): Add missing directory.
-
-2005-08-24  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Mention gxvalid module.
-
-2005-08-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/aflatin.c (af_latin_metrics_scale): Initialize
-       render mode properly.  Reported by chris@dokein.co.uk.
-
-2005-08-23  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Add gxvalid module to validate TrueType GX/AAT tables.
-
-       Modifications on existing files:
-
-       * Jamfile: Register gxvalid module.
-       * src/base/Jamfile: Register ftgxval.c.
-       * src/base/rule.mk: Register ftgxval.c.
-       * docs/INSTALL.ANY: Register gxvalid/gxvalid.c.
-
-       * include/freetype/config/ftheader.h (FT_GX_VALIDATE_H): New macro
-       to include gxvalid header file.
-       * include/freetype/config/ftmodule.h: Register gxv_module_class.
-
-       * include/freetype/ftchapters.h: Add comment about gx_validation.
-       * include/freetype/ftotval.h: Change keyword FT_VALIDATE_XXX
-       to FT_VALIDATE_OTXXX to co-exist with gxvalid.
-       * include/freetype/tttags.h: Add tags for TrueType GX/AAT tables.
-
-       * include/freetype/internal/ftserv.h (FT_SERVICE_GX_VALIDATE_H): New
-       macro for gxvalid service.
-       * include/freetype/internal/fttrace.h: Add trace facilities for
-       gxvalid.
-
-       New files on existing directories:
-
-       * include/freetype/internal/services/svgxval.h: Registration of
-       validation service for TrueType GX/AAT and classic kern table.
-       * include/freetype/ftgxval.h: Public API definition to use gxvalid.
-       * src/base/ftgxval.c: Public API of gxvalid.
-
-       New files under src/gxvalid/:
-
-       * src/gxvalid/Jamfile src/gxvalid/README src/gxvalid/module.mk
-       src/gxvalid/rules.mk src/gxvalid/gxvalid.c src/gxvalid/gxvalid.h
-       src/gxvalid/gxvbsln.c src/gxvalid/gxvcommn.c src/gxvalid/gxvcommn.h
-       src/gxvalid/gxverror.h src/gxvalid/gxvfeat.c src/gxvalid/gxvfgen.c
-       src/gxvalid/gxvjust.c src/gxvalid/gxvkern.c src/gxvalid/gxvlcar.c
-       src/gxvalid/gxvmod.c src/gxvalid/gxvmod.h src/gxvalid/gxvmort.c
-       src/gxvalid/gxvmort.h src/gxvalid/gxvmort0.c src/gxvalid/gxvmort1.c
-       src/gxvalid/gxvmort2.c src/gxvalid/gxvmort4.c src/gxvalid/gxvmort5.c
-       src/gxvalid/gxvmorx.c src/gxvalid/gxvmorx.h src/gxvalid/gxvmorx0.c
-       src/gxvalid/gxvmorx1.c src/gxvalid/gxvmorx2.c src/gxvalid/gxvmorx4.c
-       src/gxvalid/gxvmorx5.c src/gxvalid/gxvopbd.c src/gxvalid/gxvprop.c
-       src/gxvalid/gxvtrak.c: New files, gxvalid body.
-
-2005-08-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (TT_Load_Glyph): Only translate outline
-       to (0,0) if bit 1 of the `head' table isn't set.  This improves
-       rendering of buggy fonts.
-
-2005-08-20  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/truetype/ttdriver.c (Load_Glyph): Don't check the validity of
-       ttmetrics here.  TrueType fonts with only sbits always have
-       ttmetrics.valid set to false.
-
-       * src/truetype/ttgload.c (TT_Load_Glyph): Check that ttmetrics is
-       valid before loading outline glyph.
-
-       * src/cache/ftcimage.c (FTC_INode_New): Fix a memory leak.
-
-2005-08-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttload.c (tt_face_load_metrics_header): Ignore missing
-       `hhea' table for SFNT Mac fonts.  Change based on a patch by
-       mpsuzuki@hiroshima-u.ac.jp.
-
-2005-08-20  Masatake YAMATO  <jet@gyve.org>
-
-       * src/otvalid/otvmod.c (otv_validate): Use ft_validator_run instead
-       of ft_setjmp.
-
-2005-08-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fix compiler
-       warnings.
-
-2005-08-16  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/truetype/ttinterp.c, src/truetype/ttinterp.h: Update copyright
-       messages.
-
-2005-08-16  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/truetype/ttinterp.c, src/truetype/ttinterp.h: Remove original
-       TT_Done_Context and rename TT_Destroy_Context to TT_Done_Context
-       with slight changes.
-       Update all callers.
-       (TT_New_Context): Now takes TT_Driver argument directly.
-       Update all callers.
-
-       * src/truetype/ttobjs.h (tt_slot_init): New function.
-       * src/truetype/ttobjs.c (tt_driver_init): Initialize execution
-       context here.
-       (tt_slot_init): New function to create extra points for the internal
-       glyph loader.  We then use it directly, instead of face's glyph
-       loader, when loading glyph.
-
-       * src/truetype/ttdriver.c (tt_driver_class): Use tt_slot_init for
-       glyph slot initialization.
-       (Load_Glyph): Load flag dependencies are handled here.  Return error
-       if size is NULL.
-
-       * src/truetype/ttgload.c: Heavy cleanup and refactoring.
-       (org_to_cur): Removed.
-       (TT_Load_Simple_Glyph): Call FT_GlyphLoader_CheckPoints.
-       (TT_Hint_Glyph): New function to hint a zone, prepared by caller.
-       (TT_Process_Simple_Glyph): s/load/loader/.
-       Use loader->pp values instead of recalculation.
-       Use TT_Hint_Glyph.
-       No need to save/restore loader->stream before and after
-       TT_Vary_Get_Glyph_Deltas now.
-       (TT_LOADER_SET_PP): New macro to calculate and set the four phantom
-       points.
-       (load_truetype_glyph): Never set exec->glyphSize to 0.  This closes
-       Savannah bug #13107.
-       Forget glyph frame before calling TT_Process_Simple_Glyph.
-       Use TT_LOADER_SET_PP.
-       Scale all four phantom points.
-       Split off some functionality to ...
-       (TT_Process_Composite_Component, TT_Process_Composite_Glyph): These
-       new functions.
-       (TT_Load_Glyph): Set various fields of `glyph' here, not in
-       load_truetype_glyph and compute_glyph_metrics.
-       Split off some functionality to ...
-       (load_sbit_image, tt_loader_init): These new functions.
-       (compute_glyph_metrics): Call FT_Outline_Get_CBox.
-
-2005-08-08  Werner Lemberg  <wl@gnu.org>
-
-       * docs/INSTALL.ANY: Updated.
-
-2005-08-05  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_builder_close_contour),
-       src/psaux/psobjs.c (t1_builder_close_contour): Protect against
-       zero `outline' pointer.
-
-       * src/base/ftgloadr.c (FT_GlyphLoader_Add): Protect against zero
-       `loader' address.
-
-2005-08-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfdriver.c (sfnt_interface) [FT_OPTIMIZE_MEMORY]:
-       Reactivate pointers to tt_find_sbit_image and tt_load_sbit_metrics
-       to make X work again.
-
-2005-08-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/otvalid/otvcommn.h: Remove dead code.
-
-2005-07-31  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/truetype/ttobjs.h (tt_size_run_fpgm, tt_size_run_prep): New
-       functions.
-
-       * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): New
-       functions.
-       (tt_size_init): Add 4, instead of 2, (phantom) points to twilight
-       zone.
-       Move code that runs fpgm to tt_size_run_fpgm.
-       (Reset_Outline_Size): Move code that runs prep to tt_size_run_prep.
-       (tt_glyphzone_new): Allocate right size of arrays.
-       Set max_points and max_contours properly.
-
-2005-07-26  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/truetype/ttdriver.c (Set_Char_Sizes): Avoid unnecessary
-       computations and clean up.
-
-       * src/truetype/ttobjs.h (struct TT_SizeRec_): Comment on the
-       internal copy of metrics.
-
-2005-07-12  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftoutln.h (FT_Outline_Embolden): Fix prototype.
-       Reported by Xerxes.
-
-2005-07-04  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/ftmemory.h (FT_REALLOC_ARRAY): Fix typo.
-       Reported by Brett Hutley.
-
-2005-06-30  David Turner  <david@freetype.org>
-
-       * src/sfnt/ftbitmap.c, src/truetype/ttgload.c, src/sfnt/ttcmap.c:
-       Removing compiler warnings (Visual C++ /W4).
-
-
-       Implement a work-around for broken C preprocessor in Visual C++ (it
-       has been confirmed by the MS developers that it is indeed a bug
-       which won't be fixed in the very near future).
-
-       * Jamfile (FT2_COMPONENTS): Include otvalid (again).
-
-       * src/otvalid/otvcommn.h (OTV_NAME, OTV_FUNC): New macros.
-       (OTV_NEST1, OTV_NEST2, OTV_NEST3): Use OTV_NAME and OTV_FUNC to
-       avoid argument expansion by argument prescan.
-       Append `Func' to all affected macros and change them to take just a
-       single argument.  Example: `AttachList' is renamed to
-       `AttachListFunc'.
-
-       * src/otvalid/otvgdef.c, src/otvalid/otvgpos.c,
-       src/otvalid/otvgsub.c, src/otvjstf.c: Append `Func' to macros
-       affected by the changes to OTV_NESTx and modify them to take just a
-       single argument.
-
-2005-06-20  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: New function
-       ft_glyphslot_grid_fit_metrics.
-
-       * src/truetype/ttgload.c (compute_glyph_metrics): Use
-       ft_glyphslot_grid_fit_metrics.
-
-       * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
-       (cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Use
-       ft_glyphslot_grid_fit_metrics.
-       FT_Outline_Get_CBox is called twice.
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Modify metrics to more
-       reasonable values when emboldening outline glyphs.  The theoretic
-       ones are unrealistic.
-
-2005-06-16  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/base/ftoutln.c (FT_Outline_Embolden): Strength should be
-       halved.
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Change the default
-       strength.
-       Don't increase slot->advance.y.
-
-2005-06-16  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/freetype.h (FREETYPE_MINOR): Set to 2.
-       (FREETYPE_PATCH): Set to 0.
-
-       * builds/unix/configure.ac (version_info): Set to 9:9:3.
-       Currently, we are still binary compatible.
-
-       * builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj: s/219/2110/, s/2.1.9/2.1.10/.
-
-       * builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
-       s/2.1.9/2.1.10/.
-
-       * docs/CHANGES, docs/VERSION.DLL: Updated.
-
-       * ChangeLog: Split off older entries into...
-       * ChangeLog.20, ChangeLog.21: These new files.
-
-2005-06-15  Kirill Smelkov  <kirr@mns.spb.ru>
-
-       The next release will be 2.2.0, so don't worry about source code
-       backwards compatibility.
-
-       * include/freetype/ftimage.h (FT_Outline_MoveToFunc,
-       FT_Outline_LineToFunc, FT_Outline_ConicToFunc,
-       FT_Outline_CubicToFunc, FT_SpanFunc, FT_Raster_RenderFunc),
-       include/freetype/ftrender.h (FT_Glyph_TransformFunc,
-       FT_Renderer_RenderFunc, FT_Renderer_TransformFunc): Decorate
-       parameters with `const' where appropriate.
-
-2005-06-15  Chia I Wu  <b90201047@ntu.edu.tw>
-
-       * src/sfnt/ttsbit.c (tt_face_load_sbit_image): Compute vertBearingY
-       to make glyphs centered vertically.
-
-       * src/truetype/ttgload.c (compute_glyph_metrics): Compute
-       vertBearingY to make glyphs centered vertically.
-       Fix some bugs in vertical metrics:
-
-         . loader->pp3.y and loader->pp4.y are in 26.6 format, not in font
-           units.
-         . As we use the glyph's cbox to calculate the top bearing now
-           there is no need to adjust `top'.
-
-2005-06-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/otvalid/otvcommn.h (OTV_OPTIONAL_TABLE): Use FT_UShort to be
-       in sync with OTV_OPTIONAL_OFFSET.  Reported by YAMATO Masatake.
-
-2005-06-13  Werner Lemberg  <wl@gnu.org>
-
-       * docs/release: Update.
-
-----------------------------------------------------------------------------
-
-Copyright 2005, 2006, 2007, 2008 by
-David Turner, Robert Wilhelm, and Werner Lemberg.
-
-This file is part of the FreeType project, and may only be used, modified,
-and distributed under the terms of the FreeType project license,
-LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-indicate that you have read the license and understand and accept it
-fully.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/reactos/lib/3rdparty/freetype/ChangeLog.23 b/reactos/lib/3rdparty/freetype/ChangeLog.23
deleted file mode 100644 (file)
index ecbf69a..0000000
+++ /dev/null
@@ -1,15896 +0,0 @@
-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.c (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.
-       ==========================
-
-
-       Tag sources with `VER-2-3-11'.
-
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.3.11.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.10/2.3.11/, s/2310/2311/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 11.
-
-       * builds/unix/configure.raw (version_info): Set to 9:22:3.
-
-2009-10-10  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES, docs/release: Updated.
-
-2009-10-10  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/pcf/pcfread.c (pcf_get_properties): Fix a bug in the nprops
-       truncation.  Reported by Martin von Gagern and Peter Volkov.
-       https://bugs.gentoo.org/288357 and https://bugs.gentoo.org/288256
-
-2009-10-06  Werner Lemberg  <wl@gnu.org>
-
-       * Version 2.3.10 released.
-       ==========================
-
-
-       Tag sources with `VER-2-3-10'.
-
-       * builds/toplevel.mk (major, minor, patch): Fix regexp to allow more
-       than a single digit.
-       (dist): We now use git.
-
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.3.10.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.9/2.3.10/, s/239/2310/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.
-
-       * builds/unix/configure.raw (version_info): Set to 9:21:3.
-
-2009-10-06  Werner Lemberg  <wl@gnu.org>
-
-       Fix `make multi'.
-
-       * src/cache/ftccache.c, src/cache/ftcsbits.c (FT_COMPONENT): Define.
-
-       * src/sfnt/sfdriver.c: Include FT_INTERNAL_DEBUG_H.
-
-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.
-       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.
-       Now the 4th argument `node' of this function should be typed as
-       FTC_MruNode.
-
-       * src/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP): For inline
-       implementation, new temporal variable FTC_MruNode `_mrunode' to take
-       the pointer from FTC_MRULIST_LOOKUP_CMP().  For non-inline
-       implementation, tricky cast is dropped.
-
-       * src/cache/ftcmanag.c (FTC_SIZE_NODE): New macro casting
-       to FTC_SizeNode.
-       (FTC_Manager_LookupSize): Replace FTC_SizeNode `node' by FTC_MruNode
-       `mrunode', and FTC_SIZE_NODE() is inserted.
-       (FTC_FACE_NODE): New macro casting to FTC_FaceNode.
-       (FTC_Manager_LookupFace) Replace FTC_FaceNode `node' by FTC_MruNode
-       `mrunode', and FTC_FACE_NODE() is inserted.
-
-       * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Change the type of
-       `node' from FTC_INode to FTC_Node.  Extra casting macro FTC_NODE()
-       is dropped.
-       (FTC_ImageCache_LookupScaler): Ditto.
-       (FTC_SBitCache_Lookup): Change the type of `node' from FTC_SNode to
-       FTC_Node.  Extra casting macro FTC_NODE() is dropped.  FTC_SNODE()
-       is inserted.
-       (FTC_SBitCache_LookupScaler): Ditto.
-
-       * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Change the type of
-       `node' from FTC_CMapNode to FTC_Node.  Extra casting macro
-       FTC_NODE() is dropped, FTC_CMAP_NODE() is inserted.
-
-2009-09-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       [cache, psaux, type1] Fix for multi build.
-       In multi build, some cpp functions are left as unresolved symbols.
-
-       * src/cache/ftcbasic.c: Include FT_INTERNAL_DEBUG_H for FT_TRACE1().
-
-       * src/psaux/t1decode.c: Include FT_INTERNAL_CALC_H for
-       FIXED_TO_INT().
-       * src/type1/t1gload.c: Ditto.
-       * src/type1/t1objs.c: Ditto.
-
-2009-09-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       [autofit] Fix for multi build.
-
-       * src/autofit/afmodule.h: Include FT_INTERNAL_OBJECTS_H to use
-       FT_DECLARE_MODULE() macro in multi build.
-
-       * src/autofit/aflatin.c: Include <ft2build.h> to handle
-       FT_ADVANCES_H correctly in multi build.
-
-2009-09-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       [cache] Check the face filled by FTC_Manager_LookupFace().
-
-       * src/cache/ftcbasic.c (ftc_basic_family_get_count): Return
-       immediately if FTC_Manager_LookupFace() fills face by NULL.  Such
-       case can occur when the code is optimized by GCC-4.2.x.
-
-2009-09-23  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2009-09-12  Werner Lemberg  <wl@gnu.org>
-
-       [raster] Fix 5-levels grayscale output.
-       This was broken since version 2.3.0.
-
-       * src/raster/ftraster.c (count_table): Use pre-2.3.0 values (which
-       were then computed dynamically).
-       (Vertical_Gray_Sweep_Step): Updated.
-
-       (ft_black_render): Initialize `worker->gray_lines' (problem found by
-       valgrind).
-
-       (FT_RASTER_OPTION_ANTI_ALIASING, DEBUG_RASTER): Dont' #undef, just
-       comment out.
-
-2009-09-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Improve configure.raw for cross build.
-
-       * builds/unix/configure.raw: Remove temporal files created by the
-       suffix checking for CC_BUILD.  Set XX_ANSIFLAGS and XX_CFLAGS when
-       cross compiler is GCC.  AC_PROG_CC checks whether the cross compiler
-       is GCC, its result is stored in GCC.
-
-2009-09-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       [BDF] Modify hash API to take size_t value instead of void *.
-
-       The hash API in BDF driver is designed to be generic, it takes
-       void * typed data.  But BDF driver always gives an unsigned long
-       integer (the index to a property).  To reduce non-essential
-       casts from unsigned long to void* and from void* to unsigned
-       long, the hash API is changed to take size_t integer.
-       The issue of incompatible cast between unsigned long and void*
-       on LLP64 platform is reported by NightStrike from MinGW-Win64
-       project.  See
-       http://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html
-
-       * src/bdf/bdf.h: The type of hashnode->data is changed from
-       void* to size_t.
-
-       * src/bdf/bdflib.c (hash_insert): Get size_t data, instead of
-       void* data.
-       (bdf_create_property): Get the name length of new property by
-       size_t variable, with a cut-off at FT_ULONG_MAX.
-       (_bdf_set_default_spacing): Get the name length of the face by
-       size_t variable, with a cut-off at 256.
-       (bdf_get_property): Get the property id by size_t variable to
-       reduce the casts between 32-bit prop ID & hashnode->data during
-       simple copying.
-       (_bdf_add_property): Ditto.
-       (_bdf_parse_start): Calculate the index to the property array
-       by size_t variable.
-       (bdf_get_font_property): Drop a cast to unsigned long.
-
-2009-09-10  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       [Win64] Improve the computation of random seed from stack address.
-
-       On LLP64 platform, the conversion from pointer to FT_Fixed need
-       to drop higher 32-bit.  Explict casts are required. Reported by
-       NightStrike from MinGW-w64 project.  See
-       http://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html
-
-       * src/cff/cffgload.c: Convert the pointers to FT_Fixed explicitly.
-
-       * src/psaux/t1decode.c: Ditto.
-
-
-2009-09-03  Werner Lemberg  <wl@gnu.org>
-
-       [raster] Improvements for stand-alone mode.
-
-       * src/raster/rules.mk: Don't handle ftmisc.h.  It is needed for
-       stand-alone mode only.
-
-       * src/raster/ftmisc.h (FT_MemoryRec , FT_Alloc_Func, FT_Free_Func,
-       FT_Realloc_Func): Copy declarations from ftsystem.h.
-
-2009-09-02  Bram Tassyns  <bramt@enfocus.be>
-
-       Improve vertical metrics calculation (Savannah bug #27364).
-
-       The calculation of `vertBearingX' is not defined in the OTF font
-       spec so FreeType does a `best effort' attempt.  However, this value
-       is defined in the PDF and PostScript specs, and that algorithm is
-       better than the one FreeType currently uses:
-
-         FreeType: Use the middle of the bounding box as the X coordinate
-                   of the vertical origin.
-
-         Adobe PDF spec: Use the middle of the horizontal advance vector as
-                         the X coordinate of the vertical origin.
-
-       FreeType's algorithm goes wrong if you have a really small glyph
-       (like the full-width, circle-like dot at the end of the sentence, as
-       used in CJK scripts) with large bearings.  With the FreeType
-       algorithm this dot gets centered on the baseline; with the PDF
-       algorithm it gets the correct location (in the top right).  Note
-       that this is a serious issue, it's like printing the dot at the end
-       of a Roman sentence at the center of the textline instead of on the
-       baseline like it should. So i believe the PDF spec's algorithm
-       should be used in FreeType as well.
-
-       The `vertBearingY' value for such small glyphs is also very strange
-       if no `vmtx' information is present, since the height of the bbox is
-       not representable for the height of the glyph visually (the
-       whitespace up to the baseline is part of the glyph).  The fix also
-       includes some code for a better estimate of `vertBearingY'.
-
-       * src/base/ftobjs.c (ft_synthesize_vertical_metrics): `vertBearingX'
-       is now calculated as described by the Adobe PDF Spec.  Estimate for
-       `vertBearingY' now works better for small glyphs completely above or
-       below the baseline into account.
-
-       * src/cff/cffgload.c (cff_slot_load): `vertBearingX' is now
-       calculated as described by the Adobe PDF Spec.  Vertical metrics
-       information was always ignored when FT_CONFIG_OPTION_OLD_INTERNALS
-       was not defined.
-
-       * src/truetype/ttgload.c (compute_glyph_metrics): `vertBearingX' is
-       now calculated as described by the Adobe PDF Spec.
-
-2009-09-01  John Tytgat  <John.Tytgat@esko.com>
-
-       Fix custom cmap for empty Type 1 font (Savannah bug #27294).
-
-       * include/freetype/internal/t1types.h (T1_EncodingRecRec_): Update
-       comment to reflect revised code_last meaning.
-       * src/type1/t1load.c (T1_Open_Face), src/type42/t42objs.c
-       (T42_Open_Face): Assign max_char as highest character code + 1 and
-       use this for T1_EncodingRecRec_::code_last.
-       * src/psaux/t1cmap.c (t1_cmap_custom_init): Follow revised
-       T1_EncodingRecRec_::code_last meaning.
-
-2009-08-25  Werner Lemberg  <wl@gnu.org>
-
-       Fix rendering of horizontally compressed CFFs.
-       Bug reported by Ivan Nincic <inincic@pdftron.com>.
-
-       * src/cff/cffgload.c (cff_slot_load): Thinko: Check `xx' element of
-       `font_matrix' also.
-
-       * docs/CHANGES: Updated.
-
-2009-08-03  suyu0925@gmail.com
-
-       Don't call `ft_fseek' every time when executing `ft_fread'.
-
-       * src/base/ftstream.c (FT_Stream_Seek), src/base/ftsystem.c
-       (ft_ansi_stream_io): Implement it.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Cast a charcode to 32-bit in cmap format 14 parser.
-       
-       * src/sfnt/ttcmap.c (tt_cmap14_char_var_index,
-       tt_cmap14_char_var_isdefault, tt_cmap14_char_variants,
-       tt_cmap14_variant_chars): Correct mismatches from
-       FT_CMap_CharVarIndexFunc prototype, FT_ULong arguments
-       are replaced by FT_UInt32 arguments.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Cast a charcode to 32-bit in cmap format 12 parser.
-
-       * src/sfnt/ttcmap.c (tt_cmap12_char_next):
-       Insert explicit cast from FT_UFast to FT_UInt32
-       for return value.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psaux: Fix a few casts to FT_Int32 value.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings):
-       Fix a few casts setting `value' from FT_Long to FT_Int32,
-       because `value' is typed as FT_Int32 since 2009-06-22.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Fix a data type mismatching with its source.
-
-       * src/sfnt/ttcmap.c (tt_cmap13_char_next): Fix the
-       type of `gindex' from FT_ULong to FT_UInt because
-       it is set by FT_UInt tt_cmap13_char_map_binary() or
-       TT_CMap13->cur_gindex.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Extend a few local variables to load 32-bit values.
-
-       * src/sfnt/ttkern.c (tt_face_load_kern): Extend `count'
-       and `kern' to load 32-bit values.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pfr: Extend `num_aux' to take 32-bit value.
-
-       * src/pfr/pfrload.c (pfr_phy_font_load): Extend
-       `num_aux' to load 32-bit value.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Truncate FT_ULong `nprops' to fit to int PCF_Face->nprops.
-
-       * src/pcf/pcfread.c (pcf_get_properties): Load `nprops'
-       as FT_ULong value from PCF file, but truncate it as
-       int to fit PCF_Face->nprops.  The number of truncated
-       properties is shown in the trace message.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Extend a few local variables to reduce the casts.
-
-       * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
-       Extend `type' and `rest' to take FT_ULong values.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Extend `settingTable' to take 32-bit offset.
-
-       * src/gxvalid/gxvfeat.c (gxv_feat_name_validate):
-       Extend `settingTable' to take 32-bit offset.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       autofit: Cast FT_Long glyph_count to compare with FT_UInt GID.
-
-       * src/autofit/afglobal.c (af_face_globals_is_digit,
-       af_face_globals_compute_script_coverage): Cast FT_Long
-       globals->glyph_count to FT_ULong, to compare with FT_UInt
-       gindex.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Exclude 16-bit system in invalid pitch/height check.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic):
-       pitch and height are typed as FT_UInt but checked to fit
-       16-bit range, to avoid the overflows.  On 16-bit system,
-       this checking inserts a conditional that never occurs.
-
-2009-07-03  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cff: Type large constants > 0x7FFF as long for 16-bit systems.
-
-       * src/cff/cffload.c (cff_charset_load): Type large
-       constants > 0x7FFF as long, because normal constants
-       are typed signed integer that is less than 0x8000 on
-       16-bit systems.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       base: Remove an unused variable.
-
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Remove an
-       unused variable `library'.  glyph->library is used.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Check higher bits in flags for non ILP32 systems.
-
-       4 public functions ought to take FT_ULong flags, but take
-       FT_UInt flags. To keep binary compatibility, we drop higher
-       bits on non ILP32 platforms,
-               ILP64 systems: No drop occurs.
-               LP64 systems: Higher bits are not used.
-               16-bit systems: Drop can occur.
-       See
-       http://lists.gnu.org/archive/html/freetype-devel/2008-12/msg00065.html
-       These functions will be refined to take FT_ULong flags in
-       next bump with incompatible API change.
-
-       * src/cache/ftcbasic.c (FTC_ImageCache_Lookup):
-       Check `flags' in `type', the 2nd argument.
-       (FTC_SBitCache_Lookup): Ditto.
-       (FTC_ImageCache_LookupScaler): Check `load_flags',
-       the 3rd argument.
-       (FTC_SBitCache_LookupScaler): Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Ignore invalid GIDs in glyph name lookup.
-
-       * include/freetype/internal/fttrace.h:
-       New trace module for sfdriver.c is added.
-
-       * src/sfnt/sfdriver.c (sfnt_get_name_index):
-       Restrict glyph name lookup to FT_UInt GID.
-       Genuine TrueType can hold 16-bit glyphs.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Fix a comparison between FT_Long and FT_ULong.
-
-       * src/pcf/pcfread.c (pcf_get_bitmaps): Return an error
-       if PCF_Face->nemetrics is negative.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Guarantee `nFeatureFlags' size up to 32-bit.
-
-       * src/gxvalid/gxvmort.c (gxv_mort_featurearray_validate):
-       Extend the 3rd argument `nFeatureFlags' to FT_ULong.
-       * src/gxvalid/gxvmort.h: Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Insert explicit cast for LP64 system.
-
-       * src/sfnt/ttkern.c (tt_face_load_kern): Insert
-       cast from unsigned long to FT_UInt32.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Guarantee `just' table size upto 32-bit.
-
-       * src/gxvalid/gxvjust.c (gxv_just_validate):
-       The type of `offset' is changed from FT_UInt to
-       FT_Offset, for 16-bit platforms.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Guarantee `trak' table size upto 32-bit.
-
-       * src/gxvalid/gxvtrak.c (gxv_trak_validate):
-       The type of `offset' is changed from FT_UInt to
-       FT_Offset, for 16-bit platforms.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       type1: Fix a data type mismatching with its source.
-
-       * include/freetype/internal/t1types.h: The type of
-       T1_Face->buildchar is matched with T1_Decorder->top.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pfr: Fix a data type mismatching with its source.
-
-       * src/pfr/pfrtypes.h: The type of PFR_KernItem->offset
-       is extended from FT_UInt32 to FT_Offset, because it is
-       calculated with the pointer difference, in
-       pfr_extra_item_load_kerning_pairs().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pfr: Fix a data type mismatching with its source.
-
-       * src/pfr/pfrtypes.h: The type of PFR_PhysFont->chars_offset
-       is extended from FT_UInt32 to FT_Offset, because it is
-       calculated with the pointer difference in pfr_phy_font_load().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pfr: Fix a data type mismatching with its source.
-
-       * src/pfr/pfrtypes.h: The type of PFR_PhyFont->bct_offset
-       is extended from FT_UInt32 to FT_Long, because it is
-       loaded by FT_STREAM_POS() in pfr_phy_font_load().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Improve the format in debug message.
-
-       * src/smooth/ftgrays.c (gray_dump_cells): Improve the
-       format specifications to dump variables.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Fix a data type mismatching with its source.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): The type of
-       local `flags' is matched with FT_Face->face_flags.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psaux: Fix a data type mismatching with its source.
-
-       * include/freetype/internal/psaux.h: The type of
-       T1_DecorderRec.buildchar is matched with
-       T1_DecorderRec.top.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Extend TrueType GX packed deltas to FT_Offset.
-
-       * src/truetype/ttgxvar.c (ft_var_readpackeddeltas):
-       The type of 2nd argument `delta_cnt' is changed from
-       FT_Int to FT_Offset, because its source can be cvt
-       table size calculated from stream position.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Extend mmvar_len to hold size_t values.
-
-       * src/truetype/ttgxvar.h: The type of
-       GX_BlendRec.mmvar_len is changed from FT_Int to
-       FT_Offset, because TT_Get_MM_Var() calculates it
-       by sizeof() results.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Check invalid function number in IDEF instruction.
-
-       * src/truetype/ttinterp.c (Ins_IDEF): Check
-       if the operand fits to 8-bit opcode limitation.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Check invalid function number in FDEF instruction.
-
-       * src/truetype/ttinterp.c (Ins_FDEF): Check
-       if the operand fits 16-bit function number.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Truncate the deltas of composite glyph at 16-bit values.
-
-       * src/truetype/ttgload.c (load_truetype_glyph):
-       Insert cast from FT_Long (deltas[i].{x,y}) to
-       FT_Int16 in the summation of deltas[] for composite
-       glyphs.  Because deltas[i] is typed as FT_Pos,
-       its component x, y are typed as FT_Long, but
-       their sources are always FT_Int16 when they are
-       loaded by ft_var_readpackeddeltas().  However,
-       the limitation about the summed deltas is unclear.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Truncate the instructions upto 16-bit per a glyph.
-
-       * src/truetype/ttgload.c (TT_Hint_Glyph): Truncate
-       the instructions upto 16-bit length per a glyph.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Cast the numerical operands to 32-bit for LP64 systems.
-
-       * src/truetype/ttinterp.c (Ins_SPHIX, INS_MIAP,
-       Ins_MIRP): Insert cast from long (args[], the
-       operands passed to TrueType operator) to FT_Int32
-       (the argument of TT_MulFix14()).
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Cast the project vector to 32-bit for LP64 system.
-
-       * src/truetype/ttinterp.c (Project, DualProject):
-       Insert casts from FT_Pos (the arguments `dx', `dy')
-       to FT_UInt32 (the argument to TT_DotFix14()).
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Cast the scaling params to 32-bit for LP64 system.
-
-       * src/truetype/ttgload.c (TT_Process_Composite_Component):
-       Insert casts from long (return value of FT_MulFix()) to
-       FT_Int32 (the argument to FT_SqrtFixed()).
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Cast a character code to FT_UInt32 for LP64 system.
-
-       * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary,
-       tt_cmap14_variants, tt_cmap14_char_variants,
-       tt_cmap14_def_char_count, tt_cmap14_get_def_chars,
-       tt_cmap14_get_nondef_chars, tt_cmap14_variant_chars)
-       Insert casts when FT_UInt32 variable is loaded by
-       TT_NEXT_{UINT24|ULONG}.  Because most of them are
-       compared with FT_UInt32 values in public API, replacing
-       FT_UFast is not recommended.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Cast a character code to FT_UInt32 for LP64 system.
-
-       * src/sfnt/ttcmap.c (tt_cmap4_init, tt_cmap4_next):
-       Insert the casts from unsigned long constant to
-       FT_UInt32.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Extend TT_BDF->strings_size to FT_ULong for huge BDF.
-
-       * 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
-       restrict the length of string.
-       * src/sfnt/ttbdf.c: The scratch variable `strings'
-       to load TT_BDF->string_size is matched with
-       TT_BDF->string_size.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psaux: Handle the string length by FT_Offset variables.
-
-       * src/psaux/afmparse.c (afm_parser_next_key,
-       afm_tokenize, afm_parse_track_kern,
-       afm_parse_kern_pairs, afm_parse_kern_data,
-       afm_parser_skip_section, afm_parser_parse):
-       The length of key is handled by FT_Offset,
-       instead of FT_UInt.  Although the length of
-       PostScript strings or name object is 16-bit,
-       AFM_STREAM_KEY_LEN() calculates the length
-       from the pointer difference.
-
-       * src/psaux/afmparse.h (afm_parser_next_key):
-       Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Fix some data types mismatching with their sources.
-
-       * src/pcf/pcfread.c (pcf_get_bitmaps): The types
-       of `nbitmaps', `i', `sizebitmaps' are matched with
-       the type of area FT_Bitmap.pitch * FT_Bitmap.rows.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Handle the string length by size_t variables.
-
-       * src/pcf/pcfread.c (pcf_interpret_style): The types
-       of nn, len, lengths[4] are changed to size_t, because
-       they are loaded by (or compared with) ft_strlen().
-
-       * src/pcf/pcfutil.c (BitOrderInvert, TwoByteSwap,
-       FourByteSwap): The type of the 2nd argument `nbytes'
-       is changed to size_t, for similarity with ANSI C
-       string functions.
-
-       * src/pcf/pcfdrivr.c (PCF_Glyph_Load): The type of
-       `bytes' is changed to FT_Offset, because it is passed
-       to FT_ALLOC(), via ft_glyphslot_alloc_bitmap().  At
-       least, using unsigned type is better.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Fix some data types mismatching with their sources.
-
-       * src/pcf/pcfread.c (pcf_seek_to_table_type,
-       pcf_has_table_type): The type of 3rd argument
-       `ntables' is matched with PCF_Toc->count.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       otvalid: Truncate the glyph index to 16-bit.
-
-       * src/otvalid/otvalid.c (otv_validate): Checks
-       face->num_glyphs does not exceed 16-bit limit,
-       pass FT_UInt num_glyphs to backend functions
-       otv_{GPOS|GSUB|GDEF|JSTF|MATH}_validate().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Insert explict casts for LP64 systems.
-
-       * src/cache/ftcbasic.c (FTC_ImageCache_Lookup,
-       FTC_SBitCache_Lookup): The type of FTC_ImageType->width
-       is FT_Int, so the cast to unsigned larger type FT_ULong
-       is introduced for the comparisons with 0x10000L for
-       LP64 platform.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Fix some data types mismatching with their sources.
-
-       * src/cache/ftccache.h: The type of return value
-       by FTC_Node_WeightFunc function is changed to
-       FT_Offset.  The type of FTC_CacheClass->cache_size
-       is changed to FT_Offset, too.
-
-       * src/cache/ftccback.h (ft_inode_weight,
-       ftc_snode_weight): Ditto.
-
-       * src/cache/ftccmap.c (ftc_cmap_node_weight): Ditto.
-
-       * src/cache/ftcimage.c (ftc_inode_weight,
-       FTC_INode_Weight): Ditto.
-
-       * src/cache/ftcsbits.c (ftc_snode_weight,
-       FTC_SNode_Weight): Ditto.
-
-       * src/cache/ftcmru.h: The type of
-       FTC_MruListClass->node_size is changed to FT_Offset,
-       because it is passed to FT_ALLOC() to specify the
-       size of buffer.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       XXX_cmap_encoding_char_next() return FT_UInt32 values.
-
-       * include/freetype/internal/services/svpscmap.h:
-       The size of the charcode value returned by
-       the function typed PS_Unicodes_CharNextFunc is
-       matched with its input charcode value.
-
-       * src/cff/cffmap.c (cff_cmap_encoding_char_next,
-       cff_cmap_unicode_char_next): Ditto.
-
-       * src/pfr/pfrmap.c (pfr_cmap_encoding_char_next):
-       Ditto.
-
-       * src/psaux/t1cmap.c (t1_cmap_std_char_next,
-       t1_cmap_custom_char_next, t1_cmap_unicode_char_next):
-       Ditto.
-
-       * src/psnames/psmodule.c (ps_unicodes_char_next):
-       Ditto.
-
-       * src/winfonts/winfnt.c (fnt_cmap_char_next):
-       Ditto.
-
-       * src/sfnt/ttcmap.c (tt_cmap0_char_next,
-       tt_cmap2_char_next, tt_cmap4_char_next,
-       tt_cmap6_char_next, tt_cmap10_char_next,
-       tt_cmap12_char_next, tt_cmap13_char_next): Ditto.
-       (tt_cmap14_char_variants): Handle base unicode
-       codepoint by FT_UInt32 variable to avoid overflow
-       on 16-bit platforms.
-       (tt_cmap14_ensure): The type of `num_results' is
-       extend to FT_UInt32, to cover unsigned 32-bit
-       `numVarSelectorRecords' in cmap14 table header.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Extend TT_Face->num_locations for broken TTFs.
-
-       * include/freetype/internal/tttypes.h:
-       TT_Face->num_locations are extended from FT_UInt
-       to FT_ULong, to stand with broken huge loca table.
-       Some people insists there are broken TTF including
-       the glyphs over 16-bit limitation, in PRC market.
-       * src/truetype/ttpload.c (tt_face_load_loca):
-       Remove unrequired 16-bit truncation for FT_UInt
-       TT_Face->num_locations.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Fix some data types mismatching with their sources.
-
-       * src/smooth/ftgrays.c: The type of `TCoord' is
-       matched to `TPos', because they are mixed in
-       gray_set_cell().  The type of TCell->x is extended
-       to `TPos', because gray_find_cell() sets it by
-       TWorker.ex.  The type of TCell->cover is extended
-       to `TCoord', because gray_render_scanline() adds
-       TCoord value to it.  The type of TWork.cover is matched
-       with TCell->cover.  The types of
-       TWork.{max_cells,num_cells} are changed to FT_PtrDist,
-       because they are calculated from the memory addresses.
-       The type of TWork.ycount is changed to TPos, because
-       it is calculated from TPos variables.
-       (gray_find_cell): The type of `x' is matched with
-       its initial value ras.ex.
-       (gray_render_scanline): The types of `mod', `lift'
-       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 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.
-       (gray_hline): The argument `acount' is extended to
-       TCoord, to match with the parameters in the callers.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cff: Fix some data types mismatching with their sources.
-
-       * src/cff/cffobjs.c (cff_face_init): The type of
-       `scaling' is matched with the scaling parameter
-       in FT_Matrix_Multiply_Scaled() and
-       FT_Vector_Transform_Scaled().
-
-       * src/cff/cffparse.c (cff_parse_real): The type of
-       `power_ten', `scaling', `exponent_add',
-       `integer_length', `fraction_length',
-       `new_fraction_length' and `shift' are matched with
-       the type of `exponent' to avoid unexpected truncation.
-       (cff_parse_fixed_scaled): The type of `scaling' is
-       matched with the `scaling' argument to
-       cff_parse_real().
-       (cff_parse_fixed_dynamic): Ditto.
-       (cff_parse_font_matrix): The type of `scaling' is
-       matched with the `scaling' argument to
-       cff_parse_dynamic().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       autofit: Fix some data types mismatching with their sources.
-
-       * src/autofit/afglobal.c: Correct the type of
-       AF_FaceGlobalsRec.glyph_count to match with
-       FT_Face->num_glyphs.
-       (af_face_globals_compute_script_coverage):
-       Insert explicit cast to compare
-       FT_Long AF_FaceGlobalsRec.glyph_count versus
-       FT_UInt gindex.  The type of `nn' is changed
-       to scan glyph index upto AF_FaceGlobalsRec.glyph_count.
-       (af_face_globals_get_metrics): The type of `script_max'
-       is changed to cover size_t value.  Insert explicit cast
-       to compare FT_Long AF_FaceGlobalsRec.glyph_count versus
-       FT_UInt gindex.
-
-       * src/autofit/afhints.c (af_axis_hints_new_segment):
-       Insert explicit cast to calculate `big_max' from
-       integer and size_t values.
-       (af_axis_hints_new_edge): Ditto.
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_blues):
-       The type of `best_y' is matched to FT_Vector.y.
-       (af_latin_compute_stem_width): The type of `delta' is
-       matched to `dist' and `org_dist'.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       autofit: Count the size of the memory object by ptrdiff_t.
-
-       * src/autofit/afcjk.c (af_cjk_hint_edges): The
-       number of edges `n_edges' should be counted by
-       FT_PtrDist variable instead of FT_Int.
-
-       * src/autofit/aflatin.c (af_latin_hint_edges):
-       Ditto.
-
-       * src/autofit/aftypes.h: In AF_ScriptClassRec,
-       the size of metric `script_metrics_size' should
-       be counted by FT_Offset variable instead of FT_UInt.
-
-       * src/autofit/afhints.c
-       (af_glyph_hints_align_strong_points): The cursors
-       for the edges `min', `max', `mid' in the memory
-       buffer should be typed FT_PtrDist.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       autofit: Fix for unused variable `first'.
-
-       * src/autofit/afhints.c (af_glyph_hints_reload): Insert
-       FT_UNUSED() to hide the unused variable warning.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Improve bitmap size or pixel variables for 16-bit systems.
-
-       * include/freetype/config/ftstdlib.h: Introduce
-       FT_INT_MIN, to use in signed integer overflow in
-       16-bit and 64-bit platforms.
-       
-       * include/freetype/internal/fttrace.h: Add a tracer
-       to ftsynth.c.
-       
-       * src/base/ftbitmap.c (FT_Bitmap_Embolden): Check
-       invalid strength causing integer overflow on 16-bit
-       platform.
-       
-       * src/base/ftcalc.c (ft_corner_orientation): Change
-       the internal calculation from FT_Int to FT_Long, to
-       avoid an overflow on 16-bit platforms.  The caller of
-       this function should use only the sign of result,
-       so the cast to FT_Int is acceptable.
-       
-       * src/base/ftsynth.c: Introduce a tracer for synth module.
-       (FT_GlyphSlot_Embolden): Check invalid strength causing
-       integer overflow on 16-bit platform.
-       
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): The glyph index
-       in FT2 API is typed as FT_UInt, although BDF driver
-       can handle unsigned long glyph index internally.  To
-       avoid integer overflow on 16-bit platform, too large
-       glyph index should be excluded.
-       (BDF_Glyph_Load): The glyph pitch in FT2 is typed as
-       FT_UInt, although BDF driver can handle unsigned long
-       glyph pitch internally.  To avoid integer overflow on
-       16-bit platform, too large glyph pitch should not be
-       returned.
-       
-       * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): The glyph
-       pitch in FT2 is typed as FT_UInt, although PFR font
-       format can include huge bitmap glyph with 24-bit pitch
-       (however, a glyph spends 16.7 pixel, it's not realistic).
-       To avoid integer overflow on 16-bit platform, huge
-       bitmap glyph should be excluded.
-       
-       * src/smooth/ftgrays.c (gray_hline): As FT_Span.x is
-       truncated to fit its type (16-bit short), FT_Span.y
-       should be truncated to fit its type (FT_Int).
-       
-       * src/cff/cffdrivr.c (cff_get_ros): CFF specification
-       defines the supplement in ROS as a real number.
-       Truncate it to fit public FT2 API.
-       
-       * src/cff/cffparse.c (cff_parse_cid_ros): Warn the
-       supplement if it is truncated or rounded in cff_get_ros().
-       
-       * src/cff/cfftypes.h: Change the type of internal variable
-       `supplement' from FT_Long to FT_ULong to fit the signedness
-       to the type in public API.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psaux: Prevent invalid arguments to afm_parser_read_vals().
-
-       * src/psaux/afmparse.c (afm_parser_read_vals): Change
-       the type of `n' to prevent negative number how many
-       arguments should be parsed.
-
-       * src/psaux/afmparse.h (afm_parser_read_vals): Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       base: Prevent some overflows on LP64 systems.
-
-       * src/base/ftadvance.c (FT_Get_Advances): Cast the
-       unsigned long constant FT_LOAD_ADVANCE_ONLY to FT_UInt32
-       for LP64 platforms.
-
-       * src/base/ftcalc.c (FT_Sqrt32): All internal variables
-       are changed to FT_UInt32 from FT_ULong.
-       (FT_MulDiv): Insert casts to FT_Int32 for LP64 platforms.
-       This function is designed for 32-bit integer, although
-       their arguments and return value are FT_Long.
-
-       * src/base/ftobjs.c (FT_Get_Char_Index): Check `charcode'
-       is within unsigned 32-bit integer for LP64 platforms.
-       (FT_Face_GetCharVariantIndex): Check `charcode' and
-       `variantSelector' are within 32-bit integer for LP64
-       platforms.
-       (FT_Face_GetCharsOfVariant): Check `variantSelector' is
-       within unsigned 32-bit integer for LP64 platforms.
-
-       * src/base/fttrigon.c (ft_trig_downscale): The FT_Fixed
-       variable `val' and unsigned long constant FT_TRIG_SCALE
-       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>
-
-       cff: Cast the long variables to 32-bit for LP64 systems.
-
-       * src/cff/cffdrivr.c (cff_get_advances): Insert
-       explicit cast to modify a 32-bit flag by unsigned
-       long constant.
-
-       * src/cff/cffobjs.c (cff_face_init): Ditto.
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings):
-       Replace the casts to FT_Long by the casts to FT_Int32
-       for LP64 platforms.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Improve PCF_PropertyRec.value names on LP64 platforms.
-
-       * src/pcf/pcf.h: In PCF_PropertyRec.value, the member
-       `integer' is replaced by `l', `cardinal' is replaced
-       by `ul', to fix the difference between the name and
-       the types on LP64 platforms.
-
-       * src/pcf/pcfdrivr.c (pcf_get_bdf_property): Reflect
-       PCF_PropertyRec.value change, with appropriate casts
-       to FT_Int32/FT_UInt32.  Their destinations
-       BDF_PropertyRec.{integer|cardinal} are public and
-       explicitly defined as FT_Int32/FT_UInt32.
-
-       * src/pcf/pcfread.c (pcf_get_properties, pcf_load_font):
-       Reflect PCF_PropertyRec.value change.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Fix some data types mismatching with their sources.
-
-       * src/pcf/pcfdrivr.c (pcf_cmap_char_index): The type of
-       `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 cast to unsigned 32-bit
-       integer.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       bdf: Improve bdf_property_t.value names for LP64 platforms.
-
-       * src/bdf/bdf.h: In bdf_property_t.value, the member
-       `int32' is replaced by `l', `card32' is replaced by
-       `ul', to fix the difference between the name and the
-       types on LP64 platforms.
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Reflect
-       bdf_property_t.value change.
-       (bdf_get_bdf_property): Reflect bdf_property_t.value
-       change, with appropriate casts to FT_Int32/FT_UInt32.
-       Their destinations BDF_PropertyRec.{integer|cardinal}
-       are public and explicitly defined as FT_Int32/FT_UInt32.
-
-       * src/bdf/bdflib.c (_bdf_add_property): Reflect
-       bdf_property_t.value change.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       bdf: Fix some data types mismatching with their sources.
-
-       * src/bdf/bdrdrivr.c (bdf_cmap_char_index): The type
-       of `code' is matched with BDF_encoding_el->enc.
-       (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
-       cast to unsigned 32-bit integer.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       autofit: Improve Unicode range definitions.
-
-       * src/autofit/aftypes.h (AF_UNIRANGE_REC): New macro
-       to declare a range by two unsigned 32-bit integer,
-       to avoid 64-bit range definition on LP64 platforms.
-
-       * src/autofit/aflatin.c (af_latin_uniranges): Ditto.
-
-       * src/autofit/aflatin2.c (af_latin2_uniranges): Ditto.
-
-       * src/autofit/afindic.c (af_indic_uniranges): Ditto.
-
-       * src/autofit/afcjk.c (af_cjk_uniranges): Declare
-       the ranges by AF_UNIRANGE_REC.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Fix a data type mismatching with its source.
-
-       * src/smooth/ftgrays.c (gray_sweep): The type of
-       `area' is matched with the 3rd argument `area'
-       of gray_hline().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Fix a data type mismatching with its source.
-
-       * src/smooth/ftgrays.c (gray_render_line): The type
-       of `area' is matched with TWorker.area.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Disable the legacy compatibility if 16-bit system.
-
-       * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Exclude
-       the legacy behaviour from 16-bit platform, because the
-       current hack cannot detect the caller uses this function
-       via legacy convension.
-       (FTC_SBitCache_Lookup): Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Check 32-bit glyph index on 16-bit systems.
-
-       * src/cache/ftcbasic.c (ftc_basic_family_get_count):
-       Check overflow caused by the face including large
-       number of glyphs > 64k.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Fix some data types mismatching with their sources.
-
-       * src/cache/ftccache.c (ftc_cache_resize): The types of
-       `p', `mask', `count' are matched with FTC_Cache->{p,mask}.
-       (FTC_Cache_Clear): The type of `old_index' is matched to
-       FTC_Cache->{p,mask}.
-
-       * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): The type
-       of `_idx' is matched with FTC_Cache->{p,mask}.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Fix some data types mismatching with their sources.
-
-       * src/cache/ftcsbits.c (ftc_snode_load): The types
-       of `xadvance' and `yadvance' are matched with
-       FT_GlyphSlot->advance.{x|y}.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Cast NULL to a required function type explicitly.
-
-       * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID):
-       Insert explicit cast from NULL to function type.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       fttypes.h: Cast FT_MAKE_TAG output to FT_Tag exlicitly.
-
-       * include/freetype/fttypes.h (FT_MAKE_TAG):
-       Cast the result to FT_Tag.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psnames: Handle Unicode codepoints by FT_UInt32 variables.
-
-       * src/psnames/psmodule.c (BASE_GLYPH): Cast the result
-       to unsigned 32-bit integer for LP64 platform.
-       (ps_unicode_value): Return the value by unsigned 32-bit
-       integer instead of unsigned long.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psaux: Use size_t variable to pass the buffer size.
-
-       * src/psaux/psaux.h (to_bytes): The type of `max_bytes'
-       (the argument to pass the buffer size) is changed to
-       size_t, to match with ANSI C string functions.
-
-       * src/psaux/psconv.h (PS_Conv_StringDecode,
-       PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Ditto.
-
-       * src/psaux/psconv.c (PS_Conv_StringDecode,
-       PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Ditto.
-
-       * src/psaux/psobjs.h (ps_parser_to_bytes): Ditto.
-
-       * src/psaux/psobjs.c (ps_parser_to_bytes): Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       type1: Use size_t variable to pass the string length.
-
-       * psaux.h: The type of `len' (the argument to pass
-       the buffer size to the function in AFM_ParserRec)
-       is changed to size_t, to match with ANSI C string
-       functions.
-
-       * t1afm.c (t1_get_index): Ditto.
-
-       * test_afm.c (dummy_get_index): Ditto.
-
-       * afmparse.c (afm_parser_read_vals): To call
-       AFM_ParserRec.get_index, the length of token
-       `len' is cast to size_t.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cid: Fix some data types mismatching with their sources.
-
-       * src/cid/cidparse.c (cid_parser_new): The types of
-       `read_len' and `stream_len' are matched to
-       FT_Stream->size.  Unrequired cast is removed.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cff: Fix for unused variable `rest'.
-
-       * src/cff/cffparse.c (cff_parse_real): Insert
-       FT_UNUSED() to hide the unused variable warning.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cff: Fix some data types mismatching with their sources.
-
-       * src/cff/cffgload.c (cff_slot_load): The types of      
-       `top_upm' and `sub_upm' are matched with
-       CFF_FontRecDict->units_per_em.
-
-       * src/cff/cffobjs.c (cff_size_select): Ditto.
-       (cff_size_request): Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       bdf: Fix some data types mismatching with their sources.
-
-       * bdflib.c (_bdf_list_ensure): The type of `num_items'
-       is matched with _bdf_list_t.used.  Also the types of
-       `oldsize', `newsize', `bigsize' are matched too.
-       (_bdf_readstream): `cursor' is used as an offset to
-       the pointer, it should be typed as FT_Offset.  Also
-       the types of `bytes', `start', `end', `avail' are matched.
-
-       * bdfdrivr.c: The type of BDF_CMap->num_encodings is
-       matched with FT_CMap->clazz->size.
-       (bdf_cmap_char_index): The types of `min', `max', `mid'
-       are matched with BDF_CMap->num_encodings.  The type of
-       `result' is matched with encoding->glyph.
-       (bdf_cmap_char_next): Ditto, the type of `code' is
-       matched with BDF_encoding_el.enc.
-       (bdf_interpret_style): The type of `lengths' is changed
-       to size_t, to take the value by ft_strlen().  Also the
-       types of `len', `nn', `mm' are matched.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Count the size of the memory object by ptrdiff_t.
-
-       * src/sfnt/ttbdf.c (tt_face_find_bdf_prop): The type of
-       `peroperty_len' is changed from FT_UInt to FT_Offset,
-       to match with size_t, which is appropriate type for the
-       object in the memory buffer.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       lzw: Count the size of the memory object by ptrdiff_t.
-
-       * src/lzw/ftzopen.h: The types of FT_LzwState->{buf_total,
-       stack_size} are changed from FT_UInt to FT_Offset, to match
-       with size_t, which is appropriate type for the object in
-       the memory buffer.
-
-       * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): The types of
-       `old_size' and `new_size' are changed from FT_UInt to
-       FT_Offset, to match with size_t, which is appropriate type
-       for the object in the memory buffer.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       otvalid: Count the table size on memory by ptrdiff_t.
-
-       * src/otvalid/otvgpos.c (otv_ValueRecord_validate):
-       Change the type of table size from FT_UInt to
-       FT_PtrDist because it is calculated by the memory
-       addresses.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       otvalid: Prevent an overflow by GPOS/GSUB 32b-bit offset.
-
-       * src/otvalid/otvgpos.c (otv_ExtensionPos_validate):
-       Extend ExtensionOffset from FT_UInt to FT_ULong, to
-       cover 32-bit offset on 16-bit platform.
-
-       * src/otvalid/otvgsub.c (otv_ExtensionSubst_validate):
-       Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       ftobjs.c: Prevent an overflow in glyph index handling.
-
-       * src/base/ftobjs.c (FT_Face_GetCharsOfVariant):
-       Improve the cast in comparison to avoid the truncation.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Improve the variable types in raccess_make_file_name().
-
-       * src/base/ftrfork.c (raccess_make_file_name):
-       Change the type of cursor variable `tmp' to const char*,
-       to prevent the unexpected modification of original pathname.
-       (raccess_make_file_name): Change the type of new_length
-       to size_t.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       ftpatent.c: Fix for unused variable `error'.
-
-       * src/base/ftpatent.c (_tt_check_patents_in_range):
-       Fix warning for unused variable `error'.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       type1: Check invalid string longer than PostScript limit.
-
-       * src/type1/t1afm.c (t1_get_index): Check invalid string
-       which exceeds the limit of PostScript string/name objects.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gzip: Use FT2 zcalloc() & zfree() in ftgzip.c by default.
-
-       * 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
-       zlib zcalloc() & zfree(), define USE_ZLIB_ZCALLOC.
-       See discussion:
-       http://lists.gnu.org/archive/html/freetype-devel/2009-02/msg00000.html
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gzip: Distinguish PureC from TurboC on MSDOS.
-
-       * src/gzip/zutil.c (zcalloc, zcfree): Enable only for
-       MSDOS platform.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Insert PureC pragma to allow unevaluated variables.
-
-       * builds/atari/ATARI.H: Insert PureC pragma not to
-       warn against set-but-unevaluated variable in gxvalid
-       module.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Pass the union by the pointer instead of the value.
-
-       * src/gxvalid/gxvcommn.h:
-         - Declare new type `GXV_LookupValueCPtr'.
-         - Update the type of the 2nd argument to pass GXV_LookupValueDesc
-           data to the function prototyped as GXV_Lookup_Value_Validate_Func,
-           from GXV_LookupValueDesc to GXV_LookupValueCPtr.
-         - Likewise for the function prototyped as
-           GXV_Lookup_Fmt4_Transit_Func.
-
-         - Declare new type `GXV_StateTable_GlyphOffsetCPtr'.
-         - Update the type of the 3rd argument to pass
-           GXV_StateTable_GlyphOffsetDesc data to the function prototyped
-           as GXV_StateTable_Entry_Validate_Func, from
-           GXV_StateTable_GlyphOffsetDesc to GXV_StateTable_GlyphOffsetCPtr.
-
-         - Declare new type `GXV_XStateTable_GlyphOffsetCPtr'.
-         - Update the type of the 3rd argument to pass
-           GXV_XStateTable_GlyphOffsetDesc data to the function prototyped
-           as GXV_XStateTable_Entry_Validate_Func,
-           from GXV_XStateTable_GlyphOffsetDesc
-           to GXV_XStateTable_GlyphOffsetCPtr.
-
-       * src/gxvalid/gxvcommn.c (gxv_LookupTable_fmt0_validate,
-       gxv_XClassTable_lookupval_validate,
-       gxv_XClassTable_lookupfmt4_transit):
-       Update from GXV_LookupValueDesc to GXV_LookupValueCPtr.
-       
-       * src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
-       gxv_bsln_LookupFmt4_transit): Ditto.
-       
-       * src/gxvalid/gxvjust.c
-       (gxv_just_pcTable_LookupValue_entry_validate,
-       gxv_just_classTable_entry_validate,
-       gxv_just_wdcTable_LookupValue_validate): Ditto.
-       
-       * src/gxvalid/gxvkern.c
-       (gxv_kern_subtable_fmt1_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvlcar.c (gxv_lcar_LookupValue_validate,
-       gxv_lcar_LookupFmt4_transit): Ditto.
-       
-       * src/gxvalid/gxvopbd.c (gxv_opbd_LookupValue_validate,
-       gxv_opbd_LookupFmt4_transit): Ditto.
-       
-       * src/gxvalid/gxvprop.c (gxv_prop_LookupValue_validate,
-       gxv_prop_LookupFmt4_transit): Ditto.
-       
-       * src/gxvalid/gxvmort4.c
-       (gxv_mort_subtable_type4_lookupval_validate): Ditto.
-       
-       * src/gxvalid/gxvmort0.c
-       (gxv_mort_subtable_type0_entry_validate): Update
-       from GXV_StateTable_GlyphOffsetDesc
-       to GXV_StateTable_GlyphOffsetCPtr.
-       
-       * src/gxvalid/gxvmort1.c
-       (gxv_mort_subtable_type1_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvmort2.c
-       (gxv_mort_subtable_type2_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvmort5.c
-       (gxv_mort_subtable_type5_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvmorx2.c
-       (gxv_morx_subtable_type2_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvmorx5.c
-       (gxv_morx_subtable_type5_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvmorx1.c
-       (gxv_morx_subtable_type1_entry_validate): Ditto.
-       (gxv_morx_subtable_type1_LookupValue_validate,
-       gxv_morx_subtable_type1_LookupFmt4_transit):
-       Update from GXV_LookupValueDesc to GXV_LookupValueCPtr.
-       
-       * src/gxvalid/gxvmorx0.c
-       (gxv_morx_subtable_type0_entry_validate): Update
-       from GXV_XStateTable_GlyphOffsetDesc
-       to GXV_XStateTable_GlyphOffsetCPtr.
-
-2009-07-29  Fabrice Bellet  <fabrice@bellet.info>
-
-       Fix Redhat bugzilla #513582 and Savannah bug #26849.
-
-       * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP) <FTC_INLINE>: Fix
-       aliasing bug.
-
-2009-07-19  Werner Lemberg  <wl@gnu.org>
-
-       Document recent library changes.
-
-       * docs/CHANGES: Do it.
-
-2009-07-17  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #23786.
-
-       * src/truetype/ttobjs.c (tt_size_init_bytecode): Don't reset x_ppem
-       and y_ppem.  Otherwise the `*_CVT_Stretched' functions in ttinterp.c
-       get never called.
-       An anonymous guy suggested this change on Savannah, and it seems to
-       be the right solution.
-
-2009-07-15  Werner Lemberg  <wl@gnu.org>
-
-       * docs/release: Updated.
-
-2009-07-15  Werner Lemberg  <wl@gnu.org>
-
-       README.CVS -> README.git
-
-       * README.CVS: Renamed to...
-       * README.git: This.
-       Updated.
-
-2009-07-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Borland C++ compiler patch proposed by Mirco Babin.
-       http://lists.gnu.org/archive/html/freetype/2009-07/msg00016.html.
-
-       * builds/exports.mk: Delete unused flags, CCexe_{CFLAGS,LDFLAGS}.
-       Fix APINAMES_C and APINAMES_EXE pathnames to reflect the platform
-       specific pathname syntax.
-       * builds/compiler/bcc.mk: Remove unused flag, CCexe_LDFLAGS.
-       Define TE = `-e' separately (bcc32 cannot specify the pathname of
-       binary executable by T = `-o').
-       Extend the large page size in linking freetype.lib.
-       Add extra CLEAN target to delete bcc specific temporary files.
-       * builds/compiler/bcc-dev.mk: Ditto.
-
-2009-07-14  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #27026.
-
-       * builds/win32/vc2005/freetype.sln: Use correct version number.
-
-2009-07-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Add a script to check the undefined and unused trace macros.
-
-       * src/tools/chktrcmp.py: A script to check trace_XXXX macros
-       that are used in C source but undefined in fttrace.h, or
-       defined in fttrace.h but unused in C sources.  See
-       http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html.
-       * docs/DEBUG: Mention on chktrcmp.py.
-       * docs/release: Ditto.
-
-2009-07-09  Werner Lemberg  <wl@gnu.org>
-
-       [ftraster] Make it compile again with -D_STANDALONE_.
-
-       * src/raster/ftraster.c [_STANDALONE_]: Define
-       FT_CONFIG_STANDARD_LIBRARY_H.
-       Include `string.h'.
-       Don't include `rastpic.h'.
-       Define FT_DEFINE_RASTER_FUNCS.
-
-2009-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Check glyph size by width/height, instead of pitch/height.
-       Suggested by der Mouse <mouse@Rodents-Montreal.ORG>.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Improve
-       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
-       the realistic case only.
-
-2009-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Register 2 missing trace components, t1afm and ttbdf.
-
-       * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( t1afm )
-       and FT_TRACE_DEF( ttbdf ).  See
-       http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html
-
-2009-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Register a trace component for ftgloadr.c.
-
-       * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( gloader ).
-       The macro `trace_gloader' was already used in the initial version
-       on 2002-02-24.
-
-2009-07-08  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Prevent the overflows by a glyph with too many points or contours.
-       The bug is reported by Boris Letocha <b.letocha@gmc.net>.  See
-       http://lists.gnu.org/archive/html/freetype-devel/2009-06/msg00031.html
-       http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00002.html  
-
-       * include/freetype/ftimage.h (FT_OUTLINE_CONTOURS_MAX,
-       FT_OUTLINE_POINTS_MAX): New macros to declare the maximum
-       values of FT_Outline.{n_contours,n_points}.
-       * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Check the
-       total numbers of points and contours cause no overflows in
-       FT_Outline.{n_contours,n_points}.
-
-       * include/freetype/internal/ftgloadr.h (FT_GLYPHLOADER_CHECK_P,
-       FT_GLYPHLOADER_CHECK_C): Compare the numbers of points and
-       contours as unsigned long number, instead of signed int, to
-       prevent the overflows on 16-bit systems.
-
-2009-07-05  Bram Tassyns  <bramt@enfocus.be>
-
-       Improve compatibility to Acroread.
-       This fixes Savannah bug #26944.
-
-       * src/cff/cffload.c (cff_charset_compute_cids): For multiple GID to
-       single CID mappings, make the lowest value win.
-
-2009-06-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       ftpatent: Fix a bug by wrong usage of service->table_info().
-       http://lists.gnu.org/archive/html/freetype-devel/2008-12/msg00039.html
-
-       * include/freetype/internal/services/svsfnt.h: Extend
-       FT_SFNT_TableInfoFunc() to take new argument to obtain the offset
-       to the specified table.
-       * src/sfnt/sfdriver.c (sfnt_table_info): Extend to return the
-       table-offset to the caller function.
-       * src/base/ftpatent.c (_tt_check_patents_in_table): Use new
-       service->table_info().
-       * src/base/ftobjs.c (FT_Sfnt_Table_Info): Synchronize to new
-       service->table_info().
-
-2009-06-28  Werner Lemberg  <wl@gnu.org>
-
-       [psaux, cff] Protect against nested `seac' calls.
-
-       * include/freetype/internal/psaux.h (T1_Decoder), src/cff/cffgload.h
-       (CFF_Decoder): Add `seac' boolean variable.
-
-       * src/cff/cffgload.c (cff_operator_seac), src/psaux/t1decode.c
-       (t1operator_seac): Use it.
-
-2009-06-28  Werner Lemberg  <wl@gnu.org>
-
-       Thinko.
-
-       * src/psaux/t1decode.c (t1operator_seac)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Test for existence of incremental
-       interface.
-
-2009-06-28  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h [FT_CONFIG_OPTION_INCREMENTAL]: Define.
-
-2009-06-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Add tools to preprocess the source files for AtariST PureC.
-
-       * builds/atari/deflinejoiner.awk: New file to filter C source files
-       for broken C preprocessor of PureC compiler.
-
-       * builds/atari/gen-purec-patch.sh: New file to generate a patch set
-       for PureC, by using deflinejoiner.awk.
-
-2009-06-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Keep existing modules.cfg in the building tree.
-
-       * configure: If `configure' is executed outside of the source tree,
-       an existing `modules.cfg' file in the build directory should be
-       kept, not overwritten by the version in the source tree.
-
-2009-06-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Filter --srcdir= option before invoking builds/unix/configure.
-
-       * configure: If builds/unix/configure is invoked with --srcdir
-       option, the option should take `builds/unix' directory instead of
-       the top source directory.  Thus the configure script in the top
-       directory should modify the --srcdir= option if
-       `builds/unix/configure' is invoked.
-
-2009-06-27  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.
-       http://lists.gnu.org/archive/html/freetype-devel/2009-04/msg00036.html
-
-2009-06-26  Werner Lemberg  <wl@gnu.org>
-
-       [truetype] Remove TT_SubGlyphRec.
-
-       * src/truetype/ttobjs.h (TT_SubGlyphRec): Removed, unused.
-
-2009-06-26  Werner Lemberg  <wl@gnu.org>
-
-       * */*: For warning messages, replace FT_ERROR with FT_TRACE0.
-
-       FT_ERROR is now used only if a function produces a non-zero `error'
-       value.
-
-       Formatting, improving and harmonizing debug strings.
-
-2009-06-25  Werner Lemberg  <wl@gnu.org>
-
-       Provide version information better.
-
-       * src/base/ftinit.c (FT_Init_FreeType): Don't set version here
-       but...
-       * src/base/ftobjs.c (FT_New_Library): Here.
-
-2009-06-22  Werner Lemberg  <wl@gnu.org>
-
-       Use 16.16 format while parsing Type 1 charstrings.
-       This fixes Savannah bug #26867.
-
-       Previously, only integers have been used which can lead to serious
-       rounding errors.
-
-       However, fractional values are only used internally; after the
-       charstrings (of either Type 1 or 2) have been processed, the
-       resulting coordinates get rounded to integers currently -- before
-       applying scaling.  This should be fixed; at the same time a new load
-       flag should be introduced, to be used in combination with
-       FT_LOAD_NO_SCALE, which indicates that font units are returned in
-       16.16 format.  Similarly, the incremental interface should be
-       extended to allow fractional values for metrics.
-
-       * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `shift'
-       field.
-       * include/freetype/internal/pshints.h (T1_Hints_SetStemFunc,
-       T1_Hints_SetStem3Func): Use FT_Fixed for coordinates.
-
-       * src/psaux/psobjs.c: Include FT_INTERNAL_CALC_H.
-       (t1_build_add_point): Always convert fixed to integer.
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings):
-       Use 16.16 format everywhere (except for large integers followed by a
-       `div').
-       [CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS]: Remove #ifdef and activate
-       code uncoditionally.
-       Add support for random numbers and update remaining code
-       accordingly; this should work now.
-       (t1_operator_seac): Updated.
-       * src/psaux/pshrec.c: Include FT_INTERNAL_CALC_H.
-       (ps_hints_t1stem3, t1_hints_stem): Updated.
-
-       * src/cid/cidgload.c: Include FT_INTERNAL_CALC_H.
-       (cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL],
-       (cid_face_compute_max_advance, cid_slot_load_glyph): Updated.
-
-       * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String)
-       [FT_CONFIG_OPTION_INCREMENTAL], (T1_Get_Advances, T1_Load_Glyph):
-       Updated.
-       * src/type1/t1load.c: Include FT_INTERNAL_CALC_H.
-       * src/type1/t1objs.c (T1_Face_Init): Updated.
-
-2009-06-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshrec.c: Use PSH_Err_Ok.
-
-2009-06-21  Werner Lemberg  <wl@gnu.org>
-
-       Code beautification.
-
-       * src/type1/t1load.c (FT_INT_TO_FIXED): Removed.
-       Replace everywhere with INT_TO_FIXED.
-       (FT_FIXED_TO_INT): Move to ...
-       * include/freetype/internal/ftcalc.h (FIXED_TO_INT): Here.
-       Update all users.
-
-2009-06-20  Werner Lemberg  <wl@gnu.org>
-
-       Remove unused variables.
-
-       * include/freetype/internal/psaux.h (T1_BuilderRec),
-       src/cff/cffgload.h (CFF_Builder): Remove `last'.
-       Update all users.
-
-2009-06-20  Werner Lemberg  <wl@gnu.org>
-
-       [psaux] Check large integers while parsing charstrings.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Large
-       integers must be followed by a `div' operator.
-
-2009-06-20  Werner Lemberg  <wl@gnu.org>
-
-       [cff] Revert last change.
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Do it.
-       Next time, don't confuse Type 2 charstring opcodes with TOP DICT
-       values...
-
-2009-06-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/aflatin.c (af_latin_metrics_check_digits): Fix
-       compiler warning.
-
-2009-06-20  Werner Lemberg  <wl@gnu.org>
-
-       * builds/compiler/gcc.mk (CFLAGS): Use -O3, not -O6.
-
-2009-06-19  Werner Lemberg  <wl@gnu.org>
-
-       [cff] Fix handling of reserved byte 0xFF.
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Abort if byte
-       0xFF is encountered.
-
-2009-06-19  Werner Lemberg  <wl@gnu.org>
-
-       Improve debug messages for Type1 charstrings.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Emit newlines
-       after instructions.
-       Prettify output.
-
-2009-06-19  Werner Lemberg  <wl@gnu.org>
-
-       More ftgray fixes for FT_STATIC_RASTER.
-       Problems reported by suyu@cooee.cn.
-
-       * src/smooth/ftgrays.c (gray_move_to, gray_raster_render): Use
-       RAS_VAR.
-
-2009-06-18  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2009-06-18  Werner Lemberg  <wl@gnu.org>
-
-       Fix B/W rasterization of subglyphs with different drop-out modes.
-
-       Normally, the SCANMODE instruction (if present) to set the drop-out
-       mode in a TrueType font is located in the `prep' table only and thus
-       valid for all glyphs.  However, there are fonts like `pala.ttf'
-       which additionally contain this instruction in the hinting code of
-       some glyphs (but not all).  As a result it can happen that a
-       composite glyph needs multiple drop-out modes for its subglyphs
-       since the rendering state gets reset for each subglyph.
-
-       FreeType collects the hinted outlines from all subglyphs, then it
-       sends the data to the rasterizer.  It also sends the drop-out mode
-       -- after hinting has been applied -- and here is the error: It sends
-       the drop-out mode of the last subglyph only; drop-out modes of all
-       other subglyphs are lost.
-
-       This patch fixes the problem; it adds a second, alternative
-       mechanism to pass the drop-out mode: For each contour, the
-       rasterizer now checks the first `tags' array element.  If bit 2 is
-       set, bits 5-7 contain the contour's drop-out mode, overriding the
-       global drop-out mode.
-
-       * include/freetype/ftimage.h (FT_CURVE_TAG_HAS_SCANMODE): New macro.
-
-       * src/truetype/ttgload.c (TT_Hint_Glyph): Store drop-out mode in
-       `tags[0]'.
-
-       * src/raster/ftraster.c (Flow_Up, Overshoot_Top, Overshoot_Bottom):
-       Use bits 3-5 instead of 0-2.
-       (New_Profile): Set the drop-out mode in the profile's `flags' field.
-       (Decompose_Curve): Check `tags[0]' and set `dropOutControl' if
-       necessary.
-       (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
-       Horizontal_Gray_Sweep_Drop, Draw_Sweep): Use the profile's drop-out
-       mode.
-
-2009-06-16  Werner Lemberg  <wl@gnu.org>
-
-       Improve scan conversion rules 4 and 6.
-
-       Two new constraints are introduced to better identify a `stub' -- a
-       concept which is only vaguely described in the OpenType
-       specification.  The old code was too rigorous and suppressed more
-       pixel than it should.
-
-         . The intersection of the two profiles with the scanline is less
-           than a half pixel.  Code related to this was already present in
-           the sources but has been commented out.
-
-         . The endpoint of the original contour forming a profile has a
-           distance (`overshoot') less than half a pixel to the scanline.
-
-       Note that the two additional conditions fix almost all differences
-       to the Windows rasterizer, but some problematic cases remain.
-
-       * src/raster/ftraster.c (Overshoot_Top, Overshoot_Bottom): New
-       macros for the `flags' field in the `TProfile' structure.
-       (IS_BOTTOM_OVERSHOOT, IS_TOP_OVERSHOOT): New macros.
-       (New_Profile, End_Profile): Pass overshoot flag as an argument and
-       set it accordingly.
-       Update callers.
-       (Vertical_Sweep_Drop, Horizontal_Sweep_Drop): Implement the two new
-       constraints.
-
-2009-06-11  Werner Lemberg  <wl@gnu.org>
-
-       Increase precision for B/W rasterizer.
-
-       * src/raster/ftraster.c (Set_High_Precision): Add two more bits to
-       the precision.  This corrects rendering of some small glyphs, for
-       example, glyph `xi' in verdana.ttf at 13 ppem.  Testing with ftbench
-       on my GNU/Linux box I don't see a performance degradation.
-
-2009-06-08  Michael Zucchi  <notzed@gmail.com>
-
-       Handle FT_STROKER_LINECAP_BUTT.
-       This fixes Savannah bug #26757.
-
-       * src/base/ftstroke.c (ft_stroker_cap): Implement it.
-
-2009-06-07  Harald Fernengel  <harry@kdevelop.org>
-
-       Fix some potential out-of-memory crashes.
-
-       * src/base/ftobjs.c (ft_glyphslot_done): Check `slot->internal'.
-       * src/base/ftstream.c (FT_Stream_ReleaseFrame): Check `stream'.
-       * src/truetype/ttinterp.c (TT_New_Context): Avoid double-free of
-       `exec' in case of failure.
-
-2009-06-07  Werner Lemberg  <wl@gnu.org>
-
-       Simplify math.
-       Suggested by Alexei Podtelezhnikov <apodtele@gmail.com>.
-
-       * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
-       Horizontal_Gray_Sweep_Drop): Do it.
-
-2009-06-04  Werner Lemberg  <wl@gnu.org>
-
-       Preparation for fixing scan conversion rules 4 and 6.
-
-       * src/raster/ftraster.c (TFlow): Replace enumeration with...
-       (Flow_Up): This macro.
-       (TProfile): Replace `flow' member with `flags' bit field.
-       Update all affected code.
-
-2009-05-29  James Cloos  <cloos@jhcloos.com>
-
-       Enable autohinting for glyphs rotated by multiples of 90°.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Alter check for permitted
-       matrices to allow rotations by multiples of 90°, not only unrotated,
-       possibly slanted matrices.
-
-2009-05-28  Werner Lemberg  <wl@gnu.org>
-
-       Remove compiler warning.
-       Reported by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
-
-       * src/autofit/aflatin2.c (af_latin2_hint_edges): Move declaration of
-       `n_edges' into `#if' block.
-
-2009-05-28  Werner Lemberg  <wl@gnu.org>
-
-       Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined.
-       Reported by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
-
-       * src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]:
-       Make it work.
-       Simplify #ifdef logic.
-
-2009-05-22  Werner Lemberg  <wl@gnu.org>
-
-       Improve b/w rasterizer.
-       Problem reported by Krzysztof Kotlenga <pocek@users.sf.net>.
-
-       * src/raster/raster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
-       Horizontal_Gray_Sweep_Drop): For smart drop-out mode, if
-       intersections are equally distant relative to next pixel center,
-       select the left pixel, not the right one.
-
-2009-05-19  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #26600.
-
-       * src/type42/t42parse.c (t42_load_keyword): Handle
-       T1_FIELD_LOCATION_FONT_EXTRA.
-
-2009-04-30  Werner Lemberg  <wl@gnu.org>
-
-       Document recent changes to ftview.
-
-       * docs/CHANGES: Do it.
-
-2009-04-27  Werner Lemberg  <wl@gnu.org>
-
-       autohinter: Don't change digit widths if all widths are the same.
-       This fixes FreeDesktop bug #21197.
-
-       * src/autofit/afglobal.c (AF_DIGIT): New macro.
-       (af_face_globals_compute_script_coverage): Mark ASCII digits in
-       `glyph_scripts' array.
-       (af_face_globals_get_metrics): Updated.
-       (af_face_globals_is_digit): New function.
-       * src/autofit/afglobal.h: Updated.
-       (AF_ScriptMetricsRec): Add `digits_have_same_width' flag.
-
-       * src/autofit/aflatin.c: Include FT_ADVANCES_H.
-       (af_latin_metrics_check_digits): New function.
-       (af_latin_metrics_init): Use it.
-       * src/autofit/aflatin.h: Updated.
-       * src/autofit/afcjk.c (af_cjk_metrics_init): Updated.
-
-       * src/autofit/aflatin2.c: Similar changes as with aflatin.c.
-
-       * src/autofit/afloader.c (af_loader_load_g): Test digit width.
-
-       * docs/CHANGES: Document it.
-
-2009-04-26  Werner Lemberg  <wl@gnu.org>
-
-       Make ftgrays compile with _STANDALONE_ and FT_STATIC_RASTER again.
-       Problems reported by suyu@cooee.cn.
-
-       * src/smooth/ftgrays.c (FT_DEFINE_OUTLINE_FUNCS,
-       FT_DEFINE_RASTER_FUNCS) [_STANDALONE_]: Define.
-       [!_STANDALONE_]: Include ftspic.h only here.
-       (ras): Define/declare after definition of `TWorker'.
-       Use `RAS_VAR_' where necessary.
-
-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.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Add #error to modules and files that do not support PIC yet.
-
-       When FT_CONFIG_OPTION_PIC is defined the following files will
-       create #error:
-       * src/bdf/bdfdrivr.h
-       * src/cache/ftcmanag.c
-       * src/cid/cidriver.h
-       * src/gxvalid/gxvmod.h
-       * src/gzip/ftgzip.c
-       * src/lzw/ftlzw.c
-       * src/otvalid/otvmod.h
-       * src/pcf/pcfdrivr.h
-       * src/pfr/pfrdrivr.h
-       * src/psaux/psauxmod.h
-       * src/type1/t1driver.h
-       * src/type42/t42drivr.h
-       * src/winfonts/winfnt.h
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in autofit module.
-
-       * 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,
-       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
-       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,
-       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
-       being allocated in the global scope.
-
-       * 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
-       being allocated in the global scope.
-
-       * 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
-       being allocated in the global scope.
-
-       * 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
-       being allocated in the global scope.
-       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,
-       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
-       being allocated in the global scope.
-       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
-       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
-       initialize PIC globals for autofit module.
-
-       * src/autofit/autofit.c add new file to build: afpic.c.
-       * src/autofit/jamfile add new files to FT2_MULTI build: afpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in pshinter module.
-
-       * 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,
-       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
-       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
-       initialize PIC globals for pshinter module.
-
-       * src/pshinter/pshinter.c add new file to build: pshpic.c.
-       * src/pshinter/jamfile add new files to FT2_MULTI build: pshpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in psnames module.
-
-       * 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,
-       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
-       and psnames_module_class 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 pspic.h in order to access them.
-
-       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
-       initialize PIC globals for psnames module.
-
-       * src/psnames/psnames.c add new file to build: pspic.c.
-       * src/psnames/jamfile add new files to FT2_MULTI build: pspic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       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,
-       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
-       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
-       ft_standard_raster from the pic_container (allocated in ftraster.c).
-       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
-       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
-       initialize PIC globals for raster renderer.
-
-       * src/raster/raster.c add new file to build: rastpic.c.
-       * src/raster/jamfile add new files to FT2_MULTI build: rastpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       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,
-       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
-       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
-       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
-       to the global scope.
-       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
-       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
-       initialize PIC globals for smooth renderer.
-
-       * src/smooth/smooth.c add new file to build: ftspic.c.
-       * src/smooth/jamfile add new files to FT2_MULTI build: ftspic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in cff driver.
-
-       * 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
-       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:
-       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:
-       cff_service_glyph_dict, cff_service_ps_info, cff_service_ps_name
-       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.
-       And macros will be used from cffpic.h in order to access them
-       from the pic_container.
-       Use macros from cffpic.h in order to access the
-       structs allocated in cffcmap.c
-
-       * 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
-       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
-       initialize PIC globals for cff driver.
-
-       * src/cff/cff.c add new file to build: cffpic.c.
-       * src/cff/jamfile add new files to FT2_MULTI build: cffpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in sfnt driver.
-
-       * 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
-       instances of FT_Service_GlyphDictRec.
-       * 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
-       instances of FT_Service_SFNT_TableRec.
-       * include/freetype/internal/services/svttcmap.h add macros to init
-       instances of FT_Service_TTCMapsRec.
-       * 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:
-       sfnt_service_sfnt_table, sfnt_service_glyph_dict, sfnt_service_ps_name
-       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
-       instances of TT_CMap_ClassRec.
-       * 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_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.
-       And macros will be used from sfntpic.h in order to access them
-       from the pic_container.
-       The content of tt_cmap_classes is now described in the
-       new file 'ttcmapc.h'.
-
-       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
-       initialize PIC globals for sfnt driver.
-       * 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.
-       * src/sfnt/jamfile add new files to FT2_MULTI build: sfntpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in truetype driver.
-
-       * 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
-       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:
-       tt_service_gx_multi_masters, tt_service_truetype_glyf, tt_driver_class
-       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
-       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
-       initialize PIC globals for truetype driver.
-
-       * src/truetype/truetype.c add new file to build: ttpic.c.
-       * src/truetype/jamfile add new files to FT2_MULTI build: ttpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       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
-       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
-       (FT_Module_Class).
-       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
-       (FT_Driver_ClassRec).
-       * 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
-       destory arrays of FT_ServiceDescRec.
-       * include/freetype/internal/internal.h define macro to include
-       ftpic.h.
-
-       New Files:
-       * 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
-       macros to access them.
-       * 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
-       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
-       destroyed.
-
-       * src/base/jamfile add new files to FT2_MULTI build:
-       ftpic.c and basepic.c.
-       * 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
-       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
-       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
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       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
-       'CFF_ParserRec' set by `cff_parser_init'.
-       Route library pointer from 'cff_face_init' to 'cff_subfont_load'
-       for `cff_parser_init'.
-
-       * src/cff/cffparse.c (CFF_Field_Handler): Move it to...
-       * src/cff/cffparse.h: This file, to be used by other C files.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Minor change in ftstroke.c.
-
-       * src/base/ftstroke.c (FT_StrokerRec): Replace `memory' member with
-       `library' needed for PIC version.
-       Update all callers.
-
-2009-04-04  Werner Lemberg  <wl@gnu.org>
-
-       ftnames.c -> ftsnames.c
-
-       * src/base/ftnames.c: Rename to...
-       * src/base/ftsnames.c: This.
-       * src/base/Jamfile, src/base/rules.mk, src/base/ftbase.c: Updated.
-
-2009-04-04  Werner Lemberg  <wl@gnu.org>
-
-       Add support for cmap type 13.
-
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       (TT_CONFIG_CMAP_FORMAT_13): New macro.
-
-       * src/sfnt/ttcmap.c (TT_CMap13Rec, tt_cmap13_init,
-       tt_cmap13_validate, tt_cmap13_char_index, tt_cmap13_char_next,
-       tt_cmap13_get_info, tt_cmap13_char_map_def_binary,
-       tt_cmap14_class_rec): New functions and structures for cmap 13
-       support.
-       (tt_cmap_classes): Register tt_cmap13_class_rec.
-
-       * docs/CHANGES: Mention cmap 13 support.
-
-2009-04-01  Werner Lemberg  <wl@gnu.org>
-
-       Ignore empty contours in CFF glyphs.
-
-       Problem reported by Albert Astals Cid <aacid@kde.org>.
-
-       * src/cff/cffgload.c (cff_builder_close_contour): Synchronize with
-       t1_builder_close_contour.
-
-2009-03-21  Werner Lemberg  <wl@gnu.org>
-
-       Another redundant header inclusion.
-
-       * src/truetype/ttgxvar.c: Fix Ghostscript Coverity issue #4041.
-
-2009-03-21  Werner Lemberg  <wl@gnu.org>
-
-       Remove redundant header inclusions.
-
-       This covers many Ghostscript Coverity issues.
-
-       * src/*: Do it.
-
-2009-03-21  Werner Lemberg  <wl@gnu.org>
-
-       Fix Ghostscript Coverity issue #3904.
-
-       * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against
-       invalid values of `runcnt'.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-
-       Fix `make multi' run.
-
-       * src/smooth/ftsmooth.h: Include FT_INTERNAL_DEBUG_H.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25923.
-
-       * src/cache/ftccmap.c (FTC_CMAP_HASH): Fix typo.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-
-       Protect against too large glyphs.
-
-       Problem reported by Tavis Ormandy <taviso@google.com>.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Don't allow
-       `pitch' or `height' to be larger than 0xFFFF.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-           Tavis Ormandy  <taviso@google.com>
-
-       Fix validation for various cmap table formats.
-
-       * src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate,
-       tt_cmap12_validate): Check `length' correctly.
-       (tt_cmap_14_validate): Check `length' and `numMappings' correctly.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-
-       Protect against malformed compressed data.
-
-       * src/lzw/ftzopen.c (ft_lzwstate_io): Test whether `state->prefix' is
-       zero.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-
-       Protect against invalid SID values in CFFs.
-
-       Problem reported by Tavis Ormandy <taviso@google.com>.
-
-       * src/cff/cffload.c (cff_charset_load): Reject SID values larger
-       than 64999.
-
-2009-03-19  Vincent Richomme  <richom.v@free.fr>
-
-       Update WinCE Visual C project files.
-
-       * builds/wince/vc2005-ce/freetype.vcproj,
-       builds/wince/vc2008-ce/freetype.vcproj: Add missing base extension
-       files.
-
-2009-03-19  Werner Lemberg  <wl@gnu.org>
-
-       Remove unused Win32 code.
-
-       * builds/wince/ftdebug.c: Remove code guarded with `!_WIN32_WCE'.
-       Since Win32 is handled separately this is no longer needed.
-
-2009-03-19  Vincent Richomme  <richom.v@free.fr>
-
-       Make `gzip' module compile on WinCE.
-
-       * src/gzip/zconf.h [_WIN32_WCE]: Define NO_ERRNO_H.
-
-2009-03-19  Werner Lemberg  <wl@gnu.org>
-
-       Remove unused WinCE code.
-
-       * builds/win32/ftdebug.c: Remove code guarded with `_WIN32_WCE'.
-       Since WinCE is handled separately this is no longer needed.
-
-2009-03-16  Werner Lemberg  <wl@gnu.org>
-
-       docmaker: Don't ignore single-line code blocks.
-
-       * src/tools/docmaker/content.py (DocBlock::_init__): Fix change from
-       2009-01-31.
-
-2009-03-15  Steve Langasek  <steve.langasek@canonical.com>
-
-       Use __asm__ for declaring assembly instead of asm.
-
-       * builds/unix/ftconfig.in (FT_MulFix_arm): Use __asm__ instead of
-       asm on arm, fixing a build failure on armel with -pedantic.
-
-2009-03-14  Werner Lemberg  <wl@gnu.org>
-
-       Fix valgrind warning.
-
-       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_bit_aligned): Don't read
-       past the end of the frame.
-
-2009-03-12  Werner Lemberg  <wl@gnu.org>
-
-       * Version 2.3.9 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-9'.
-
-2009-03-12  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/freetype2.in: Move @FT2_EXTRA_LIBS@ to `Libs.private'.
-
-2009-03-12  Werner Lemberg  <wl@gnu.org>
-
-       Fix some FreeType Coverity issues as reported for Ghostscript.
-
-       * src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize
-       `args.stream' (#3874, #3875).
-       (open_face_PS_from_sfnt_stream): Improve error management (#3786).
-       * src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice'
-       (#3870).
-       * src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead
-       code (#3790).
-       * src/base/ftrfork.c (raccess_guess_apple_generic): Check error
-       value of `FT_Stream_Skip' (#3784).
-
-       * src/type1/t1gload.c (T1_Load_Glyph): Check `size' before accessing
-       it (#3872)
-
-       * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Check `face' before accessing
-       it (#3871).
-       * src/pcf/pcfread.c (pcf_get_metrics): Handle return value of
-       `pcf_get_metric' (#3789, #3782).
-       (pcf_get_properties): Use FT_STREAM_SKIP (#3783).
-
-       * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Fix check of
-       `acache' (#3797)
-
-       * src/cff/cffdrivr.c (cff_ps_get_font_info): Fix check of `cff'
-       (#3796).
-       * src/cff/cffgload.c (cff_decoder_prepare): Check `size' (#3795).
-       * src/cff/cffload.c (cff_index_get_pointers): Add comment (#3794).
-
-       * src/bdf/bdflib.c (_bdf_add_property): Check `fp->value.atom'
-       (#3793).
-       (_bdf_parse_start): Add comment (#3792).
-
-       * src/raster/ftraster.c (Finalize_Profile_Table): Check
-       `ras.fProfile' (#3791).
-
-       * src/sfnt/ttsbit.c (Load_SBit_Image): Use FT_STREAM_SKIP (#3785).
-
-       * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore
-       seek error (#3781).
-
-2009-03-11  Michael Toftdal  <toftdal@gmail.com>
-
-       Extend CID service functions to handle CID-keyed CFFs as CID fonts.
-
-       * include/freetype/ftcid.h (FT_Get_CID_Is_Internally_CID_keyed,
-       FT_Get_CID_From_Glyph_Index): New functions.
-
-       * include/freetype/internal/services/svcid.h
-       (FT_CID_GetIsInternallyCIDKeyedFunc,
-       FT_CID_GetCIDFromGlyphIndexFunc): New function typedefs.
-       (CID Service): Use them.
-
-       * src/base/ftcid.c: Include FT_CID_H.
-       (FT_Get_CID_Is_Internally_CID_keyed, FT_Get_CID_From_Glyph_Index):
-       New functions.
-
-       * src/cff/cffdrivr.c (cff_get_is_cid, cff_get_cid_from_glyph_index):
-       New functions.
-       (cff_service_cid_info): Add them.
-       * src/cff/cffload.c (cff_font_load): Don't free `font->charset.sids'
-       -- it is needed for access as a CID-keyed font.  It gets deleted
-       later on.
-
-       * src/cid/cidriver.c (cid_get_is_cid, cid_get_cid_from_glyph_index):
-       New functions.
-       (cid_service_cid_info): Add them.
-
-       * docs/CHANGES: Updated.
-
-2009-03-11  Bram Tassyns  <bramt@enfocus.be>
-
-       Fix Savannah bug #25597.
-
-       * src/cff/cffparse.c (cff_parse_real): Don't allow fraction_length
-       to become larger than 9.
-
-2009-03-11  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25814.
-
-       * builds/unix/freetype2.in: As suggested in the bug report, move
-       @LIBZ@ to `Libs.private'.
-
-2009-03-11  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25781.
-       We now simply check for a valid `offset', no longer handling `delta
-       = 1' specially.
-
-       * src/sfnt/ttcmap.c (tt_cmap4_validate): Don't check `delta' for
-       last segment.
-       (tt_cmap4_set_range, tt_cmap4_char_map_linear,
-       tt_cmap4_char_map_binary): Check offset.
-
-2009-03-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/Jamfile: Fix handling of ftadvanc.c.
-       Reported by Oran Agra <oran@monfort.co.il>.
-
-2009-03-10  Vincent Richomme  <richom.v@free.fr>
-
-       Restructure Win32 and Wince compiler support.
-
-       * src/builds/win32: Remove files for WinCE.
-       Move VC 2005 support to a separate directory.
-       Add directory for VC 2008 support.
-
-       * src/builds/wince: New directory hierarchy for WinCE compilers
-       (VC 2005 and VC 2008).
-
-2009-03-09  Werner Lemberg  <wl@gnu.org>
-
-       More preparations for 2.3.9 release.
-
-       * docs/CHANGES: Updated.
-
-       * Jamfile, README: s/2.3.8/2.3.9/, s/238/239/.
-
-2009-03-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/rules.mk (SFNT_DRV_H): Add ttsbit0.c.
-
-2009-03-09  Alexey Kryukov  <anagnost@yandex.ru>
-
-       Fix handling of EBDT formats 8 and 9 (part 2).
-
-       This patch fixes the following problems in ttsbit0.c:
-
-       . Bitmaps for compound glyphs were never allocated.
-
-       . `SBitDecoder' refused to load metrics if some other metrics have
-         already been loaded.  This condition certainly makes no sense for
-         recursive calls, so I've just disabled it.  Another possibility
-         would be resetting `decoder->metrics_loaded' to false before
-         loading each composite component.  However, we must restore the
-         original metrics after finishing the recursion; otherwise we can
-         get a misaligned glyph.
-
-       . `tt_sbit_decoder_load_bit_aligned' incorrectly handled `x_pos',
-         causing some glyph components to be shifted too far to the right
-         (especially noticeable for small sizes).
-
-       Note that support for grayscale bitmaps (not necessarily compound) is
-       completely broken in ttsbit0.c.
-
-       * src/sfnt/tt_sbit_decoder_load_metrics: Always load metrics.
-       (tt_sbit_decoder_load_bit_aligned): Handle `x_pos' correctly in case
-       of `h == height'.
-       (tt_sbit_decoder_load_compound): Reset metrics after loading
-       components.
-       Allocate bitmap.
-
-2009-03-09  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.raw (version_info): Set to 9:20:3.
-
-2009-03-03  David Turner  <david@freetype.org>
-
-       Protect SFNT kerning table parser against malformed tables.
-
-       This closes Savannah BUG #25750.
-
-       * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning): Fix a
-       bug where a malformed table would be successfully loaded but later
-       crash the engine during parsing.
-
-2009-03-03  David Turner  <david@freetype.org>
-
-       Update documentation and bump version number to 2.3.9.
-
-       * include/freetype/freetype.h: Bump patch version to 9.
-       * docs/CHANGES: Document the ABI break in 2.3.8.
-       * docs/VERSION.DLL: Update version numbers table for 2.3.9.
-
-2009-03-03  David Turner  <david@freetype.org>
-
-       Remove ABI-breaking field in public PS_InfoFontRec definition.
-
-       Instead, we define a new internal PS_FontExtraRec structure to
-       hold the additional field, then place it in various internal
-       positions of the corresponding FT_Face derived objects.
-
-       * include/freetype/t1tables.h (PS_FontInfoRec): Remove the
-       `fs_type' field from the public structure.
-       * include/freetype/internal/psaux.h (T1_FieldLocation): New
-       enumeration `T1_FIELD_LOCATION_FONT_EXTRA'.
-       * include/freetype/internal/t1types.h (PS_FontExtraRec): New
-       structure.
-       (T1_FontRec, CID_FaceRec): Add it.
-
-       * src/cid/cidload.c (cid_load_keyword): Handle
-       T1_FIELD_LOCATION_FONT_EXTRA.
-       * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c:
-       Adjust FT_STRUCTURE and T1CODE properly to handle `FSType'.
-       * src/type1/t1load.c (t1_load_keyword): Handle
-       T1_FIELD_LOCATION_FONT_EXTRA.
-
-       * include/freetype/internal/services/svpsinfo.h (PsInfo service):
-       Add `PS_GetFontExtraFunc' function typedef.
-
-       * src/base/ftfstype.c: Include FT_INTERNAL_SERVICE_H and
-       FT_SERVICE_POSTSCRIPT_INFO_H.
-       (FT_Get_FSType_Flags): Use POSTSCRIPT_INFO service.
-
-       * src/cff/cffdrivr.c (cff_service_ps_info): Updated.
-       * src/cid/cidriver.c (cid_ps_get_font_extra): New function.
-       (cid_service_ps_info): Updated.
-       * src/type1/t1driver.c (t1_ps_get_font_extra): New function.
-       (t1_service_ps_info): Updated.
-       * src/type42/t42drivr.c (t42_ps_get_font_extra): New function.
-       (t42_service_ps_info): Updated.
-
-2009-03-02  Alexey Kryukov  <anagnost@yandex.ru>
-
-       Fix handling of EBDT formats 8 and 9.
-
-       The main cycle in `blit_sbit' makes too many iterations: it actually
-       needs the count of lines in the source bitmap rather than in the
-       target image.
-
-       * src/sfnt/ttsbit.c (blit_sbit) [FT_CONFIG_OPTION_OLD_INTERNALS]:
-       Add parameter `source_height' and use it for main loop.
-       (Load_SBit_Single) [FT_CONFIG_OPTION_OLD_INTERNALS]: Updated.
-
-2009-02-23  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25669.
-
-       * src/base/ftadvanc.h (FT_Get_Advances): Fix serious typo.
-
-       * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics): Fix
-       scaling factor for non-scalable fonts.
-
-       * src/cff/cffdrivr.c (cff_get_advances): Use correct advance width
-       value to prevent incorrect scaling.
-
-       * docs/CHANGES: Document it.
-
-2009-02-15  Matt Godbolt  <matt@godbolt.org>
-
-       Fix Savannah bug #25588.
-
-       * builds/unix/ftconfig.in (FT_MulFix_arm): Use correct syntax for
-       `orr' instruction.
-
-2009-02-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttobjs.c (tt_check_trickyness): Add `DFKaiShu'.
-       Reported by David Bevan <dbevan@emtex.com>.
-
-2009-02-09  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25495.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Test for bitmap strikes before
-       setting metrics and bbox values.  This ensures that the check for a
-       font with neither a `glyf' table nor bitmap strikes can be performed
-       early enough to set metrics and bbox values too.
-
-2009-02-04  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25480.
-
-       * builds/unix/freetype-config.in: For --ftversion, don't use $prefix
-       but $includedir.
-
-2009-01-31  Werner Lemberg  <wl@gnu.org>
-
-       Minor docmaker improvements.
-
-       * src/tools/docmaker/content.py (DocBlock::__init__): Ignore empty
-       code blocks.
-
-2009-01-25  Werner Lemberg  <wl@gnu.org>
-
-       Fix SCANCTRL handling in TTFs.
-       Problem reported by Alexey Kryukov <anagnost@yandex.ru>.
-
-       * src/truetype/ttinterp.c (Ins_SCANCTRL): Fix threshold handling.
-
-2009-01-23  Werner Lemberg  <wl@gnu.org>
-
-       Move FT_Get_FSType_Flags to a separate file.
-       Problem reported by Mickey Gabel <mickey@monfort.co.il>.
-
-       * src/base/ftobjs.c (FT_Get_FSType_Flags): Move to...
-       * src/base/ftfstype.c: This new file.
-
-       * modules.cfg (BASE_EXTENSION): Add ftfstype.c.
-
-       * docs/INSTALL.ANY: Updated.
-
-       * builds/mac/*.txt, builds/amiga/*makefile*,
-       builds/win32/{visualc,visualce}/freetype.*, builds/symbian/*:
-       Updated.
-
-2009-01-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Fix 2 error
-       messages ending without "\n".
-
-2009-01-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Fix Savannah bug #25347.
-
-       * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Rewind
-       the stream to the original position passed to this function,
-       when ft_lookup_PS_in_sfnt_stream() failed.
-       (Mac_Read_sfnt_Resource): Rewind the stream to the head of
-       sfnt resource body, when open_face_PS_from_sfnt_stream()
-       failed.
-
-2009-01-19  Michael Lotz  <mmlr@mlotz.ch>
-
-       Fix Savannah bug #25355.
-
-       * include/freetype/config/ftconfig.h (FT_MulFix_i386): Make
-       assembler code work with gcc 2.95.3 (as used by the Haiku project).
-       Add `cc' register to the clobber list.
-
-2009-01-18  Werner Lemberg  <wl@gnu.org>
-
-       Protect FT_Get_Next_Char.
-
-       * src/sfnt/ttcmap.c (tt_cmap4_set_range): Apply fix similar to
-       change from 2008-07-22.
-
-       Patch from Ronen Ghoshal <rghoshal@emtex.com>.
-
-2009-01-18  Werner Lemberg  <wl@gnu.org>
-
-       Implement FT_Get_Name_Index for SFNT driver.
-
-       * src/sfnt/sfdriver.c (sfnt_get_name_index): New function.
-       (sfnt_service_glyph_dict): Use it.
-
-       Problem reported by Truc Truong <tructv@necsv.com>.
-
-2009-01-18  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftstroke.h (FT_Outline_GetInsideBorder): Fix
-       documentation.  Problem reported by Truc Truong <tructv@necsv.com>.
-
-       * docs/CHANGES: Updated.
-
-2009-01-14  Werner Lemberg  <wl@gnu.org>
-
-       * Version 2.3.8 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-8'.
-
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.3.8.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.7/2.3.8/, s/237/238/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8.
-
-       * builds/unix/configure.raw (version_info): Set to 9:19:3.
-
-       * docs/release: Updated.
-
-2009-01-14  Werner Lemberg  <wl@gnu.org>
-
-       * builds/toplevel.mk (dist): Compress better.
-
-2009-01-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Get_FSType_Flags): Cast for compilation
-       with C++.
-
-2009-01-13  Werner Lemberg  <wl@gnu.org>
-
-       Don't use stdlib.h and friends directly.
-       Reported by Mickey Gabel <mickey@monfort.co.il>.
-
-       * src/base/ftdbgmem.c: s/<stdlib.h>/FT_CONFIG_STANDARD_LIBRARY_H/.
-
-       * src/gzip/ftgzip.c, src/lzw/ftlzw.c, src/raster/ftmisc.h:
-       s/<string.h>/FT_CONFIG_STANDARD_LIBRARY_H/.
-
-       * src/autofit/aftypes.h, src/autofit/afhints.c,
-       src/pshinter/pshalgo.c: s/<stdio.h>/FT_CONFIG_STANDARD_LIBRARY_H/
-
-       * src/lzw/ftlzw.c, src/base/ftdbgmem.c: Don't include stdio.h.
-
-2009-01-12  Werner Lemberg  <wl@gnu.org>
-
-       Avoid compiler warnings.
-
-       * */*: s/do ; while ( 0 )/do { } while ( 0 )/.
-       Reported by Sean McBride <sean@rogue-research.com>.
-
-2009-01-12  Werner Lemberg  <wl@gnu.org>
-
-       Fix stdlib dependencies.
-
-       Problem reported by Mickey Gabel <mickey@monfort.co.il>.
-
-       * include/freetype/config/ftstdlib.h (ft_exit): Removed.  Unused.
-
-       * src/autofit/afhints.c, src/base/ftlcdfil.c, src/smooth/ftsmooth.c:
-       s/memcpy/ft_memcpy/.
-       * src/psaux/t1decode.c: s/memset/ft_memset/, s/memcpy/ft_memcpy/.
-
-2009-01-11  Werner Lemberg  <wl@gnu.org>
-
-       * docs/formats.txt: Add link to PCF specification.
-
-       * include/freetype/ftbdf.h (FT_Get_BDF_Property): Improve
-       documentation.
-
-2009-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftadvanc.c (_ft_face_scale_advances, FT_Get_Advance,
-       FT_Get_Advances): Change the type of load_flags from FT_UInt32 to
-       FT_Int32, to match with the flags for FT_Load_Glyph().
-       * src/cff/cffdrivr.c (cff_get_advances): Ditto.
-       * src/truetype/ttdriver.c (tt_get_advances): Ditto.
-       * include/freetype/ftadvanc.h (FT_Get_Advance, FT_Get_Advances):
-       Ditto.
-       * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc):
-       Ditto.
-
-2009-01-09  Daniel Zimmermann  <netzimme@aol.com>
-
-       * src/gxvalid/gxvmort.c (gxv_mort_feature_validate): Fix wrong
-       length check.  From Savannah patch #6682.
-
-2009-01-09  Werner Lemberg  <wl@gnu.org>
-
-       Fix problem with T1_FIELD_{NUM,FIXED}_TABLE2.
-
-       * src/psaux/psobjs.c (ps_parser_load_field_table): Don't handle
-       `count_offset' if it is zero (i.e., unused).  Otherwise, the first
-       element of the structure which holds the data is erroneously
-       modified.  Problem reported by Chi Nguyen <chint@necsv.com>.
-
-2009-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftadvanc.c (_ft_face_scale_advances, FT_Get_Advance,
-       FT_Get_Advances): Extend the type of load_flags from FT_UInt to
-       FT_UInt32, to pass 32-bit flags on 16bit platforms.
-       * src/cff/cffdrivr.c (cff_get_advances): Ditto.
-       * src/truetype/ttdriver.c (tt_get_advances): Ditto.
-       * include/freetype/ftadvanc.h (FT_Get_Advance, FT_Get_Advances):
-       Ditto.
-       * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc):
-       Ditto.
-
-2009-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (FT_Done_Library): Issue an error message when
-       FT_Done_Face() cannot free all faces. If the list of the opened
-       faces includes broken face which FT_Done_Face() cannot free,
-       FT_Done_Library() retries FT_Done_Face() and it can fall into
-       an endless loop. See the discussion:
-       http://lists.gnu.org/archive/html/freetype-devel/2008-09/msg00047.html
-       http://lists.gnu.org/archive/html/freetype-devel/2008-10/msg00000.html
-
-2009-01-07  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Document new key `a' in ftdiff.
-
-2009-01-06  Werner Lemberg  <wl@gnu.org>
-
-       * autogen.sh: Don't use GNUisms while calling sed.  Problem reported
-       by Sean McBride.
-
-2009-01-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftbitmap.c (FT_Bitmap_Convert): Handle FT_PIXEL_MODE_LCD
-       and FT_PIXEL_MODE_LCD_V.  Problem reported by Chi Nguyen
-       <chint@necsv.com>.
-
-2009-01-06  Diego Pettenò  <flameeyes@gmail.com>
-
-       * builds/unix/configure.raw: Don't call AC_CANONICAL_BUILD and
-       AC_CANONICAL_TARGET and use $host_os only.  A nice explanation for
-       this change can be found at
-       http://blog.flameeyes.eu/s/canonical-target.
-
-       From Savannah patch #6712.
-
-2009-01-06  Sean McBride  <sean@rogue-research.com>
-
-       * src/base/ftdbgmem.c (_debug_mem_dummy): Make it static.
-
-       * src/base/ftmac.c: Remove some #undefs.
-
-2008-12-26  Werner Lemberg  <wl@gnu.org>
-
-       Set `face_index' field in FT_Face for all font formats.
-
-       * cff/cffobjs.c (cff_face_init), winfonts/winfnt.c (FNT_Face_Init),
-       sfnt/sfobjs.c (sfnt_init_face): Do it.
-
-       * docs/CHANGES: Document it.
-
-2008-12-22  Steve Grubb
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Reject zero-length files.
-       Patch from Savannah bug #25151.
-
-2008-12-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/pfrdrivr.c, src/winfonts/winfnt.c, src/cache/ftcmanag.c,
-       src/smooth/ftgrays.c, src/base/ftobjc.s, src/sfobjs.c:
-       s/_Err_Bad_Argument/_Err_Invalid_Argument/.  The former is for
-       errors in the bytecode interpreter only.
-
-2008-12-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftpfr.c (FT_Get_PFR_Metrics): Protect against NULL
-       arguments.
-       Fix return value for non-PFR fonts.  Both problems reported by Chi
-       Nguyen <chint@necsv.com>.
-
-2008-12-21  anonymous
-
-       FT_USE_MODULE declares things as:
-
-         extern const FT_Module_Class
-
-       (or similar for C++).  However, the actual types of the variables
-       being declared are often different, e.g., FT_Driver_ClassRec or
-       FT_Renderer_Class.  (Some are, indeed, FT_Module_Class.)
-
-       This works with most C compilers (since those structs begin with an
-       FT_Module_Class struct), but technically it's undefined behavior.
-
-       To quote the ISO/IEC 9899:TC2 final committee draft, section 6.2.7
-       paragraph 2:
-
-         All declarations that refer to the same object or function shall
-         have compatible type; otherwise, the behavior is undefined.
-
-       (And they are not compatible types.)
-
-       Most C compilers don't reject (or even detect!) code which has this
-       issue, but the GCC LTO development branch compiler does.  (It
-       outputs the types of the objects while generating .o files, along
-       with a bunch of other information, then compares them when doing the
-       final link-time code generation pass.)
-
-       Patch from Savannah bug #25133.
-
-       * src/base/ftinit.c (FT_USE_MODULE): Include variable type.
-
-       * builds/amiga/include/freetype/config/ftmodule.h,
-       include/freetype/config/ftmodule.h, */module.mk: Updated to declare
-       pass correct types to FT_USE_MODULE.
-
-2008-12-21  Hongbo Ni  <hongbo@njstar.com>
-
-       * src/autofit/aflatin.c (af_latin_hint_edges),
-       src/autofit/aflatin2.c (af_latin2_hint_edges), src/autofit/afcjk.c
-       (af_cjk_hint_edges): Protect against division by zero.  This fixes
-       Savannah bug #25124.
-
-2008-12-18  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2008-12-18  Bevan, David  <dbevan@emtex.com>
-
-       Provide API for accessing embedding and subsetting restriction
-       information.
-
-       * include/freetype.h (FT_FSTYPE_INSTALLABLE_EMBEDDING,
-       FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING,
-       FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING, FT_FSTYPE_EDITABLE_EMBEDDING,
-       FT_FSTYPE_NO_SUBSETTING, FT_FSTYPE_BITMAP_EMBEDDING_ONLY): New
-       macros.
-       (FT_Get_FSType_Flags): New function declaration.
-
-       * src/base/ftobjs.c (FT_Get_FSType_Flags): New function.
-
-       * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c
-       (t42_keywords): Handle `FSType'.
-
-       * include/freetype/t1tables.h (PS_FontInfoRec): Add `fs_type' field.
-
-2008-12-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Don't use internal
-       macros so that copying the source code into an application works
-       out of the box.
-
-2008-12-17  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftsynth.h, src/base/ftsynth.c: Move
-       FT_GlyphSlot_Own_Bitmap to...
-       * include/freetype/ftbitmap.h, src/base/ftbitmap.c: These files.
-
-       * docs/CHANGES: Document it.
-
-2008-12-10  Werner Lemberg  <wl@gnu.org>
-
-       Generalize the concept of `tricky' fonts by introducing
-       FT_FACE_FLAG_TRICKY to indicate that the font format's hinting
-       engine is necessary for correct rendering.
-
-       At the same time, slightly modify the behaviour of tricky fonts:
-       FT_LOAD_NO_HINTING is now ignored.  To really force raw loading
-       of tricky fonts (without hinting), both FT_LOAD_NO_HINTING and
-       FT_LOAD_NO_AUTOHINT must be used.
-
-       Finally, tricky TrueType fonts always use the bytecode interpreter
-       even if the patented code is used.
-
-       * include/freetype/freetype.h (FT_FACE_FLAG_TRICKY, FT_IS_TRICKY):
-       New macros.
-
-       * src/truetype/ttdriver.c (Load_Glyph): Handle new load flags
-       semantics as described above.
-
-       * src/truetype/ttobjs.c (tt_check_trickyness): New function, using
-       code of ...
-       (tt_face_init): This function, now simplified and updated to new
-       semantics.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Don't use autohinter for tricky
-       fonts.
-
-       * docs/CHANGES: Document it.
-
-2008-12-09  Werner Lemberg  <wl@gnu.org>
-
-       Really fix Savannah bug #25010: An SFNT font with neither outlines
-       nor bitmaps can be considered as containing space `glyphs' only.
-
-       * src/truetype/ttpload.c (tt_face_load_loca): Handle the case where
-       a `glyf' table is missing.
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Abort if we have no
-       `glyf' table but a non-zero `loca' entry.
-       (tt_loader_init): Handle missing `glyf' table.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Undo change 2008-12-05.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): A font with neither outlines
-       nor bitmaps is scalable.
-
-2008-12-05  Werner Lemberg  <wl@nu.org>
-
-       * src/autofit/aflatin.c (af_latin_uniranges): Add more ranges.  This
-       fixes Savannah bug #21190 which also provides a basic patch.
-
-2008-12-05  Werner Lemberg  <wl@nu.org>
-
-       * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): Use value
-       0x100 instead of 0x10000; the latter value is already occupied by
-       FT_LOAD_TARGET_LIGHT.  Bug reported by James Cloos.
-
-
-       Handle SFNT with neither outlines nor bitmaps.  This fixes Savannah
-       bug #25010.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Reject fonts with neither
-       outlines nor bitmaps.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Don't return an error if there
-       is no table with glyphs.
-
-
-       * src/sfnt/ttload.c (tt_face_lookup_table): Improve debugging
-       message.
-
-2008-12-01  Werner Lemberg  <wl@gnu.org>
-
-       GDEF tables need `glyph_count' too for validation.  Problem reported
-       by Chi Nguyen <chint@necsv.com>.
-
-       * src/otvalid/otvgdef.c (otv_GDEF_validate), src/otvalid/otvalid.h
-       (otv_GDEF_validate), src/otvalid/otvmod.c (otv_validate): Pass
-       `glyph_count'.
-
-2008-11-29  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c,
-       src/bdf/bdfdrivr.c, src/gxvalid/gxvmorx.c, src/otvalid/otvmath.c,
-       src/pcf/pcfdrivr.c, src/psnames/pstables.h, src/smooth/ftgrays.c,
-       src/tools/glnames.py, src/truetype/ttinterp.c, src/type1/t1load.c,
-       src/type42/t42objs.c, src/winfonts/winfnt.c: Fix compiler warnings
-       (Atari PureC).
-
-2008-11-29  James Cloos  <cloos@jhcloos.com>
-
-       * src/type/t1load.c (mm_axis_unmap): Revert previous patch and fix
-       it correctly by using FT_INT_TO_FIXED (FreeType expects 16.16 values
-       in the /BlendDesignMap space).
-
-2008-11-29  James Cloos  <cloos@jhcloos.com>
-
-       * src/type1/t1load.c (mm_axis_unmap): `blend_points' is FT_Fixed*,
-       whereas `design_points' is FT_Long*.  Therefore, return blend rather
-       than design points.
-
-2008-11-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffparse.c (cff_parse_real): Handle more than nine
-       significant digits correctly.  This fixes Savannah bug #24953.
-
-2008-11-25  Daniel Zimmermann  <netzimme@aol.com>
-
-       * src/base/ftstream.c (FT_Stream_ReadFields): Don't access stream
-       before the NULL check.  From Savannah patch #6681.
-
-2008-11-24  Werner Lemberg  <wl@gnu.org>
-
-       Fixes from the gnuwin32 port.
-
-       * src/base/ftlcdfil.c: s/EXPORT/EXPORT_DEF/.
-
-       * src/base/ftotval.c: Include FT_OPENTYPE_VALIDATE_H.
-
-       * src/psaux/psobjs.c (ps_table_add): Check `length'.
-
-2008-11-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (tt_default_graphics_state): The default
-       value for `scan_type' is zero, as confirmed by Greg Hitchcock from
-       Microsoft.  Problem reported by Michal Nowakowski
-       <miszka@limes.com.pl>.
-
-2008-11-12  Tor Andersson  <tor.andersson@gmail.com>
-
-       * src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field.
-       This fixes Savannah bug #24819.
-
-2008-11-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Remove #if 0/#endif guards
-       since OpenType version 1.5 has been released.
-
-       * include/ttnameid.h (TT_NAME_ID_WWS_FAMILY,
-       TT_NAME_ID_WWS_SUBFAMILY): New macros for OpenType 1.5.
-       (TT_URC_COPTIC, TT_URC_VAI, TT_URC_NKO, TT_URC_BALINESE,
-       TT_URC_PHAGSPA, TT_URC_NON_PLANE_0, TT_URC_PHOENICIAN,
-       TT_URC_TAI_LE, TT_URC_NEW_TAI_LUE, TT_URC_BUGINESE,
-       TT_URC_GLAGOLITIC, TT_URC_YIJING, TT_URC_SYLOTI_NAGRI,
-       TT_URC_LINEAR_B, TT_URC_ANCIENT_GREEK_NUMBERS, TT_URC_UGARITIC,
-       TT_URC_OLD_PERSIAN, TT_URC_SHAVIAN, TT_URC_OSMANYA,
-       TT_URC_CYPRIOT_SYLLABARY, TT_URC_KHAROSHTHI, TT_URC_TAI_XUAN_JING,
-       TT_URC_CUNEIFORM, TT_URC_COUNTING_ROD_NUMERALS, TT_URC_SUNDANESE,
-       TT_URC_LEPCHA, TT_URC_OL_CHIKI, TT_URC_SAURASHTRA, TT_URC_KAYAH_LI,
-       TT_URC_REJANG, TT_URC_CHAM, TT_URC_ANCIENT_SYMBOLS,
-       TT_URC_PHAISTOS_DISC, TT_URC_OLD_ANATOLIAN, TT_URC_GAME_TILES): New
-       macros for OpenType 1.5.
-
-2008-11-08  Wenlin Institute  <wenlin@wenlin.com>
-
-       * src/base/ftobjs.c (ft_glyphslot_free_bitmap): Protect against
-       slot->internal == NULL.  Reported by Graham Asher.
-
-2008-11-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (tt_face_get_name): Modified to return an error
-       code so that memory allocation problems can be distinguished from
-       missing table entries.  Reported by Graham Asher.
-       (GET_NAME): New macro.
-       (sfnt_load_face): Use it.
-
-2008-11-05  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Undefine
-       TT_CONFIG_OPTION_UNPATENTED_HINTING.  This fixes the return value of
-       `FT_Get_TrueType_Engine_Type' (and makes it work as documented).
-       Reported in bug #441638 of bugzilla.novell.com.
-
-       * docs/CHANGES: Document it.
-
-2008-11-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_subrs): Use an endless loop.  There are
-       fonts (like HELVI.PFB version 003.001, used on OS/2) which define
-       some `subrs' elements more than once.  Problem reported by Peter
-       Weilbacher <mozilla@weilbacher.org>.
-
-2008-10-15  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/sfnt/ttpost.c (tt_post_default_names): Add `const'.
-
-2008-10-15  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Disambiguate for
-       meddlesome compilers' warning against `for ( ...; ...; ...) ;'.
-
-2008-10-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_face_init): Remove compiler warning.
-       Suggested by Bram Tassyns in Savannah patch #6651.
-
-2008-10-12  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Fix computation of
-       `underline_position'.
-
-2008-10-12  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2008-10-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Fix Savannah bug #24468.
-
-       According to include/freetype/internal/ftobjs.h, the appropriate
-       type to interchange single character codepoint is FT_UInt32. It
-       should be distinguished from FT_UInt which can be 16bit integer.
-
-       * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Change the type
-       of the second argument `pcharcode' from FT_UInt* to FT_UInt32*.
-       (tt_cmap4_char_map_binary): Ditto.
-       (tt_cmap14_get_nondef_chars): Change the type of return value
-       from FT_UInt* to FT_UInt32*.
-
-2008-10-08  John Tytgat  <John.Tytgat@esko.com>
-
-       Fix Savannah bug #24485.
-
-       * src/type1/t1load.c (parse_charstrings): Assure that we always have
-       a .notdef glyph.
-
-2008-10-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Include FT_TRUETYPE_TAGS_H for multi build.
-       * builds/mac/ftmac.c: Ditto.
-
-2008-10-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/tttags.h (TTAG_TYP1, TTAG_typ1): Fix definitions.
-       * src/base/ftobjs.c: Include FT_TRUETYPE_TAGS_H.
-
-2008-10-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/sfnt/sfobjs.c (sfnt_open_font): Allow `typ1' version tag in
-       the beginning of sfnt container.
-       * src/sfnt/ttload.c (check_table_dir): Return
-       `SFNT_Err_Table_Missing' when sfnt table directory structure is
-       correct but essential tables for TrueType fonts (`head', `bhed' or
-       `SING') are missing.  Other errors are returned by
-       SFNT_Err_Unknown_File_Format.
-
-       * src/base/ftobjs.c (FT_Open_Face): When TrueType driver returns
-       `FT_Err_Table_Missing', try `open_face_PS_from_sfnt_stream'.  It is
-       enabled only when old mac font support is configured.
-
-2008-10-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/tttags.h (TTAG_CID, TTAG_FOND, TTAG_LWFN,
-       TTAG_POST, TTAG_sfnt, TTAG_TYP1, TTAG_typ1): New tags to simplify
-       the repeated calculations of these values in ftobjs.c and ftmac.c.
-       * src/base/ftobjs.c: Replace all FT_MAKE_TAG by new tags.
-       * src/base/ftmac.c: Ditto.
-       * builds/mac/ftmac.c: Ditto.
-
-2008-10-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (ft_lookup_PS_in_sfnt_stream): Remove wrong
-       initialization of *is_sfnt_cid.
-
-2008-10-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler
-       warnings.
-
-2008-10-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Replaced by...
-       (ft_lookup_PS_in_sfnt_stream): This.
-       (open_face_PS_from_sfnt_stream): New function.  It checks whether
-       the stream is sfnt-wrapped Type1 PS font or sfnt-wrapped CID-keyed
-       font, then try to open a face for given face_index.
-       (Mac_Read_sfnt_Resource): Replace the combination of
-       `ft_lookup_PS_in_sfnt' and `open_face_from_buffer' by
-       `open_face_PS_from_sfnt_stream'.
-       * src/base/ftmac.c (FT_New_Face_From_SFNT): Ditto.
-       * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto.
-       * src/base/ftbase.h: Remove `ft_lookup_PS_in_sfnt' and add
-       `open_face_PS_from_sfnt_stream'.
-
-2008-10-03  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Set *is_sfnt_cid to
-       FALSE if neither `CID ' nor `TYP1' is found in the sfnt container.
-
-2008-10-03  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/config/ftconfig.h: Define FT_MACINTOSH when SC or
-       MrC compiler of MPW is used.  These compilers do not define the
-       macro __APPLE__ by themselves.
-       * builds/unix/ftconfig.in: Ditto.
-       * builds/vms/ftconfig.h: Ditto.
-       * src/base/ftbase.c: Use FT_MACINTOSH instead of __APPLE__, to
-       include ftmac.c if FreeType 2 is built by MPW.
-       * src/base/ftobjs.c: Use FT_MACINTOSH instead of __APPLE__, to
-       enable shared functions for ftmac.c if FreeType 2 is built by MPW.
-
-       * builds/mac/ftmac.c: Include ftbase.h.
-       (memory_stream_close): Removed.
-       (new_memory_stream): Ditto.
-       (open_face_from_buffer): Removed.  Use the implementation in
-       ftobjs.c.
-       (ft_lookup_PS_in_sfnt): Ditto.
-
-       * builds/mac/FreeType.m68k_far.make.txt: Build ftmac.c as an
-       included part of ftbase.c, to share the functions in ftobjs.c.  The
-       rule compiling ftmac.c separately is removed and the rule copying
-       ftbase.c from src/base/ftbase.c to builds/mac/ftbase.c is added.
-       * builds/mac/FreeType.m68k_cfm.make.txt: Ditto.
-       * builds/mac/FreeType.ppc_classic.make.txt: Ditto.
-       * builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
-
-2008-10-02  Bram Tassyns  <bramt@enfocus.be>
-
-       * src/cff/cffgload.c (cff_slot_load): Map CID 0 to GID 0.  This
-       fixes Savannah bug #24430.
-
-2008-10-02  Werner Lemberg  <wl@gnu.org>
-
-       * builds/freetype.mk (BASE_H): Rename to...
-       (INTERNAL_H): This.
-       (FREETYPE_H): Updated.
-       * src/base/rules.mk: (BASE_OBJ_S, OBJ_DIR/%.$O): Add BASE_H.
-       * src/bdf/rules.mk (BDF_DRV_H): Add bdferror.h.
-       * src/cache/rules.mk (CACHE_DRV_H): Add ftccache.h and ftcsbits.h.
-       * src/pcf/rules.mk (PCF_DRV_H): Add pcfread.h.
-       * src/raster/rules.mk (RASTER_DRV_H): Add ftmisc.h.
-       * src/type42/rules.mk (T42_DRV_H): Add t42types.h.
-
-2008-10-02  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftbase.h: New file to declare the private utility
-       functions shared by the sources of base modules.  Currently,
-       `ft_lookup_PS_in_sfnt' and `open_face_from_buffer' are declared to
-       share between ftobjs.c and ftmac.c.
-
-       * src/base/rule.mk: Add ftbase.h.
-
-       * src/base/ftobjs.c: Include ftbase.h.
-       (memory_stream_close): Build on any platform when old MacOS font
-       support is enabled.
-       (new_memory_stream): Ditto.
-       (open_face_from_buffer): Build on any platform when old MacOS font
-       support is enabled.  The counting of the face in a font file is
-       slightly different between Carbon-dependent parser and Carbon-free
-       parser.  They are merged with the platform-specific conditional.
-       (ft_lookup_PS_in_sfnt): Ditto.
-
-       * src/base/ftmac.c: Include ftbase.h.
-       (memory_stream_close): Removed.
-       (new_memory_stream): Ditto.
-       (open_face_from_buffer): Removed.  Use the implementation in
-       ftobjs.c.
-       (ft_lookup_PS_in_sfnt): Ditto.
-
-2008-10-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): `psnames_error' is only needed
-       if TT_CONFIG_OPTION_POSTSCRIPT_NAMES is defined.
-
-2008-10-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttobjs.c (tt_face_done), src/cff/cffobjs.c
-       (cff_face_done), src/pfr/pfrobjs.c (pfr_face_done),
-       src/pcf/pcfdrivr.c (PCF_Face_Done), src/cid/cidobjs.c
-       (cid_face_done), src/bdf/bdfdrivr. (BDF_Face_Done),
-       src/sfnt/sfobjs.c (sfnt_face_done): Protect against face == 0.
-       Reported by Graham Asher.
-
-2008-09-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/rules.mk: Add conditional source to BASE_SRC, for `make
-       multi' on Mac OS X.  If the macro $(ftmac_c) is defined,
-       $(BASE_DIR)/$(ftmac_c) is added to BASE_SRC.  In a normal build, the
-       lack of ftmac.c in BASE_SRC is not serious because ftbase.c includes
-       ftmac.c.
-       * builds/unix/unix-def.in: Add a macro definition of $(ftmac_c).
-       * builds/unix/configure.raw: Add procedure to set up appropriate
-       value of $(ftmac_c) with the consideration of the availability of
-       Carbon framework.
-
-2008-09-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/Jamfile: Add target for multi build by jam on Mac OS X.
-       * src/base/ftobjs.c (FT_New_Face): Fix the condition to include this
-       function for MPW building.  It is synchronized the condition to
-       include ftmac.c source into ftbase.c.
-
-2008-09-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (CFF_Operator, cff_argument_counts,
-       cff_decoder_parse_charstrings): Handle (invalid)
-       `callothersubr' and `pop' instructions.
-
-2008-09-22  John Tytgat  <John.Tytgat@esko.com>
-
-       Fix Savannah bug #24307.
-
-       * include/freetype/internal/t1types.h (CID_FaceRec),
-       src/type42/t42types.h (T42_FaceRec): Comment out `afm_data'.
-
-2008-09-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/smooth/ftgrays.c (gray_raster_render): Don't dereference
-       `target_map' if FT_RASTER_FLAG_DIRECT is set.  Problem reported by
-       Stephan T. Lavavej <stl@nuwen.net>.
-
-2008-09-21  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/otvalid/Jamfile: Add missing target `otvmath' for multi build
-       by jam.
-       * src/sfnt/Jamfile: Add missing target `ttmtx' for multi build by
-       jam.
-
-2008-09-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/smooth/ftgrays.c (gray_find_cell): Fix threshold.  The values
-       passed to this function are already `normalized'.  Problem reported
-       by Stephan T. Lavavej <stl@nuwen.net>.
-
-       * docs/CHANGES: Document it.
-
-2008-09-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftoutln.c: Include FT_INTERNAL_DEBUG_H.
-       (FT_Outline_Decompose): Decorate with tracing messages.
-
-       * src/smooth/ftgrays.c [DEBUG_GRAYS]: Replace with
-       FT_DEBUG_LEVEL_TRACE.
-       [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: Include stdio.h and
-       stdarg.h.
-
-       (FT_TRACE) [_STANDALONE_]: Remove.
-       (FT_Message) [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: New function.
-       (FT_TRACE5, FT_TRACE7) [_STANDALONE_]: New macros.
-       (FT_ERROR) [_STANDALONE_]: Updated.
-
-       (gray_hline) [FT_DEBUG_LEVEL_TRACE]: Fix condition.
-       Use FT_TRACE7.
-       (gray_dump_cells): Make it `static void'.
-       (gray_convert_glyph): Use FT_TRACE7.
-
-       (FT_Outline_Decompose) [_STANDALONE_]: Synchronize with version in
-       ftoutln.c.
-
-       * src/base/ftadvanc.c (FT_Get_Advance, FT_Get_Advances): Use
-       FT_ERROR_BASE.
-
-       * docs/formats.txt: Updated.
-
-2008-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Import sfnt-wrapped Type1 and sfnt-wrapped
-       CID-keyed font support.
-       * builds/mac/ftmac.c: Ditto.
-
-2008-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Fix double free bug in
-       sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font support code.
-       `open_face_from_buffer' frees the passed buffer if it cannot open a
-       face from the buffer, so the caller must not free it.
-
-2008-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Add initial support
-       for sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font.
-       (ft_lookup_PS_in_sfnt): New function to look up `TYP1' or `CID '
-       table in sfnt table directory.  It is used before loading TrueType
-       font driver.
-
-       * docs/CHANGES: Add note about the current status of sfnt-wrapped
-       Type1 and sfnt-wrapped CID-keyed font support.
-
-2008-09-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftsystem.c (FT_Done_Memory): Use ft_sfree directly for
-       orthogonality (ft_free and ft_sfree could belong to different memory
-       pools).  This fixes Savannah bug #24297.
-
-2008-09-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/cff/cffobjs.c (cff_face_init): Use TTAG_OTTO defined
-       in ttags.h instead of numerical value 0x4F54544FL.
-
-2008-09-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.h, src/cff/cffgload.c
-       (cff_decoder_set_width_only): Eliminate function call.
-
-2008-09-15  George Williams  <gww@silcom.com>
-
-       Fix Savannah bug #24179, reported by Bram Tassyns.
-
-       * src/type1/t1load.c (mm_axis_unmap, T1_Get_MM_Var): Fix computation
-       of default values.
-
-2008-09-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/glnames.py (main): Surround `ft_get_adobe_glyph_index'
-       and `ft_adobe_glyph_list' with FT_CONFIG_OPTION_ADOBE_GLYPH_LIST to
-       prevent unconditional definition.  This fixes Savannah bug #24241.
-
-       * src/psnames/pstables.h: Regenerated.
-
-2008-09-13  Werner Lemberg  <wl@gnu.org>
-
-       * autogen.sh, builds/unix/configure.raw,
-       include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor
-       beautifying.
-
-       * include/freetype/ftadvanc.h, include/freetype/ftgasp.h,
-       include/freetype/ftlcdfil.h: Protect against FreeType 1.
-       Some other minor fixes.
-
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
-
-2008-09-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftbase.c: Include ftadvanc.c.
-
-2008-09-11  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/ftconfig.in: Duplicate the cpp computation of
-       FT_SIZEOF_{INT|LONG} from include/freetype/config/ftconfig.h.
-       (FT_USE_AUTOCONF_SIZEOF_TYPES): New macro.  If defined, the cpp
-       computation is disabled and the statically configured sizes are
-       used.  This fixes Savannah bug #21250.
-
-       * builds/unix/configure.raw: Add the checks to compare the cpp
-       computation results of the bit length of int and long versus the
-       sizes detected by running `configure'.  If the results are
-       different, FT_USE_AUTOCONF_SIZEOF_TYPES is defined to prioritize the
-       results.
-       New option --{enable|disable}-biarch-config is added to define or
-       undefine FT_USE_AUTOCONF_SIZEOF_TYPES manually.
-
-2008-09-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Clear FT2_EXTRA_LIBS when Carbon or
-       ApplicationService framework is missing.  Although this value is not
-       used in building of FreeType2, it is written in `freetype2.pc' and
-       `freetype-config'.
-
-2008-09-01  david turner  <david@freetype.org>
-
-       * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Accept a negative cmap
-       index to mean `use default cached FT_Face's charmap'.  This fixes
-       Savannah bug #22625.
-       * include/freetype/ftcache.h: Document it.
-
-
-       Make FT_MulFix an inlined function.  This is done to speed up
-       FreeType a little (on x86 3% when loading+hinting, 10% when
-       rendering, ARM savings are more important though).  Disable this by
-       undefining FT_CONFIG_OPTION_INLINE_MULFIX.
-
-       Use of assembler code can now be controlled with
-       FT_CONFIG_OPTION_NO_ASSEMBLER.
-
-       * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in
-       [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_arm): New assembler
-       implementation.
-       [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_i386): Assembler
-       implementation taken from `ftcalc.c'.
-       [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MULFIX_ASSEMBLER): New macro
-       which is defined to the platform-specific assembler implementation
-       of FT_MulFix.
-       [FT_CONFIG_OPTION_INLINE_MULFIX && FT_MULFIX_ASSEMBLER]
-       (FT_MULFIX_INLINED): New macro.
-
-       * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_NO_ASSEMBLER,
-       FT_CONFIG_OPTION_INLINE_MULFIX): New macros.
-
-       * include/freetype/freetype.h: Updated to handle FT_MULFIX_INLINED.
-
-       * src/base/ftcalc.c: Updated to use FT_MULFIX_ASSEMBLER and
-       FT_MULFIX_INLINED.
-
-
-       Add a new header named FT_ADVANCES_H declaring some new APIs to
-       extract the advances of one or more glyphs without necessarily
-       loading their outlines.  Also provide `fast loaders' for the
-       TrueType, Type1, and CFF font drivers (more to come later).
-
-       * src/base/ftadvanc.c, include/freetype/ftadvanc.h: New files.
-
-       * include/freetype/config/ftheader.h (FT_ADVANCES_H): New macro.
-       * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): New macro.
-
-       * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc):
-       `flags' and `advances' are now of type `FT_UInt' and `FT_Fixed',
-       respectively.
-
-       * src/base/Jamfile (_sources), src/base/rules.mk (BASE_SRC): Add
-       ftadvanc.c.
-
-       * src/cff/cffdrivr.c (cff_get_advances): New function.
-       (cff_driver_class): Register it.
-
-       * src/cff/cffgload.c (cff_decoder_set_width_only): New function.
-       (cff_decoder_parse_charstrings): Handle `width_only'.
-       (cff_slot_load): Handle FT_LOAD_ADVANCE_ONLY.
-
-       * src/cff/cffgload.h (cff_decoder): New element `width_only'.
-       (cff_decoder_set_width_only): New declaration.
-
-       * src/truetype/ttdriver.c (tt_get_advances): New function.
-       (tt_driver_class): Register it.
-
-       * src/truetype/ttgload.c (Get_HMetrics, Get_VMetrics): Renamed to...
-       (TT_Get_HMetrics, TT_Get_VMetrics): This.
-       Update callers.
-       * src/truetype/ttgload.h: Declare them.
-
-       * src/type1/t1gload.h, src/type1/t1gload.c (T1_Get_Advances): New
-       function.
-       * src/type1/t1driver.c (t1_driver_class): Register T1_Get_Advances.
-
-
-       Add checks for minimum version of the `autotools' stuff.
-
-       * autogen.sh: Implement it.
-       (get_major_version, get_minor_version, get_patch_version,
-       compare_to_minimum_version, check_tool_version): New auxiliary
-       functions.
-
-       * README.CVS: Document it.
-
-2008-08-29  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/sfnt/sfobjs.c (sfnt_open_font): Use TTAG_OTTO defined in
-       ttags.h instead of FT_MAKE_TAG( 'O', 'T', 'T', 'O' ).
-
-2008-08-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_encoding): Protect against infinite
-       loop.  This fixes Savannah bug #24150 (where a patch has been posted
-       too).
-
-2008-08-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c
-       (afm_compare_kern_pairs): Fix comparison.  This fixes Savannah bug
-       #24119.
-
-2008-08-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (FT_Stream_New): Initialize *astream always,
-       even if passed library or arguments are invalid.  This fixes a bug
-       that an uninitialized stream is freed when an invalid library handle
-       is passed.  Originally proposed by Mike Fabian, 2008/08/18 on
-       freetype-devel.
-       (FT_Open_Face): Ditto (stream).
-       (load_face_in_embedded_rfork): Ditto (stream2).
-
-2008-08-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Add a fallback to guess the availability of the
-       `ResourceIndex' type.  It is used when built without configure
-       (e.g., a build with Jam).
-       * builds/mac/ftmac.c: Ditto.
-       * builds/unix/configure.raw: Set HAVE_TYPE_RESOURCE_INDEX to 1 or 0
-       explicitly, even if `ResourceIndex' is unavailable.
-
-2008-08-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: In checking of Mac OS X features,
-       all-in-one header file `Carbon.h' is replaced by the minimum
-       header file `CoreServices.h', similar to current src/base/ftmac.c.
-
-2008-08-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/sfnt/ttcmap.c (tt_cmap2_validate): Skip the validation of
-       sub-header when its code_count is 0.  Many Japanese Dynalab fonts
-       include such an empty sub-header (code_count == 0, first_code == 0
-       delta == 0, but offset != 0) as the second sub-header in SJIS cmap.
-
-2008-08-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1tokens.h: Handle `ForceBold' keyword.  This fixes
-       Savannah bug #23995.
-
-       * src/cid/cidload.c (parse_expansion_factor): New callback function.
-       (cid_field_records): Use it for `ExpansionFactor'.
-       * src/cod/cidtoken.h: Handle `ForceBold' keyword.
-       Don't handle `ExpansionFactor'.
-
-2008-08-04  Bram Tassyns  <bramt@enfocus.be>
-
-       * src/cff/cffparse.c (cff_parse_fixed_scaled): Fix thinko which
-       resulted in incorrect scaling.  This fixes Savannah bug #23973.
-
-2008-08-04  Werner Lemberg  <wl@gnu.org>
-
-       Be more tolerant w.r.t. invalid entries in SFNT table directory.
-
-       * src/sfnt/ttload.c (check_table_dir): Ignore invalid entries and
-       adjust table count.
-       Add more trace messages.
-       (tt_face_load_font_dir): Updated.
-
-2008-07-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings): No longer
-       assume that the first argument on the stack is the bottom-most
-       element.  Two reasons:
-
-         o According to people from Adobe it is missing in the Type 2
-           specification that pushing of additional, superfluous arguments
-           on the stack is prohibited.
-
-         o Acroread in general handles fonts differently, namely by popping
-           the number of arguments needed for a particular operand (as a PS
-           interpreter would do).  In case of buggy fonts this causes a
-           different interpretation which of the elements on the stack are
-           superfluous and which not.
-
-       Since there are CFF subfonts (embedded in PDFs) which rely on
-       Acroread's behaviour, FreeType now does the same.
-
-2008-07-27  Werner Lemberg  <wl@gnu.org>
-
-       Add extra mappings for `Tcommaaccent' and `tcommaaccent'.  This
-       fixes Savannah bug #23940.
-
-       * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): Rename to...
-       (EXTRA_GLYPH_LIST_SIZE): This.
-       Increase by 2.
-       (ft_wgl_extra_unicodes): Rename to...
-       (ft_extra_glyph_unicodes): This.
-       Add two code values.
-       (ft_wgl_extra_glyph_names): Rename to...
-       (ft_extra_glyph_names): This.
-       Add two glyphs.
-       (ft_wgl_extra_glyph_name_offsets): Rename to...
-       (ft_extra_glyph_name_offsets): This.
-       Add two offsets.
-
-       (ps_check_wgl_name, ps_check_wgl_unicode): Rename to...
-       (ps_check_extra_glyph_name, ps_check_extra_glyph_unicode): This.
-       Updated.
-       (ps_unicodes_init): Updated.
-
-2008-07-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_decoder_prepare,
-       cff_decoder_parse_charstrings): Improve debug output.
-
-2008-07-22  Martin McBride  <mmcbride@emtex.com>
-
-       * src/sfnt/ttcmap.c (tt_cmap4_validate, tt_cmap4_char_map_linear,
-       tt_cmap4_char_map_binary): Handle fonts which treat the last segment
-       specially.  According to the specification, such fonts would be
-       invalid but acroread accepts them.
-
-2008-07-16  Jon Foster  <Jon.Foster@cabot.co.uk>
-
-       * src/pfr/pfrdrivr.c (pfr_get_advance): Fix off-by-one error.
-
-       * src/base/ftcalc.c (FT_MulFix): Fix portability issue.
-
-       * src/sfnt/ttpost.c (MAC_NAME) [!FT_CONFIG_OPTION_POSTSCRIPT_NAMES]:
-       Fix compiler warning.
-
-2008-07-16  Werner Lemberg  <wl@gnu.org>
-
-       Handle CID-keyed fonts wrapped in an SFNT (with cmaps) correctly.
-
-       * src/cff/cffload.c (cff_font_load): Pass `pure_cff'.
-       Invert sids table only if `pure_cff' is set.
-       * src/cff/cffload.h: Udpated.
-
-       * src/cff/cffobjs.c (cff_face_init): Updated.
-       Set FT_FACE_FLAG_CID_KEYED only if pure_cff is set.
-
-       * docs/CHANGES: Updated.
-
-2008-07-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttpload.c (tt_face_load_loca): Handle buggy fonts
-       where num_locations < num_glyphs.  Problem reported by Ding Li.
-
-2008-07-05  Werner Lemberg  <wl@gnu.org>
-
-       Since FreeType uses `$(value ...)', we now need GNU make 3.80 or
-       newer.  This fixes Savannah bug #23648.
-
-       * configure: zsh doesn't like ${1+"$@"}.
-       Update needed GNU make version.
-       * builds/toplevel.mk: Check for `$(eval ...)'.
-       * docs/INSTALL.GNU, docs/INSTALL.CROSS, docs/INSTALL.UNIX: Document
-       it.
-
-2008-07-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (Draw_Sweep): If span is smaller than one
-       pixel, only check for dropouts if neither start nor end point lies
-       on a pixel center.  This fixes Savannah bug #23762.
-
-2008-06-29  Werner Lemberg  <wl@gnu.org>
-
-       * Version 2.3.7 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-7'.
-
-       * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
-       version number to 2.3.7.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.6/2.3.7/, s/236/237/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7.
-
-       * builds/unix/configure.raw (version_info): Set to 9:18:3.
-
-       * docs/release: Updated.
-
-2008-06-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/ftglyph.c (FT_Matrix_Multiply, FT_Matrix_Invert): Move to...
-       * src/ftcalc.c: Here.  This fixes Savannah bug #23729.
-
-2008-06-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
-       Horizontal_Gray_Sweep_Drop): Test for intersections which
-       degenerate to a single point can be ignored; this has been confirmed
-       by Greg Hitchcock from Microsoft.  (This was commented out code.)
-
-2008-06-26  Werner Lemberg  <wl@gnu.org>
-
-       Improve navigation in API reference.
-
-       * src/tools/docmaker/tohtml.py (html_header_3): Renamed to...
-       (html_header_6): This.
-       (html_header_3, html_header_3i, html_header_4, html_header_5,
-       html_header_5t): New strings.
-       (toc_footer_start, toc_footer_end): New strings.
-       (HtmlFormatter::html_header): Updated.
-       (HtmlFormatter::html_index_header, HtmlFormatter::html_toc_header):
-       New strings.
-       (HtmlFormatter::index_enter): Use `html_index_header'.
-       (HtmlFormatter::index_exit): Print `html_footer'.
-       (HtmlFormatter::toc_enter): Use `html_toc_header'.
-       (HtmlFormatter::toc_exit): Print proper footer.
-
-       Convert ~ to non-breakable space.
-
-       * src/tools/docmaker/tohtml.py (make_html_para): Implement it.
-       Update header files accordingly.
-
-2008-06-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Check type `ResourceIndex' explicitly
-       and define HAVE_TYPE_RESOURCE_INDEX if it is defined.  Mac OS X 10.5
-       bundles 10.4u SDK with MAC_OS_X_VERSION_10_5 macro but without
-       ResourceIndex type definition.  The macro does not inform the type
-       availability.
-       * src/base/ftmac.c: More parentheses are inserted to clarify the
-       conditionals to disable legacy APIs in `10.5 and later' cases.  If
-       HAVE_TYPE_RESOURCE_INDEX is not defined, ResourceIndex is defined.
-
-2008-06-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (Ins_SCANTYPE): Don't check rendering
-       mode.
-
-       * src/raster/ftraster.c (Render_Glyph, Render_Gray_Glyph,
-       Draw_Sweep): No-dropout mode is value 2, not value 0.
-       (Draw_Sweep): Really skip dropout handling for no-dropout mode.
-
-2008-06-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psobjs.c (t1_builder_close_contour): Don't add contour
-       if it consists of one point only.  Based on a patch from Savannah
-       bug #23683 (from John Tytgat).
-
-2008-06-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (TT_Load_Glyph): Protect bytecode stuff
-       with IS_HINTED.
-
-       * docs/CHANGES: Updated.
-
-2008-06-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: If CFLAGS has `-isysroot XXX' option
-       but LDFLAGS does not, import it to LDFLAGS.  The option is used to
-       specify non-default SDK on Mac OS X (e.g., universal binary SDK for
-       Mac OS X 10.4 on PowerPC platform).  Although Apple TechNote 2137
-       recommends to add the option only to CFLAGS, LDFLAGS should include
-       it because libfreetype.la is built with -no-undefined.  This fixes a
-       bug reported by Ryan Schmidt in MacPorts,
-       http://trac.macports.org/ticket/15331.
-
-2008-06-21  Werner Lemberg  <wl@gnu.org>
-
-       Enable access to the various dropout rules of the B&W rasterizer.
-       Pass dropout rules from the TT bytecode interpreter to the
-       rasterizer.
-
-       * include/freetype/ftimage.h (FT_OUTLINE_SMART_DROPOUTS,
-       FT_OUTLINE_EXCLUDE_STUBS): New flags for FT_Outline.
-
-       * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
-       Horizontal_Gray_Sweep_Drop): Use same mode numbers as given in the
-       OpenType specification.
-       Fix mode 4 computation.
-       (Render_Glyph, Render_Gray_Glyph): Handle new outline flags.
-
-       * src/truetype/ttgload.c (TT_Load_Glyph) Convert scan conversion
-       mode to FT_OUTLINE_XXX flags.
-
-       * src/truetype/ttinterp.c (Ins_SCANCTRL): Enable ppem check.
-
-2008-06-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_face_init): Compute final
-       `dict->units_per_em' value before assigning it to
-       `cffface->units_per_EM'.  Otherwise, CFFs without subfonts are
-       scaled incorrectly if the font matrix is non-standard.  This fixes
-       Savannah bug #23630.
-
-       * docs/CHANGES: Updated.
-
-2008-06-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/type/t1objs.c (T1_Face_Init): Slightly improve algorithm fix
-       from 2008-06-19.
-
-2008-06-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/type/t1objs.c (T1_Face_Init): Fix change from 2008-03-21.
-       Reported by Peter Weilbacher <mozilla@weilbacher.org>.
-
-       * docs/CHANGES: Updated.
-
-2008-06-15  George Williams  <gww@silcom.com>
-
-       * src/otvalid/otvgpos.c (otv_MarkBasePos_validate): Set
-       `valid->extra2' to 1.  This is undocumented in the OpenType 1.5
-       specification.
-
-2008-06-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftcalc.c (FT_MulFix) <asm>: Protect registers correctly
-       from clobbering.  Patch from Savannah bug report #23556.
-
-       * docs/CHANGES: Document it.
-
-2008-06-10  Werner Lemberg  <wl@gnu.org>
-
-       * autogen.sh: Add option `--install' to libtoolize.
-
-2008-06-10  Werner Lemberg  <wl@gnu.org>
-
-       * Version 2.3.6 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-6'.
-
-       * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
-       version number to 2.3.6.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.5/2.3.6/, s/235/236/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6.
-
-       * builds/unix/configure.raw (version_info): Set to 9:17:3.
-
-
-       * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `scale_x'
-       and `scale_y'.
-       * src/cff/cffgload.h (CFF_Builder): Remove `scale_x' and `scale_y'.
-
-
-       * src/cff/cffparse.c: Include FT_INTERNAL_DEBUG_H.
-       * src/cff/cffobjs.h: Include FT_INTERNAL_POSTSCRIPT_HINTS_H.
-
-2008-06-10  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (open_face): Check `clazz->init_face' and
-       `clazz->done_face'.
-
-2008-06-09  VaDiM  <s_sliva@rambler.ru>
-
-       Support debugging on WinCE.  From Savannah patch #6536; this fixes
-       bug #23497.
-
-       * builds/win32/ftdebug.c (OutputDebugStringEx): New function/macro
-       as a replacement for OutputDebugStringA (which WinCE doesn't have).
-       Update all callers.
-       (ft_debug_init) [_WIN32_CE]: WinCE apparently doesn't have
-       environment variables.
-
-2008-06-09  Werner Lemberg  <wl@gnu.org>
-
-       * README.CVS: Updated.
-
-       * builds/unix/configure.raw, builds/unix/freetype-config.in: Updated
-       for newer versions of autoconf and friends.
-
-2008-06-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1parse.h (T1_ParserRec): Make `base_len' and
-       `private_len' unsigned.
-
-       * src/type1/t1parse.c (read_pfb_tag): Make `asize' unsigned and read
-       it as such.
-       (T1_New_Parser, T1_Get_Private_Dict): Make `size' unsigned.
-
-
-       * src/base/ftstream.c (FT_Stream_Skip): Reject negative values.
-
-
-       * src/type1/t1load.c (parse_blend_design_positions): Check `n_axis'
-       for sane value.
-       Fix typo.
-
-
-       * src/psaux/psobjs.c (ps_table_add): Check `idx' correctly.
-
-
-       * src/truetype/ttinterp (Ins_SHC): Use BOUNDS() to check
-       `last_point'.
-
-
-       * src/sfnt/ttload.c (tt_face_load_max_profile): Limit
-       `maxTwilightPoints'.
-
-2008-06-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (Ins_IP): Handle case `org_dist == 0'
-       correctly.  This fixes glyphs `t' and `h' of Arial Narrow at 12ppem.
-
-2008-06-03  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftcache.h (FTC_FaceID): Change type back to
-       FT_Pointer.  Reported by Ian Britten <britten@caris.com>.
-
-2008-06-02  Werner Lemberg  <wl@gnu.org>
-
-       Emit header info for defined FreeType objects in reference.
-
-       * src/tools/docmaker/content.py (re_header_macro): New regexp.
-       (ContentProcessor::__init__): Initialize new dictionary `headers'.
-       (DocBlock::__init__): Collect macro header definitions.
-
-       * src/tools/docmaker/tohtml.py (header_location_header,
-       header_location_footer): New strings.
-       (HtmlFormatter::__init__): Pass `headers' dictionary.
-       (HtmlFormatter::print_html_field): Don't emit paragraph tags.
-       (HtmlFormatter::print_html_field_list): Emit empty paragraph.
-       (HtmlFormatter::block_enter): Emit header info.
-
-2008-06-01  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftheader.h (FT_UNPATENTED_HINTING_H,
-       FT_INCREMENTAL_H): Added.
-
-2008-05-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/docmaker/sources.py (SourceBlock::__init__): While
-       looking for markup tags, return immediately as soon a single one is
-       found.
-
-2008-05-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (Ins_MD): The MD instruction also uses
-       original, unscaled input values.  Confirmed by Greg Hitchcock from
-       Microsoft.
-
-2008-05-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/docmaker/tohtml.py (block_footer_start,
-       block_footer_middle): Beautify output.
-
-2008-05-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (fc_black_render): Return 0 when we are
-       trying to render into a zero-width/height bitmap, not an error code.
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Move initialization
-       of the graphics state for subglyphs to...
-       (TT_Hint_Glyph): This function.
-       Hinting instructions for a composite glyph apparently refer to the
-       just hinted subglyphs, not the unhinted, unscaled outline.  This
-       seems to fix Savannah bugs #20973 and (at least partially) #23310.
-
-2008-05-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (FT_New_Face_From_Suitcase): Check if valid
-       `aface' is returned by FT_New_Face_From_FOND().  The patch was
-       proposed by an anonymous reporter of Savannah bug #23204.
-
-2008-05-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshalgo.c (ps_hints_apply): Reset scale values after
-       correction for pixel boundary.  Without this patch, the effect can
-       be cumulative under certain circumstances, making glyphs taller and
-       taller after each call.  This fixes Savannah bug #19976.
-
-2008-05-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftdebug.c (FT_Message, FT_Panic): Send output to stderr.
-       This fixes Savannah bug #23280.
-
-       * docs/CHANGES: Updated.
-
-2008-05-18  David Turner  <david@freetype.org>
-
-       * src/psnames/psmodule.c (ft_wgl_extra_unicodes,
-       ft_wgl_extra_glyph_names, ft_wgl_extra_glyph_name_offsets,
-       ps_check_wgl_name, ps_check_wgl_unicode): Use `static' to make
-       declarations non-global.
-
-       * src/type1/t1load.c: Add missing comment.
-
-2008-05-17  Sam Hocevar  <samh>
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle zero-contour
-       glyphs correctly.  Patch from Savannah bug #23277.
-
-2008-05-16  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2008-05-16  Sergey Tolstov  <stolstov@esri.com>
-
-       Improve support for WGL4 encoded fonts.
-
-       * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): New macro.
-       (ft_wgl_extra_unicodes, ft_wgl_extra_glyph_names,
-       ft_wgl_extra_glyph_name_offsets): New arrays.
-       (ps_check_wgl_name, ps_check_wgl_unicode): New functions.
-       (ps_unicodes_init): Use them to add additional Unicode mappings.
-
-2008-05-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
-       <op_closepath>: `closepath' without a path is a no-op, not an error
-       (cf. the PS reference manual).
-
-       Reported by Martin McBride.
-
-2008-05-15  Werner Lemberg  <wl@gnu.org>
-
-       * builds/toplevel.mk (CONFIG_GUESS, CONFIG_SUB): Updated.
-
-2008-05-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_subrs): Accept fonts with a subrs array
-       which contains a single but empty entry.  This is technically
-       invalid (since it must end with `return'), but...
-
-       Reported by Martin McBride.
-
-2008-05-14  Werner Lemberg  <wl@gnu.org>
-
-       Finish fix of scaling bug of CID-keyed CFF subfonts.
-
-       * include/freetype/internal/ftcalc.h, src/base/ftcalc.c
-       (FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled): New
-       functions.
-
-       * src/cff/cffobjs.h (CFF_Internal): New struct.  It is used to
-       provide global hinting data for both the top-font and all subfonts
-       (with proper scaling).
-
-       * src/cff/cffobjs.c (cff_make_private_dict): New function, using
-       code from `cff_size_init'.
-       (cff_size_init, cff_size_done, cff_size_select, cff_size_request):
-       Use CFF_Internal and handle subfonts.
-       (cff_face_init): Handle top-dict and subfont matrices correctly;
-       apply some heuristic in case of unlikely matrix concatenation
-       results.  This has been discussed with people from Adobe (thanks
-       goes mainly to David Lemon) who confirm that the CFF specs are fuzzy
-       and not correct.
-
-       * src/cff/cffgload.h (cff_decoder_prepare): Add `size' argument.
-
-       * src/cff/cffgload.c (cff_builder_init): Updated.
-       (cff_decoder_prepare): Handle hints globals for subfonts.
-       Update all callers.
-       (cff_slot_load): Handling scaling of subfonts properly.
-
-       * src/cff/cffparse.c (cff_parse_fixed_dynamic): New function.
-       (cff_parse_font_matrix): Use it.
-
-       * src/cff/cfftypes.h (CFF_FontDictRec): Make `units_per_em'
-       FT_ULong.
-
-       * docs/CHANGES: Document it.
-
-2008-05-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/winfonts/winfnt.c (fnt_face_get_dll_font, FNT_Face_Init):
-       Handle case `face_index < 0'.
-       * docs/CHANGES: Document it.
-
-2008-05-04  Werner Lemberg  <wl@gnu.org>
-
-       First steps to fix the scaling bug of CID-keyed CFF subfonts,
-       reported by Ding Li on 2008/03/28 on freetype-devel.
-
-       * src/base/cff/cffparse.c (power_tens): New array.
-       (cff_parse_real): Rewritten to introduce a fourth parameter which
-       returns the `scaling' of the real number so that we have no
-       precision loss.  This is not used yet.
-       Update all callers.
-       (cff_parse_fixed_thousand): Replace with...
-       (cff_parse_fixed_scaled): This function.  Update all callers.
-
-2008-05-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Call the auto-hinter without
-       transformation since it recursively calls FT_Load_Glyph.  This fixes
-       Savannah bug #23143.
-
-2008-04-26  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/psaux.h (T1_BuilderRec): Mark `scale_x'
-       and `scale_y' as obsolete since they aren't used.
-       * src/psaux/psobjs.c (t1_builder_init): Updated.
-
-       * src/cff/cffgload.h (CFF_Builder): Mark `scale_x' and `scale_y' as
-       obsolete since they aren't used.
-       * src/cff/cffgload.c (cff_builder_init): Updated.
-
-2008-04-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/pcf/pcfdrivr.c (PCF_Face_Init): Protect call to
-       `FT_Stream_OpenLZW' with `FT_CONFIG_OPTION_USE_LZ'.  From Savannah
-       bug #22909.
-
-2008-04-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if
-       integer part is zero.
-
-2008-04-01  Werner Lemberg  <wl@gnu.org>
-
-       Fix compilation with g++ 4.1 (with both `single' and `multi'
-       targets).
-
-       * src/base/ftobjs.c (FT_Open_Face): Don't define a variable in block
-       which is crossed by a `goto'.
-
-       * src/otvalid/otvalid.h (otv_MATH_validate): Add prototype.
-
-2008-03-31  Werner Lemberg  <wl@gnu.org>
-
-       Fix support for subsetted CID-keyed CFFs.
-
-       * include/freetype/freetype.h (FT_FACE_FLAG_CID_KEYED,
-       FT_IS_CID_KEYED): New macros.
-
-       * src/cff/cffobjs.c (cff_face_init): Set number of glyphs to the
-       maximum CID value in CID-keyed CFFs.
-       Handle FT_FACE_FLAG_CID_KEYED flag.
-
-       * docs/CHANGES: Document it.
-
-
-       Fix CFF font matrix calculation and improve precision.
-
-       * src/cff/cffparse.c (cff_parse_real): Increase precision if integer
-       part is zero.
-       (cff_parse_font_matrix): Simplify computation of `units_per_em';
-       this prevents overflow also.
-
-
-       Support FT_Get_CID_Registry_Ordering_Supplement for PS CID fonts.
-
-       * src/cid/cidriver.c: Include FT_SERVICE_CID_H.
-       (cid_get_ros): New function.
-       (cid_service_cid_info): New service structure.
-       (cid_services): Register it.
-
-2008-03-23  Werner Lemberg  <wl@gnu.org>
-
-       Adjustments for Visual C++ 8.0, as reported by Rainer Deyke.
-
-       * builds/compiler/visualc.mk (CFLAGS): Remove /W5.
-       (ANSIFLAGS): Add _CRT_SECURE_NO_DEPRECATE.
-
-2008-03-21  Laurence Darby  <ldarby>
-
-       * src/type1/t1objs.c (T1_Face_Init): Use `/Weight'.  Patch from
-       Savannah bug #22675.
-
-2008-03-13  Derek Clegg  <dclegg@apple.com>
-
-       * src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix named style loop.
-       Patch from Savannah bug #22541.
-
-2008-03-03  Masatoshi Kimura  <VYV03354@nifty.ne.jp>
-
-       * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary,
-       tt_cmap14_find_variant): Return correct value.
-       (tt_cmap14_variant_chars): Fix check for `di'.
-
-2008-02-29  Wermer Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2008-02-29  Wolf
-
-       Add build support for symbian platform.  From Savannah bug #22440.
-
-       * builds/symbian/*: New files.
-
-2008-02-21  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (parse_fond): Fix a bug of PostScript font name
-       synthesis.  For any face of a specified FOND, always the name for
-       the first face was used.  Except of a FOND that refers multiple
-       Type1 font files, wrong synthesized font names are not used at all,
-       so this is an invisible bug.  A few limit checks are added too.
-
-       * builds/mac/ftmac.c: Ditto.
-
-2008-02-21  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Split compiler option to link Carbon
-       frameworks to one option for CoreServices framework and another
-       option for ApplicationServices framework.  The split options can be
-       managed by GNU libtool to avoid unrequired duplication when FreeType
-       is linked with other applications.  Suggested by Daniel Macks,
-       Savannah bug #22366.
-
-2008-02-18  Victor Stinner  <victor.stinner@haypocalc.com>
-
-       * src/truetype/ttinterp.c (Ins_IUP): Check number of points.  Fix
-       from Savannah bug #22356.
-
-2008-02-17  Jonathan Blow  <jon@number-none.com>
-
-       * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
-       Check for valid callback pointers.
-
-2008-02-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (FT_New_Face_From_SFNT): Check the sfnt resource
-       handle by its value instead of ResError(), fix provided by Deron
-       Kazmaier.  According to the Resource Manager Reference,
-       GetResource(), Get1Resource(), GetNamedResource(),
-       Get1NamedResource() and RGetResource() set noErr but return NULL
-       handle when they can not find the requested resource.  These
-       functions never return undefined values, so it is sufficient to
-       check if the handle is not NULL.
-
-       * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto.
-
-2008-02-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftbase.c: <ftmac.c> is replaced by "ftmac.c" as other
-       inclusion styles.  Now it always includes src/base/ftmac.c;
-       builds/mac/ftmac.c is never included in any configuration.
-
-       * builds/unix/configure.raw: Print warning if configure is executed
-       with options to specify Carbon functionalities explicitly.
-
-       * docs/INSTALL.MAC: Note that legacy builds/mac/ftmac.c is not
-       included automatically and manual replacement is required.
-
-2008-02-11  Werner Lemberg  <wl@gnu.org>
-
-       * builds/modules.mk (CLOSE_MODULE, REMOVE_MODULE), builds/detect.mk
-       (dos_setup), builds/freetype.mk (clean_project_dos,
-       distclean_project_dos): Don't use \ but $(SEP).  Reported by Duncan
-       Murdoch.
-
-2008-01-18  Sylvain Pasche  <sylvain.pasche@gmail.com>
-
-       * src/base/ftlcdfil.c (_ft_lcd_filter_legacy): Updated comment to
-       mention intra-pixel algorithm.
-
-       * include/freetype/freetype.h (FT_Render_Mode): Mention that
-       FT_Library_SetLcdFilter can be used to reduce fringes.
-
-2008-01-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (ft_black_render): Check `outline' before
-       using it.  Reported by Allan Yang.
-
-2008-01-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (FT_CONFIG_OPTION_5_GRAY_LEVELS): Remove.
-
-2008-01-12  Allan Yang, Jian Hua - SH  <Allan.Yang@fmc.fujitsu.com>
-
-       * src/raster/ftraster.c (ft_black_init)
-       [FT_RASTER_OPTION_ANTI_ALIASING]: Fix compilation.
-
-2008-01-10  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Handle the case
-       where the number of contours in a simple glyph is zero (and which
-       does contain an entry in the `glyf' table).  This fixes Savannah bug
-       #21990.
-
-2008-01-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Formatting suggested by Sean McBride.
-
-       * builds/mac/ftmac.c: Formatting (tab expanded).
-       * src/autofit/afindic.c: Ditto.
-       * src/base/ftcid.c: Ditto.
-       * src/base/ftmac.c: Ditto.
-
-2007-12-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/smooth/ftgrays.c (gray_raster_render): Check `outline'
-       correctly.
-
-2007-12-21  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Improvement of POSIX resource-fork accessor to load unsorted
-       references in a resource.  In HelveLTMM (resource-fork PostScript
-       Type1 font bundled with Mac OS X since 10.3.x), the appearance order
-       of PFB chunks is not sorted; sorting the chunks by reference IDs is
-       required.
-
-       * include/freetype/internal/ftrfork.h (FT_RFork_Ref): New structure
-       type to store a pair of reference ID and offset to the chunk.
-
-       * src/base/ftrfork.c (ft_raccess_sort_ref_by_id): New function to
-       sort FT_RFork_Ref by their reference IDs.
-
-       (FT_Raccess_Get_DataOffsets): Returns an array of offsets that is
-       sorted by reference ID.
-
-2007-12-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffparse.c (cff_parse_real): Don't apply `power_ten'
-       division too early; otherwise the most significant digit(s) of the
-       final result are lost as the value is truncated to an integer.  This
-       fixes Savannah bug #21794 (where the patch has been posted too).
-
-2007-12-06  Fix  <4d876b82@gmail.com>
-
-       Pass options from one configure script to another as-is (not
-       expanded).  This is needed for options like
-       --includedir='${prefix}/include'.
-
-       * builds/unix/detect.mk, configure: Prevent argument expansion in
-       call to the (real) `configure' script.
-
-2007-12-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fix compilation if
-       TT_USE_BYTECODE_INTERPRETER isn't defined.
-
-2007-12-06  Werner Lemberg  <wl@gnu.org>
-
-       There exist CFFs which contain opcodes for the Type 1 operators
-       `hsbw' and `closepath' which are both invalid in Type 2 charstrings.
-       However, it doesn't harm to support them.
-
-       * src/cff/cffgload.c (CFF_Operator): Add `cff_op_hsbw' and
-       `cff_op_closepath.'
-       (cff_argument_counts): Ditto.
-
-       (cff_decoder_parse_charstrings): Handle Type 1 opcodes 9 (closepath)
-       and 13 (hsbw) which are invalid in Type 2 charstrings.
-
-2007-12-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftrfork.c (raccess_guess_darwin_newvfs): New function to
-       support new pathname syntax `..namedfork/rsrc' to access a resource
-       fork on Mac OS X.  The legacy syntax `/rsrc' does not work on
-       case-sensitive HFS+.
-       (raccess_guess_darwin_hfsplus): Fix a bug in the calculation of
-       buffer size to store a pathname.
-       * include/freetype/internal/ftrfork.h: Increment the number of
-       resource fork guessing rule.
-
-2007-12-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Improve the compile tests to search
-       Carbon functions.
-       * builds/mac/ftmac.c: Import fixes for Carbon incompatibilities
-       proposed by Sean McBride from src/base/ftmac.c (see 2007-11-16).
-
-2007-12-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       The documents and comments for Mac OS X are improved by Sean
-       McBride.
-
-       * src/base/ftmac.c: Fix a comment.
-       * include/freetype/ftmac.h: Ditto.
-       * docs/INSTALL.MAC: Improve English and add comment on lowest
-       system version specified by MACOSX_DEPLOYMENT_TARGET.
-
-2007-12-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_subfont_load): Don't use logical OR to
-       concatenate error codes.
-       * src/sfnt/ttsbit.c (Load_SBit_Range): Ditto.
-
-2007-12-04  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/truetype/ttobjs.c (tt_face_init): Don't use logical OR to
-       concatenate error codes.
-
-2007-12-04  Sean McBride  <sean@rogue-research.com>
-
-       * src/pfr/pfrgload.c (pfr_glyph_load_compound): Remove compiler
-       warning.
-
-2007-11-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Fix MacOS legacy font support by Masatake Yamato on Mac OS X.  It is
-       not working since 2.3.5.  In FT_Open_New(), if FT_New_Stream()
-       cannot mmap() the specified file and cannot seek to head of the
-       specified file, it returns NULL stream and FT_Open_New() returns the
-       error immediately.  On MacOS, most legacy MacOS fonts fall into such
-       a scenario because their data forks are zero-sized and cannot be
-       sought.  To proceed to guessing of resource fork fonts, the
-       functions for legacy MacOS font must properly handle the NULL stream
-       returned by FT_New_Stream().
-
-       * src/base/ftobjs.c (IsMacBinary): Return error
-       FT_Err_Invalid_Stream_Operation immediately when NULL stream is
-       passed.
-       (FT_Open_Face): Even when FT_New_Stream() returns an error, proceed
-       to fallback.  Originally, legacy MacOS font is tested in the cases
-       of FT_Err_Invalid_Stream_Operation (occurs when data fork is empty)
-       or FT_Err_Unknown_File_Format (occurs when AppleSingle header or
-       .dfont header is combined).  Now the case of
-       FT_Err_Cannot_Open_Stream is included.
-
-       * src/base/ftrfork.c (FT_Raccess_Guess): When passed stream is NULL,
-       skip FT_Stream_Seek(), which seeks to the head of stream, and
-       proceed to unit testing of raccess_guess_XXX().  FT_Stream_Seek()
-       for a NULL stream causes a Bus error on Mac OS X.
-       (raccess_guess_apple_double): Return FT_Err_Cannot_Open_Stream
-       immediately if passed stream is NULL.
-       (raccess_guess_apple_single): Ditto.
-
-2007-11-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Fix for Carbon incompatibilities since Mac OS X 10.5,
-       proposed by Sean McBride.
-
-       * doc/INSTALL.MAC: Comment on MACOSX_DEPLOYMENT_TARGET.
-
-       * include/freetype/ftmac.h: Deprecate FT_New_Face_From_FOND and
-       FT_GetFilePath_From_Mac_ATS_Name.  Since Mac OS X 10.5, calling
-       Carbon functions from a forked process is classified as unsafe
-       by Apple.  All Carbon-dependent functions should be deprecated.
-
-       * src/base/ftmac.c: Use essential header files
-       <CoreServices/CoreServices.h> and
-       <ApplicationServices/ApplicationServices.h> instead of
-       all-in-one header file <Carbon/Carbon.h>.
-
-       Include <sys/syslimits.h> and replace HFS_MAXPATHLEN by Apple
-       genuine macro PATH_MAX.
-
-       Add fallback macro for kATSOptionFlagsUnRestrictedScope which
-       is not found in Mac OS X 10.0.
-
-       Multi-character constants ('POST', 'sfnt' etc) are replaced by
-       64bit constants calculated by FT_MAKE_TAG() macro.
-
-       For the index in the segment of resource fork, new portable
-       type ResourceIndex is introduced for better compatibility.
-       This type is since Mac OS X 10.5, so it is defined as short
-       when built on older platforms.
-
-       (FT_ATSFontGetFileReference): If build target is only the systems
-       10.5 and newer, it calls Apple genuine ATSFontGetFileReference().
-
-       (FT_GetFile_From_Mac_ATS_Name): Return an error if system is 10.5
-       and newer or 64bit platform, because legacy type FSSpec type is
-       removed completely.
-
-       (FT_New_Face_From_FSSpec): Ditto.
-
-2007-11-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_done_face): Check `sfnt' everywhere.  This
-       fixes Savannah bug #21485.
-
-2007-10-29  Daniel Svoboda  <dasvo@planeta@cz>
-
-       * src/winfonts/winfnt.c (FNT_Face_Init): Check first that the driver
-       can handle the font at all, then check `face_index'.  Otherwise, the
-       driver might return the wrong error code.  This fixes Savannah bug
-       #21468.
-
-2007-10-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Support bit 9 and prepare
-       support for bit 8 of the `fsSelection' field in the `OS/2' table.
-       MS is already using this; hopefully, this becomes part of OpenType
-       1.5.
-       Prepare also support for `name' IDs 21 (WWS_FAMILY) and 22
-       (WWS_SUBFAMILY).
-
-2007-10-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/docmaker/tohtml.py (html_header_2): Fix typo.
-       Add `td.left' element to CSS.
-       (toc_section_enter): Use it.
-
-2007-10-18  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h, src/base/ftobjs.c: Rename API
-       functions related to cmap type 14 support to the
-       `FT_Object_ActionName' scheme:
-
-         FT_Get_Char_Variant_index     -> FT_Face_GetCharVariantIndex
-         FT_Get_Char_Variant_IsDefault -> FT_Face_GetCharVariantIsDefault
-         FT_Get_Variant_Selectors      -> FT_Face_GetVariantSelectors
-         FT_Get_Variants_Of_Char       -> FT_Face_GetVariantsOfChar
-         FT_Get_Chars_Of_Variant       -> FT_Face_GetCharsOfVariant
-
-       Update documentation accordingly.
-
-       * src/sfnt/ttcmap.c: Stronger cmap 14 validation.
-       Make the code a little more consistent with FreeType coding
-       conventions and modify the cmap14 functions that returned a newly
-       allocated array to use a persistent vector from the TT_CMap14 object
-       instead.
-
-       (TT_CMap14Rec): Provide array and auxiliary data for result.
-       (tt_cmap14_done, tt_cmap14_ensure): New functions.
-
-       (tt_cmap14_init, tt_cmap14_validate, tt_cmap14_char_map_def_binary,
-       tt_cmap14_char_map_nondef_binary, tt_cmap14_find_variant,
-       tt_cmap14_char_var_index, tt_cmap14_variants,
-       tt_cmap14_char_variants, tt_cmap14_def_char_count,
-       tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars,
-       tt_cmap14_variant_chars, tt_cmap14_class_rec): Updated and improved.
-
-2007-10-15  George Williams  <gww@silcom.com>
-
-       Add support for cmap type 14.
-
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       (TT_CONFIG_CMAP_FORMAT_14): New macro.
-
-       * include/freetype/internal/ftobjs.h (FT_CMap_CharVarIndexFunc,
-       FT_CMap_CharVarIsDefaultFunc, FT_CMap_VariantListFunc,
-       FT_CMap_CharVariantListFunc, FT_CMap_VariantCharListFunc): New
-       support function prototypes.
-       (FT_CMap_ClassRec): Add them.
-       Update all users.
-
-       * include/freetype/ttnameid.h (TT_APPLE_ID_VARIANT_SELECTOR): New
-       macro.
-
-       * include/freetype/freetype.h (FT_Get_Char_Variant_Index,
-       FT_Get_Char_Variant_IsDefault, FT_Get_Variant_Selectors,
-       FT_Get_Variants_Of_Char, FT_Get_Chars_Of_Variant): New API
-       functions.
-
-       * src/base/ftobjs.c (find_variant_selector_charmap): New auxiliary
-       function.
-       (FT_Set_Charmap): Disallow cmaps of type 14.
-       (FT_Get_Char_Variant_Index, FT_Get_Char_Variant_IsDefault,
-       FT_Get_Variant_Selectors, FT_Get_Variants_Of_Char,
-       FT_Get_Chars_Of_Variant): New API functions.
-
-       * src/sfnt/ttcmap.c (TT_PEEK_UINT24, TT_NEXT_UINT24): New macros.
-
-       (TT_CMap14Rec, tt_cmap14_init, tt_cmap14_validate,
-       tt_cmap14_char_index, tt_cmap14_char_next, tt_cmap14_get_info,
-       tt_cmap14_char_map_def_binary, tt_cmap14_char_map_nondef_binary,
-       tt_cmap14_find_variant, tt_cmap14_char_var_index,
-       tt_cmap14_char_var_isdefault, tt_cmap14_variants,
-       tt_cmap14_char_variants, tt_cmap14_def_char_count,
-       tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars,
-       tt_cmap14_variant_chars, tt_cmap14_class_rec): New functions and
-       structures for cmap 14 support.
-       (tt_cmap_classes): Register tt_cmap14_class_rec.
-       (tt_face_build_cmaps): One more error message.
-
-       * docs/CHANGES: Mention cmap 14 support.
-
-2007-10-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (find_unicode_charmap): If search for a UCS-4
-       charmap fails, do the loop again while searching a UCS-2 charmap.
-       This favours MS charmaps over Apple ones.
-
-2007-08-29  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Introduction of abstract `short' data types,
-       ResFileRefNum and ResID.  These types were introduced for Copland,
-       then backported to MPW.  The variables exchanged with FileManager
-       QuickDraw frameworks are redefined by these data types.  Patch was
-       proposed by Sean McBride.
-       * builds/mac/ftmac.c: Ditto.
-
-2007-08-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/otvalid/otvcmmn.c (otv_x_y_ux_sy): Skip context glyphs.  Found
-       by Imran Yousaf.  Fixes Savannah bug #20773.
-
-       (otv_Lookup_validate): Correct handling of LookupType.  Found by
-       Imran Yousaf.  Fixes Savannah bug #20782.
-
-2007-08-17  George Williams  <gww@silcom.com>
-
-       * src/otvalid/otvgsub.c (otv_SingleSubst_validate): Fix handling of
-       SingleSubstFormat1.
-
-2007-08-11  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Fix a bug which sets CC_BUILD by
-       ${build-gcc} (unchecked) instead of by ${build}-gcc (checked).
-       Found by Ryan Hill.
-
-2007-08-11  George Williams  <gww@silcom.com>
-
-       * src/otvalid/otvcommn.c, src/otvalid/otvcommn.h
-       (otv_Coverage_validate): Add fourth argument to pass an expected
-       count value.  Update all users.
-       Check glyph IDs.
-       (otv_ClassDef_validate): Check `StartGlyph'.
-
-       * src/otvalid/otvgsub.c (otv_SingleSubst_validate): More glyph ID
-       checks.
-
-       * src/otvalid/otvmath.c (otv_MathConstants_validate): There are only
-       56 constants.
-       (otv_GlyphAssembly_validate, otv_MathGlyphConstruction_validate):
-       Check glyph IDs.
-
-2007-08-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/otvalid/otvbase.c, src/otvalid/otvcommn.c,
-       src/otvalid/otvgdef.c, src/otvalid/otvgpos.c, src/otvalid/otvgsub.c,
-       src/otvalid/otvjstf.c: s/FT_INVALID_DATA/FT_INVALID_FORMAT/ where
-       appropriate.  Reported by George.
-
-       * include/freetype/internal/fttrace.h: Define `trace_otvmath'.
-
-       * src/otvalid/rules.mk (OTV_DRV_SRC): Add otvmath.c.
-
-       * docs/CHANGES: Updated.
-
-2007-08-08  George Williams  <gww@silcom.com>
-
-       Add `MATH' validating support to otvalid module.
-
-       * include/freetype/tttags.h (TTAG_MATH): New macro.
-       * include/freetype/ftotval.h (FT_VALIDATE_MATH): New macro.
-       (FT_VALIDATE_OT): Updated.
-
-       * src/otvalid/otmath.c: New file.
-
-       * src/otvalid/otvalid.c: Include otvmath.c.
-       * src/otvalid/otvmod.c (otv_validate): Handle `MATH' table.
-
-2007-08-04  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.raw: Add call to AC_LIBTOOL_WIN32_DLL.
-       Fixes Savannah bug #20686.
-
-2007-08-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/psnames/psmodule.c: Fix usage of
-       FT_CONFIG_OPTION_POSTSCRIPT_NAMES macro.  Reported by Graham Asher.
-
-2007-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (open_face_from_buffer): The argument
-       `driver_name' is typed as `const char*' to match with the
-       callers in FT_New_Face_From_LWFN and FT_New_Face_From_SFNT.
-       This is same with open_face_from_buffer in src/base/ftobjs.c.
-       Found and fixed by Sean McBride.
-
-2007-07-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (count_table): Make it conditional.
-       * src/base/ftobjs.c (FT_New_Library): Check FT_RENDER_POOL_SIZE with
-       a preprocessor statement.
-
-2007-07-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftoutln.c (FT_Outline_Translate): Check `outline' before
-       first usage.  From Savannah patch #6115.
-
-2007-07-16  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2007-07-16  Derek Clegg  <dclegg@apple.com>
-
-       Add new service for getting the ROS from a CID font.
-
-       * include/freetype/config/ftheader.h (FT_CID_H): New macro.
-       * include/freetype/ftcid.h: New file.
-
-       * include/freetype/internal/ftserv.h (FT_SERVIVE_CID_H): New macro.
-       * include/freetype/internal/services/svcid.h: New file.
-
-       * src/base/ftcid.c: New file.
-
-       * src/cff/cffdrivr.c: Include FT_SERVICE_CID_H.
-       (cff_get_ros): New function.
-       (cff_service_cid_info): New service structure.
-       (cff_services): Register it.
-
-       * src/cff/cffload.c (cff_font_done): Free registry and ordering.
-
-       * src/cff/cfftypes.h (CFF_FontRec): Add `registry' and `ordering'.
-
-       * modules.cfg (BASE_EXTENSIONS): Add ftcid.c.
-
-2007-07-11  Derek Clegg  <dclegg@apple.com>
-
-       Add support for postscript name service to CFF driver.
-
-       * src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_NAME_H.
-       (cff_get_ps_name): New function.
-       (cff_service_ps_name): New service structure.
-       (cff_services): Register it.
-
-2007-07-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftglyph.c (FT_Glyph_Copy): Fix initialization of
-       `target'.  Reported by Sean McBride.
-
-2007-07-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/pfrcmap.c: Include pfrerror.h.
-
-       * src/autofit/afindic.c: Add some external declarations to pacify
-       `make multi' compilation.
-
-       * src/cid/cidgload.c (cid_load_glyph): Pacify compiler.
-
-       * src/cff/cffdrivr.c (cff_ps_get_font_info), src/cff/cffobjs.c
-       (cff_strcpy), include/freetype/internal/ftmemory.h (FT_MEM_STRDUP),
-       src/autofit/aflatin.c (af_latin_hints_compute_edges),
-       src/autofit/afcjk.c (af_cjk_hints_compute_edges), src/sfnt/ttmtx.c
-       (tt_face_get_metrics), src/base/ftobjs.c (open_face)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Fix compilation with C++ compiler.
-
-       * docs/release: Mention test compilation targets.
-
-2007-07-04  Werner Lemberg  <wl@gnu.org>
-
-       * docs/PROBLEMS: Mention that some PS based fonts can't be
-       handled correctly by FreeType.
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Always allow a
-       recursion depth of 1.  This was the maximum value in TrueType 1.0,
-       and some older fonts don't set this field correctly.
-
-       * src/gxvalid/gxvmort1.c
-       (gxv_mort_subtable_type1_substTable_validate): Fix tracing message.
-
-2007-07-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize
-       `round' to pacify compiler.
-
-2007-07-02  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.5 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-5'.
-
-       * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
-       version number to 2.3.5.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.4/2.3.5/, s/234/235/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
-
-       * builds/unix/configure.raw (version_info): Set to 9:16:3.
-
-2007-07-01  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h, src/base/ftpatent.c
-       (FT_Face_SetUnpatentedHinting): New function to dynamically change
-       the setting after a face is created.
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Fix a small bug
-       that created distortions in the bytecode interpreter results.
-
-2007-06-30  David Turner  <david@freetype.org>
-
-       * src/truetype/ttinterp.c (Ins_IUP): Add missing variable
-       initialization.
-
-       * src/autofit/aflatin.c (af_latin_metric_init_blues): Get rid of an
-       infinite loop in the case of degenerate fonts.
-
-2007-06-26  Rahul Bhalerao  <b.rahul.pm@gmail.com>
-
-       Add autofit module for Indic scripts.  This currently just reuses
-       the CJK-specific functions.
-
-       * include/freetype/config/ftoption.h (AF_CONFIG_OPTION_INDIC): New
-       macro.
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
-
-       * src/autofit/afindic.c, src/autofit/afindic.h: New files.
-
-       * src/autofit/afglobal.c, src/autofit/aftypes.h,
-       src/autofit/autofit.c: Updated.
-
-       * src/autofit/Jamfile (_sources), * src/autofit/rules.mk
-       (AUTOF_DRV_SRC): Updated.
-
-2007-06-23  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c (TT_Load_Simple): Fix change from
-       2007-06-16 that prevented the TrueType module from loading most
-       glyphs.
-
-2007-06-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_slot_load): Fix logic of 2007-05-28
-       change.
-
-2007-06-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_encoding): Handle one more error.
-
-2007-06-19  Dmitry Timoshkov  <dmitry@codeweavers.com>
-
-       * src/winfonts/winfnt.c (fnt_face_get_dll_font): Return error
-       FNT_Err_Invalid_File_Format if file format was recognized but
-       the file doesn't contain any FNT(NE) or RT_FONT(PE) resources.
-       Add verbose debug logs to make it easier to debug failing load
-       attempts.
-       (FNT_Face_Init): A single FNT font can't contain more than 1 face,
-       so return an error if requested face index is > 0.
-       Do not do further attempt to load fonts if a previous attempt has
-       failed but returned error FNT_Err_Invalid_File_Format, i.e., the
-       file format has been recognized but no fonts found in the file.
-
-2007-07-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Apply patches proposed by Sean McBride.
-       (FT_GetFile_From_Mac_Name): Insert FT_UNUSED macros to fix
-       the compiler warnings against unused arguments.
-       (FT_ATSFontGetFileReference): Ditto.
-       (FT_GetFile_From_Mac_ATS_Name): Ditto.
-       (FT_New_Face_From_FSSpec): Ditto.
-       (lookup_lwfn_by_fond): Fix wrong comment.
-       Replace `const StringPtr' by more appropriate type
-       `ConstStr255Param'.
-       FSRefMakePathPath always returns UTF8 POSIX pathname in
-       Mach-O, thus HFS pathname support is dropped.
-       (count_faces): Remove HLock and HUnlock which is not
-       required on Mac OS X anymore.
-       (FT_New_Face_From_SFNT): Ditto.
-       (FT_New_Face_From_FOND): Ditto.
-       * builds/mac/ftmac.c: Synchronize to src/base/ftmac.c,
-       except of HFS pathname support and HLock/HUnlock.
-       They are required on classic CFM environment.
-
-2007-06-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psobjs.c (ps_parser_skip_PS_token): Remove incorrect
-       assertion.
-       (ps_parser_to_bytes): Fix error message.
-
-       * src/type42/t42objs.c (T42_Open_Face): Handle one more error.
-       * src/type42/t42parse.c (t42_parse_sfnts): s/alloc/allocated/.
-       Don't allow mixed binary and hex strings.
-       Handle string_size == 0 and string_buf == 0.
-       (t42_parse_encoding): Handle one more error.
-
-2007-06-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psobjs.c (ps_tofixedarray, ps_tocoordarray): Fix exit
-       logic.
-       (ps_parser_load_field) <T1_FIELD_TYPE_BBOX>: Skip delimiters
-       correctly.
-       (ps_parser_load_field_table): Use `fields->array_max' instead of
-       T1_MAX_TABLE_ELEMENTS to limit the number of arguments.
-
-       * src/cff/cffgload.c (cff_decoder_prepare): Fix change from
-       2007-06-06.
-
-2007-06-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/ftrandom.c (font_size): New global variable.
-       (TestFace): Use it.
-       (main): Handle new option `--size' to set `font_size'.
-       (Usage): Updated.
-
-       * src/winfonts/winfnt.c (fnt_face_get_dll_font): Exit in case of
-       invalid font.
-       (FNT_Load_Glyph): Protect against invalid bitmap width.
-
-2007-06-16  David Turner  <david@freetype.org>
-
-       * src/smooth/ftgrays.c (gray_find_cell, gray_set_cell, gray_hline):
-       Prevent integer overflows when rendering very large outlines.
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check the
-       well-formedness of the contours array when loading a glyph.
-
-       * src/truetype/ttinterp.c (TT_Load_Context): Initialize `zp0', `zp1',
-       and `zp2'.
-       (Ins_IP): Check argument ranges to reject bogus operations properly.
-       (IUP_WorkerRec): Add `max_points' member.
-       (_iup_worker_interpolate): Check argument ranges.
-       (Ins_IUP): Ignore empty outlines.
-
-2007-06-16  Dmitry Timoshkov  <dmitry@codeweavers.com>
-
-       * src/winfonts/winfnt.h: Add necessary structures for PE resource
-       parsing.
-       (WinPE32_HeaderRec): New structure.
-       (WinPE32_SectionRec): New structure.
-       (WinPE_RsrcDirRec): New structure.
-       (WinPE_RsrcDirEntryRec): New structure.
-       (WinPE_RsrcDataEntryRec): New structure.
-       (FNT_FontRec): Remove unused `size_shift' field.
-
-       * src/winfonts/winfnt.c (fnt_face_get_dll_font): Add support for
-       loading bitmap .fon files in PE format.
-
-2007-06-15  Dmitry Timoshkov  <dmitry@codeweavers.com>
-
-       * builds/win32/ftdebug.c: Unify debug level handling with other
-       platforms.
-
-2007-06-14  Dmitry Timoshkov  <dmitry@codeweavers.com>
-
-       * builds/win32/ftdebug.c (FT_Message): Send debug output to the
-       console as well as to the debugger.
-
-2007-06-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/aflatin.c (af_latin_uniranges): Expand structure to
-       cover all ranges which could possibly be handled by the aflatin
-       module (since the default fallback for unknown ranges is now the
-       afcjk module).  It might be necessary to fine-tune this further by
-       splitting off modules for Greek, Cyrillic, or other blocks.
-
-2007-06-11  David Turner  <david@freetype.org>
-
-       * src/autofit/aflatin.c (af_latin_hints_link_segments): Fix
-       incorrect segment linking computation.  This was the root cause of
-       Savannah bug #19565.
-
-
-       * src/autofit/* [FT_OPTION_AUTOFIT2]: Some very experimental changes
-       to improve the Latin auto-hinter.  Note that the new code is
-       disabled by default since it is not stabilized yet.
-
-       * src/autofit/aflatin2.c, src/autofit/aflatin2.h: New files
-       (disabled currently).
-
-       * src/autofit/afhints.c: Remove dead code.
-       (af_axis_hints_new_edge): Add argument to handle segment directions.
-       (af_edge_flags_to_string): New function.
-       (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Handle
-       option flags.
-       (af_glyph_hints_reload): Add argument to handle inflections.
-       Simplify.
-       (af_direction_compute): Fine tuning.
-       (af_glyph_hints_align_edge_points): Fix logic.
-       (af_glyph_hints_align_strong_points): Do linear search for small
-       edge counts.
-       (af_glyph_hints_align_weak_points): Skip any touched neighbors.
-       (af_iup_shift): Handle zero `delta'.
-
-       * src/autofit/afhints.h: Updated.
-       (AF_SORT_SEGMENTS): New macro (disabled).
-       (AF_AxisHintsRec) [AF_SORT_SEGMENTS]: New member `mid_segments'.
-
-       * src/autofit/afglobal.c (af_face_globals_get_metrics): Add
-       argument to pass option flags for handling scripts.
-       * src/autofit/afglobal.h: Updated.
-
-       * src/autofit/afcjk.c: Updated.
-       * src/autofit/aflatin.c: Updated.
-       (af_latin_metrics_scale_dim): Don't reduce scale by 2%.
-
-       (af_latin_hints_compute_segments) [AF_HINT_METRICS]: Remove dead code.
-       (af_latin_hints_compute_edges) [AF_HINT_METRICS]: Remove dead code.
-       Don't set `edge->dir'
-       (af_latin_hint_edges): Add more logging.
-
-       * src/autofit/afloader.c: Updated.
-
-2007-06-11  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Document FT_Face_CheckTrueTypePatents.
-
-2007-06-10  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Slight speed-up to
-       the TrueType glyph loader.
-
-       * include/freetype/config/ftoption.h: Clarify documentation
-       regarding unpatented hinting.
-
-
-       Add new `FT_Face_CheckTrueTypePatents' API.
-
-       * include/freetype/freetype.h (FT_Face_CheckTrueTypePatents): New
-       declaration.
-
-       * include/freetype/internal/services/svttglyf.h,
-       src/base/ftpatent.c: New files.
-
-       * include/freetype/internal/ftserv.h (FT_SERVICE_TRUETYPE_GLYF_H):
-       New macro.
-
-       * src/truetype/ttdriver.c: Include FT_SERVICE_TRUETYPE_GLYF_H and
-       `ttpload.h'.
-       (tt_service_truetype_glyf): New service structure.
-       (tt_services): Register it.
-
-       * modules.cfg (BASE_EXTENSIONS), src/base/Jamfile (_sources): Add
-       `ftpatent.c'.
-
-2007-06-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Undo change from 2007-04-28.
-       Fonts without a cmap must be handled correctly by FreeType (anything
-       else would be a bug).
-
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
-       [FT_DEBUG_LEVEL_TRACE]: Improve tracing message.
-
-2007-06-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttsbit0.c (tt_sbit_decoder_init,
-       tt_sbit_decoder_load_image): Protect against integer overflows.
-
-
-       * src/pfr/pfrgload.c (pfr_glyph_load_simple): More bounding checks
-       for `x_control' and `y_control'.
-
-2007-06-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftoutln.c (FT_Outline_Decompose): Check `last'.
-
-
-       * src/pfr/pfrcmap.c (pfr_cmap_init): Convert assertion into normal
-       FreeType error.
-
-
-       * src/winfonts/winfnt.c (fnt_face_get_dll_font): Do a rough check of
-       `font_count'.
-
-
-       * src/type1/t1load.c (parse_font_matrix): Check `temp_scale'.
-
-
-       * src/cff/cffgload.c (cff_decoder_prepare): Change return type to
-       `FT_Error'.
-       Check `fd_index'.
-       (cff_slot_load): Updated.
-       * src/cff/cffgload.h: Updated.
-
-2007-06-05  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/pfrgload.c (pfr_glyph_done): Comment out unused code.
-       (pfr_glyph_load_simple): Convert assertion into normal FreeType
-       error.
-       Check `idx'.
-       (pfr_glyph_load_compound, pfr_glyph_curve_to, pfr_glyph_line_to):
-       Convert assertion into normal FreeType error.
-
-       * src/pfr/pfrtypes.h (PFR_GlyphRec): Comment out unused code.
-
-
-       * src/winfonts/winfnt.c (FNT_Face_Init): Check `family_size'.
-
-
-       * src/psaux/psobjs.c (ps_tocoordarray, ps_tofixedarray): Return -1
-       in case of parsing error.
-       (ps_parser_load_field): Updated.
-
-       * src/type1/t1load.c (parse_font_matrix): Updated.
-
-2007-06-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidgload.c (cid_load_glyph): Check `fd_select'.
-
-       * src/tools/ftrandom/Makefile: Depend on `libfreetype.a'.
-
-2007-06-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/ftrandom/*: Add the `ftrandom' test program written by
-       George Williams (with some modifications).
-
-2007-06-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (destroy_charmaps), src/type1/t1objs.c
-       (T1_Face_Done), src/winfonts/winfnt.c (FNT_Face_Done): Check for
-       face == NULL.  Suggested by Graham Asher.
-
-2007-06-03  Ismail Dönmez  <ismail@pardus.org.tr>
-
-       * src/base/ftobjs.c (FT_Request_Metrics): Fix compiler warning.
-
-2007-06-02  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/fterrdef.h (FT_Err_Corrupted_Font_Header,
-       FT_Err_Corrupted_Font_Glyphs): New error codes for BDF files.
-
-       * src/bdf/bdflib.c (bdf_load_font): Use them.
-
-       * src/bdf/bdflib.c (_bdf_parse_start): Check `FONT' better.
-
-2007-06-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Request_Metrics), src/cache/ftccmap.c
-       (FTC_CMapCache_Lookup): Remove unused code.
-
-2007-06-01  Sean McBride  <sean@rogue-research.com>
-
-       * src/truetype/ttinterp.c (Null_Vector, NULL_Vector): Removed,
-       unused.
-
-2007-06-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidparse.c (cid_parser_new): Don't continue second search
-       pass for `StartData' if an error has occurred.
-       Exit properly if no `StartData' has been seen at all.
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Don't use ULONG_MAX but
-       LONG_MAX to avoid compiler warning.  Suggested by Sean McBride.
-
-2007-05-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_subrs, parse_charstrings): Protect
-       against too small binary data strings.
-
-       * src/bdf/bdflib.c (_bdf_parse_glyphs): Check `STARTCHAR' better.
-
-2007-05-28  David Turner  <david@freetype.org>
-
-       * src/cff/cffgload.c (cff_slot_load): Do not apply the identity
-       transformation.  This significantly reduces the loading time of CFF
-       glyphs.
-
-       * docs/CHANGES: Updated.
-
-       * src/autofit/afglobal.c (AF_SCRIPT_LIST_DEFAULT): Change default
-       hinting script to CJK, since it works well with more scripts than
-       latin.  Thanks to Rahul Bhalerao <b.rahul.pm@gmail.com> for pointing
-       this out!
-
-2007-05-25  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2007-05-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttobjs.h (tt_size_ready_bytecode): Move declaration
-       into TT_USE_BYTECODE_INTERPRETER preprocessor block.
-
-2007-05-24  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/truetype/ttobjs.c (tt_size_ready_bytecode)
-       [!TT_USE_BYTECODE_INTERPRETER]: Removed.  Unused.
-
-2007-05-22  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fix last change to
-       avoid crashes in case the bytecode interpreter is not used.
-
-
-       Avoid heap blowup with very large .Z font files.  This fixes
-       Savannah bug #19910.
-
-       * src/lzw/ftzopen.h (FT_LzwStateRec): Remove `in_cursor',
-       `in_limit', `pad', `pad_bits', and `in_buff' members.
-       Add `buf_tab', `buf_offset', `buf_size', `buf_clear', and
-       `buf_total' members.
-
-       * src/lzw/ftzopen.c (ft_lzwstate_get_code): Rewritten.  It now takes
-       only one argument.
-       (ft_lzwstate_refill, ft_lzwstate_reset, ft_lzwstate_io): Updated.
-
-2007-05-20  Ismail Dönmez  <ismail@pardus.org.tr>
-
-       * src/pshinter/pshrec.c (ps_mask_table_set_bits): Add `const'.
-       (ps_dimension_set_mask_bits): Remove `const'.
-
-2007-05-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttmtx.c (tt_face_get_metrics)
-       [!FT_CONFIG_OPTION_OLD_INTERNALS]: Another type-punning fix.
-
-2007-05-19  Derek Clegg  <dclegg@apple.com>
-
-       Savannah patch #5929.
-
-       * include/freetype/tttables.h, src/base/ftobjcs.c
-       (FT_Get_CMap_Format): New function.
-
-       * include/freetype/internal/services/svttcmap.c (TT_CMapInfo): Add
-       `format' member.
-       * src/sfnt/ttcmap.c (tt_cmap{0,2,4,6,8,10,12}_get_info): Set
-       cmap_info->format.
-
-2007-05-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Save graphics state
-       before handling subglyphs so that it can be reinitialized each time.
-       This fixes Savannah bug #19859.
-
-2007-05-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftccache.c (ftc_node_mru_link, ftc_node_mru_unlink),
-       src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP), src/cache/ftcglyph.h
-       (FTC_GCACHE_LOOKUP_CMP), src/pshinter/pshmod.c (ps_hinter_init),
-       src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_load_hhea,
-       tt_face_get_metrics): Fix type-punning issues.
-
-2007-05-15  David Turner  <david@freetype.org>
-
-       * include/freetype/config/ftstdlib.h,
-       include/freetype/internal/ftobjs.h: As suggested by Graham Asher,
-       ensure that ft_isalnum, ft_isdigit, etc., use hard-coded values
-       instead on relying on the locale-dependent functions provided by
-       <ctypes.h>.
-
-2007-05-15  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Remove unused
-       variable.
-       * src/autofit/afloader.c (af_loader_load_g): Ditto.
-
-       * src/base/ftobjs.c (ft_validator_error): Use `ft_jmp_buf'.
-       (open_face_from_buffer): Initialize `stream'.
-       (FT_Request_Metrics): Remove unused variable.
-       Remove redundant `break' statements.
-       (FT_Get_Track_Kerning): Remove unused variable.
-
-       * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs,
-       afm_parse_kern_data): Remove redundant
-       `break' statements.
-       (afm_parser_parse): Ditto.
-       Don't use uninitialized variables.
-
-       * src/psnames/psmodule.c (VARIANT_BIT): Define as unsigned long.
-       Use `|' operator instead of `^' to set it.
-       Update all users.
-
-       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Use `ft_jmp_buf'.
-       * src/sfnt/ttkern.c (tt_face_load_kern): Remove unused variable.
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant
-       comparison.
-       (TT_Process_Simple_Glyph): Use FT_UInt for `n_points' and `i'.
-       (TT_Load_Glyph): Remove unused variable.
-
-2007-05-13  Derek Clegg  <dclegg@apple.com>
-
-       * src/base/ftobjs.c (FT_New_Library): Only allocate rendering pool
-       if FT_RENDER_POOL_SIZE is > 0.  From Savannah patch #5928.
-
-2007-05-11  David Turner  <david@freetype.org>
-
-       * src/cache/ftbasic.c, include/freetype/ftcache.h
-       (FTC_ImageCache_LookupScaler, FTC_SBit_Cache_LookupScaler): Two new
-       functions that allow us to look up glyphs using an FTC_Scaler object
-       to specify the size, making it possible to use fractional pixel
-       sizes.
-
-       * src/truetype/ttobjs.c (tt_size_ready_bytecode): Set
-       `size->cvt_ready'.  Reported by Boris Letocha.
-
-2007-05-09  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/truetype/ttinterp.c (Ins_IP), src/autofit/aflatin.c
-       (af_latin_metrics_scale_dim): Fix compiler warnings.
-
-2007-05-06  Werner Lemberg  <wl@gnu.org>
-
-       * builds/win32/visualce/freetype.sln: Removed, as requested by
-       Vincent.
-
-2007-05-04  Vincent RICHOMME  <richom.v@free.fr>
-
-       * builds/win32/visualce/*: Add Visual C++ project files for Pocket
-       PC targets.
-
-       * docs/CHANGES: Document them.
-
-2007-05-04  <harry@kdevelop.org>
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Handle return value 0 of
-       mmap (which might happen on some RTOS).  From Savannah patch #5909.
-
-2007-05-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Set_Char_Size): Simplify code.
-       * include/freetype/freetype.h (FT_Set_Char_Size): Update
-       documentation.
-
-2007-04-28  Victor Stinner  <victor.stinner@inl.fr>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Check error code after loading
-       `cmap'.
-
-2007-04-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check for negative
-       number of points in contours.  Problem reported by Victor Stinner
-       <victor.stinner@haypocalc.com>.
-       (TT_Process_Simple_Glyph): Synchronize variable types.
-
-2007-04-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftglyph.c (FT_Glyph_Copy): Always set second argument to
-       zero in case of error.  This fixes Savannah bug #19689.
-
-2007-04-25  Boris Letocha  <b.letocha@cz.gmc.net>
-
-       * src/truetype/ttobjs.c: Fix a typo that created a speed regression
-       in the TrueType bytecode loader.
-
-2007-04-10  Martin Horak  <horakm@centrum.cz>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face) [FT_CONFIG_OPTION_INCREMENTAL]:
-       Ignore `hhea' table.  This fixes Savannah bug #19261.
-
-2007-04-09  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.4 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-4'.
-
-       * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
-       version number to 2.3.4.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj: s/2.3.3/2.3.4/, s/233/234/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
-
-       * builds/unix/configure.raw (version_info): Set to 9:15:3.
-
-2007-04-09  Martin Horak  <horakm@centrum.cz>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Save and restore
-       memory stream to avoid a crash with the incremental memory
-       interface (Savannah bug #19260).
-
-2007-04-06  David Turner  <david@freetype.org>
-
-       * src/base/ftbimap.c (ft_bitmap_assure_buffer): Fix buffer-overwrite bug
-       (Savannah bug #19536).
-
-2007-04-04  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.3 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-3'.
-
-       * docs/CHANGES: Mention CVE-2007-1351.
-
-2007-04-03  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c (FT_Set_Char_Size): As suggested by James Cloos,
-       if one of the resolution values is 0, treat it as if it were the
-       same as the other value.
-
-2007-04-02  David Turner  <david@freetype.org>
-
-       Add special code to detect `extra-light' fonts and do not snap their
-       stem widths too much to avoid bizarre hinting effects.
-
-       * src/autofit/aflatin.h (AF_LatinAxisRec): Add `standard_width' and
-       `extra_light' members.
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_widths): Initialize
-       them.
-       (af_latin_metrics_scale_dim): Set `extra_light'.
-       (af_latin_compute_stem_width): Use `extra_light'.
-
-2007-03-28  David Turner  <david@freetype.org>
-
-       * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Fix zero-ing of the
-       padding.
-
-2007-03-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdflib.c (setsbit, sbitset): Handle values >= 128
-       gracefully.
-       (_bdf_set_default_spacing): Increase `name' buffer size to 256 and
-       issue an error for longer names.  This fixes CVE-2007-1351.
-       (_bdf_parse_glyphs): Limit allowed number of glyphs in font to the
-       number of code points in Unicode.
-
-       * builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj, README: s/2.3.2/2.3.3/,
-       s/232/233/.
-
-       * docs/CHANGES: Mention ftdiff.
-
-2007-03-26  David Turner  <david@freetype.org>
-
-       * src/truetype/ttinterp.c [FIX_BYTECODE]: Remove it and
-       corresponding code.
-       (Ins_MD): Last regression fix.
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Fix blues
-       computations in order to ignore single-point contours.  These are
-       never rasterized and correspond in certain fonts to mark-attach
-       points that are very far from the glyph's real outline, ruining the
-       computation.
-
-       * src/autofit/afloader.c (af_loader_load_g): In the case of
-       monospaced fonts, always set `rsb_delta' and `lsb_delta' to 0.
-       Otherwise code that uses them will most certainly ruin the fixed
-       advance property.
-
-       * docs/CHANGES, docs/VERSION.DLL, README, Jamfile (RefDoc): Update
-       documentation and bump version number to 2.3.3.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
-
-       * builds/unix/configure.raw (version_info): Set to 9:14:3.
-
-2007-03-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/ftconfig.in: Disable Carbon framework dependency on
-       64bit ABI on Mac OS X 10.4.x (ppc & i386).  Found by Sean McBride.
-       * builds/vms/ftconfig.h: Ditto.
-       * include/freetype/config/ftconfig.h: Ditto.
-
-2007-03-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Temporary fix to prevent
-       32bit unsigned long overflow by 64bit filesize on LP64 platform, as
-       proposed by Sean McBride:
-       http://lists.gnu.org/archive/html/freetype-devel/2007-03/msg00032.html
-
-2007-03-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/ftconfig.in: Suppress SGI compiler's warning against
-       setjmp, proposed by Sean McBride:
-       http://lists.gnu.org/archive/html/freetype-devel/2007-03/msg00032.html
-
-2007-03-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Dequote `OS_INLINE' in comment of
-       conftest.c, to avoid unexpected shell evaluation.  Possibly it is a
-       bug or undocumented behaviour of autoconf.
-
-2007-03-18  David Turner   <david@freetype.org>
-
-       * src/truetype/ttinterp.c (Ins_MDRP): Another bytecode regression
-       fix; testing still needed.
-
-       * src/truetype/ttinterp.c (Ins_MD): Another bytecode regression fix.
-
-2007-03-17  David Turner   <david@freetype.org>
-
-       * src/truetype/ttinterp.c (Ins_IP): Fix wrong handling of the
-       (undocumented) twilight zone special case.
-
-2007-03-09  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.2 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-2'.
-
-       * builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj, README: s/2.3.1/2.3.2/,
-       s/231/232/.
-
-2007-03-08  David Turner  <david@freetype.org>
-
-       * docs/CHANGES, docs/VERSION.DLL: Updated for upcoming release.
-
-       * builds/unix/configure.raw (version_info): Set to 9:13:3.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
-
-       * README, Jamfile (RefDoc): s/2.3.1/2.3.2/.
-
-       * src/base/ftutil.c (ft_mem_strcpyn): Fix a bug that prevented the
-       function to work properly, over-writing user-provided buffers in
-       some cases.  Reported by James Cloos <cloos@jhcloos.com>.
-
-
-2007-03-05  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftstdlib.h (ft_strstr): New wrapper
-       macro for `strstr'.
-
-       * src/truetype/ttobjs.c (tt_face_init): Use ft_strstr for scanning
-       `trick_names', as suggested by Ivan Nincic.
-
-2007-03-05  David Turner  <david@freetype.org>
-
-       * src/base/ftinit.c (FT_Init_FreeType): Fix a small memory leak in
-       case FT_Init_FreeType fails for some reason.  Problem reported by
-       Maximilian Schwerin <maximilian.schwerin@buelowssiege.de>.
-
-       * src/truetype/ttobs.c (tt_size_init_bytecode): Clear the `x_ppem'
-       and `y_ppem' fields of the `TT_Size.metrics' structure, not those of
-       `TT_Size.root.metrics'.  Problem reported by Daniel Glöckner
-       <daniel-gl@gmx.net>.
-
-       * src/type1/t1afm.c (T1_Read_PFM): Read kerning values as 16-bit
-       signed values, not unsigned ones.  Problem reported by Johannes
-       Walther <joh_walt@yahoo.de>.
-
-2007-02-21  David Turner  <david@freetype.org>
-
-       * src/pshinter/pshalgo.c (psh_hint_align): Fix a bug in the hinting
-       of small and ghost stems in the Postscript interpreter.
-
-2007-02-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (FT_GetFileRef_From_Mac_ATS_Name): Fix memory
-       leak, patch by "Jjgod Jiang" <gzjjgod@gmail.com>.
-       * builds/mac/ftmac.c (FT_GetFileRef_From_Mac_ATS_Name): Ditto.
-
-2007-02-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (Ins_MD): Remove unused variable.
-       * src/autofit/aflatin.c (af_latin_hints_link_segments): Ditto.
-
-2007-02-14  David Turner  <david@freetype.org>
-
-       It seems that the following changes fix most of the known
-       interpreter problems with my fonts, but more testing is needed,
-       though.
-
-       * src/truetype/ttinterp.c (FIX_BYTECODE): Activate.
-       (TT_MulFix14): Rewrite.
-       (Ins_MD, Ins_MDRP, Ins_IP) [FIX_BYTECODE]: Improved and updated.
-       (Ins_MIRP): Ditto.
-
-2007-02-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (Project_x, Project_y): Remove compiler
-       warnings.
-
-       * src/pcf/pcfread.c (pcf_interpret_style), src/bdf/bdfdrivr.c
-       (bdf_interpret_style): Ditto.
-
-2007-02-12  David Turner  <david@freetype.org>
-
-       Simplify projection and dual-projection code interface.
-
-       * src/truetype/ttinterp.h (TT_Project_Func): Use `FT_Pos', not
-       FT_Vector' as argument type.
-       * src/truetype/ttinterp.c (CUR_Func_project, CUR_Func_dualproj):
-       Updated.
-       (CUR_fast_project, CUR_fast_dualproj): New macros.
-       (Project, Dual_Project, Project_x, Project_y): Updated.
-       (Ins_GC, Ins_SCFS, Ins_MDAP, Ins_MIAP, Ins_IP): Use new `fast'
-       macros.
-
-
-       * src/autofit/afloader.c (af_loader_load_g): Improve spacing
-       adjustments for the non-light auto-hinted modes.  Gets rid of
-       `inter-letter spacing is too wide' problems.
-
-       * src/autofit/aflatin.c (af_latin_hints_link_segments,
-       af_latin_hints_compute_edges): Slight optimization of the segment
-       linker and better handling of serif segments to get rid of broken
-       `9' in Arial at 9pt (96dpi).
-
-
-       Introduce new string functions and the corresponding macros to get
-       rid of various uses of strcpy and other `evil' functions, as well as
-       to simplify a few things.
-
-       * include/freetype/internal/ftmemory.h (ft_mem_strdup, ft_mem_dup,
-       ft_mem_strcpyn): New declarations.
-       (FT_MEM_STRDUP, FT_STRDUP, FT_MEM_DUP, FT_DUP, FT_STRCPYN): New
-       macros.
-       * src/base/ftutil.c (ft_mem_dup, ft_mem_strdup, ft_mem_strcpyn): New
-       functions.
-
-       * src/bfd/bfddrivr.c (bdf_interpret_style, BDF_Face_Init),
-       src/bdf/bdflib.c (_bdf_add_property), src/pcf/pcfread.c
-       (pcf_get_properties, pcf_interpret_style, pcf_load_font),
-       src/cff/cffdrivr.c (cff_get_glyph_name), src/cff/cffload.c
-       (cff_index_get_sid_string), src/cff/cffobjs.c (cff_strcpy),
-       src/sfnt/sfdriver.c (sfnt_get_glyph_name), src/type1/t1driver.c
-       (t1_get_glyph_name), src/type42/t42drivr.c (t42_get_glyph_name,
-       t42_get_name_index): Use new functions and simplify code.
-
-       * builds/mac/ftmac.c (FT_FSPathMakeSpec): Don't use FT_MIN.
-
-2007-02-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/afloader.c (af_loader_load_g): Don't change width for
-       non-spacing glyphs.
-
-2007-02-07  Tom Parker  <palfrey@tevp.net>
-
-       * src/cff/cffdrivr.c (cff_get_name_index): Protect against NULL
-       pointer.
-
-2007-02-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/ftmac.h (FT_DEPRECATED_ATTRIBUTE):
-       Introduce __attribute((deprecated))__ to warn functions
-       which use non-ANSI data types in its interfaces.
-       (FT_GetFile_From_Mac_Name): Deprecated, using FSSpec.
-       (FT_GetFile_From_Mac_ATS_Name): Deprecated, using FSSpec.
-       (FT_New_Face_From_FSSpec): Deprecated, using FSSpec.
-       (FT_New_Face_From_FSRef): Deprecated, using FSRef.
-
-       * src/base/ftmac.c: Predefine FT_DEPRECATED_ATTRIBUTE as void
-       to avoid warning in building FreeType.
-       * builds/mac/ftmac.c: Ditto.
-
-2007-02-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftbase.c: Fix to use builds/mac/ftmac.c, if configured
-       `--with-fsspec' etc.  Replace #include "ftmac.c" with
-       #include <ftmac.c>.
-
-2007-02-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/ftmac.h (FT_GetFilePath_From_Mac_ATS_Name):
-       Introduced as replacement of FT_GetFile_From_Mac_ATS_Name.
-       * src/base/ftmac.c (FT_GetFilePath_From_Mac_ATS_Name): Ditto.
-       (FT_GetFile_From_Mac_ATS_Name): Rewritten as wrapper of
-       FT_GetFilePath_From_Mac_ATS_Name.
-       * builds/mac/ftmac.c: Ditto.
-
-2007-02-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/ftmac.h: Fixed wrong comment: FSSpec of
-       FT_GetFile_From_Mac_Name, FT_GetFile_From_Mac_ATS_Name are
-       for passing to FT_New_Face_From_FSSpec.
-
-2007-02-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Check whether Mac OS X system headers
-       can be built under ANSI C mode.
-
-       * src/base/ftmac.c (OS_INLINE): Redefine OS_INLINE by a version
-       compatible to ANSI C in case system headers are ANSI C incompatible.
-       * builds/mac/ftmac.c (OS_INLINE): Ditto.
-
-2007-02-01  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ttnameid.h (TT_MS_LANGID_DZONGHKA_BHUTAN):
-       Explain why applications shouldn't use it.  Found by Alexei.
-
-2007-02-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
-
-       * builds/unix/freetype2.m4 (AC_CHECK_FT2): Fix spelling of warning
-       message.
-
-       * src/gxvalid/gxvmort1.c
-       (gxv_mort_subtable_type1_substTable_validate): Fix debugging
-       message.
-
-2007-01-31  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.1 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-1-FINAL'.
-
-       * builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj: s/230/231/.
-       * builds/win32/visualc/index.html: s/221/231/.
-
-       * vms_make.com: Add `ftgasp'.
-
-2007-01-30  David Turner  <david@freetype.org>
-
-       Tag sources with VER-2-3-1 to prepare release.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
-       * docs/VERSION.DLL, docs/release, README, Jamfile (RefDoc):
-       s/2.3.0/2.3.1/.
-
-       * builds/unix/configure.raw (version_info): Set to 9:12:3.
-
-
-       * src/autofit/aftypes.h (AF_USE_WARPER), src/autofit/afloader.c
-       (af_loader_load_g): Disable the warper (i.e., the light hinting
-       improvements) to make a 2.3.1 bugfix release before introducing a
-       new feature.  This should give us more time to tune and improve the
-       warper for the next release.
-
-       * docs/CHANGES: Update accordingly.
-
-2007-01-25  David Turner  <david@freetype.org>
-
-       For light auto-hinting, improve glyph advance widths and resurrect
-       normal/full hinting to its normal quality.
-
-       * src/autofit/afhints.h (AF_GlyphHintsRec): New members `xmin_delta'
-       and `xmax_delta'.
-       * src/autofit/afhints.c (af_glyph_hints_reload): Reset `xmin_delta'
-       and `xmax_delta'.
-
-       * src/autofit/afloader.c (af_loader_load_g) <AF_USE_WARPER>: Replace
-       preprocessor conditional with if-clause, handling both light and
-       normal mode.
-
-       * src/autofit/afwarp.c (AF_WarpScore): Fine-tune again.
-       (af_warper_compute): Handle `xmin_delta' and `xmax_delta'.
-
-2007-01-25  Werner Lemberg  <wl@gnu.org>
-
-       * docs/release: Updated -- Savannah uses a new uploading scheme.
-
-2007-01-25  David Turner  <david@freetype.org>
-
-       * src/cff/cffload.c (cff_index_get_pointers): Improve previous fix.
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       <cff_op_callsubr, cff_op_callgsubr>: Fix sanity check for empty
-       functions.
-
-       * docs/CHANGES: Document light auto-hinting improvement.
-
-2007-01-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_index_get_pointers): Handle last entry
-       correctly in a sanity check.  Since this function is only used to
-       load local and global functions, any charstring that called the last
-       local/global function would fail otherwise.  This fixes Savannah bug
-       #18867.
-
-       * docs/CHANGES: Document it.
-
-2007-01-23  David Turner  <david@freetype.org>
-
-       * src/truetype/ttobjs.c (tt_size_ready_bytecode): Fix typo that
-       prevented compilation when disabling both the unpatented and the
-       bytecode interpreter in the TrueType font driver.
-
-
-       Fix and enable the warper to improve `light' hinting mode.  This is
-       not necessarily a final version, but it seems to work well.
-
-       * src/autofit/aflatin.c (af_latin_hints_init) [AF_USE_WARPER]:
-       Disable code.
-       (af_latin_hints_apply) [AF_USE_WARPER]: Handle FT_RENDER_MODE_LIGHT.
-       * src/autofit/aftypes.h: Activate AF_USE_WARPER.
-
-       * src/autofit/afwarp.c (AF_WarpScore): Tune table.
-       (af_warper_compute_line_best): Fix array size of `scores'.
-       (af_warper_compute): Better handling of border cases.
-       * src/autofit/afwarp.h (AF_WarperRec): Remove unused members `X1'
-       and `X2'.
-
-2007-01-21  Werner Lemberg  <wl@gnu.org>
-
-       * ChangeLog: Split off older entries into...
-       * ChangeLog.22: This new file.
-
-2007-01-21  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Document SHZ fix.
-
-2007-01-21  George Williams  <gww@silcom.com>
-
-       * src/truetype/ttinterp.c (Ins_SHZ): SHZ doesn't move phantom
-       points.
-
-2007-01-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttmtx.c (tt_face_get_metrics)
-       [!FT_CONFIG_OPTION_OLD_INTERNALS]: Fix limit check.
-
-2007-01-17  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.0 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-0-FINAL'.
-
-2007-01-17  Werner Lemberg  <wl@gnu.org>
-
-       * docs/release: Updated.
-
-2007-01-16  David Turner  <david@freetype.org>
-
-       * src/autofit/aflatin.c (af_latin_hints_compute_segments),
-       src/cff/cffdriver.c (cff_ps_get_font_info), src/truetype/ttobjs.c
-       (tt_face_init), src/truetype/ttinterp.c (Ins_SHC): Fix compiler
-       warnings.
-
-2007-01-15  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/makefile, builds/amiga/makefile.os4,
-       builds/amiga/smakefile: Add `ftgasp.c' and `ftlcdfil.c'.
-
-       * builds/amiga/include/freetype/config/ftconfig.h: Synchronize.
-
-2007-01-14  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       Fix various compiler warnings.
-
-       * src/truetype/ttdriver.c (tt_size_select), src/cff/cffobjs.h,
-       src/cff/cffobjs.c (cff_size_request), src/type42/t42objs.h:
-       s/index/strike_index/.
-       * src/base/ftobjs.c (FT_Match_Size): s/index/size_index/.
-
-       * src/gxvalid/gxvmorx5.c
-       (gxv_morx_subtable_type5_InsertList_validate): s/index/table_index/.
-
-       * src/truetype/ttinterp.c (Compute_Point_Displacement),
-       src/pcf/pcfread.c (pcf_seek_to_table_type): Avoid possibly
-       uninitialized variables.
-
-2007-01-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * docs/CHANGES, docs/INSTALL.MAC: Improvements.
-
-2007-01-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1afm.c (T1_Read_Metrics): MS Windows allows PFM
-       versions up to 0x3FF without complaining.
-
-2007-01-13  Derek Clegg  <dclegg@apple.com>
-
-       Add FT_Get_PS_Font_Info interface to CFF driver.
-
-       * src/cff/cfftypes.h: Include FT_TYPE1_TABLES_H.
-       (CFF_FontRec): Add `font_info' field.
-
-       * src/cff/cffload.c: Include FT_TYPE1_TABLES_H.
-       (cff_font_done): Free font->font_info if necessary.
-
-       * src/cff/cffdrvr.c (cff_ps_get_font_info): New function.
-       (cff_service_ps_info): Register cff_ps_get_font_info.
-
-2007-01-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Fix compilation
-       with C++ compiler.
-
-       * src/autofit/afhints.c (af_glyph_hints_dump_segments,
-       af_glyph_hints_dump_edges): Ditto.
-
-       * src/base/rules.mk (BASE_SRC): Remove ftgasp.c (it's already in
-       `modules.cfg').
-
-       * src/sfnt/ttsbit0.h: Remove.
-
-       * src/sfnt/rules.mk (SFNT_DRV_SRC): Don't include ttsbit0.c.
-
-2007-01-12  David Turner  <david@freetype.org>
-
-       * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Fix memory stomping
-       bug in the bitmap emboldener if the pitch of the source bitmap is
-       much larger than its width.
-
-       * src/truetype/ttinterp.c (Update_Max): Fix aliasing-related
-       compilation warning.
-
-2007-01-12  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
-       `automake' CVS module from sources.redhat.com.
-
-2007-01-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (is_space): Removed.
-       (parse_encoding, parse_charstrings): Use IS_PS_DELIM.
-       (parse_charstrings): Use IS_PS_TOKEN.
-
-
-       * autogen.sh: Avoid bash specific syntax.
-
-2007-01-11  David Turner  <david@freetype.org>
-
-       * docs/CHANGES: Small update.
-
-       * builds/unix/configure.raw (version_info): Set to 9:11:3.
-
-       * src/base/ftobjs.c (IsMacResource): Fix a small bug that caused a
-       crash with some Mac OS X .dfont files.  Submitted by Masatake
-       Yamato.
-
-       * autogen.sh: Small fix to get it working on Mac OS X properly:
-       The issue is that GNU libtool is called `glibtool' on this platform,
-       and we must call `glibtoolize', since `libtoolize' doesn't exist.
-
-2007-01-10  David Turner  <david@freetype.org>
-
-       * all-sources: Tag all sources with VER-2-3-0-RC1 and
-       VER-2-3-0.
-
-       * Jamfile (RefDoc), README, builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj, docs/VERSION.DLL: Update
-       version number to 2.3.0.
-
-       * include/freetype/freetype.h (FREETYPE_MINOR): Set to 3.
-       (FREETYPE_PATCH): Set to 0.
-
-       * include/freetype/ftchapters.h, include/freetype/ftgasp.h,
-       include/freetype/ftlcdfil.h: Update reference documentation with
-       GASP support and LCD filtering sections.
-
-       * src/pshinter/pshalgo.c (psh_glyph_compute_inflections): Fix a typo
-       which created an endless loop with some malformed font files.
-
-2007-01-10  Derek Clegg  <dclegg@apple.com>
-
-       * src/type1/t1load.c (T1_Get_MM_Var): Always return fixed point
-       values.
-
-2007-01-08  David Turner  <david@freetype.org>
-
-       * docs/CHANGES: Updated.
-
-       * include/freetype/ftgasp.h, src/base/ftgasp.c: New files which add
-       a new API `FT_Get_Gasp' to return entries of the `gasp' table
-       corresponding to a given character pixel size.
-
-       * src/sfnt/ttload.c (tt_face_load_gasp): Add version check for the
-       `gasp' table, in order to avoid potential problems with later
-       versions.
-
-       * include/freetype/config/ftheader.h (FT_GASP_H): New macro for
-       <freetype/ftgasp.h>.
-
-       * src/base/rules.mk (BASE_SRC), src/base/Jamfile (_sources),
-       modules.cfg (BASE_EXTENSIONS), builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj: Add src/base/ftgasp.c to the
-       default build.
-
-2007-01-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidparse.c (cid_parser_new): Improve error message for
-       Type 11 fonts.
-       Scan for `/sfnts' token.
-
-2007-01-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidparse.c (cid_parser_new): Reject Type 11 fonts.
-
-2007-01-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_index_init): Remove unused variable.
-       (cff_index_read_offset): s/perror/errorp/ to avoid global shadowing.
-
-2007-01-04  David Turner  <david@freetype.org>
-
-       * src/pfr/pfrobjs.c (pfr_face_init): Detect non-scalable fonts
-       correctly.  This fixes Savannah bug #17876.
-
-
-       Do not allocate interpreter-specific tables in memory if we are not
-       going to load glyphs with the bytecode interpreter anyway.
-
-       * src/truetype/ttgload.c (tt_loader_init): Load execution context
-       only if glyph is hinted.
-       Updated.
-       * src/truetype/ttobjs.h (TT_SizeRec): Add members `bytecode_ready'
-       and `cvs_ready'.
-       Add `tt_size_ready_bytecode' declaration.
-       * src/truetype/ttobjs.c (tt_size_done_bytecode,
-       tt_size_init_bytecode, tt_size_ready_bytecode): New functions.
-       (tt_size_init): Move most code into `tt_size_init_bytecode'.
-       (tt_size_done): Move most code into `tt_size_done_bytecode'.
-       (tt_size_reset): Move some code to `tt_size_ready_bytecode'.
-
-
-       Don't extract the metrics table from the SFNT font file.  Instead,
-       reparse it on each glyph load.  The runtime difference is not
-       noticeable, and it can save a lot of heap memory when memory-mapped
-       files are not used.
-
-       * include/freetype/internal/tttypes.h (TT_FaceRec): Add members
-       `horz_metrics_offset' and `vert_metrics_ofset'.
-       * src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_get_metrics):
-       Updated.
-
-
-       * src/sfnt/ttcmap.c (tt_cmap4_validate): Slight optimization.
-
-
-       Do not load the CFF index offsets into memory, since this wastes a
-       *lot* of heap memory with large Asian CFF fonts.  There is no
-       significant performance loss.
-
-       * src/cff/cffload.h: Add `cff_charset_cid_to_gindex' declaration.
-       * src/cff/cfftypes.h (CFF_IndexRec): Add fields `start' and
-       `data_size'.
-       (CFF_CharsetRec): Add field `num_glyphs'.
-
-       * src/cff/cffload.c (cff_index_read_offset, cff_index_load_offsets,
-       cff_charset_cid_to_gindex): New functions.
-       (cff_new_index): Renamed to...
-       (cff_index_init): This.  Update all callers.
-       Updated -- some code has been moved to `cff_index_load_offsets'.
-       (cff_done_index): Renamed to...
-       (cff_index_done): This.  Update all callers.
-       (cff_index_get_pointers, cff_index_access_element): Updated to use
-       stream offsets.
-       (cff_charset_compute_cids): Set `num_glyphs' field.
-       (cff_encoding_load): Updated.
-
-       * src/cff/cffgload.c (cff_slot_load): Updated.
-
-2007-01-04  David Turner  <david@freetype.org>
-
-       * docs/INSTALL.UNIX: Simplify some parts, add reference to
-       autogen.sh and pointer to README.CVS.
-
-       * README.CVS: Add common problem description and solution
-       when running autogen.sh.
-
-       * docs/INSTALL: Add reference to MacOS X.
-
-       * docs/MAKEPP, docs/INSTALL.MAC: New documentation files.
-
-       * docs/TODO: Remove obsolete items.
-
-       * src/raster/ftraster.c: (TRaster_Instance): Replace it with...
-       (TWorker): This.
-       Remove `count_table' and `memory'.
-       Make `grays' a pointer.
-       (TRaster): New structure.
-       (count_table): New static array.
-       (RAS_ARGS, RAS_ARG, RAS_VARS, RAS_VAR, FT_UNUSED_RASTER, cur_ras,
-       Vertical_Gray_Sweep_Step, ft_black_new, ft_black_done,
-       ft_black_set_mode, ft_black_render): Updated.
-       (ft_black_init): Don't initialize `count_table'.
-       (ft_black_reset): Use the render pool.  This saves about 6KB of
-       heap space for each FT_Library instance.
-
-       * src/smooth/ftgrays.c (TRaster): Replaced with...
-       (TWorker): This.
-       Remove `memory'.
-       (TRaster): New structure.
-
-       (RAS_ARG_, RAS_ARG, RAS_VAR_, RAS_VAR, ras, gray_render_line,
-       gray_move_to, gray_line_to, gray_conic_to, gray_cubic_to,
-       gray_render_span, gray_raster_render): Updated.
-       (gray_raster_reset): Use the render pool.  This saves about 6KB of
-       heap space for each FT_Library instance.
-
-       * src/sfnt/sfobjs.c, src/sfnt/ttkern.c, src/sfnt/ttkern.h,
-       src/sfnt/ttmtx.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
-       src/truetype/ttpload.c, include/freetype/config/ftoption.h: Remove
-       FT_OPTIMIZE_MEMORY macro (and code for !FT_OPTIMIZE_MEMORY) since
-       the optimization is no longer experimental.
-
-       * src/pshinter/pshalgo.c (psh_glyph_interpolate_normal_points):
-       Remove a typo that results in no hinting and a memory leak with some
-       large Asian CFF fonts.
-
-       * src/base/ftobjs.c (FT_Done_Library): Remove a subtle memory leak
-       which happens when FT_Done_Library is called with still opened
-       CFF_Faces in it.  We need to close all faces before destroying the
-       modules, or else some bad things (memory leaks) may happen.
-
-2007-01-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt0_pairs_validate):
-       Remove compiler warning.
-
-2007-01-02  David Turner  <david@freetype.org>
-
-       * src/sfnt/sfobjs.c: Add documentation comment.
-
-2006-12-31  Masatake YAMATO  <jet@gyve.org>
-
-       * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt0_pairs_validate): New
-       function.
-       Check uniqueness of the gid pairs.
-       (gxv_kern_subtable_fmt0_validate): Move some code to
-       `gxv_kern_subtable_fmt0_pairs_validate'.
-
-2006-12-22  David Turner  <david@freetype.org>
-
-       * src/autofit/aflatin.c, src/truetype/ttgload.c: Remove compiler
-       warnings.
-
-       * builds/win32/visualc/freetype.vcproj: Add _CRT_SECURE_NO_DEPRECATE
-       to avoid deprecation warnings with Visual C++ 8.
-
-2006-12-16  Anders Kaseorg  <anders@kaseorg.com>
-
-       * src/base/ftlcdfil.c (FT_Library_SetLcdFilter)
-       [FT_FORCE_LIGHT_LCD_FILTER]: Fix typo.
-
-2006-12-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/internal/services/svotval.h: Add `volatile' to
-       sync with the modification by Jens Claudius on 2006-08-22; cf.
-         http://cvs.savannah.gnu.org/viewcvs/freetype/freetype2/src/otvalid/otvmod.c?r1=1.4&r2=1.5
-
-2006-12-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Specialized for Mac OS X only.
-       * builds/unix/ftconfig.in: Fixed for ppc64 missing Carbon framework.
-       * builds/unix/configure.raw: Ditto.  When explicit switches for
-       FSSpec/FSRef/QuickDraw/ATS availability are given to configure,
-       builds/mac/ftmac.c is used instead of default src/base/ftmac.c.
-
-2006-12-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/mac/ftmac.c: Copied src/base/ftmac.c for legacy system.
-       * builds/mac/FreeType.m68k_cfm.make.txt: Fix to use builds/mac/ftmac.c
-       instead of src/base/ftmac.c
-       * builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
-       * builds/mac/FreeType.ppc_classic.make.txt: Ditto.
-       * builds/mac/FreeType.m68k_far.make.txt: Ditto, and exclude gxvalid.c
-       that cannot be built at present.
-
-2006-12-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c: Improvement of resource fork handler for
-       POSIX, cf.
-         http://lists.gnu.org/archive/html/freetype-devel/2006-10/msg00025.html
-       (Mac_Read_sfnt_Resource): Count only `sfnt' resource of suitcase font
-       format or .dfont, to simulate the face index number counted by ftmac.c.
-       (IsMacResource): Return the number of scalable faces correctly.
-
-2006-12-10  Werner Lemberg  <wl@gnu.org>
-
-       * builds/toplevel.mk (version): Protect against `distclean' target.
-
-2006-12-09  Werner Lemberg  <wl@gnu.org>
-
-       * builds/*/*def.mk, builds/*/detect.mk (CAT): Define to either `cat'
-       or `type'.
-
-       * builds/freetype.mk (version): Extracted from freetype.h, using
-       GNU make's built-in string functions.
-       (refdoc): Use $(version) instead of static version number.
-
-2006-12-08  Werner Lemberg  <wl@gnu.org>
-
-       * builds/toplevel.mk (dist): Extract version number from freetype.h.
-
-2006-12-08  Vladimir Volovich  <vvv@vsu.ru>
-
-       * 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>
-
-       * src/autofit/afloader.c (af_loader_load_g): Small adjustment
-       to the spacing of auto-fitted glyphs.  This only impacts rare
-       cases (e.g., Arial Bold at rather small character sizes).
-
-2006-12-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/rules.mk (SFNT_DRV_SRC): Add ttsbit0.c.
-
-2006-12-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (tt_face_get_name): All Unicode strings are
-       encoded in UTF-16BE.  Patch from Rajeev Pahuja <rpahuja@esri.com>.
-       (tt_name_entry_ascii_from_ucs4): Removed.
-
-
-       * include/freetype/ftxf86.h: Fix and extend comment so that it
-       appears in the documentation.
-
-       * include/freetype/ftchapters.h: Add `font_format' section.
-
-
-       * src/tools/docmaker/tohtml.py (HtmlFormatter::index_exit): Add link
-       to TOC in index page.
-
-2006-11-28  David Turner  <david@freetype.org>
-
-       * src/smooth/ftgrays.c (gray_raster_render): Return 0 when we are
-       trying to render into a zero-width/height bitmap, not an error code.
-
-       * src/truetype/ttobjs.c (tt_face_init): Fix typo in previous patch.
-
-       * src/smooth/ftgrays.c: Remove hard-coded error values; use FreeType
-       ones instead.
-
-       * src/autofit/afhints.c (af_glyph_hints_dump_segments): Remove unused
-       variable.
-
-2006-11-26  Pierre Hanser  <hanser@club-internet.fr>
-
-       * src/truetype/ttobjs.c (tt_face_init): Protect against NULL pointer.
-
-2006-11-25  David Turner  <david@freetype.org>
-
-       * src/autofit/afhints.c (af_glyph_hints_dump_points,
-       af_glyph_hints_dump_segments, af_glyph_hints_dumpedges) [!AF_DEBUG]:
-       Add stubs to link the `ftgrid' test program when debugging is
-       disabled in the auto-hinter.
-
-2006-11-23  David Turner  <david@freetype.org>
-
-       * src/autofit/afhints.c, src/autofit/afhints.h, src/autofit/aflatin.c,
-       src/autofit/aftypes.h: Miscellaneous auto-hinter improvements.
-
-       * src/autofit/afhints.c (af_glyph_hints_dump_segments) [AF_DEBUG]:
-       Emit more sensible information.
-
-       * src/autofit/afhints.h (AF_SegmentRec): Add `height' member.
-
-       * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Improve
-       rounding of blue values.
-       (af_latin_hints_compute_segments): Hint segment heights.
-       (af_latin_hints_link_segments): Reduce `len_score' value.
-       (af_latin_hints_compute_edges): Increase `segment_length_threshold'
-       value and use `height' member for comparisons.
-       (af_latin_hint_edges): Extend logging message.
-       Improve handling of remaining edges.
-
-2006-11-22  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #15553.
-
-       * src/truetype/ttgload.c (tt_loader_init): Re-execute the CVT
-       program after a change from mono to grayscaling (and vice versa).
-       Use correct constant for comparison to get `exec->grayscale'.
-
-2006-11-18  Werner Lemberg  <wl@gnu.org>
-
-       Because FT_Load_Glyph expects CID values for CID-keyed fonts, the
-       test for a valid glyph index must be deferred to the font drivers.
-       This patch fixes Savannah bug #18301.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Don't check `glyph_index'.
-       * src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/cff/cffgload.c
-       (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph),
-       src/pcf/pcfdrivr.c (PCF_Glyph_Load), src/pfr/pfrobjs.c
-       (pfr_slot_load), src/truetype/ttdriver.c (Load_Glyph),
-       src/type1/t1gload.c (T1_Load_Glyph), src/winfonts/winfnt.c
-       (FNT_Load_Glyph): Check validity of `glyph_index'.
-
-2006-11-13  David Turner  <david@freetype.org>
-
-       * src/truetype/ttinterp.c (FIX_BYTECODE): Undefine.  The interpreter
-       `enhancements' are still too buggy for general use.
-
-       * src/base/ftlcdfil.c: Add support for FT_FORCE_LIGHT_LCD_FILTER and
-       FT_FORCE_LEGACY_LCD_FILTER at compile time.  Define these macros
-       when building the library to change the default LCD filter to be
-       used.  This is only useful for experimentation.
-
-       * include/freetype/ftlcdfil.h: Update documentation.
-
-2006-11-10  David Turner  <david@freetype.org>
-
-       * src/smooth/ftsmooth.c: API change for the LCD
-       filter.  The FT_LcdFilter value is an enumeration describing which
-       filter to apply, with new values FT_LCD_FILTER_LIGHT and
-       FT_LCD_FILTER_LEGACY (the latter implements the LibXft original
-       algorithm which produces strong color fringes for everything
-       except very-well hinted text).
-
-       * include/freetype/ftlcdfil.h (FT_Library_SetLcdFilter): Change
-       second parameter to an enum type.
-
-       * src/base/ftlcdfil.c (USE_LEGACY): Define.
-       (_ft_lcd_filter): Rename to...
-       (_ft_lcd_filter_fir): This.
-       Update parameters.
-       (_ft_lcd_filter_legacy) [USE_LEGACY]: New filter function.
-       (FT_Library_Set_LcdFilter): Update parameters.
-       Handle new filter modes.
-
-       * include/internal/ftobjs.h: Include FT_LCD_FILTER_H.
-       (FT_Bitmap_LcdFilterFunc): Change third argument to `FT_Library'.
-       (FT_LibraryRec) [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Add filtering
-       callback and update other fields.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic)
-       [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Update.
-       Other minor improvements.
-
-       * src/autofit/aflatin.c: Various tiny improvements that drastically
-       improve the handling of serif fonts and of LCD/LCD_V hinting modes.
-       (af_latin_hints_compute_edges): Fix typo.
-       (af_latin_compute_stem_width): Take better care of diagonal stems.
-
-2006-11-09  David Turner  <david@freetype.org>
-
-       * src/pshinter/pshalgo.c (psh_glyph_compute_inflections): Fix
-       typo which created a variable-used-before-initialized bug.
-
-2006-11-07  Zhe Su  <james.su@gmail.com>
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Handle vertical layout
-       also.
-
-2006-11-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftcalc.c: Don't use `long long' but `FT_Int64'.
-
-2006-11-02  David Turner  <david@freetype.org>
-
-       Add a few tweaks to better handle serif fonts.
-       Add more debugging messages.
-
-       * src/autofit/aflatin.c (af_latin_hints_compute_edges): Ignore
-       segments that are less than 1.5 pixels high.  This gets rid of
-       *many* corner cases with serifs.
-       (af_latin_align_linked_edge): Add logging message.
-       (af_latin_hint_edges): Use AF_HINTS_DO_BLUES.
-       Add logging messages.
-       Handle AF_EDGE_FLAG flag specially.
-
-       * src/autofit/afmodule.c [AF_DEBUG]: Add _af_debug,
-       _af_debug_disable_blue_hints, and _af_debug_hints variables.
-
-       * src/autofit/aftypes.h (AF_LOG) [AF_DEBUG]: Use _af_debug.
-       Update external declarations.
-       (af_corner_orientation, af_corner_is_flat): Replaced by...
-
-       * include/freetype/internal/ftcalc.h (ft_corner_orientation,
-       ft_corner_is_flat): These declarations.
-
-       * src/autofit/afangles.c (af_corner_orientation, af_corner_is_flat):
-       Comment out.  Replaced by...
-
-       * src/base/ftcalc.h (ft_corner_orientation, ft_corner_is_flat):
-       These functions.  Update all callers.
-       (FT_Add64) [!FT_LONG64]: Simplify.
-
-       * src/autofit/afhints.c: Include FT_INTERNAL_CALC_H.
-       (af_direction_compute): Add a missing FT_ABS call.  This bug caused
-       production of garbage by missing lots of segments.
-
-       * src/autofit/afhints.h (AF_HINTS_DO_BLUES): New macro.
-
-       * src/autofit/afloader.c (af_loader_init, af_loader_done)
-       [AF_DEBUG]: Set _af_debug_hints.
-
-
-       * src/pshinter/pshalgo.c: Include FT_INTERNAL_CALC_H.
-       (psh_corner_is_flat, psh_corner_orientation): Use ft_corner_is_flat
-       and ft_corner_orientation.
-
-
-       * src/gzip/inftrees.c (huft_build): Remove compiler warning.
-
-2006-10-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_encoding_load): Remove unused variable.
-
-       * src/base/ftobjs.c (FT_Select_Charmap): Disallow FT_ENCODING_NONE
-       as argument.
-
-2006-10-23  Zhe Su  <zsu@novell.com>
-
-       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Re-implement to
-       better deal with broken Asian fonts with strange glyphs, having
-       self-intersections and other peculiarities.  The used algorithm is
-       based on the nonzero winding rule.
-
-2006-10-23  David Turner  <david@freetype.org>
-
-       Speed up the CFF font loader.  With some large CFF fonts,
-       FT_Open_Face is now more than three times faster.
-
-       * src/cff/cffload.c (cff_get_offset): Removed.
-       (cff_new_index): Inline functionality of `cff_get_offset'.
-       (cff_charset_compute_cids, cff_charset_free_cids): New functions.
-       (cff_charset_done): Call `cff_charset_free_cids'.
-       (cff_charset_load): Call `cff_charset_compute_cids'.
-       (cff_encoding_load) <Populate>: Ditto, to replace inefficient loop.
-
-       * src/sfnt/ttmtx.c (tt_face_load_hmtx): Replace calls to FT_GET_XXX
-       with FT_NEXT_XXX.
-
-
-       Speed up the Postscript hinter, with more than 100% speed increase
-       on my machine.
-
-       * src/pshinter/pshalgo.c (psh_corner_is_flat,
-       psh_corner_orientation): New functions.
-       (psh_glyph_compute_inflections): Merge loops for efficiency.
-       Use `psh_corner_orientation'.
-       (psh_glyph_init): Use `psh_corner_is_flat'.
-       (psh_hint_table_find_strong_point): Renamed to...
-       (psh_hint_table_find_strong_points): This.
-       Rewrite, adding argument to handle all points at once.
-       Update all callers.
-       (PSH_MAX_STRONG_INTERNAL): New macro.
-       (psh_glyph_interpolate_normal_points): Rewrite for efficiency.
-
-2006-10-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (FT_New_Face_From_FOND): Initialize variable
-       `error' with FT_Err_Ok.
-
-2006-10-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * docs/INSTALL.CROSS: New document file for cross-building.
-
-       * builds/unix/configure.raw: Preliminary cross-building support.
-       Find native C compiler and pass it by CC_BUILD, and
-       find suffix for native executable and pass it by EXEEXT_BUILD.
-       Also suffix for target executable is passed by EXEEXT.
-
-       * builds/unix/unix-cc.in (CCraw_build, E_BUILD): New variables to
-       build `apinames' which runs on building system.  They are set by
-       CC_BUILD and EXEEXT_BUILD.
-
-       * builds/exports.mk (APINAMES_EXE): Change the extension for
-       apinames from the suffix for target (E) to that for building host
-       (E_BUILD).
-
-2006-10-12  Werner Lemberg  <wl@gnu.org>
-
-       * docs/INSTALL.UNX, docs/UPGRADE.UNX: Renamed to...
-       * docs/INSTALL.UNIX, docs/UPGRADE.UNIX: This.  Update all documents
-       which reference those files.
-
-2006-10-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw (FT2_EXTRA_LIBS): New variable.  It is
-       embedded in freetype2.pc and freetype-config.  Use it to record
-       Carbon dependency of MacOSX.
-
-       * builds/unix/freetype2.in: Embed FT2_EXTRA_LIBS.
-
-       * builds/unix/freetype-config.in: Ditto.
-
-2006-10-11  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h (FT_CONFIG_OPTION_SUBPIXEL_RENDERING): Define for
-       development.
-
-2006-10-03  Jens Claudius  <jens.claudius@yahoo.com>
-
-       * include/freetype/config/ftstdlib.h: Cast away volatileness from
-       argument to ft_setjmp.
-
-       * include/freetype/internal/ftvalid.h: Add comment that
-       ft_validator_run must not be used.
-
-2006-10-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftbase.c: Undo change from 2006-09-30.
-
-       * src/base/rules.mk (BASE_SRC): Remove `ftlcdfil.c'.
-
-2006-09-30  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec):
-       s/unpatented_hinting/ignore_unpatented_hinter/.
-       Update all callers.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Refine the algorithm whether
-       auto-hinting shall be used or not.
-
-       * src/truetype/ttobjs.c (tt_face_init): Ditto.
-
-2006-09-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/rules.mk (BASE_SRC): Remove `ftapi.c' (which is no longer
-       in use).
-
-       * src/base/ftbase.c: Include `ftlcdfil.c'.
-
-2006-09-29  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary): Fix algorithm for
-       overlapping segments.  Bug reported by Stefan Koch.
-
-2006-09-28  David Turner  <david@freetype.org>
-
-       Fix a bug in the automatic unpatented hinting support which prevents
-       normal bytecode hinting to work properly.
-
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec):
-       s/force_autohint/unpatented_hinting/.  Update all callers.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Updated code.
-
-       * src/autofit/aftypes.h (AF_DEBUG): Undefine to get rid of traces.
-
-2006-09-27  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h (FT_FREETYPE_PATCH): Set to 2.
-
-
-       Add a new API to support color filtering of subpixel glyph bitmaps.
-       In a default build, the function `FT_Library_SetLcdFilter' returns
-       `FT_Err_Unimplemented_Feature'; you need to #define
-       FT_CONFIG_OPTION_SUBPIXEL_RENDERING in ftoption.h to compile the
-       real implementation.
-
-       * include/freetype/ftlcdfil.h, src/base/ftlcdfil.c: New files.
-
-       * include/freetype/internal/ftobjs.h (FT_Bitmap_LcdFilterFunc): New
-       typedef.
-       (FT_LibraryRec) [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: New members
-       `lcd_filter_weights' and `lcd_filter'.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove arguments
-       `hmul' and `vmul'.
-
-       Handle subpixel rendering.
-       Simplify function.
-       (ft_smooth_render_lcd): Use `FT_RENDER_MODE_LCD'.
-       (ft_smooth_render_lcd_v): Use `FT_RENDER_MODE_LCD_V'.
-
-       * include/freetype/config/ftheader.h (FT_LCD_FILTER_H): New macro,
-       pointing to <freetype/ftlcdfil.h>.
-
-       * src/base/Jamfile (_sources), src/base/rules.mk (BASE_SRC),
-       vms_make.com: Add `ftlcdfil.c' to the list of compiled source files.
-
-       * modules.cfg (BASE_EXTENSIONS): Add ftlcdfil.c.
-
-2006-09-26  David Bustin
-
-       * src/pfr/pfrobjs.c (pfr_face_get_kerning): Skip adjustment bytes
-       correctly.  Reported as Savannah bug #17843.
-
-2006-09-26  David Turner  <david@freetype.org>
-
-       * src/autofit/afhints.h (AF_HINTS_DO_HORIZONTAL,
-       AF_HINTS_DO_VERTICAL, AF_HINTS_DO_ADVANCE): New macros to disable
-       horizontal and vertical hinting for the purpose of debugging the
-       auto-fitter.
-
-       * src/autofit/afmodule.c (_af_debug_disable_horz_hints,
-       _af_debug_disable_vert_hints) [AF_DEBUG]: New global variables.
-
-       * src/autofit/aftypes.h [AF_DEBUG]: Declare above variables.
-
-       * include/freetype/config/ftoption.h, devel/ftoption.h
-       (FT_CONFIG_OPTION_SUBPIXEL_RENDERING): New macro to control whether
-       we want to compile LCD-optimized rendering code (à la ClearType) or
-       not.  The macro *must* be disabled in default builds of the library
-       for patent reasons.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Disable
-       LCD-specific rendering when FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-       isn't defined at compile time.  This only changes the content of the
-       rendered glyph to match the one of normal gray-level rendering,
-       hence clients should not need to be modified.
-
-       * docs/CHANGES: Updated.
-
-2006-09-18  Garrick Meeker  <garrick@digitalanarchy.com>
-
-       * src/base/ftmac.c (FT_New_Face_From_FOND): Fall back to SFNT if
-       LWFN fails and both are available.
-
-2006-09-11  David Turner  <david@freetype.org>
-
-       * src/sfnt/sfobjs.c (tt_face_get_name): Support some fonts which
-       report their English names through an Apple Roman
-       (platform,encoding) pair, with language_id != English.
-
-       If the font uses another name entry with language_id == English, it
-       will be selected correctly, though.
-
-       * src/truetype/ttobjs.c (tt_face_init): Add unpatented hinting
-       selection for `mingli.ttf'.
-
-2006-09-05  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttpload.c (tt_face_load_hdmx): Handle `record_size'
-       values which have the upper two bytes set to 0xFF instead of 0x00
-       (as it happens in at least two CJKV fonts, `HAN NOM A.ttf' and
-       `HAN NOM B.ttf').
-
-       * src/smooth/ftgrays.c [GRAYS_USE_GAMMA]: Really remove all code.
-
-2006-09-05  David Turner  <david@freetype.org>
-
-       Minor source cleanups and optimizations.
-
-       * src/smooth/ftgrays.c (GRAYS_COMPACT): Removed.
-       (TRaster): Remove `count_ex' and `count_ey'.
-       (gray_find_cell): Remove 2nd and 3rd argument.
-       (gray_alloc_cell): Merged with `gray_find_cell'.
-       (gray_record_cell): Simplify.
-       (gray_set_cell): Rewrite.
-       (gray_start_cell): Apply offsets to `ras.ex' and `ras.ey'.
-       (gray_render_span): Don't use FT_MEM_SET for small values.
-       (gray_dump_cells) [DEBUG_GRAYS]: New function.
-       (gray_sweep): Avoid buffer overwrites when to drawing the end of a
-       bitmap scanline.
-       (gray_convert_glyph): Fix speed-up.
-
-2006-09-04  David Turner  <david@freetype.org>
-
-       * src/smooth/ftgrays.c (gray_convert_glyphs): Make it work with
-       64bit processors.
-
-2006-09-03  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
-
-       * src/smooth/ftgrays.c (gray_record_cell): Remove shadowing
-       variable declaration.
-       (gray_convert_glyph): Fix compiler warnings.
-
-2006-09-01  David Turner  <david@freetype.org>
-
-       * src/truetype/ttobjs.c (tt_face_init): Update the TrueType loader
-       to recognize a few fonts that require the automatic unpatented
-       loader.
-
-       * src/smooth/ftgrays.c: Optmize the performance of the anti-aliased
-       rasterizer.  The speed improvement is between 15% and 25%, depending
-       on the font data.
-
-       (GRAYS_USE_GAMMA, GRAYS_COMPACT): Removed, and all associated code.
-       (TCell): Redefine.
-       (TRaster): New members `buffer', `buffer_size', `ycells', `ycount'.
-       (gray_init_cells): Updated.
-       (gray_find_cell, gray_alloc_cell): New functions.
-       (gray_record_cell): Rewritten to use `gray_find_cell' and
-       `gray_alloc_cell'.
-       (PACK, LESS_THAN, SWAP_CELLS, DEBUG_SORT, QUICK_SORT, SHELL_SORT,
-       QSORT_THRESHOLD):
-       Removed.
-       (gray_shell_sort, gray_quick_sort, gray_check_sort,
-       gray_dump_cells): Removed.
-       (gray_sweep): Rewritten.
-       (gray_convert_glyph): Rewrite code which used one of the sorting
-       functions.
-       (gray_raster_render): Updated.
-
-2006-08-29  Dr. Werner Fink  <werner@suse.de>
-
-       * configure: Make it possible to handle configure options which
-       have strings containing spaces.
-
-2006-08-27  David Turner  <david@freetype.org>
-
-       * include/freetype/config/ftoption.h (TT_USE_BYTECODE_INTERPRETER):
-       New macro, defined if either TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-       or TT_CONFIG_OPTION_UNPATENTED_HINTING is defined.
-
-       * include/freetype/internal/ftcalc.h, src/base/ftcalc.c,
-       src/truetype/truetype.c, src/truetype/ttdriver.c,
-       src/truetype/ttgload.c, src/truetype/ttgload.h,
-       src/truetype/ttinterp.c, src/truetype/ttobjs.c,
-       src/truetype/ttobjs.h, src/truetype/ttpload.c, src/type42/t42drivr.c:
-       s/TT_CONFIG_OPTION_BYTECODE_INTERPRETER/TT_USE_BYTECODE_INTERPRETER/.
-
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): New
-       member `force_autohint'.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Use `force_autohint'.
-
-       * src/truetype/ttobjs.c (tt_face_init): Prepare code for testing
-       against a list of font names which need the bytecode interpreter.
-
-2006-08-27  Jens Claudius  <jens.claudius@yahoo.com>
-
-       Fix miscellaneous compiler warnings.
-
-       * include/freetype/internal/ftobjs.h: Close comment with `*/' to
-       avoid `/* in comment' compiler warning.
-
-       * src/base/ftdbgmem.c (ft_mem_table_get_source): Turn cast
-       `(FT_UInt32)(void*)' into `(FT_UInt32)(FT_PtrDist)(void*)' since on
-       64-bit platforms void* is larger than FT_UInt32.
-
-       * src/base/ftobjs.c (t_validator_error): Cast away
-       volatileness of argument to ft_longjmp.  Spotted by Werner
-       `Putzfrau' Lemberg.
-
-       * src/bdf/bdflib.c (bdf_load_font): Initialize local
-       variable `lineno'.
-
-       * src/gxvalid/gxvmod.c (classic_kern_validate): Mark local variable
-       `error' as volatile.
-
-2006-08-27  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/ftconfig.in: Synchronize with main ftconfig.h.
-       Reported by Jens.
-
-2006-08-22  Jens Claudius  <jens.claudius@yahoo.com>
-
-       Fix for previous commit, which caused many compiler warnings/errors
-       about addresses of volatile objects passed as function arguments as
-       non-volatile pointers.
-
-       * include/freetype/internal/ftvalid.h: Make FT_Validator typedef a
-       pointer to a volatile object.
-
-       * src/gxvalid/gxvmod.c (gxv_load_table): Make function argument
-       `table' a pointer to a volatile object.
-
-       * src/otvalid/otvmod.c (otv_load_table): Make function argument
-       `table' a pointer to a volatile object.
-
-2006-08-18  Jens Claudius  <jens.claudius@yahoo.com>
-
-       * src/gxvalid/gxvmod.c (GXV_TABLE_DECL): Mark local variable `_sfnt'
-       as volatile since it must keep its value across a call to ft_setjmp.
-       (gxv_validate): Same for local variables `memory' and `valid'.
-       (classic_kern_validate): Same for local variables `memory',
-       `ckern', and `valid'.
-
-       * src/otvalid/otvmod.c (otv_validate): Same for function parameter
-       `face' and local variables `base', `gdef', `gpos', `gsub', `jstf',
-       and 'valid'.
-
-       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Same for local variable
-       `cmap'.
-
-2006-08-16  David Turner  <david@freetype.org>
-
-       * src/cid/cidgload.c (cid_slot_load_glyph): Remove compiler
-       warnings.
-
-       * src/base/ftobjs.c (ft_validator_run): Disable function; it is
-       buggy by design.  Always return -1.
-
-
-       Improvements to native TrueType hinting.  This is a first try,
-       controlled by the FIX_BYTECODE macro in src/truetype/ttinterp.c.
-
-       * include/freetype/internal/ftgloadr.h (FT_GlyphLoadRec): Add member
-       `extra_points2'.
-
-       * include/freetype/internal/tttypes.h (TT_GlyphZoneRec): Add member
-       `orus'.
-
-       * src/base/ftgloadr.c (FT_GlyphLoader_Reset,
-       FT_GlyphLoader_Adjust_Points, FT_GlyphLoader_CreateExtra,
-       FT_GlyphLoader_CheckPoints, FT_GlyphLoader_CopyPoints): Updated to
-       handle `extra_points2'.
-
-       * src/truetype/ttgload.c (tt_prepare_zone): Handle `orus'.
-       Remove compiler warning.
-       (cur_to_arg): Remove macro.
-       (TT_Hint_Glyph): Updated.
-       (TT_Process_Simple_Glyph): Handle `orus'.
-
-       * src/truetype/ttinterp.c (FIX_BYTECODE): New macro.
-       (Ins_MD, Ins_MDRP, Ins_IP) [FIX_BYTECODE]: Handle `orus'.
-       (LOC_Ins_IUP): Renamed to...
-       (IUP_WorkerRec): This.
-       Add `orus' member.
-       (Shift): Renamed to...
-       (_iup_worker_shift): This.
-       Updated.
-       (Interp): Renamed to...
-       (_iup_worker_interpolate): This.
-       Updated to handle `orus'.
-       (Ins_IUP): Updated.
-
-       * src/truetype/ttobjs.c (tt_glyphzone_done, tt_glyphzone_new):
-       Handle `orus'.
-
-2006-08-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * modules.cfg (BASE_EXTENSIONS): Compile in ftgxval.c by default to
-       build ftvalid in ft2demos.  This has been inadvertedly changed
-       2006-08-13.
-
-2006-08-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       `ft_validator_run' wrapping `setjmp' can cause a crash, as found by
-       Jens:
-       http://lists.gnu.org/archive/html/freetype-devel/2006-08/msg00004.htm.
-
-       * src/otvalid/otvmod.c: Replace `ft_validator_run' by `ft_setjmp'.
-       It reverts the change introduced on 2005-08-20.
-
-       * src/gxvalid/gxvmod.c: Ditto.
-
-2006-08-13  Jens Claudius  <jens.claudius@yahoo.com>
-
-       * finclude/freetype/internal/psaux.h: (T1_TokenType): Add
-       T1_TOKEN_TYPE_KEY.
-       (T1_FieldRec): Add `dict'.
-       (T1_FIELD_DICT_FONTDICT, T1_FIELD_DICT_PRIVATE): New macros.
-       (T1_NEW_XXX, T1_FIELD_XXX): Update to take the dictionary where a PS
-       keyword is expected as an additional argument.
-
-       * src/cid/cidload.c: (cid_field_records): Adjust invocations of
-       T1_FIELD_XXX.
-
-       * src/cid/cidtoken.h: Adjust invocations of T1_FIELD_XXX.
-
-       * src/psaux/psobjs.c: Add macro FT_COMPONENT for tracing.
-       (ps_parser_to_token): Report a PostScript key as T1_TOKEN_TYPE_KEY,
-       not T1_TOKEN_TYPE_ANY.
-       (ps_parser_load_field): Make sure a token that should be a string or
-       name is really a string or name.
-       Avoid memory leak if a keyword has been already encountered and its
-       value is overwritten.
-       * src/type1/t1load.c: (t1_keywords): Adjust invocations of
-       T1_FIELD_XXX.
-       (parse_dict): Ignore keywords that occur in the wrong dictionary
-       (e.g., in `Private' instead of `FontDict').
-
-       * src/type1/t1tokens.h: Adjust invocations of T1_FIELD_XXX.
-
-       * src/type42/t42parse.c: (t42_keywords): Adjust invocations of
-       T1_FIELD_XXX.
-
-2006-07-18  Jens Claudius  <jens.claudius@yahoo.com>
-
-       Move creation of field `buildchar' of T1_DecoderRec out of
-       `t1_decoder_init' and let the caller of `t1_decoder_init' take care
-       of it.
-
-       Call the finisher for T1_Decoder in `cid_face_compute_max_advance'
-       and `T1_Compute_Max_Advance'.
-
-       * include/freetype/internal/psaux.h (T1_DecoderRec): Remove field
-       `face', add `len_buildchar'.
-
-       * include/freetype/internal/t1types.h (T1_FaceRec): Add field
-       `buildchar'.
-
-       * src/cid/cidgload.c (cid_face_compute_max_advance): Call finisher
-       for T1_Decoder.
-       (cid_slot_load_glyph): Do not ignore failure when initializing the
-       T1_Decoder.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Updated.
-       (t1_decoder_init): Remove initialization of fields `buildchar' and
-       `len_buildchar'.
-       (t1_decoder_done): Remove deallocation of field `buildchar'.
-
-       * freetype/src/type1/t1gload.c (T1_Compute_Max_Advance): Initialize
-       T1_Decoder's `buildchar' and `len_buildchar'; call finisher for
-       T1_Decoder.
-       (T1_Load_Glyph): Initialize T1_Decoder's `buildchar' and
-       `len_buildchar'; make sure to call finisher for T1_Decoder even in
-       case of error.
-
-       * src/type1/t1load.c (T1_Open_Face): Allocate new field `buildchar'
-       of T1_FaceRec.
-
-       * src/type1/t1objs.c (T1_Face_Done): Free new field `buildchar' of
-       T1_FaceRec.
-
-2006-07-14  Jens Claudius  <jens.claudius@yahoo.com>
-
-       * include/freetype/internal/psaux.h: New macros IS_PS_NEWLINE,
-       IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT,
-       and IS_PS_BASE85 (from src/psaux/psconv.h).
-       (T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER,
-       T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND.
-       (T1_DecoderRec): New fields `buildchar' and `face'.
-       (IS_PS_TOKEN): New macro.
-
-       * include/freetype/internal/t1types.h (T1_FaceRec): New fields
-       `ndv_idx', `cdv_idx', and `len_buildchar'.
-
-       * include/freetype/t1tables.h (PS_BlendRec): New fields
-       `default_design_vector' and `num_default_design_vector'.
-
-       * src/psaux/psconv.h: Move macros IS_PS_NEWLINE, IS_PS_SPACE,
-       IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT, and
-       IS_PS_BASE85 to include/freetype/internal/psaux.h.
-
-       * src/psaux/psobjs.c (ps_parser_to_token_array): Allow `token'
-       argument to be NULL if we want only to count the number of tokens.
-       (ps_tocoordarray): Allow `coords' argument to be NULL if we just
-       want to skip the array.
-       (ps_tofixedarray): Allow `values' argument to be NULL if we just
-       want to skip the array.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add support
-       for (partially commented out) othersubrs 19-25, 27, and 28.
-       (t1_decoder_init): Initialize new fields `face' and `buildchar'.
-       (t1_decoder_done): Release new field `buildchar'.
-
-       * src/type1/t1load.c (parse_buildchar, parse_private): New
-       functions.
-       (t1_keywords): Register them.
-       (t1_allocate_blend): Updated.
-       (t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER,
-       T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND.
-       (parse_dict): Remove `keyword_flags' argument.
-       Use new macro IS_PS_TOKEN.
-       Changed function so that later PostScript definitions override
-       earlier ones.
-       (t1_init_loader): Initialize new field `keywords_encountered'.
-       (T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and
-       `len_buildchar'.
-       Remove `keywords_flags'.
-
-       * src/type1/t1load.h (T1_LoaderRect): New field
-       `keywords_encountered'.
-       (T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros.
-
-       * src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: New
-       entries for parsing /NDV, /CDV, and /DesignVector.
-
-2006-07-07  Werner Lemberg  <wl@gnu.org>
-
-       Add many checks to protect against malformed PCF files.
-
-       * src/pcf/pcfdrivr.c (PCF_Face_Done): Protect against NULL pointers.
-       (PCF_Face_Init): Add calls to PCF_Face_Done in case of errors.
-
-       * src/pcf/pcfread.c (pcf_read_TOC): Protect against malformed table
-       data and check that tables don't overlap (using a simple
-       bubblesort).
-       (PCF_METRIC_SIZE, PCF_COMPRESSED_METRIC_SIZE, PCF_PROPERTY_SIZE):
-       New macros which give the size of data structures in the data
-       stream.
-       (pcf_get_properties): Use rough estimates to get array size limits.
-       Assign `face->nprops' and `face->properties' earlier so that a call
-       to PCF_Face_Done can do the clean-up in case of error.
-       Protect against invalid string offsets.
-       (pcf_get_metrics): Clean up code.
-       Adjust tracing message levels.
-       Use rough estimate to get array size limit.
-       (pcf_get_bitmaps): Clean up code.
-       Adjust tracing message levels.
-       Use rough estimates to get offset limits.
-       (pcf_get_encodings): Adjust tracing message level.
-       (pcf_get_accel): Clean up code.
-
-2006-06-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Handle fonts correctly which
-       don't have a POINT_SIZE property.  This fixes Savannah bug #16914.
-
-2006-06-26  Jens Claudius  <jens.claudius@yahoo.com>
-
-       * src/psaux/t1decode.c (T1_Operator, t1_args_count): Add opcode 15.
-       (t1_decoder_parse_charstrings): Operator with
-       opcode 15 pops its two arguments.
-       Handle the case where the pops of an othersubr may be part of a
-       subroutine.
-       Handle unknown othersubrs gracefully: count their operands and let
-       the following pop operators push the operands as the results onto
-       the Type1 stack.
-       Improve handling of setcurrentpoint opcode.
-
-2006-06-25  Jens Claudius  <jens.claudius@yahoo.com>
-
-       The Type 1 parser now skips over top-level procedures as required
-       for a `Simplified Parser'.  This makes the parser more robust as it
-       doesn't poke around in PostScript code.  Additionally, it makes the
-       FontDirectory hackery in src/type1/t1load.c unnecessary.
-
-       * src/psaux/psobjs.c (IS_OCTAL_DIGIT): New macro.
-       (skip_literal_string): Add FT_Error as return value.
-       Handle escapes better.
-       (skip_string): Add FT_Error as return value.
-       Don't set `parser->error' but return error code directly.
-       (skip_procedure): New function.
-       (ps_parser_skip_PS_token): Handle procedures.
-       Update code.
-       (ps_parser_to_token): Update code.
-       (ps_parser_load_field_table): Handle bbox entries also.
-
-       * src/type1/t1load.c (parse_dict): Remove FontDirectory hackery.
-       Add commented-out code for synthetic fonts.
-
-2006-06-24  Eugeniy Meshcheryakov  <eugen@univ.kiev.ua>
-
-       Fix two hinting bugs as reported in
-       http://lists.gnu.org/archive/html/freetype-devel/2006-06/msg00057.html.
-
-       * include/freetype/internal/tttypes.h (TT_GlyphZoneRec): Add
-       `first_point' member.
-
-       * src/truetype/ttgload.c (tt_prepare_zone): Initialize
-       `first_point'.
-       (TT_Process_Composite_Glyph): Always untouch points.
-
-       * src/truetype/ttinterp.c (Ins_SHC): Fix computation of
-       `first_point' and `last_point' in case of composite glyphs.
-       (Ins_IUP): Fix computation of `end_point'.
-
-2006-06-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Insert EndianS16_BtoN and EndianS32_BtoN as workaround for Intel
-       Mac.  The original patch was written by David Sachitano and Lawrence
-       Coopet, and modified by Sean McBride for MPW compatibility.  Only
-       required data are converted; unused data are left in big endian.
-
-       * src/base/ftmac.c: Include <Endian.h> for byteorder macros for non
-       Mac OS X platforms.
-       (OS_INLINE): Undefine before definition.
-       (count_faces_sfnt): Insert EndianS16_BtoN to parse the header of
-       FontAssociation table in FOND resource.
-       (count_faces_scalable): Insert EndianS16_BtoN to parse the header
-       and fontSize at each entry of FontAssociation table in FOND
-       resource.
-       (parse_fond): Insert EndianS16_BtoN and EndianS32_BtoN to parse
-       ffStylOff of FamilyRecord header of FOND resource, the header,
-       fontSize, fontID at each entry of FontAssociation table, and
-       StyleMapping table.
-       (count_faces): Call `HUnlock' after all FOND utilization.
-
-2006-06-08  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Public API of TrueTypeGX, OpenType, and classic kern table validator
-       should return `FT_Err_Unimplemented_Feature' if validation service
-       is unavailable (disabled in `modules.cfg').  It is originally
-       suggested by David Turner, cf.
-       http://lists.gnu.org/archive/html/freetype-devel/2005-11/msg00078.html
-
-       * src/base/ftgxval.c (FT_TrueTypeGX_Validate): Return
-       FT_Err_Unimplemented_Feature if TrueTypeGX validation service is
-       unavailable.
-       (FT_ClassicKern_Validate): Return FT_Err_Unimplemented_Feature if
-       classic kern table validation service is unavailable.
-
-       * src/base/ftotval.c (FT_OpenType_Validate): Return
-       FT_Err_Unimplemented_Feature if OpenType validation service is
-       unavailable.
-
-2006-06-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdflib.c (bdf_load_font): Fix memory leaks in case of
-       errors.
-
-2006-06-07  David Turner  <david@freetype.org>
-
-       * src/type1/t1afm.c (KERN_INDEX): Make it more robust.
-       (T1_Read_Metrics): Fix memory leak which happened when the metrics
-       file doesn't have kerning pairs.  This fixes Savannah bug #16768.
-
-2006-06-06  David Turner  <david@freetype.org>
-
-       Fix memory leak described in Savannah bug #16759.
-
-       We change `ps_unicodes_init' so that it also takes a
-       `free_glyph_name' callback to release the glyph names returned by
-       `get_glyph_name'
-
-       * include/freetype/internal/services/svpscmap.h (PS_Glyph_NameFunc):
-       Renamed to ...
-       (PS_GetGlyphNameFunc): This.
-       (PS_FreeGlyphNameFunc): New typedef.
-       (PS_Unicodes_InitFunc): Add variable for PS_FreeGlyphNameFunc.
-
-       * src/cff/cffcmap.c (cff_sid_to_glyph_name): Use `TT_Face' for first
-       argument.
-       (cff_sid_free_glyph_name): New function.
-       (cff_cmap_unicode_init): Updated.
-
-       * src/psaux/t1cmap.c (t1_cmap_unicode_init): Updated.
-
-       * src/psnames/psmodule.c (ps_unicodes_init): Add variable for
-       PS_FreeGlyphNameFunc and use it.
-
-
-2006-06-04  David Turner  <david@freetype.org>
-
-       * src/base/ftutil.c (ft_mem_qrealloc): Fix the function to accept
-       `item_size == 0' as well -- though this sounds weird, it can
-       theoretically happen.  This fixes Savannah bug #16669.
-
-       * src/pfr/pfrobjs.c (pfr_face_init): Fix the computation
-       of `face->num_glyphs' which missed the last glyph, due to
-       the offset-by-1 computation, since the PFR format doesn't
-       guarantee that glyph index 0 corresponds to the `missing
-       glyph.  This fixes Savannah bug #16668.
-
-2006-05-25  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/unix-cc.in (LINK_LIBRARY): Don't comment out
-       `-no-undefined'.  Reported by Christian Biesinger.
-
-2006-05-19  Brian Weed  <bw@imaginengine.com>
-
-       * builds/win32/visualc/freetype.dsp: Release libraries no longer
-       have debug information, and debug libraries use `C7 compatible'
-       debug info.
-
-2006-05-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Apply patch by Derek Clegg to fix two memory leaks in the MacOS
-       resource fork handler.  This fixes Savannah bug #16631.
-
-       * src/base/ftobjs.c (load_face_in_embedded_rfork): Replace
-       `FT_Stream_Close' by `FT_Stream_Free' to fix memory leak.
-
-       * src/base/ftrfrk.c (raccess_guess_linux_double_from_file_name):
-       Replace `FT_Stream_Close' by `FT_Stream_Free' to fix memory leak.
-
-2006-05-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * build/unix/configure.raw: Add a fallback to disable Carbon
-       dependency, if configured with no options on Mac OS X.
-
-2006-05-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (open_face_from_buffer): Deallocate stream when
-       its content cannot be parsed as supported font.  This fixes
-       the second part of Savannah bug #16590.
-
-2006-05-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (TT_Load_Composite_Glyph)
-       [FT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Make it compilable again.
-
-2006-05-17  David Turner  <david@freetype.org>
-
-       This is a major patch used to drastically improve the performance of
-       loading glyphs.  This both speeds up loading the glyph vectors
-       themselves and the auto-fitter module.
-
-       We now use inline assembler code with GCC to implement `FT_MulFix',
-       which is probably the most important function related to the
-       engine's performance.
-
-       The resulting speed-up is about 25%.
-
-
-       * include/freetype/internal/tttypes.h (TT_LoaderRec): Add fields
-       `cursor' and `limit'.
-
-       * src/autofit/afangles.c (af_corner_is_flat, af_corner_orientation):
-       New functions.
-       (AF_ATAN_BITS, af_arctan, af_angle_atan): Comment out.
-       [TEST]: Remove.
-
-       * src/autofit/afcjk.c (AF_Script_UniRangeRec): Comment out test
-       code.
-
-       * src/autofit/afhints.c (af_axis_hints_new_segment): Don't call
-       `FT_ZERO'
-       (af_direction_compute, af_glyph_hints_compute_inflections): Rewritten.
-       (af_glyph_hints_reload: Rewrite recognition of weak points.
-
-       * src/autofit/aflatin.c (af_latin_hints_compute_segments): Move
-       constant values out of the loops.
-
-       * src/autofit/aftypes.h: Updated.
-
-       * src/base/ftcalc.c (FT_MulFix): Use inline assembler code.
-
-       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Use vector
-       product to get orientation.
-
-       * src/gzip/ftgzip.c (ft_get_uncompressed_size): New function.
-       (FT_Stream_OpenGzip): Use it to handle small files directly in
-       memory.
-
-       * src/psaux/psconv.c (PS_Conv_ASCIIHexDecode, PS_ConvEexecDecode):
-       Improve performance.
-
-       * src/truetype/ttgload.c (TT_Access_Glyph_Frame): Set `cursor' and
-       `limit'.
-
-       (TT_Load_Glyph_Header, TT_Load_Simple_Glyph,
-       TT_Load_Composite_Glyph): Updated.  Add threshold to protect against
-       exceedingly large values of number of contours.  Speed up by
-       reducing the number of loops.
-
-       * src/type1/t1gload.c (T1_Load_Glyph): Don't apply unit matrix.
-
-
-       * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Change the threshold
-       used to detect rogue clients from 4 to 16.  This is to prevent some
-       segmentation faults with fonts like `KozMinProVI-Regular.otf' which
-       comes from the Japanese Adobe Reader Asian Font pack.
-
-2007-05-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_font_done): Deallocate subfont array.  This
-       fixes the first part of Savannah bug #16590.
-
-2006-05-16  Werner Lemberg  <wl@gnu.org>
-
-       * docs/PROBLEMS: Updated icl issues.
-
-----------------------------------------------------------------------------
-
-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,
-and distributed under the terms of the FreeType project license,
-LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-indicate that you have read the license and understand and accept it
-fully.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
-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.c (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.
-       ==========================
-
-
-       Tag sources with `VER-2-3-11'.
-
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.3.11.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.10/2.3.11/, s/2310/2311/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 11.
-
-       * builds/unix/configure.raw (version_info): Set to 9:22:3.
-
-2009-10-10  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES, docs/release: Updated.
-
-2009-10-10  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/pcf/pcfread.c (pcf_get_properties): Fix a bug in the nprops
-       truncation.  Reported by Martin von Gagern and Peter Volkov.
-       https://bugs.gentoo.org/288357 and https://bugs.gentoo.org/288256
-
-2009-10-06  Werner Lemberg  <wl@gnu.org>
-
-       * Version 2.3.10 released.
-       ==========================
-
-
-       Tag sources with `VER-2-3-10'.
-
-       * builds/toplevel.mk (major, minor, patch): Fix regexp to allow more
-       than a single digit.
-       (dist): We now use git.
-
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.3.10.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.9/2.3.10/, s/239/2310/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.
-
-       * builds/unix/configure.raw (version_info): Set to 9:21:3.
-
-2009-10-06  Werner Lemberg  <wl@gnu.org>
-
-       Fix `make multi'.
-
-       * src/cache/ftccache.c, src/cache/ftcsbits.c (FT_COMPONENT): Define.
-
-       * src/sfnt/sfdriver.c: Include FT_INTERNAL_DEBUG_H.
-
-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.
-       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.
-       Now the 4th argument `node' of this function should be typed as
-       FTC_MruNode.
-
-       * src/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP): For inline
-       implementation, new temporal variable FTC_MruNode `_mrunode' to take
-       the pointer from FTC_MRULIST_LOOKUP_CMP().  For non-inline
-       implementation, tricky cast is dropped.
-
-       * src/cache/ftcmanag.c (FTC_SIZE_NODE): New macro casting
-       to FTC_SizeNode.
-       (FTC_Manager_LookupSize): Replace FTC_SizeNode `node' by FTC_MruNode
-       `mrunode', and FTC_SIZE_NODE() is inserted.
-       (FTC_FACE_NODE): New macro casting to FTC_FaceNode.
-       (FTC_Manager_LookupFace) Replace FTC_FaceNode `node' by FTC_MruNode
-       `mrunode', and FTC_FACE_NODE() is inserted.
-
-       * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Change the type of
-       `node' from FTC_INode to FTC_Node.  Extra casting macro FTC_NODE()
-       is dropped.
-       (FTC_ImageCache_LookupScaler): Ditto.
-       (FTC_SBitCache_Lookup): Change the type of `node' from FTC_SNode to
-       FTC_Node.  Extra casting macro FTC_NODE() is dropped.  FTC_SNODE()
-       is inserted.
-       (FTC_SBitCache_LookupScaler): Ditto.
-
-       * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Change the type of
-       `node' from FTC_CMapNode to FTC_Node.  Extra casting macro
-       FTC_NODE() is dropped, FTC_CMAP_NODE() is inserted.
-
-2009-09-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       [cache, psaux, type1] Fix for multi build.
-       In multi build, some cpp functions are left as unresolved symbols.
-
-       * src/cache/ftcbasic.c: Include FT_INTERNAL_DEBUG_H for FT_TRACE1().
-
-       * src/psaux/t1decode.c: Include FT_INTERNAL_CALC_H for
-       FIXED_TO_INT().
-       * src/type1/t1gload.c: Ditto.
-       * src/type1/t1objs.c: Ditto.
-
-2009-09-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       [autofit] Fix for multi build.
-
-       * src/autofit/afmodule.h: Include FT_INTERNAL_OBJECTS_H to use
-       FT_DECLARE_MODULE() macro in multi build.
-
-       * src/autofit/aflatin.c: Include <ft2build.h> to handle
-       FT_ADVANCES_H correctly in multi build.
-
-2009-09-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       [cache] Check the face filled by FTC_Manager_LookupFace().
-
-       * src/cache/ftcbasic.c (ftc_basic_family_get_count): Return
-       immediately if FTC_Manager_LookupFace() fills face by NULL.  Such
-       case can occur when the code is optimized by GCC-4.2.x.
-
-2009-09-23  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2009-09-12  Werner Lemberg  <wl@gnu.org>
-
-       [raster] Fix 5-levels grayscale output.
-       This was broken since version 2.3.0.
-
-       * src/raster/ftraster.c (count_table): Use pre-2.3.0 values (which
-       were then computed dynamically).
-       (Vertical_Gray_Sweep_Step): Updated.
-
-       (ft_black_render): Initialize `worker->gray_lines' (problem found by
-       valgrind).
-
-       (FT_RASTER_OPTION_ANTI_ALIASING, DEBUG_RASTER): Dont' #undef, just
-       comment out.
-
-2009-09-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Improve configure.raw for cross build.
-
-       * builds/unix/configure.raw: Remove temporal files created by the
-       suffix checking for CC_BUILD.  Set XX_ANSIFLAGS and XX_CFLAGS when
-       cross compiler is GCC.  AC_PROG_CC checks whether the cross compiler
-       is GCC, its result is stored in GCC.
-
-2009-09-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       [BDF] Modify hash API to take size_t value instead of void *.
-
-       The hash API in BDF driver is designed to be generic, it takes
-       void * typed data.  But BDF driver always gives an unsigned long
-       integer (the index to a property).  To reduce non-essential
-       casts from unsigned long to void* and from void* to unsigned
-       long, the hash API is changed to take size_t integer.
-       The issue of incompatible cast between unsigned long and void*
-       on LLP64 platform is reported by NightStrike from MinGW-Win64
-       project.  See
-       http://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html
-
-       * src/bdf/bdf.h: The type of hashnode->data is changed from
-       void* to size_t.
-
-       * src/bdf/bdflib.c (hash_insert): Get size_t data, instead of
-       void* data.
-       (bdf_create_property): Get the name length of new property by
-       size_t variable, with a cut-off at FT_ULONG_MAX.
-       (_bdf_set_default_spacing): Get the name length of the face by
-       size_t variable, with a cut-off at 256.
-       (bdf_get_property): Get the property id by size_t variable to
-       reduce the casts between 32-bit prop ID & hashnode->data during
-       simple copying.
-       (_bdf_add_property): Ditto.
-       (_bdf_parse_start): Calculate the index to the property array
-       by size_t variable.
-       (bdf_get_font_property): Drop a cast to unsigned long.
-
-2009-09-10  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       [Win64] Improve the computation of random seed from stack address.
-
-       On LLP64 platform, the conversion from pointer to FT_Fixed need
-       to drop higher 32-bit.  Explict casts are required. Reported by
-       NightStrike from MinGW-w64 project.  See
-       http://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html
-
-       * src/cff/cffgload.c: Convert the pointers to FT_Fixed explicitly.
-
-       * src/psaux/t1decode.c: Ditto.
-
-
-2009-09-03  Werner Lemberg  <wl@gnu.org>
-
-       [raster] Improvements for stand-alone mode.
-
-       * src/raster/rules.mk: Don't handle ftmisc.h.  It is needed for
-       stand-alone mode only.
-
-       * src/raster/ftmisc.h (FT_MemoryRec , FT_Alloc_Func, FT_Free_Func,
-       FT_Realloc_Func): Copy declarations from ftsystem.h.
-
-2009-09-02  Bram Tassyns  <bramt@enfocus.be>
-
-       Improve vertical metrics calculation (Savannah bug #27364).
-
-       The calculation of `vertBearingX' is not defined in the OTF font
-       spec so FreeType does a `best effort' attempt.  However, this value
-       is defined in the PDF and PostScript specs, and that algorithm is
-       better than the one FreeType currently uses:
-
-         FreeType: Use the middle of the bounding box as the X coordinate
-                   of the vertical origin.
-
-         Adobe PDF spec: Use the middle of the horizontal advance vector as
-                         the X coordinate of the vertical origin.
-
-       FreeType's algorithm goes wrong if you have a really small glyph
-       (like the full-width, circle-like dot at the end of the sentence, as
-       used in CJK scripts) with large bearings.  With the FreeType
-       algorithm this dot gets centered on the baseline; with the PDF
-       algorithm it gets the correct location (in the top right).  Note
-       that this is a serious issue, it's like printing the dot at the end
-       of a Roman sentence at the center of the textline instead of on the
-       baseline like it should. So i believe the PDF spec's algorithm
-       should be used in FreeType as well.
-
-       The `vertBearingY' value for such small glyphs is also very strange
-       if no `vmtx' information is present, since the height of the bbox is
-       not representable for the height of the glyph visually (the
-       whitespace up to the baseline is part of the glyph).  The fix also
-       includes some code for a better estimate of `vertBearingY'.
-
-       * src/base/ftobjs.c (ft_synthesize_vertical_metrics): `vertBearingX'
-       is now calculated as described by the Adobe PDF Spec.  Estimate for
-       `vertBearingY' now works better for small glyphs completely above or
-       below the baseline into account.
-
-       * src/cff/cffgload.c (cff_slot_load): `vertBearingX' is now
-       calculated as described by the Adobe PDF Spec.  Vertical metrics
-       information was always ignored when FT_CONFIG_OPTION_OLD_INTERNALS
-       was not defined.
-
-       * src/truetype/ttgload.c (compute_glyph_metrics): `vertBearingX' is
-       now calculated as described by the Adobe PDF Spec.
-
-2009-09-01  John Tytgat  <John.Tytgat@esko.com>
-
-       Fix custom cmap for empty Type 1 font (Savannah bug #27294).
-
-       * include/freetype/internal/t1types.h (T1_EncodingRecRec_): Update
-       comment to reflect revised code_last meaning.
-       * src/type1/t1load.c (T1_Open_Face), src/type42/t42objs.c
-       (T42_Open_Face): Assign max_char as highest character code + 1 and
-       use this for T1_EncodingRecRec_::code_last.
-       * src/psaux/t1cmap.c (t1_cmap_custom_init): Follow revised
-       T1_EncodingRecRec_::code_last meaning.
-
-2009-08-25  Werner Lemberg  <wl@gnu.org>
-
-       Fix rendering of horizontally compressed CFFs.
-       Bug reported by Ivan Nincic <inincic@pdftron.com>.
-
-       * src/cff/cffgload.c (cff_slot_load): Thinko: Check `xx' element of
-       `font_matrix' also.
-
-       * docs/CHANGES: Updated.
-
-2009-08-03  suyu0925@gmail.com
-
-       Don't call `ft_fseek' every time when executing `ft_fread'.
-
-       * src/base/ftstream.c (FT_Stream_Seek), src/base/ftsystem.c
-       (ft_ansi_stream_io): Implement it.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Cast a charcode to 32-bit in cmap format 14 parser.
-       
-       * src/sfnt/ttcmap.c (tt_cmap14_char_var_index,
-       tt_cmap14_char_var_isdefault, tt_cmap14_char_variants,
-       tt_cmap14_variant_chars): Correct mismatches from
-       FT_CMap_CharVarIndexFunc prototype, FT_ULong arguments
-       are replaced by FT_UInt32 arguments.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Cast a charcode to 32-bit in cmap format 12 parser.
-
-       * src/sfnt/ttcmap.c (tt_cmap12_char_next):
-       Insert explicit cast from FT_UFast to FT_UInt32
-       for return value.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psaux: Fix a few casts to FT_Int32 value.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings):
-       Fix a few casts setting `value' from FT_Long to FT_Int32,
-       because `value' is typed as FT_Int32 since 2009-06-22.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Fix a data type mismatching with its source.
-
-       * src/sfnt/ttcmap.c (tt_cmap13_char_next): Fix the
-       type of `gindex' from FT_ULong to FT_UInt because
-       it is set by FT_UInt tt_cmap13_char_map_binary() or
-       TT_CMap13->cur_gindex.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Extend a few local variables to load 32-bit values.
-
-       * src/sfnt/ttkern.c (tt_face_load_kern): Extend `count'
-       and `kern' to load 32-bit values.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pfr: Extend `num_aux' to take 32-bit value.
-
-       * src/pfr/pfrload.c (pfr_phy_font_load): Extend
-       `num_aux' to load 32-bit value.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Truncate FT_ULong `nprops' to fit to int PCF_Face->nprops.
-
-       * src/pcf/pcfread.c (pcf_get_properties): Load `nprops'
-       as FT_ULong value from PCF file, but truncate it as
-       int to fit PCF_Face->nprops.  The number of truncated
-       properties is shown in the trace message.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Extend a few local variables to reduce the casts.
-
-       * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
-       Extend `type' and `rest' to take FT_ULong values.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Extend `settingTable' to take 32-bit offset.
-
-       * src/gxvalid/gxvfeat.c (gxv_feat_name_validate):
-       Extend `settingTable' to take 32-bit offset.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       autofit: Cast FT_Long glyph_count to compare with FT_UInt GID.
-
-       * src/autofit/afglobal.c (af_face_globals_is_digit,
-       af_face_globals_compute_script_coverage): Cast FT_Long
-       globals->glyph_count to FT_ULong, to compare with FT_UInt
-       gindex.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Exclude 16-bit system in invalid pitch/height check.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic):
-       pitch and height are typed as FT_UInt but checked to fit
-       16-bit range, to avoid the overflows.  On 16-bit system,
-       this checking inserts a conditional that never occurs.
-
-2009-07-03  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cff: Type large constants > 0x7FFF as long for 16-bit systems.
-
-       * src/cff/cffload.c (cff_charset_load): Type large
-       constants > 0x7FFF as long, because normal constants
-       are typed signed integer that is less than 0x8000 on
-       16-bit systems.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       base: Remove an unused variable.
-
-       * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Remove an
-       unused variable `library'.  glyph->library is used.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Check higher bits in flags for non ILP32 systems.
-
-       4 public functions ought to take FT_ULong flags, but take
-       FT_UInt flags. To keep binary compatibility, we drop higher
-       bits on non ILP32 platforms,
-               ILP64 systems: No drop occurs.
-               LP64 systems: Higher bits are not used.
-               16-bit systems: Drop can occur.
-       See
-       http://lists.gnu.org/archive/html/freetype-devel/2008-12/msg00065.html
-       These functions will be refined to take FT_ULong flags in
-       next bump with incompatible API change.
-
-       * src/cache/ftcbasic.c (FTC_ImageCache_Lookup):
-       Check `flags' in `type', the 2nd argument.
-       (FTC_SBitCache_Lookup): Ditto.
-       (FTC_ImageCache_LookupScaler): Check `load_flags',
-       the 3rd argument.
-       (FTC_SBitCache_LookupScaler): Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Ignore invalid GIDs in glyph name lookup.
-
-       * include/freetype/internal/fttrace.h:
-       New trace module for sfdriver.c is added.
-
-       * src/sfnt/sfdriver.c (sfnt_get_name_index):
-       Restrict glyph name lookup to FT_UInt GID.
-       Genuine TrueType can hold 16-bit glyphs.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Fix a comparison between FT_Long and FT_ULong.
-
-       * src/pcf/pcfread.c (pcf_get_bitmaps): Return an error
-       if PCF_Face->nemetrics is negative.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Guarantee `nFeatureFlags' size up to 32-bit.
-
-       * src/gxvalid/gxvmort.c (gxv_mort_featurearray_validate):
-       Extend the 3rd argument `nFeatureFlags' to FT_ULong.
-       * src/gxvalid/gxvmort.h: Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Insert explicit cast for LP64 system.
-
-       * src/sfnt/ttkern.c (tt_face_load_kern): Insert
-       cast from unsigned long to FT_UInt32.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Guarantee `just' table size upto 32-bit.
-
-       * src/gxvalid/gxvjust.c (gxv_just_validate):
-       The type of `offset' is changed from FT_UInt to
-       FT_Offset, for 16-bit platforms.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Guarantee `trak' table size upto 32-bit.
-
-       * src/gxvalid/gxvtrak.c (gxv_trak_validate):
-       The type of `offset' is changed from FT_UInt to
-       FT_Offset, for 16-bit platforms.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       type1: Fix a data type mismatching with its source.
-
-       * include/freetype/internal/t1types.h: The type of
-       T1_Face->buildchar is matched with T1_Decorder->top.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pfr: Fix a data type mismatching with its source.
-
-       * src/pfr/pfrtypes.h: The type of PFR_KernItem->offset
-       is extended from FT_UInt32 to FT_Offset, because it is
-       calculated with the pointer difference, in
-       pfr_extra_item_load_kerning_pairs().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pfr: Fix a data type mismatching with its source.
-
-       * src/pfr/pfrtypes.h: The type of PFR_PhysFont->chars_offset
-       is extended from FT_UInt32 to FT_Offset, because it is
-       calculated with the pointer difference in pfr_phy_font_load().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pfr: Fix a data type mismatching with its source.
-
-       * src/pfr/pfrtypes.h: The type of PFR_PhyFont->bct_offset
-       is extended from FT_UInt32 to FT_Long, because it is
-       loaded by FT_STREAM_POS() in pfr_phy_font_load().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Improve the format in debug message.
-
-       * src/smooth/ftgrays.c (gray_dump_cells): Improve the
-       format specifications to dump variables.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Fix a data type mismatching with its source.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): The type of
-       local `flags' is matched with FT_Face->face_flags.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psaux: Fix a data type mismatching with its source.
-
-       * include/freetype/internal/psaux.h: The type of
-       T1_DecorderRec.buildchar is matched with
-       T1_DecorderRec.top.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Extend TrueType GX packed deltas to FT_Offset.
-
-       * src/truetype/ttgxvar.c (ft_var_readpackeddeltas):
-       The type of 2nd argument `delta_cnt' is changed from
-       FT_Int to FT_Offset, because its source can be cvt
-       table size calculated from stream position.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Extend mmvar_len to hold size_t values.
-
-       * src/truetype/ttgxvar.h: The type of
-       GX_BlendRec.mmvar_len is changed from FT_Int to
-       FT_Offset, because TT_Get_MM_Var() calculates it
-       by sizeof() results.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Check invalid function number in IDEF instruction.
-
-       * src/truetype/ttinterp.c (Ins_IDEF): Check
-       if the operand fits to 8-bit opcode limitation.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Check invalid function number in FDEF instruction.
-
-       * src/truetype/ttinterp.c (Ins_FDEF): Check
-       if the operand fits 16-bit function number.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Truncate the deltas of composite glyph at 16-bit values.
-
-       * src/truetype/ttgload.c (load_truetype_glyph):
-       Insert cast from FT_Long (deltas[i].{x,y}) to
-       FT_Int16 in the summation of deltas[] for composite
-       glyphs.  Because deltas[i] is typed as FT_Pos,
-       its component x, y are typed as FT_Long, but
-       their sources are always FT_Int16 when they are
-       loaded by ft_var_readpackeddeltas().  However,
-       the limitation about the summed deltas is unclear.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Truncate the instructions upto 16-bit per a glyph.
-
-       * src/truetype/ttgload.c (TT_Hint_Glyph): Truncate
-       the instructions upto 16-bit length per a glyph.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Cast the numerical operands to 32-bit for LP64 systems.
-
-       * src/truetype/ttinterp.c (Ins_SPHIX, INS_MIAP,
-       Ins_MIRP): Insert cast from long (args[], the
-       operands passed to TrueType operator) to FT_Int32
-       (the argument of TT_MulFix14()).
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Cast the project vector to 32-bit for LP64 system.
-
-       * src/truetype/ttinterp.c (Project, DualProject):
-       Insert casts from FT_Pos (the arguments `dx', `dy')
-       to FT_UInt32 (the argument to TT_DotFix14()).
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Cast the scaling params to 32-bit for LP64 system.
-
-       * src/truetype/ttgload.c (TT_Process_Composite_Component):
-       Insert casts from long (return value of FT_MulFix()) to
-       FT_Int32 (the argument to FT_SqrtFixed()).
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Cast a character code to FT_UInt32 for LP64 system.
-
-       * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary,
-       tt_cmap14_variants, tt_cmap14_char_variants,
-       tt_cmap14_def_char_count, tt_cmap14_get_def_chars,
-       tt_cmap14_get_nondef_chars, tt_cmap14_variant_chars)
-       Insert casts when FT_UInt32 variable is loaded by
-       TT_NEXT_{UINT24|ULONG}.  Because most of them are
-       compared with FT_UInt32 values in public API, replacing
-       FT_UFast is not recommended.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Cast a character code to FT_UInt32 for LP64 system.
-
-       * src/sfnt/ttcmap.c (tt_cmap4_init, tt_cmap4_next):
-       Insert the casts from unsigned long constant to
-       FT_UInt32.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Extend TT_BDF->strings_size to FT_ULong for huge BDF.
-
-       * 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
-       restrict the length of string.
-       * src/sfnt/ttbdf.c: The scratch variable `strings'
-       to load TT_BDF->string_size is matched with
-       TT_BDF->string_size.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psaux: Handle the string length by FT_Offset variables.
-
-       * src/psaux/afmparse.c (afm_parser_next_key,
-       afm_tokenize, afm_parse_track_kern,
-       afm_parse_kern_pairs, afm_parse_kern_data,
-       afm_parser_skip_section, afm_parser_parse):
-       The length of key is handled by FT_Offset,
-       instead of FT_UInt.  Although the length of
-       PostScript strings or name object is 16-bit,
-       AFM_STREAM_KEY_LEN() calculates the length
-       from the pointer difference.
-
-       * src/psaux/afmparse.h (afm_parser_next_key):
-       Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Fix some data types mismatching with their sources.
-
-       * src/pcf/pcfread.c (pcf_get_bitmaps): The types
-       of `nbitmaps', `i', `sizebitmaps' are matched with
-       the type of area FT_Bitmap.pitch * FT_Bitmap.rows.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Handle the string length by size_t variables.
-
-       * src/pcf/pcfread.c (pcf_interpret_style): The types
-       of nn, len, lengths[4] are changed to size_t, because
-       they are loaded by (or compared with) ft_strlen().
-
-       * src/pcf/pcfutil.c (BitOrderInvert, TwoByteSwap,
-       FourByteSwap): The type of the 2nd argument `nbytes'
-       is changed to size_t, for similarity with ANSI C
-       string functions.
-
-       * src/pcf/pcfdrivr.c (PCF_Glyph_Load): The type of
-       `bytes' is changed to FT_Offset, because it is passed
-       to FT_ALLOC(), via ft_glyphslot_alloc_bitmap().  At
-       least, using unsigned type is better.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Fix some data types mismatching with their sources.
-
-       * src/pcf/pcfread.c (pcf_seek_to_table_type,
-       pcf_has_table_type): The type of 3rd argument
-       `ntables' is matched with PCF_Toc->count.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       otvalid: Truncate the glyph index to 16-bit.
-
-       * src/otvalid/otvalid.c (otv_validate): Checks
-       face->num_glyphs does not exceed 16-bit limit,
-       pass FT_UInt num_glyphs to backend functions
-       otv_{GPOS|GSUB|GDEF|JSTF|MATH}_validate().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Insert explict casts for LP64 systems.
-
-       * src/cache/ftcbasic.c (FTC_ImageCache_Lookup,
-       FTC_SBitCache_Lookup): The type of FTC_ImageType->width
-       is FT_Int, so the cast to unsigned larger type FT_ULong
-       is introduced for the comparisons with 0x10000L for
-       LP64 platform.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Fix some data types mismatching with their sources.
-
-       * src/cache/ftccache.h: The type of return value
-       by FTC_Node_WeightFunc function is changed to
-       FT_Offset.  The type of FTC_CacheClass->cache_size
-       is changed to FT_Offset, too.
-
-       * src/cache/ftccback.h (ft_inode_weight,
-       ftc_snode_weight): Ditto.
-
-       * src/cache/ftccmap.c (ftc_cmap_node_weight): Ditto.
-
-       * src/cache/ftcimage.c (ftc_inode_weight,
-       FTC_INode_Weight): Ditto.
-
-       * src/cache/ftcsbits.c (ftc_snode_weight,
-       FTC_SNode_Weight): Ditto.
-
-       * src/cache/ftcmru.h: The type of
-       FTC_MruListClass->node_size is changed to FT_Offset,
-       because it is passed to FT_ALLOC() to specify the
-       size of buffer.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       XXX_cmap_encoding_char_next() return FT_UInt32 values.
-
-       * include/freetype/internal/services/svpscmap.h:
-       The size of the charcode value returned by
-       the function typed PS_Unicodes_CharNextFunc is
-       matched with its input charcode value.
-
-       * src/cff/cffmap.c (cff_cmap_encoding_char_next,
-       cff_cmap_unicode_char_next): Ditto.
-
-       * src/pfr/pfrmap.c (pfr_cmap_encoding_char_next):
-       Ditto.
-
-       * src/psaux/t1cmap.c (t1_cmap_std_char_next,
-       t1_cmap_custom_char_next, t1_cmap_unicode_char_next):
-       Ditto.
-
-       * src/psnames/psmodule.c (ps_unicodes_char_next):
-       Ditto.
-
-       * src/winfonts/winfnt.c (fnt_cmap_char_next):
-       Ditto.
-
-       * src/sfnt/ttcmap.c (tt_cmap0_char_next,
-       tt_cmap2_char_next, tt_cmap4_char_next,
-       tt_cmap6_char_next, tt_cmap10_char_next,
-       tt_cmap12_char_next, tt_cmap13_char_next): Ditto.
-       (tt_cmap14_char_variants): Handle base unicode
-       codepoint by FT_UInt32 variable to avoid overflow
-       on 16-bit platforms.
-       (tt_cmap14_ensure): The type of `num_results' is
-       extend to FT_UInt32, to cover unsigned 32-bit
-       `numVarSelectorRecords' in cmap14 table header.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       truetype: Extend TT_Face->num_locations for broken TTFs.
-
-       * include/freetype/internal/tttypes.h:
-       TT_Face->num_locations are extended from FT_UInt
-       to FT_ULong, to stand with broken huge loca table.
-       Some people insists there are broken TTF including
-       the glyphs over 16-bit limitation, in PRC market.
-       * src/truetype/ttpload.c (tt_face_load_loca):
-       Remove unrequired 16-bit truncation for FT_UInt
-       TT_Face->num_locations.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Fix some data types mismatching with their sources.
-
-       * src/smooth/ftgrays.c: The type of `TCoord' is
-       matched to `TPos', because they are mixed in
-       gray_set_cell().  The type of TCell->x is extended
-       to `TPos', because gray_find_cell() sets it by
-       TWorker.ex.  The type of TCell->cover is extended
-       to `TCoord', because gray_render_scanline() adds
-       TCoord value to it.  The type of TWork.cover is matched
-       with TCell->cover.  The types of
-       TWork.{max_cells,num_cells} are changed to FT_PtrDist,
-       because they are calculated from the memory addresses.
-       The type of TWork.ycount is changed to TPos, because
-       it is calculated from TPos variables.
-       (gray_find_cell): The type of `x' is matched with
-       its initial value ras.ex.
-       (gray_render_scanline): The types of `mod', `lift'
-       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 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.
-       (gray_hline): The argument `acount' is extended to
-       TCoord, to match with the parameters in the callers.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cff: Fix some data types mismatching with their sources.
-
-       * src/cff/cffobjs.c (cff_face_init): The type of
-       `scaling' is matched with the scaling parameter
-       in FT_Matrix_Multiply_Scaled() and
-       FT_Vector_Transform_Scaled().
-
-       * src/cff/cffparse.c (cff_parse_real): The type of
-       `power_ten', `scaling', `exponent_add',
-       `integer_length', `fraction_length',
-       `new_fraction_length' and `shift' are matched with
-       the type of `exponent' to avoid unexpected truncation.
-       (cff_parse_fixed_scaled): The type of `scaling' is
-       matched with the `scaling' argument to
-       cff_parse_real().
-       (cff_parse_fixed_dynamic): Ditto.
-       (cff_parse_font_matrix): The type of `scaling' is
-       matched with the `scaling' argument to
-       cff_parse_dynamic().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       autofit: Fix some data types mismatching with their sources.
-
-       * src/autofit/afglobal.c: Correct the type of
-       AF_FaceGlobalsRec.glyph_count to match with
-       FT_Face->num_glyphs.
-       (af_face_globals_compute_script_coverage):
-       Insert explicit cast to compare
-       FT_Long AF_FaceGlobalsRec.glyph_count versus
-       FT_UInt gindex.  The type of `nn' is changed
-       to scan glyph index upto AF_FaceGlobalsRec.glyph_count.
-       (af_face_globals_get_metrics): The type of `script_max'
-       is changed to cover size_t value.  Insert explicit cast
-       to compare FT_Long AF_FaceGlobalsRec.glyph_count versus
-       FT_UInt gindex.
-
-       * src/autofit/afhints.c (af_axis_hints_new_segment):
-       Insert explicit cast to calculate `big_max' from
-       integer and size_t values.
-       (af_axis_hints_new_edge): Ditto.
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_blues):
-       The type of `best_y' is matched to FT_Vector.y.
-       (af_latin_compute_stem_width): The type of `delta' is
-       matched to `dist' and `org_dist'.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       autofit: Count the size of the memory object by ptrdiff_t.
-
-       * src/autofit/afcjk.c (af_cjk_hint_edges): The
-       number of edges `n_edges' should be counted by
-       FT_PtrDist variable instead of FT_Int.
-
-       * src/autofit/aflatin.c (af_latin_hint_edges):
-       Ditto.
-
-       * src/autofit/aftypes.h: In AF_ScriptClassRec,
-       the size of metric `script_metrics_size' should
-       be counted by FT_Offset variable instead of FT_UInt.
-
-       * src/autofit/afhints.c
-       (af_glyph_hints_align_strong_points): The cursors
-       for the edges `min', `max', `mid' in the memory
-       buffer should be typed FT_PtrDist.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       autofit: Fix for unused variable `first'.
-
-       * src/autofit/afhints.c (af_glyph_hints_reload): Insert
-       FT_UNUSED() to hide the unused variable warning.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Improve bitmap size or pixel variables for 16-bit systems.
-
-       * include/freetype/config/ftstdlib.h: Introduce
-       FT_INT_MIN, to use in signed integer overflow in
-       16-bit and 64-bit platforms.
-       
-       * include/freetype/internal/fttrace.h: Add a tracer
-       to ftsynth.c.
-       
-       * src/base/ftbitmap.c (FT_Bitmap_Embolden): Check
-       invalid strength causing integer overflow on 16-bit
-       platform.
-       
-       * src/base/ftcalc.c (ft_corner_orientation): Change
-       the internal calculation from FT_Int to FT_Long, to
-       avoid an overflow on 16-bit platforms.  The caller of
-       this function should use only the sign of result,
-       so the cast to FT_Int is acceptable.
-       
-       * src/base/ftsynth.c: Introduce a tracer for synth module.
-       (FT_GlyphSlot_Embolden): Check invalid strength causing
-       integer overflow on 16-bit platform.
-       
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): The glyph index
-       in FT2 API is typed as FT_UInt, although BDF driver
-       can handle unsigned long glyph index internally.  To
-       avoid integer overflow on 16-bit platform, too large
-       glyph index should be excluded.
-       (BDF_Glyph_Load): The glyph pitch in FT2 is typed as
-       FT_UInt, although BDF driver can handle unsigned long
-       glyph pitch internally.  To avoid integer overflow on
-       16-bit platform, too large glyph pitch should not be
-       returned.
-       
-       * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): The glyph
-       pitch in FT2 is typed as FT_UInt, although PFR font
-       format can include huge bitmap glyph with 24-bit pitch
-       (however, a glyph spends 16.7 pixel, it's not realistic).
-       To avoid integer overflow on 16-bit platform, huge
-       bitmap glyph should be excluded.
-       
-       * src/smooth/ftgrays.c (gray_hline): As FT_Span.x is
-       truncated to fit its type (16-bit short), FT_Span.y
-       should be truncated to fit its type (FT_Int).
-       
-       * src/cff/cffdrivr.c (cff_get_ros): CFF specification
-       defines the supplement in ROS as a real number.
-       Truncate it to fit public FT2 API.
-       
-       * src/cff/cffparse.c (cff_parse_cid_ros): Warn the
-       supplement if it is truncated or rounded in cff_get_ros().
-       
-       * src/cff/cfftypes.h: Change the type of internal variable
-       `supplement' from FT_Long to FT_ULong to fit the signedness
-       to the type in public API.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psaux: Prevent invalid arguments to afm_parser_read_vals().
-
-       * src/psaux/afmparse.c (afm_parser_read_vals): Change
-       the type of `n' to prevent negative number how many
-       arguments should be parsed.
-
-       * src/psaux/afmparse.h (afm_parser_read_vals): Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       base: Prevent some overflows on LP64 systems.
-
-       * src/base/ftadvance.c (FT_Get_Advances): Cast the
-       unsigned long constant FT_LOAD_ADVANCE_ONLY to FT_UInt32
-       for LP64 platforms.
-
-       * src/base/ftcalc.c (FT_Sqrt32): All internal variables
-       are changed to FT_UInt32 from FT_ULong.
-       (FT_MulDiv): Insert casts to FT_Int32 for LP64 platforms.
-       This function is designed for 32-bit integer, although
-       their arguments and return value are FT_Long.
-
-       * src/base/ftobjs.c (FT_Get_Char_Index): Check `charcode'
-       is within unsigned 32-bit integer for LP64 platforms.
-       (FT_Face_GetCharVariantIndex): Check `charcode' and
-       `variantSelector' are within 32-bit integer for LP64
-       platforms.
-       (FT_Face_GetCharsOfVariant): Check `variantSelector' is
-       within unsigned 32-bit integer for LP64 platforms.
-
-       * src/base/fttrigon.c (ft_trig_downscale): The FT_Fixed
-       variable `val' and unsigned long constant FT_TRIG_SCALE
-       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>
-
-       cff: Cast the long variables to 32-bit for LP64 systems.
-
-       * src/cff/cffdrivr.c (cff_get_advances): Insert
-       explicit cast to modify a 32-bit flag by unsigned
-       long constant.
-
-       * src/cff/cffobjs.c (cff_face_init): Ditto.
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings):
-       Replace the casts to FT_Long by the casts to FT_Int32
-       for LP64 platforms.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Improve PCF_PropertyRec.value names on LP64 platforms.
-
-       * src/pcf/pcf.h: In PCF_PropertyRec.value, the member
-       `integer' is replaced by `l', `cardinal' is replaced
-       by `ul', to fix the difference between the name and
-       the types on LP64 platforms.
-
-       * src/pcf/pcfdrivr.c (pcf_get_bdf_property): Reflect
-       PCF_PropertyRec.value change, with appropriate casts
-       to FT_Int32/FT_UInt32.  Their destinations
-       BDF_PropertyRec.{integer|cardinal} are public and
-       explicitly defined as FT_Int32/FT_UInt32.
-
-       * src/pcf/pcfread.c (pcf_get_properties, pcf_load_font):
-       Reflect PCF_PropertyRec.value change.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       pcf: Fix some data types mismatching with their sources.
-
-       * src/pcf/pcfdrivr.c (pcf_cmap_char_index): The type of
-       `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 cast to unsigned 32-bit
-       integer.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       bdf: Improve bdf_property_t.value names for LP64 platforms.
-
-       * src/bdf/bdf.h: In bdf_property_t.value, the member
-       `int32' is replaced by `l', `card32' is replaced by
-       `ul', to fix the difference between the name and the
-       types on LP64 platforms.
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Reflect
-       bdf_property_t.value change.
-       (bdf_get_bdf_property): Reflect bdf_property_t.value
-       change, with appropriate casts to FT_Int32/FT_UInt32.
-       Their destinations BDF_PropertyRec.{integer|cardinal}
-       are public and explicitly defined as FT_Int32/FT_UInt32.
-
-       * src/bdf/bdflib.c (_bdf_add_property): Reflect
-       bdf_property_t.value change.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       bdf: Fix some data types mismatching with their sources.
-
-       * src/bdf/bdrdrivr.c (bdf_cmap_char_index): The type
-       of `code' is matched with BDF_encoding_el->enc.
-       (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
-       cast to unsigned 32-bit integer.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       autofit: Improve Unicode range definitions.
-
-       * src/autofit/aftypes.h (AF_UNIRANGE_REC): New macro
-       to declare a range by two unsigned 32-bit integer,
-       to avoid 64-bit range definition on LP64 platforms.
-
-       * src/autofit/aflatin.c (af_latin_uniranges): Ditto.
-
-       * src/autofit/aflatin2.c (af_latin2_uniranges): Ditto.
-
-       * src/autofit/afindic.c (af_indic_uniranges): Ditto.
-
-       * src/autofit/afcjk.c (af_cjk_uniranges): Declare
-       the ranges by AF_UNIRANGE_REC.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Fix a data type mismatching with its source.
-
-       * src/smooth/ftgrays.c (gray_sweep): The type of
-       `area' is matched with the 3rd argument `area'
-       of gray_hline().
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Fix a data type mismatching with its source.
-
-       * src/smooth/ftgrays.c (gray_render_line): The type
-       of `area' is matched with TWorker.area.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Disable the legacy compatibility if 16-bit system.
-
-       * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Exclude
-       the legacy behaviour from 16-bit platform, because the
-       current hack cannot detect the caller uses this function
-       via legacy convension.
-       (FTC_SBitCache_Lookup): Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Check 32-bit glyph index on 16-bit systems.
-
-       * src/cache/ftcbasic.c (ftc_basic_family_get_count):
-       Check overflow caused by the face including large
-       number of glyphs > 64k.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Fix some data types mismatching with their sources.
-
-       * src/cache/ftccache.c (ftc_cache_resize): The types of
-       `p', `mask', `count' are matched with FTC_Cache->{p,mask}.
-       (FTC_Cache_Clear): The type of `old_index' is matched to
-       FTC_Cache->{p,mask}.
-
-       * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): The type
-       of `_idx' is matched with FTC_Cache->{p,mask}.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Fix some data types mismatching with their sources.
-
-       * src/cache/ftcsbits.c (ftc_snode_load): The types
-       of `xadvance' and `yadvance' are matched with
-       FT_GlyphSlot->advance.{x|y}.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cache: Cast NULL to a required function type explicitly.
-
-       * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID):
-       Insert explicit cast from NULL to function type.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       fttypes.h: Cast FT_MAKE_TAG output to FT_Tag exlicitly.
-
-       * include/freetype/fttypes.h (FT_MAKE_TAG):
-       Cast the result to FT_Tag.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psnames: Handle Unicode codepoints by FT_UInt32 variables.
-
-       * src/psnames/psmodule.c (BASE_GLYPH): Cast the result
-       to unsigned 32-bit integer for LP64 platform.
-       (ps_unicode_value): Return the value by unsigned 32-bit
-       integer instead of unsigned long.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       psaux: Use size_t variable to pass the buffer size.
-
-       * src/psaux/psaux.h (to_bytes): The type of `max_bytes'
-       (the argument to pass the buffer size) is changed to
-       size_t, to match with ANSI C string functions.
-
-       * src/psaux/psconv.h (PS_Conv_StringDecode,
-       PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Ditto.
-
-       * src/psaux/psconv.c (PS_Conv_StringDecode,
-       PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Ditto.
-
-       * src/psaux/psobjs.h (ps_parser_to_bytes): Ditto.
-
-       * src/psaux/psobjs.c (ps_parser_to_bytes): Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       type1: Use size_t variable to pass the string length.
-
-       * psaux.h: The type of `len' (the argument to pass
-       the buffer size to the function in AFM_ParserRec)
-       is changed to size_t, to match with ANSI C string
-       functions.
-
-       * t1afm.c (t1_get_index): Ditto.
-
-       * test_afm.c (dummy_get_index): Ditto.
-
-       * afmparse.c (afm_parser_read_vals): To call
-       AFM_ParserRec.get_index, the length of token
-       `len' is cast to size_t.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cid: Fix some data types mismatching with their sources.
-
-       * src/cid/cidparse.c (cid_parser_new): The types of
-       `read_len' and `stream_len' are matched to
-       FT_Stream->size.  Unrequired cast is removed.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cff: Fix for unused variable `rest'.
-
-       * src/cff/cffparse.c (cff_parse_real): Insert
-       FT_UNUSED() to hide the unused variable warning.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       cff: Fix some data types mismatching with their sources.
-
-       * src/cff/cffgload.c (cff_slot_load): The types of      
-       `top_upm' and `sub_upm' are matched with
-       CFF_FontRecDict->units_per_em.
-
-       * src/cff/cffobjs.c (cff_size_select): Ditto.
-       (cff_size_request): Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       bdf: Fix some data types mismatching with their sources.
-
-       * bdflib.c (_bdf_list_ensure): The type of `num_items'
-       is matched with _bdf_list_t.used.  Also the types of
-       `oldsize', `newsize', `bigsize' are matched too.
-       (_bdf_readstream): `cursor' is used as an offset to
-       the pointer, it should be typed as FT_Offset.  Also
-       the types of `bytes', `start', `end', `avail' are matched.
-
-       * bdfdrivr.c: The type of BDF_CMap->num_encodings is
-       matched with FT_CMap->clazz->size.
-       (bdf_cmap_char_index): The types of `min', `max', `mid'
-       are matched with BDF_CMap->num_encodings.  The type of
-       `result' is matched with encoding->glyph.
-       (bdf_cmap_char_next): Ditto, the type of `code' is
-       matched with BDF_encoding_el.enc.
-       (bdf_interpret_style): The type of `lengths' is changed
-       to size_t, to take the value by ft_strlen().  Also the
-       types of `len', `nn', `mm' are matched.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       sfnt: Count the size of the memory object by ptrdiff_t.
-
-       * src/sfnt/ttbdf.c (tt_face_find_bdf_prop): The type of
-       `peroperty_len' is changed from FT_UInt to FT_Offset,
-       to match with size_t, which is appropriate type for the
-       object in the memory buffer.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       lzw: Count the size of the memory object by ptrdiff_t.
-
-       * src/lzw/ftzopen.h: The types of FT_LzwState->{buf_total,
-       stack_size} are changed from FT_UInt to FT_Offset, to match
-       with size_t, which is appropriate type for the object in
-       the memory buffer.
-
-       * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): The types of
-       `old_size' and `new_size' are changed from FT_UInt to
-       FT_Offset, to match with size_t, which is appropriate type
-       for the object in the memory buffer.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       otvalid: Count the table size on memory by ptrdiff_t.
-
-       * src/otvalid/otvgpos.c (otv_ValueRecord_validate):
-       Change the type of table size from FT_UInt to
-       FT_PtrDist because it is calculated by the memory
-       addresses.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       otvalid: Prevent an overflow by GPOS/GSUB 32b-bit offset.
-
-       * src/otvalid/otvgpos.c (otv_ExtensionPos_validate):
-       Extend ExtensionOffset from FT_UInt to FT_ULong, to
-       cover 32-bit offset on 16-bit platform.
-
-       * src/otvalid/otvgsub.c (otv_ExtensionSubst_validate):
-       Ditto.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       ftobjs.c: Prevent an overflow in glyph index handling.
-
-       * src/base/ftobjs.c (FT_Face_GetCharsOfVariant):
-       Improve the cast in comparison to avoid the truncation.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Improve the variable types in raccess_make_file_name().
-
-       * src/base/ftrfork.c (raccess_make_file_name):
-       Change the type of cursor variable `tmp' to const char*,
-       to prevent the unexpected modification of original pathname.
-       (raccess_make_file_name): Change the type of new_length
-       to size_t.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       ftpatent.c: Fix for unused variable `error'.
-
-       * src/base/ftpatent.c (_tt_check_patents_in_range):
-       Fix warning for unused variable `error'.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       type1: Check invalid string longer than PostScript limit.
-
-       * src/type1/t1afm.c (t1_get_index): Check invalid string
-       which exceeds the limit of PostScript string/name objects.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gzip: Use FT2 zcalloc() & zfree() in ftgzip.c by default.
-
-       * 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
-       zlib zcalloc() & zfree(), define USE_ZLIB_ZCALLOC.
-       See discussion:
-       http://lists.gnu.org/archive/html/freetype-devel/2009-02/msg00000.html
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gzip: Distinguish PureC from TurboC on MSDOS.
-
-       * src/gzip/zutil.c (zcalloc, zcfree): Enable only for
-       MSDOS platform.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Insert PureC pragma to allow unevaluated variables.
-
-       * builds/atari/ATARI.H: Insert PureC pragma not to
-       warn against set-but-unevaluated variable in gxvalid
-       module.
-
-2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       gxvalid: Pass the union by the pointer instead of the value.
-
-       * src/gxvalid/gxvcommn.h:
-         - Declare new type `GXV_LookupValueCPtr'.
-         - Update the type of the 2nd argument to pass GXV_LookupValueDesc
-           data to the function prototyped as GXV_Lookup_Value_Validate_Func,
-           from GXV_LookupValueDesc to GXV_LookupValueCPtr.
-         - Likewise for the function prototyped as
-           GXV_Lookup_Fmt4_Transit_Func.
-
-         - Declare new type `GXV_StateTable_GlyphOffsetCPtr'.
-         - Update the type of the 3rd argument to pass
-           GXV_StateTable_GlyphOffsetDesc data to the function prototyped
-           as GXV_StateTable_Entry_Validate_Func, from
-           GXV_StateTable_GlyphOffsetDesc to GXV_StateTable_GlyphOffsetCPtr.
-
-         - Declare new type `GXV_XStateTable_GlyphOffsetCPtr'.
-         - Update the type of the 3rd argument to pass
-           GXV_XStateTable_GlyphOffsetDesc data to the function prototyped
-           as GXV_XStateTable_Entry_Validate_Func,
-           from GXV_XStateTable_GlyphOffsetDesc
-           to GXV_XStateTable_GlyphOffsetCPtr.
-
-       * src/gxvalid/gxvcommn.c (gxv_LookupTable_fmt0_validate,
-       gxv_XClassTable_lookupval_validate,
-       gxv_XClassTable_lookupfmt4_transit):
-       Update from GXV_LookupValueDesc to GXV_LookupValueCPtr.
-       
-       * src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
-       gxv_bsln_LookupFmt4_transit): Ditto.
-       
-       * src/gxvalid/gxvjust.c
-       (gxv_just_pcTable_LookupValue_entry_validate,
-       gxv_just_classTable_entry_validate,
-       gxv_just_wdcTable_LookupValue_validate): Ditto.
-       
-       * src/gxvalid/gxvkern.c
-       (gxv_kern_subtable_fmt1_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvlcar.c (gxv_lcar_LookupValue_validate,
-       gxv_lcar_LookupFmt4_transit): Ditto.
-       
-       * src/gxvalid/gxvopbd.c (gxv_opbd_LookupValue_validate,
-       gxv_opbd_LookupFmt4_transit): Ditto.
-       
-       * src/gxvalid/gxvprop.c (gxv_prop_LookupValue_validate,
-       gxv_prop_LookupFmt4_transit): Ditto.
-       
-       * src/gxvalid/gxvmort4.c
-       (gxv_mort_subtable_type4_lookupval_validate): Ditto.
-       
-       * src/gxvalid/gxvmort0.c
-       (gxv_mort_subtable_type0_entry_validate): Update
-       from GXV_StateTable_GlyphOffsetDesc
-       to GXV_StateTable_GlyphOffsetCPtr.
-       
-       * src/gxvalid/gxvmort1.c
-       (gxv_mort_subtable_type1_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvmort2.c
-       (gxv_mort_subtable_type2_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvmort5.c
-       (gxv_mort_subtable_type5_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvmorx2.c
-       (gxv_morx_subtable_type2_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvmorx5.c
-       (gxv_morx_subtable_type5_entry_validate): Ditto.
-       
-       * src/gxvalid/gxvmorx1.c
-       (gxv_morx_subtable_type1_entry_validate): Ditto.
-       (gxv_morx_subtable_type1_LookupValue_validate,
-       gxv_morx_subtable_type1_LookupFmt4_transit):
-       Update from GXV_LookupValueDesc to GXV_LookupValueCPtr.
-       
-       * src/gxvalid/gxvmorx0.c
-       (gxv_morx_subtable_type0_entry_validate): Update
-       from GXV_XStateTable_GlyphOffsetDesc
-       to GXV_XStateTable_GlyphOffsetCPtr.
-
-2009-07-29  Fabrice Bellet  <fabrice@bellet.info>
-
-       Fix Redhat bugzilla #513582 and Savannah bug #26849.
-
-       * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP) <FTC_INLINE>: Fix
-       aliasing bug.
-
-2009-07-19  Werner Lemberg  <wl@gnu.org>
-
-       Document recent library changes.
-
-       * docs/CHANGES: Do it.
-
-2009-07-17  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #23786.
-
-       * src/truetype/ttobjs.c (tt_size_init_bytecode): Don't reset x_ppem
-       and y_ppem.  Otherwise the `*_CVT_Stretched' functions in ttinterp.c
-       get never called.
-       An anonymous guy suggested this change on Savannah, and it seems to
-       be the right solution.
-
-2009-07-15  Werner Lemberg  <wl@gnu.org>
-
-       * docs/release: Updated.
-
-2009-07-15  Werner Lemberg  <wl@gnu.org>
-
-       README.CVS -> README.git
-
-       * README.CVS: Renamed to...
-       * README.git: This.
-       Updated.
-
-2009-07-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Borland C++ compiler patch proposed by Mirco Babin.
-       http://lists.gnu.org/archive/html/freetype/2009-07/msg00016.html.
-
-       * builds/exports.mk: Delete unused flags, CCexe_{CFLAGS,LDFLAGS}.
-       Fix APINAMES_C and APINAMES_EXE pathnames to reflect the platform
-       specific pathname syntax.
-       * builds/compiler/bcc.mk: Remove unused flag, CCexe_LDFLAGS.
-       Define TE = `-e' separately (bcc32 cannot specify the pathname of
-       binary executable by T = `-o').
-       Extend the large page size in linking freetype.lib.
-       Add extra CLEAN target to delete bcc specific temporary files.
-       * builds/compiler/bcc-dev.mk: Ditto.
-
-2009-07-14  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #27026.
-
-       * builds/win32/vc2005/freetype.sln: Use correct version number.
-
-2009-07-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Add a script to check the undefined and unused trace macros.
-
-       * src/tools/chktrcmp.py: A script to check trace_XXXX macros
-       that are used in C source but undefined in fttrace.h, or
-       defined in fttrace.h but unused in C sources.  See
-       http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html.
-       * docs/DEBUG: Mention on chktrcmp.py.
-       * docs/release: Ditto.
-
-2009-07-09  Werner Lemberg  <wl@gnu.org>
-
-       [ftraster] Make it compile again with -D_STANDALONE_.
-
-       * src/raster/ftraster.c [_STANDALONE_]: Define
-       FT_CONFIG_STANDARD_LIBRARY_H.
-       Include `string.h'.
-       Don't include `rastpic.h'.
-       Define FT_DEFINE_RASTER_FUNCS.
-
-2009-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       smooth: Check glyph size by width/height, instead of pitch/height.
-       Suggested by der Mouse <mouse@Rodents-Montreal.ORG>.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Improve
-       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
-       the realistic case only.
-
-2009-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Register 2 missing trace components, t1afm and ttbdf.
-
-       * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( t1afm )
-       and FT_TRACE_DEF( ttbdf ).  See
-       http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html
-
-2009-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Register a trace component for ftgloadr.c.
-
-       * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( gloader ).
-       The macro `trace_gloader' was already used in the initial version
-       on 2002-02-24.
-
-2009-07-08  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Prevent the overflows by a glyph with too many points or contours.
-       The bug is reported by Boris Letocha <b.letocha@gmc.net>.  See
-       http://lists.gnu.org/archive/html/freetype-devel/2009-06/msg00031.html
-       http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00002.html  
-
-       * include/freetype/ftimage.h (FT_OUTLINE_CONTOURS_MAX,
-       FT_OUTLINE_POINTS_MAX): New macros to declare the maximum
-       values of FT_Outline.{n_contours,n_points}.
-       * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Check the
-       total numbers of points and contours cause no overflows in
-       FT_Outline.{n_contours,n_points}.
-
-       * include/freetype/internal/ftgloadr.h (FT_GLYPHLOADER_CHECK_P,
-       FT_GLYPHLOADER_CHECK_C): Compare the numbers of points and
-       contours as unsigned long number, instead of signed int, to
-       prevent the overflows on 16-bit systems.
-
-2009-07-05  Bram Tassyns  <bramt@enfocus.be>
-
-       Improve compatibility to Acroread.
-       This fixes Savannah bug #26944.
-
-       * src/cff/cffload.c (cff_charset_compute_cids): For multiple GID to
-       single CID mappings, make the lowest value win.
-
-2009-06-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       ftpatent: Fix a bug by wrong usage of service->table_info().
-       http://lists.gnu.org/archive/html/freetype-devel/2008-12/msg00039.html
-
-       * include/freetype/internal/services/svsfnt.h: Extend
-       FT_SFNT_TableInfoFunc() to take new argument to obtain the offset
-       to the specified table.
-       * src/sfnt/sfdriver.c (sfnt_table_info): Extend to return the
-       table-offset to the caller function.
-       * src/base/ftpatent.c (_tt_check_patents_in_table): Use new
-       service->table_info().
-       * src/base/ftobjs.c (FT_Sfnt_Table_Info): Synchronize to new
-       service->table_info().
-
-2009-06-28  Werner Lemberg  <wl@gnu.org>
-
-       [psaux, cff] Protect against nested `seac' calls.
-
-       * include/freetype/internal/psaux.h (T1_Decoder), src/cff/cffgload.h
-       (CFF_Decoder): Add `seac' boolean variable.
-
-       * src/cff/cffgload.c (cff_operator_seac), src/psaux/t1decode.c
-       (t1operator_seac): Use it.
-
-2009-06-28  Werner Lemberg  <wl@gnu.org>
-
-       Thinko.
-
-       * src/psaux/t1decode.c (t1operator_seac)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Test for existence of incremental
-       interface.
-
-2009-06-28  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h [FT_CONFIG_OPTION_INCREMENTAL]: Define.
-
-2009-06-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Add tools to preprocess the source files for AtariST PureC.
-
-       * builds/atari/deflinejoiner.awk: New file to filter C source files
-       for broken C preprocessor of PureC compiler.
-
-       * builds/atari/gen-purec-patch.sh: New file to generate a patch set
-       for PureC, by using deflinejoiner.awk.
-
-2009-06-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Keep existing modules.cfg in the building tree.
-
-       * configure: If `configure' is executed outside of the source tree,
-       an existing `modules.cfg' file in the build directory should be
-       kept, not overwritten by the version in the source tree.
-
-2009-06-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Filter --srcdir= option before invoking builds/unix/configure.
-
-       * configure: If builds/unix/configure is invoked with --srcdir
-       option, the option should take `builds/unix' directory instead of
-       the top source directory.  Thus the configure script in the top
-       directory should modify the --srcdir= option if
-       `builds/unix/configure' is invoked.
-
-2009-06-27  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.
-       http://lists.gnu.org/archive/html/freetype-devel/2009-04/msg00036.html
-
-2009-06-26  Werner Lemberg  <wl@gnu.org>
-
-       [truetype] Remove TT_SubGlyphRec.
-
-       * src/truetype/ttobjs.h (TT_SubGlyphRec): Removed, unused.
-
-2009-06-26  Werner Lemberg  <wl@gnu.org>
-
-       * */*: For warning messages, replace FT_ERROR with FT_TRACE0.
-
-       FT_ERROR is now used only if a function produces a non-zero `error'
-       value.
-
-       Formatting, improving and harmonizing debug strings.
-
-2009-06-25  Werner Lemberg  <wl@gnu.org>
-
-       Provide version information better.
-
-       * src/base/ftinit.c (FT_Init_FreeType): Don't set version here
-       but...
-       * src/base/ftobjs.c (FT_New_Library): Here.
-
-2009-06-22  Werner Lemberg  <wl@gnu.org>
-
-       Use 16.16 format while parsing Type 1 charstrings.
-       This fixes Savannah bug #26867.
-
-       Previously, only integers have been used which can lead to serious
-       rounding errors.
-
-       However, fractional values are only used internally; after the
-       charstrings (of either Type 1 or 2) have been processed, the
-       resulting coordinates get rounded to integers currently -- before
-       applying scaling.  This should be fixed; at the same time a new load
-       flag should be introduced, to be used in combination with
-       FT_LOAD_NO_SCALE, which indicates that font units are returned in
-       16.16 format.  Similarly, the incremental interface should be
-       extended to allow fractional values for metrics.
-
-       * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `shift'
-       field.
-       * include/freetype/internal/pshints.h (T1_Hints_SetStemFunc,
-       T1_Hints_SetStem3Func): Use FT_Fixed for coordinates.
-
-       * src/psaux/psobjs.c: Include FT_INTERNAL_CALC_H.
-       (t1_build_add_point): Always convert fixed to integer.
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings):
-       Use 16.16 format everywhere (except for large integers followed by a
-       `div').
-       [CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS]: Remove #ifdef and activate
-       code uncoditionally.
-       Add support for random numbers and update remaining code
-       accordingly; this should work now.
-       (t1_operator_seac): Updated.
-       * src/psaux/pshrec.c: Include FT_INTERNAL_CALC_H.
-       (ps_hints_t1stem3, t1_hints_stem): Updated.
-
-       * src/cid/cidgload.c: Include FT_INTERNAL_CALC_H.
-       (cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL],
-       (cid_face_compute_max_advance, cid_slot_load_glyph): Updated.
-
-       * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String)
-       [FT_CONFIG_OPTION_INCREMENTAL], (T1_Get_Advances, T1_Load_Glyph):
-       Updated.
-       * src/type1/t1load.c: Include FT_INTERNAL_CALC_H.
-       * src/type1/t1objs.c (T1_Face_Init): Updated.
-
-2009-06-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshrec.c: Use PSH_Err_Ok.
-
-2009-06-21  Werner Lemberg  <wl@gnu.org>
-
-       Code beautification.
-
-       * src/type1/t1load.c (FT_INT_TO_FIXED): Removed.
-       Replace everywhere with INT_TO_FIXED.
-       (FT_FIXED_TO_INT): Move to ...
-       * include/freetype/internal/ftcalc.h (FIXED_TO_INT): Here.
-       Update all users.
-
-2009-06-20  Werner Lemberg  <wl@gnu.org>
-
-       Remove unused variables.
-
-       * include/freetype/internal/psaux.h (T1_BuilderRec),
-       src/cff/cffgload.h (CFF_Builder): Remove `last'.
-       Update all users.
-
-2009-06-20  Werner Lemberg  <wl@gnu.org>
-
-       [psaux] Check large integers while parsing charstrings.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Large
-       integers must be followed by a `div' operator.
-
-2009-06-20  Werner Lemberg  <wl@gnu.org>
-
-       [cff] Revert last change.
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Do it.
-       Next time, don't confuse Type 2 charstring opcodes with TOP DICT
-       values...
-
-2009-06-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/aflatin.c (af_latin_metrics_check_digits): Fix
-       compiler warning.
-
-2009-06-20  Werner Lemberg  <wl@gnu.org>
-
-       * builds/compiler/gcc.mk (CFLAGS): Use -O3, not -O6.
-
-2009-06-19  Werner Lemberg  <wl@gnu.org>
-
-       [cff] Fix handling of reserved byte 0xFF.
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings): Abort if byte
-       0xFF is encountered.
-
-2009-06-19  Werner Lemberg  <wl@gnu.org>
-
-       Improve debug messages for Type1 charstrings.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Emit newlines
-       after instructions.
-       Prettify output.
-
-2009-06-19  Werner Lemberg  <wl@gnu.org>
-
-       More ftgray fixes for FT_STATIC_RASTER.
-       Problems reported by suyu@cooee.cn.
-
-       * src/smooth/ftgrays.c (gray_move_to, gray_raster_render): Use
-       RAS_VAR.
-
-2009-06-18  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2009-06-18  Werner Lemberg  <wl@gnu.org>
-
-       Fix B/W rasterization of subglyphs with different drop-out modes.
-
-       Normally, the SCANMODE instruction (if present) to set the drop-out
-       mode in a TrueType font is located in the `prep' table only and thus
-       valid for all glyphs.  However, there are fonts like `pala.ttf'
-       which additionally contain this instruction in the hinting code of
-       some glyphs (but not all).  As a result it can happen that a
-       composite glyph needs multiple drop-out modes for its subglyphs
-       since the rendering state gets reset for each subglyph.
-
-       FreeType collects the hinted outlines from all subglyphs, then it
-       sends the data to the rasterizer.  It also sends the drop-out mode
-       -- after hinting has been applied -- and here is the error: It sends
-       the drop-out mode of the last subglyph only; drop-out modes of all
-       other subglyphs are lost.
-
-       This patch fixes the problem; it adds a second, alternative
-       mechanism to pass the drop-out mode: For each contour, the
-       rasterizer now checks the first `tags' array element.  If bit 2 is
-       set, bits 5-7 contain the contour's drop-out mode, overriding the
-       global drop-out mode.
-
-       * include/freetype/ftimage.h (FT_CURVE_TAG_HAS_SCANMODE): New macro.
-
-       * src/truetype/ttgload.c (TT_Hint_Glyph): Store drop-out mode in
-       `tags[0]'.
-
-       * src/raster/ftraster.c (Flow_Up, Overshoot_Top, Overshoot_Bottom):
-       Use bits 3-5 instead of 0-2.
-       (New_Profile): Set the drop-out mode in the profile's `flags' field.
-       (Decompose_Curve): Check `tags[0]' and set `dropOutControl' if
-       necessary.
-       (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
-       Horizontal_Gray_Sweep_Drop, Draw_Sweep): Use the profile's drop-out
-       mode.
-
-2009-06-16  Werner Lemberg  <wl@gnu.org>
-
-       Improve scan conversion rules 4 and 6.
-
-       Two new constraints are introduced to better identify a `stub' -- a
-       concept which is only vaguely described in the OpenType
-       specification.  The old code was too rigorous and suppressed more
-       pixel than it should.
-
-         . The intersection of the two profiles with the scanline is less
-           than a half pixel.  Code related to this was already present in
-           the sources but has been commented out.
-
-         . The endpoint of the original contour forming a profile has a
-           distance (`overshoot') less than half a pixel to the scanline.
-
-       Note that the two additional conditions fix almost all differences
-       to the Windows rasterizer, but some problematic cases remain.
-
-       * src/raster/ftraster.c (Overshoot_Top, Overshoot_Bottom): New
-       macros for the `flags' field in the `TProfile' structure.
-       (IS_BOTTOM_OVERSHOOT, IS_TOP_OVERSHOOT): New macros.
-       (New_Profile, End_Profile): Pass overshoot flag as an argument and
-       set it accordingly.
-       Update callers.
-       (Vertical_Sweep_Drop, Horizontal_Sweep_Drop): Implement the two new
-       constraints.
-
-2009-06-11  Werner Lemberg  <wl@gnu.org>
-
-       Increase precision for B/W rasterizer.
-
-       * src/raster/ftraster.c (Set_High_Precision): Add two more bits to
-       the precision.  This corrects rendering of some small glyphs, for
-       example, glyph `xi' in verdana.ttf at 13 ppem.  Testing with ftbench
-       on my GNU/Linux box I don't see a performance degradation.
-
-2009-06-08  Michael Zucchi  <notzed@gmail.com>
-
-       Handle FT_STROKER_LINECAP_BUTT.
-       This fixes Savannah bug #26757.
-
-       * src/base/ftstroke.c (ft_stroker_cap): Implement it.
-
-2009-06-07  Harald Fernengel  <harry@kdevelop.org>
-
-       Fix some potential out-of-memory crashes.
-
-       * src/base/ftobjs.c (ft_glyphslot_done): Check `slot->internal'.
-       * src/base/ftstream.c (FT_Stream_ReleaseFrame): Check `stream'.
-       * src/truetype/ttinterp.c (TT_New_Context): Avoid double-free of
-       `exec' in case of failure.
-
-2009-06-07  Werner Lemberg  <wl@gnu.org>
-
-       Simplify math.
-       Suggested by Alexei Podtelezhnikov <apodtele@gmail.com>.
-
-       * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
-       Horizontal_Gray_Sweep_Drop): Do it.
-
-2009-06-04  Werner Lemberg  <wl@gnu.org>
-
-       Preparation for fixing scan conversion rules 4 and 6.
-
-       * src/raster/ftraster.c (TFlow): Replace enumeration with...
-       (Flow_Up): This macro.
-       (TProfile): Replace `flow' member with `flags' bit field.
-       Update all affected code.
-
-2009-05-29  James Cloos  <cloos@jhcloos.com>
-
-       Enable autohinting for glyphs rotated by multiples of 90°.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Alter check for permitted
-       matrices to allow rotations by multiples of 90°, not only unrotated,
-       possibly slanted matrices.
-
-2009-05-28  Werner Lemberg  <wl@gnu.org>
-
-       Remove compiler warning.
-       Reported by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
-
-       * src/autofit/aflatin2.c (af_latin2_hint_edges): Move declaration of
-       `n_edges' into `#if' block.
-
-2009-05-28  Werner Lemberg  <wl@gnu.org>
-
-       Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined.
-       Reported by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
-
-       * src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]:
-       Make it work.
-       Simplify #ifdef logic.
-
-2009-05-22  Werner Lemberg  <wl@gnu.org>
-
-       Improve b/w rasterizer.
-       Problem reported by Krzysztof Kotlenga <pocek@users.sf.net>.
-
-       * src/raster/raster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
-       Horizontal_Gray_Sweep_Drop): For smart drop-out mode, if
-       intersections are equally distant relative to next pixel center,
-       select the left pixel, not the right one.
-
-2009-05-19  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #26600.
-
-       * src/type42/t42parse.c (t42_load_keyword): Handle
-       T1_FIELD_LOCATION_FONT_EXTRA.
-
-2009-04-30  Werner Lemberg  <wl@gnu.org>
-
-       Document recent changes to ftview.
-
-       * docs/CHANGES: Do it.
-
-2009-04-27  Werner Lemberg  <wl@gnu.org>
-
-       autohinter: Don't change digit widths if all widths are the same.
-       This fixes FreeDesktop bug #21197.
-
-       * src/autofit/afglobal.c (AF_DIGIT): New macro.
-       (af_face_globals_compute_script_coverage): Mark ASCII digits in
-       `glyph_scripts' array.
-       (af_face_globals_get_metrics): Updated.
-       (af_face_globals_is_digit): New function.
-       * src/autofit/afglobal.h: Updated.
-       (AF_ScriptMetricsRec): Add `digits_have_same_width' flag.
-
-       * src/autofit/aflatin.c: Include FT_ADVANCES_H.
-       (af_latin_metrics_check_digits): New function.
-       (af_latin_metrics_init): Use it.
-       * src/autofit/aflatin.h: Updated.
-       * src/autofit/afcjk.c (af_cjk_metrics_init): Updated.
-
-       * src/autofit/aflatin2.c: Similar changes as with aflatin.c.
-
-       * src/autofit/afloader.c (af_loader_load_g): Test digit width.
-
-       * docs/CHANGES: Document it.
-
-2009-04-26  Werner Lemberg  <wl@gnu.org>
-
-       Make ftgrays compile with _STANDALONE_ and FT_STATIC_RASTER again.
-       Problems reported by suyu@cooee.cn.
-
-       * src/smooth/ftgrays.c (FT_DEFINE_OUTLINE_FUNCS,
-       FT_DEFINE_RASTER_FUNCS) [_STANDALONE_]: Define.
-       [!_STANDALONE_]: Include ftspic.h only here.
-       (ras): Define/declare after definition of `TWorker'.
-       Use `RAS_VAR_' where necessary.
-
-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.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Add #error to modules and files that do not support PIC yet.
-
-       When FT_CONFIG_OPTION_PIC is defined the following files will
-       create #error:
-       * src/bdf/bdfdrivr.h
-       * src/cache/ftcmanag.c
-       * src/cid/cidriver.h
-       * src/gxvalid/gxvmod.h
-       * src/gzip/ftgzip.c
-       * src/lzw/ftlzw.c
-       * src/otvalid/otvmod.h
-       * src/pcf/pcfdrivr.h
-       * src/pfr/pfrdrivr.h
-       * src/psaux/psauxmod.h
-       * src/type1/t1driver.h
-       * src/type42/t42drivr.h
-       * src/winfonts/winfnt.h
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in autofit module.
-
-       * 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,
-       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
-       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,
-       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
-       being allocated in the global scope.
-
-       * 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
-       being allocated in the global scope.
-
-       * 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
-       being allocated in the global scope.
-
-       * 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
-       being allocated in the global scope.
-       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,
-       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
-       being allocated in the global scope.
-       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
-       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
-       initialize PIC globals for autofit module.
-
-       * src/autofit/autofit.c add new file to build: afpic.c.
-       * src/autofit/jamfile add new files to FT2_MULTI build: afpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in pshinter module.
-
-       * 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,
-       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
-       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
-       initialize PIC globals for pshinter module.
-
-       * src/pshinter/pshinter.c add new file to build: pshpic.c.
-       * src/pshinter/jamfile add new files to FT2_MULTI build: pshpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in psnames module.
-
-       * 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,
-       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
-       and psnames_module_class 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 pspic.h in order to access them.
-
-       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
-       initialize PIC globals for psnames module.
-
-       * src/psnames/psnames.c add new file to build: pspic.c.
-       * src/psnames/jamfile add new files to FT2_MULTI build: pspic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       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,
-       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
-       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
-       ft_standard_raster from the pic_container (allocated in ftraster.c).
-       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
-       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
-       initialize PIC globals for raster renderer.
-
-       * src/raster/raster.c add new file to build: rastpic.c.
-       * src/raster/jamfile add new files to FT2_MULTI build: rastpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       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,
-       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
-       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
-       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
-       to the global scope.
-       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
-       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
-       initialize PIC globals for smooth renderer.
-
-       * src/smooth/smooth.c add new file to build: ftspic.c.
-       * src/smooth/jamfile add new files to FT2_MULTI build: ftspic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in cff driver.
-
-       * 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
-       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:
-       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:
-       cff_service_glyph_dict, cff_service_ps_info, cff_service_ps_name
-       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.
-       And macros will be used from cffpic.h in order to access them
-       from the pic_container.
-       Use macros from cffpic.h in order to access the
-       structs allocated in cffcmap.c
-
-       * 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
-       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
-       initialize PIC globals for cff driver.
-
-       * src/cff/cff.c add new file to build: cffpic.c.
-       * src/cff/jamfile add new files to FT2_MULTI build: cffpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in sfnt driver.
-
-       * 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
-       instances of FT_Service_GlyphDictRec.
-       * 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
-       instances of FT_Service_SFNT_TableRec.
-       * include/freetype/internal/services/svttcmap.h add macros to init
-       instances of FT_Service_TTCMapsRec.
-       * 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:
-       sfnt_service_sfnt_table, sfnt_service_glyph_dict, sfnt_service_ps_name
-       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
-       instances of TT_CMap_ClassRec.
-       * 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_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.
-       And macros will be used from sfntpic.h in order to access them
-       from the pic_container.
-       The content of tt_cmap_classes is now described in the
-       new file 'ttcmapc.h'.
-
-       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
-       initialize PIC globals for sfnt driver.
-       * 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.
-       * src/sfnt/jamfile add new files to FT2_MULTI build: sfntpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Position Independent Code (PIC) support in truetype driver.
-
-       * 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
-       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:
-       tt_service_gx_multi_masters, tt_service_truetype_glyf, tt_driver_class
-       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
-       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
-       initialize PIC globals for truetype driver.
-
-       * src/truetype/truetype.c add new file to build: ttpic.c.
-       * src/truetype/jamfile add new files to FT2_MULTI build: ttpic.c.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       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
-       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
-       (FT_Module_Class).
-       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
-       (FT_Driver_ClassRec).
-       * 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
-       destory arrays of FT_ServiceDescRec.
-       * include/freetype/internal/internal.h define macro to include
-       ftpic.h.
-
-       New Files:
-       * 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
-       macros to access them.
-       * 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
-       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
-       destroyed.
-
-       * src/base/jamfile add new files to FT2_MULTI build:
-       ftpic.c and basepic.c.
-       * 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
-       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
-       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
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       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
-       'CFF_ParserRec' set by `cff_parser_init'.
-       Route library pointer from 'cff_face_init' to 'cff_subfont_load'
-       for `cff_parser_init'.
-
-       * src/cff/cffparse.c (CFF_Field_Handler): Move it to...
-       * src/cff/cffparse.h: This file, to be used by other C files.
-
-2009-04-05  Oran Agra  <oran@monfort.co.il>
-
-       Minor change in ftstroke.c.
-
-       * src/base/ftstroke.c (FT_StrokerRec): Replace `memory' member with
-       `library' needed for PIC version.
-       Update all callers.
-
-2009-04-04  Werner Lemberg  <wl@gnu.org>
-
-       ftnames.c -> ftsnames.c
-
-       * src/base/ftnames.c: Rename to...
-       * src/base/ftsnames.c: This.
-       * src/base/Jamfile, src/base/rules.mk, src/base/ftbase.c: Updated.
-
-2009-04-04  Werner Lemberg  <wl@gnu.org>
-
-       Add support for cmap type 13.
-
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       (TT_CONFIG_CMAP_FORMAT_13): New macro.
-
-       * src/sfnt/ttcmap.c (TT_CMap13Rec, tt_cmap13_init,
-       tt_cmap13_validate, tt_cmap13_char_index, tt_cmap13_char_next,
-       tt_cmap13_get_info, tt_cmap13_char_map_def_binary,
-       tt_cmap14_class_rec): New functions and structures for cmap 13
-       support.
-       (tt_cmap_classes): Register tt_cmap13_class_rec.
-
-       * docs/CHANGES: Mention cmap 13 support.
-
-2009-04-01  Werner Lemberg  <wl@gnu.org>
-
-       Ignore empty contours in CFF glyphs.
-
-       Problem reported by Albert Astals Cid <aacid@kde.org>.
-
-       * src/cff/cffgload.c (cff_builder_close_contour): Synchronize with
-       t1_builder_close_contour.
-
-2009-03-21  Werner Lemberg  <wl@gnu.org>
-
-       Another redundant header inclusion.
-
-       * src/truetype/ttgxvar.c: Fix Ghostscript Coverity issue #4041.
-
-2009-03-21  Werner Lemberg  <wl@gnu.org>
-
-       Remove redundant header inclusions.
-
-       This covers many Ghostscript Coverity issues.
-
-       * src/*: Do it.
-
-2009-03-21  Werner Lemberg  <wl@gnu.org>
-
-       Fix Ghostscript Coverity issue #3904.
-
-       * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against
-       invalid values of `runcnt'.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-
-       Fix `make multi' run.
-
-       * src/smooth/ftsmooth.h: Include FT_INTERNAL_DEBUG_H.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25923.
-
-       * src/cache/ftccmap.c (FTC_CMAP_HASH): Fix typo.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-
-       Protect against too large glyphs.
-
-       Problem reported by Tavis Ormandy <taviso@google.com>.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Don't allow
-       `pitch' or `height' to be larger than 0xFFFF.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-           Tavis Ormandy  <taviso@google.com>
-
-       Fix validation for various cmap table formats.
-
-       * src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate,
-       tt_cmap12_validate): Check `length' correctly.
-       (tt_cmap_14_validate): Check `length' and `numMappings' correctly.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-
-       Protect against malformed compressed data.
-
-       * src/lzw/ftzopen.c (ft_lzwstate_io): Test whether `state->prefix' is
-       zero.
-
-2009-03-20  Werner Lemberg  <wl@gnu.org>
-
-       Protect against invalid SID values in CFFs.
-
-       Problem reported by Tavis Ormandy <taviso@google.com>.
-
-       * src/cff/cffload.c (cff_charset_load): Reject SID values larger
-       than 64999.
-
-2009-03-19  Vincent Richomme  <richom.v@free.fr>
-
-       Update WinCE Visual C project files.
-
-       * builds/wince/vc2005-ce/freetype.vcproj,
-       builds/wince/vc2008-ce/freetype.vcproj: Add missing base extension
-       files.
-
-2009-03-19  Werner Lemberg  <wl@gnu.org>
-
-       Remove unused Win32 code.
-
-       * builds/wince/ftdebug.c: Remove code guarded with `!_WIN32_WCE'.
-       Since Win32 is handled separately this is no longer needed.
-
-2009-03-19  Vincent Richomme  <richom.v@free.fr>
-
-       Make `gzip' module compile on WinCE.
-
-       * src/gzip/zconf.h [_WIN32_WCE]: Define NO_ERRNO_H.
-
-2009-03-19  Werner Lemberg  <wl@gnu.org>
-
-       Remove unused WinCE code.
-
-       * builds/win32/ftdebug.c: Remove code guarded with `_WIN32_WCE'.
-       Since WinCE is handled separately this is no longer needed.
-
-2009-03-16  Werner Lemberg  <wl@gnu.org>
-
-       docmaker: Don't ignore single-line code blocks.
-
-       * src/tools/docmaker/content.py (DocBlock::_init__): Fix change from
-       2009-01-31.
-
-2009-03-15  Steve Langasek  <steve.langasek@canonical.com>
-
-       Use __asm__ for declaring assembly instead of asm.
-
-       * builds/unix/ftconfig.in (FT_MulFix_arm): Use __asm__ instead of
-       asm on arm, fixing a build failure on armel with -pedantic.
-
-2009-03-14  Werner Lemberg  <wl@gnu.org>
-
-       Fix valgrind warning.
-
-       * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_bit_aligned): Don't read
-       past the end of the frame.
-
-2009-03-12  Werner Lemberg  <wl@gnu.org>
-
-       * Version 2.3.9 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-9'.
-
-2009-03-12  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/freetype2.in: Move @FT2_EXTRA_LIBS@ to `Libs.private'.
-
-2009-03-12  Werner Lemberg  <wl@gnu.org>
-
-       Fix some FreeType Coverity issues as reported for Ghostscript.
-
-       * src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize
-       `args.stream' (#3874, #3875).
-       (open_face_PS_from_sfnt_stream): Improve error management (#3786).
-       * src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice'
-       (#3870).
-       * src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead
-       code (#3790).
-       * src/base/ftrfork.c (raccess_guess_apple_generic): Check error
-       value of `FT_Stream_Skip' (#3784).
-
-       * src/type1/t1gload.c (T1_Load_Glyph): Check `size' before accessing
-       it (#3872)
-
-       * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Check `face' before accessing
-       it (#3871).
-       * src/pcf/pcfread.c (pcf_get_metrics): Handle return value of
-       `pcf_get_metric' (#3789, #3782).
-       (pcf_get_properties): Use FT_STREAM_SKIP (#3783).
-
-       * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Fix check of
-       `acache' (#3797)
-
-       * src/cff/cffdrivr.c (cff_ps_get_font_info): Fix check of `cff'
-       (#3796).
-       * src/cff/cffgload.c (cff_decoder_prepare): Check `size' (#3795).
-       * src/cff/cffload.c (cff_index_get_pointers): Add comment (#3794).
-
-       * src/bdf/bdflib.c (_bdf_add_property): Check `fp->value.atom'
-       (#3793).
-       (_bdf_parse_start): Add comment (#3792).
-
-       * src/raster/ftraster.c (Finalize_Profile_Table): Check
-       `ras.fProfile' (#3791).
-
-       * src/sfnt/ttsbit.c (Load_SBit_Image): Use FT_STREAM_SKIP (#3785).
-
-       * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore
-       seek error (#3781).
-
-2009-03-11  Michael Toftdal  <toftdal@gmail.com>
-
-       Extend CID service functions to handle CID-keyed CFFs as CID fonts.
-
-       * include/freetype/ftcid.h (FT_Get_CID_Is_Internally_CID_keyed,
-       FT_Get_CID_From_Glyph_Index): New functions.
-
-       * include/freetype/internal/services/svcid.h
-       (FT_CID_GetIsInternallyCIDKeyedFunc,
-       FT_CID_GetCIDFromGlyphIndexFunc): New function typedefs.
-       (CID Service): Use them.
-
-       * src/base/ftcid.c: Include FT_CID_H.
-       (FT_Get_CID_Is_Internally_CID_keyed, FT_Get_CID_From_Glyph_Index):
-       New functions.
-
-       * src/cff/cffdrivr.c (cff_get_is_cid, cff_get_cid_from_glyph_index):
-       New functions.
-       (cff_service_cid_info): Add them.
-       * src/cff/cffload.c (cff_font_load): Don't free `font->charset.sids'
-       -- it is needed for access as a CID-keyed font.  It gets deleted
-       later on.
-
-       * src/cid/cidriver.c (cid_get_is_cid, cid_get_cid_from_glyph_index):
-       New functions.
-       (cid_service_cid_info): Add them.
-
-       * docs/CHANGES: Updated.
-
-2009-03-11  Bram Tassyns  <bramt@enfocus.be>
-
-       Fix Savannah bug #25597.
-
-       * src/cff/cffparse.c (cff_parse_real): Don't allow fraction_length
-       to become larger than 9.
-
-2009-03-11  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25814.
-
-       * builds/unix/freetype2.in: As suggested in the bug report, move
-       @LIBZ@ to `Libs.private'.
-
-2009-03-11  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25781.
-       We now simply check for a valid `offset', no longer handling `delta
-       = 1' specially.
-
-       * src/sfnt/ttcmap.c (tt_cmap4_validate): Don't check `delta' for
-       last segment.
-       (tt_cmap4_set_range, tt_cmap4_char_map_linear,
-       tt_cmap4_char_map_binary): Check offset.
-
-2009-03-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/Jamfile: Fix handling of ftadvanc.c.
-       Reported by Oran Agra <oran@monfort.co.il>.
-
-2009-03-10  Vincent Richomme  <richom.v@free.fr>
-
-       Restructure Win32 and Wince compiler support.
-
-       * src/builds/win32: Remove files for WinCE.
-       Move VC 2005 support to a separate directory.
-       Add directory for VC 2008 support.
-
-       * src/builds/wince: New directory hierarchy for WinCE compilers
-       (VC 2005 and VC 2008).
-
-2009-03-09  Werner Lemberg  <wl@gnu.org>
-
-       More preparations for 2.3.9 release.
-
-       * docs/CHANGES: Updated.
-
-       * Jamfile, README: s/2.3.8/2.3.9/, s/238/239/.
-
-2009-03-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/rules.mk (SFNT_DRV_H): Add ttsbit0.c.
-
-2009-03-09  Alexey Kryukov  <anagnost@yandex.ru>
-
-       Fix handling of EBDT formats 8 and 9 (part 2).
-
-       This patch fixes the following problems in ttsbit0.c:
-
-       . Bitmaps for compound glyphs were never allocated.
-
-       . `SBitDecoder' refused to load metrics if some other metrics have
-         already been loaded.  This condition certainly makes no sense for
-         recursive calls, so I've just disabled it.  Another possibility
-         would be resetting `decoder->metrics_loaded' to false before
-         loading each composite component.  However, we must restore the
-         original metrics after finishing the recursion; otherwise we can
-         get a misaligned glyph.
-
-       . `tt_sbit_decoder_load_bit_aligned' incorrectly handled `x_pos',
-         causing some glyph components to be shifted too far to the right
-         (especially noticeable for small sizes).
-
-       Note that support for grayscale bitmaps (not necessarily compound) is
-       completely broken in ttsbit0.c.
-
-       * src/sfnt/tt_sbit_decoder_load_metrics: Always load metrics.
-       (tt_sbit_decoder_load_bit_aligned): Handle `x_pos' correctly in case
-       of `h == height'.
-       (tt_sbit_decoder_load_compound): Reset metrics after loading
-       components.
-       Allocate bitmap.
-
-2009-03-09  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.raw (version_info): Set to 9:20:3.
-
-2009-03-03  David Turner  <david@freetype.org>
-
-       Protect SFNT kerning table parser against malformed tables.
-
-       This closes Savannah BUG #25750.
-
-       * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning): Fix a
-       bug where a malformed table would be successfully loaded but later
-       crash the engine during parsing.
-
-2009-03-03  David Turner  <david@freetype.org>
-
-       Update documentation and bump version number to 2.3.9.
-
-       * include/freetype/freetype.h: Bump patch version to 9.
-       * docs/CHANGES: Document the ABI break in 2.3.8.
-       * docs/VERSION.DLL: Update version numbers table for 2.3.9.
-
-2009-03-03  David Turner  <david@freetype.org>
-
-       Remove ABI-breaking field in public PS_InfoFontRec definition.
-
-       Instead, we define a new internal PS_FontExtraRec structure to
-       hold the additional field, then place it in various internal
-       positions of the corresponding FT_Face derived objects.
-
-       * include/freetype/t1tables.h (PS_FontInfoRec): Remove the
-       `fs_type' field from the public structure.
-       * include/freetype/internal/psaux.h (T1_FieldLocation): New
-       enumeration `T1_FIELD_LOCATION_FONT_EXTRA'.
-       * include/freetype/internal/t1types.h (PS_FontExtraRec): New
-       structure.
-       (T1_FontRec, CID_FaceRec): Add it.
-
-       * src/cid/cidload.c (cid_load_keyword): Handle
-       T1_FIELD_LOCATION_FONT_EXTRA.
-       * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c:
-       Adjust FT_STRUCTURE and T1CODE properly to handle `FSType'.
-       * src/type1/t1load.c (t1_load_keyword): Handle
-       T1_FIELD_LOCATION_FONT_EXTRA.
-
-       * include/freetype/internal/services/svpsinfo.h (PsInfo service):
-       Add `PS_GetFontExtraFunc' function typedef.
-
-       * src/base/ftfstype.c: Include FT_INTERNAL_SERVICE_H and
-       FT_SERVICE_POSTSCRIPT_INFO_H.
-       (FT_Get_FSType_Flags): Use POSTSCRIPT_INFO service.
-
-       * src/cff/cffdrivr.c (cff_service_ps_info): Updated.
-       * src/cid/cidriver.c (cid_ps_get_font_extra): New function.
-       (cid_service_ps_info): Updated.
-       * src/type1/t1driver.c (t1_ps_get_font_extra): New function.
-       (t1_service_ps_info): Updated.
-       * src/type42/t42drivr.c (t42_ps_get_font_extra): New function.
-       (t42_service_ps_info): Updated.
-
-2009-03-02  Alexey Kryukov  <anagnost@yandex.ru>
-
-       Fix handling of EBDT formats 8 and 9.
-
-       The main cycle in `blit_sbit' makes too many iterations: it actually
-       needs the count of lines in the source bitmap rather than in the
-       target image.
-
-       * src/sfnt/ttsbit.c (blit_sbit) [FT_CONFIG_OPTION_OLD_INTERNALS]:
-       Add parameter `source_height' and use it for main loop.
-       (Load_SBit_Single) [FT_CONFIG_OPTION_OLD_INTERNALS]: Updated.
-
-2009-02-23  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25669.
-
-       * src/base/ftadvanc.h (FT_Get_Advances): Fix serious typo.
-
-       * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics): Fix
-       scaling factor for non-scalable fonts.
-
-       * src/cff/cffdrivr.c (cff_get_advances): Use correct advance width
-       value to prevent incorrect scaling.
-
-       * docs/CHANGES: Document it.
-
-2009-02-15  Matt Godbolt  <matt@godbolt.org>
-
-       Fix Savannah bug #25588.
-
-       * builds/unix/ftconfig.in (FT_MulFix_arm): Use correct syntax for
-       `orr' instruction.
-
-2009-02-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttobjs.c (tt_check_trickyness): Add `DFKaiShu'.
-       Reported by David Bevan <dbevan@emtex.com>.
-
-2009-02-09  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25495.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Test for bitmap strikes before
-       setting metrics and bbox values.  This ensures that the check for a
-       font with neither a `glyf' table nor bitmap strikes can be performed
-       early enough to set metrics and bbox values too.
-
-2009-02-04  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #25480.
-
-       * builds/unix/freetype-config.in: For --ftversion, don't use $prefix
-       but $includedir.
-
-2009-01-31  Werner Lemberg  <wl@gnu.org>
-
-       Minor docmaker improvements.
-
-       * src/tools/docmaker/content.py (DocBlock::__init__): Ignore empty
-       code blocks.
-
-2009-01-25  Werner Lemberg  <wl@gnu.org>
-
-       Fix SCANCTRL handling in TTFs.
-       Problem reported by Alexey Kryukov <anagnost@yandex.ru>.
-
-       * src/truetype/ttinterp.c (Ins_SCANCTRL): Fix threshold handling.
-
-2009-01-23  Werner Lemberg  <wl@gnu.org>
-
-       Move FT_Get_FSType_Flags to a separate file.
-       Problem reported by Mickey Gabel <mickey@monfort.co.il>.
-
-       * src/base/ftobjs.c (FT_Get_FSType_Flags): Move to...
-       * src/base/ftfstype.c: This new file.
-
-       * modules.cfg (BASE_EXTENSION): Add ftfstype.c.
-
-       * docs/INSTALL.ANY: Updated.
-
-       * builds/mac/*.txt, builds/amiga/*makefile*,
-       builds/win32/{visualc,visualce}/freetype.*, builds/symbian/*:
-       Updated.
-
-2009-01-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Fix 2 error
-       messages ending without "\n".
-
-2009-01-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Fix Savannah bug #25347.
-
-       * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Rewind
-       the stream to the original position passed to this function,
-       when ft_lookup_PS_in_sfnt_stream() failed.
-       (Mac_Read_sfnt_Resource): Rewind the stream to the head of
-       sfnt resource body, when open_face_PS_from_sfnt_stream()
-       failed.
-
-2009-01-19  Michael Lotz  <mmlr@mlotz.ch>
-
-       Fix Savannah bug #25355.
-
-       * include/freetype/config/ftconfig.h (FT_MulFix_i386): Make
-       assembler code work with gcc 2.95.3 (as used by the Haiku project).
-       Add `cc' register to the clobber list.
-
-2009-01-18  Werner Lemberg  <wl@gnu.org>
-
-       Protect FT_Get_Next_Char.
-
-       * src/sfnt/ttcmap.c (tt_cmap4_set_range): Apply fix similar to
-       change from 2008-07-22.
-
-       Patch from Ronen Ghoshal <rghoshal@emtex.com>.
-
-2009-01-18  Werner Lemberg  <wl@gnu.org>
-
-       Implement FT_Get_Name_Index for SFNT driver.
-
-       * src/sfnt/sfdriver.c (sfnt_get_name_index): New function.
-       (sfnt_service_glyph_dict): Use it.
-
-       Problem reported by Truc Truong <tructv@necsv.com>.
-
-2009-01-18  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftstroke.h (FT_Outline_GetInsideBorder): Fix
-       documentation.  Problem reported by Truc Truong <tructv@necsv.com>.
-
-       * docs/CHANGES: Updated.
-
-2009-01-14  Werner Lemberg  <wl@gnu.org>
-
-       * Version 2.3.8 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-8'.
-
-       * docs/VERSION.DLL: Update documentation and bump version number to
-       2.3.8.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.7/2.3.8/, s/237/238/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8.
-
-       * builds/unix/configure.raw (version_info): Set to 9:19:3.
-
-       * docs/release: Updated.
-
-2009-01-14  Werner Lemberg  <wl@gnu.org>
-
-       * builds/toplevel.mk (dist): Compress better.
-
-2009-01-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Get_FSType_Flags): Cast for compilation
-       with C++.
-
-2009-01-13  Werner Lemberg  <wl@gnu.org>
-
-       Don't use stdlib.h and friends directly.
-       Reported by Mickey Gabel <mickey@monfort.co.il>.
-
-       * src/base/ftdbgmem.c: s/<stdlib.h>/FT_CONFIG_STANDARD_LIBRARY_H/.
-
-       * src/gzip/ftgzip.c, src/lzw/ftlzw.c, src/raster/ftmisc.h:
-       s/<string.h>/FT_CONFIG_STANDARD_LIBRARY_H/.
-
-       * src/autofit/aftypes.h, src/autofit/afhints.c,
-       src/pshinter/pshalgo.c: s/<stdio.h>/FT_CONFIG_STANDARD_LIBRARY_H/
-
-       * src/lzw/ftlzw.c, src/base/ftdbgmem.c: Don't include stdio.h.
-
-2009-01-12  Werner Lemberg  <wl@gnu.org>
-
-       Avoid compiler warnings.
-
-       * */*: s/do ; while ( 0 )/do { } while ( 0 )/.
-       Reported by Sean McBride <sean@rogue-research.com>.
-
-2009-01-12  Werner Lemberg  <wl@gnu.org>
-
-       Fix stdlib dependencies.
-
-       Problem reported by Mickey Gabel <mickey@monfort.co.il>.
-
-       * include/freetype/config/ftstdlib.h (ft_exit): Removed.  Unused.
-
-       * src/autofit/afhints.c, src/base/ftlcdfil.c, src/smooth/ftsmooth.c:
-       s/memcpy/ft_memcpy/.
-       * src/psaux/t1decode.c: s/memset/ft_memset/, s/memcpy/ft_memcpy/.
-
-2009-01-11  Werner Lemberg  <wl@gnu.org>
-
-       * docs/formats.txt: Add link to PCF specification.
-
-       * include/freetype/ftbdf.h (FT_Get_BDF_Property): Improve
-       documentation.
-
-2009-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftadvanc.c (_ft_face_scale_advances, FT_Get_Advance,
-       FT_Get_Advances): Change the type of load_flags from FT_UInt32 to
-       FT_Int32, to match with the flags for FT_Load_Glyph().
-       * src/cff/cffdrivr.c (cff_get_advances): Ditto.
-       * src/truetype/ttdriver.c (tt_get_advances): Ditto.
-       * include/freetype/ftadvanc.h (FT_Get_Advance, FT_Get_Advances):
-       Ditto.
-       * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc):
-       Ditto.
-
-2009-01-09  Daniel Zimmermann  <netzimme@aol.com>
-
-       * src/gxvalid/gxvmort.c (gxv_mort_feature_validate): Fix wrong
-       length check.  From Savannah patch #6682.
-
-2009-01-09  Werner Lemberg  <wl@gnu.org>
-
-       Fix problem with T1_FIELD_{NUM,FIXED}_TABLE2.
-
-       * src/psaux/psobjs.c (ps_parser_load_field_table): Don't handle
-       `count_offset' if it is zero (i.e., unused).  Otherwise, the first
-       element of the structure which holds the data is erroneously
-       modified.  Problem reported by Chi Nguyen <chint@necsv.com>.
-
-2009-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftadvanc.c (_ft_face_scale_advances, FT_Get_Advance,
-       FT_Get_Advances): Extend the type of load_flags from FT_UInt to
-       FT_UInt32, to pass 32-bit flags on 16bit platforms.
-       * src/cff/cffdrivr.c (cff_get_advances): Ditto.
-       * src/truetype/ttdriver.c (tt_get_advances): Ditto.
-       * include/freetype/ftadvanc.h (FT_Get_Advance, FT_Get_Advances):
-       Ditto.
-       * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc):
-       Ditto.
-
-2009-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (FT_Done_Library): Issue an error message when
-       FT_Done_Face() cannot free all faces. If the list of the opened
-       faces includes broken face which FT_Done_Face() cannot free,
-       FT_Done_Library() retries FT_Done_Face() and it can fall into
-       an endless loop. See the discussion:
-       http://lists.gnu.org/archive/html/freetype-devel/2008-09/msg00047.html
-       http://lists.gnu.org/archive/html/freetype-devel/2008-10/msg00000.html
-
-2009-01-07  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Document new key `a' in ftdiff.
-
-2009-01-06  Werner Lemberg  <wl@gnu.org>
-
-       * autogen.sh: Don't use GNUisms while calling sed.  Problem reported
-       by Sean McBride.
-
-2009-01-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftbitmap.c (FT_Bitmap_Convert): Handle FT_PIXEL_MODE_LCD
-       and FT_PIXEL_MODE_LCD_V.  Problem reported by Chi Nguyen
-       <chint@necsv.com>.
-
-2009-01-06  Diego Pettenò  <flameeyes@gmail.com>
-
-       * builds/unix/configure.raw: Don't call AC_CANONICAL_BUILD and
-       AC_CANONICAL_TARGET and use $host_os only.  A nice explanation for
-       this change can be found at
-       http://blog.flameeyes.eu/s/canonical-target.
-
-       From Savannah patch #6712.
-
-2009-01-06  Sean McBride  <sean@rogue-research.com>
-
-       * src/base/ftdbgmem.c (_debug_mem_dummy): Make it static.
-
-       * src/base/ftmac.c: Remove some #undefs.
-
-2008-12-26  Werner Lemberg  <wl@gnu.org>
-
-       Set `face_index' field in FT_Face for all font formats.
-
-       * cff/cffobjs.c (cff_face_init), winfonts/winfnt.c (FNT_Face_Init),
-       sfnt/sfobjs.c (sfnt_init_face): Do it.
-
-       * docs/CHANGES: Document it.
-
-2008-12-22  Steve Grubb
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Reject zero-length files.
-       Patch from Savannah bug #25151.
-
-2008-12-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/pfrdrivr.c, src/winfonts/winfnt.c, src/cache/ftcmanag.c,
-       src/smooth/ftgrays.c, src/base/ftobjc.s, src/sfobjs.c:
-       s/_Err_Bad_Argument/_Err_Invalid_Argument/.  The former is for
-       errors in the bytecode interpreter only.
-
-2008-12-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftpfr.c (FT_Get_PFR_Metrics): Protect against NULL
-       arguments.
-       Fix return value for non-PFR fonts.  Both problems reported by Chi
-       Nguyen <chint@necsv.com>.
-
-2008-12-21  anonymous
-
-       FT_USE_MODULE declares things as:
-
-         extern const FT_Module_Class
-
-       (or similar for C++).  However, the actual types of the variables
-       being declared are often different, e.g., FT_Driver_ClassRec or
-       FT_Renderer_Class.  (Some are, indeed, FT_Module_Class.)
-
-       This works with most C compilers (since those structs begin with an
-       FT_Module_Class struct), but technically it's undefined behavior.
-
-       To quote the ISO/IEC 9899:TC2 final committee draft, section 6.2.7
-       paragraph 2:
-
-         All declarations that refer to the same object or function shall
-         have compatible type; otherwise, the behavior is undefined.
-
-       (And they are not compatible types.)
-
-       Most C compilers don't reject (or even detect!) code which has this
-       issue, but the GCC LTO development branch compiler does.  (It
-       outputs the types of the objects while generating .o files, along
-       with a bunch of other information, then compares them when doing the
-       final link-time code generation pass.)
-
-       Patch from Savannah bug #25133.
-
-       * src/base/ftinit.c (FT_USE_MODULE): Include variable type.
-
-       * builds/amiga/include/freetype/config/ftmodule.h,
-       include/freetype/config/ftmodule.h, */module.mk: Updated to declare
-       pass correct types to FT_USE_MODULE.
-
-2008-12-21  Hongbo Ni  <hongbo@njstar.com>
-
-       * src/autofit/aflatin.c (af_latin_hint_edges),
-       src/autofit/aflatin2.c (af_latin2_hint_edges), src/autofit/afcjk.c
-       (af_cjk_hint_edges): Protect against division by zero.  This fixes
-       Savannah bug #25124.
-
-2008-12-18  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2008-12-18  Bevan, David  <dbevan@emtex.com>
-
-       Provide API for accessing embedding and subsetting restriction
-       information.
-
-       * include/freetype.h (FT_FSTYPE_INSTALLABLE_EMBEDDING,
-       FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING,
-       FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING, FT_FSTYPE_EDITABLE_EMBEDDING,
-       FT_FSTYPE_NO_SUBSETTING, FT_FSTYPE_BITMAP_EMBEDDING_ONLY): New
-       macros.
-       (FT_Get_FSType_Flags): New function declaration.
-
-       * src/base/ftobjs.c (FT_Get_FSType_Flags): New function.
-
-       * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c
-       (t42_keywords): Handle `FSType'.
-
-       * include/freetype/t1tables.h (PS_FontInfoRec): Add `fs_type' field.
-
-2008-12-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Don't use internal
-       macros so that copying the source code into an application works
-       out of the box.
-
-2008-12-17  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftsynth.h, src/base/ftsynth.c: Move
-       FT_GlyphSlot_Own_Bitmap to...
-       * include/freetype/ftbitmap.h, src/base/ftbitmap.c: These files.
-
-       * docs/CHANGES: Document it.
-
-2008-12-10  Werner Lemberg  <wl@gnu.org>
-
-       Generalize the concept of `tricky' fonts by introducing
-       FT_FACE_FLAG_TRICKY to indicate that the font format's hinting
-       engine is necessary for correct rendering.
-
-       At the same time, slightly modify the behaviour of tricky fonts:
-       FT_LOAD_NO_HINTING is now ignored.  To really force raw loading
-       of tricky fonts (without hinting), both FT_LOAD_NO_HINTING and
-       FT_LOAD_NO_AUTOHINT must be used.
-
-       Finally, tricky TrueType fonts always use the bytecode interpreter
-       even if the patented code is used.
-
-       * include/freetype/freetype.h (FT_FACE_FLAG_TRICKY, FT_IS_TRICKY):
-       New macros.
-
-       * src/truetype/ttdriver.c (Load_Glyph): Handle new load flags
-       semantics as described above.
-
-       * src/truetype/ttobjs.c (tt_check_trickyness): New function, using
-       code of ...
-       (tt_face_init): This function, now simplified and updated to new
-       semantics.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Don't use autohinter for tricky
-       fonts.
-
-       * docs/CHANGES: Document it.
-
-2008-12-09  Werner Lemberg  <wl@gnu.org>
-
-       Really fix Savannah bug #25010: An SFNT font with neither outlines
-       nor bitmaps can be considered as containing space `glyphs' only.
-
-       * src/truetype/ttpload.c (tt_face_load_loca): Handle the case where
-       a `glyf' table is missing.
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Abort if we have no
-       `glyf' table but a non-zero `loca' entry.
-       (tt_loader_init): Handle missing `glyf' table.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Undo change 2008-12-05.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): A font with neither outlines
-       nor bitmaps is scalable.
-
-2008-12-05  Werner Lemberg  <wl@nu.org>
-
-       * src/autofit/aflatin.c (af_latin_uniranges): Add more ranges.  This
-       fixes Savannah bug #21190 which also provides a basic patch.
-
-2008-12-05  Werner Lemberg  <wl@nu.org>
-
-       * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): Use value
-       0x100 instead of 0x10000; the latter value is already occupied by
-       FT_LOAD_TARGET_LIGHT.  Bug reported by James Cloos.
-
-
-       Handle SFNT with neither outlines nor bitmaps.  This fixes Savannah
-       bug #25010.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Reject fonts with neither
-       outlines nor bitmaps.
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Don't return an error if there
-       is no table with glyphs.
-
-
-       * src/sfnt/ttload.c (tt_face_lookup_table): Improve debugging
-       message.
-
-2008-12-01  Werner Lemberg  <wl@gnu.org>
-
-       GDEF tables need `glyph_count' too for validation.  Problem reported
-       by Chi Nguyen <chint@necsv.com>.
-
-       * src/otvalid/otvgdef.c (otv_GDEF_validate), src/otvalid/otvalid.h
-       (otv_GDEF_validate), src/otvalid/otvmod.c (otv_validate): Pass
-       `glyph_count'.
-
-2008-11-29  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c,
-       src/bdf/bdfdrivr.c, src/gxvalid/gxvmorx.c, src/otvalid/otvmath.c,
-       src/pcf/pcfdrivr.c, src/psnames/pstables.h, src/smooth/ftgrays.c,
-       src/tools/glnames.py, src/truetype/ttinterp.c, src/type1/t1load.c,
-       src/type42/t42objs.c, src/winfonts/winfnt.c: Fix compiler warnings
-       (Atari PureC).
-
-2008-11-29  James Cloos  <cloos@jhcloos.com>
-
-       * src/type/t1load.c (mm_axis_unmap): Revert previous patch and fix
-       it correctly by using FT_INT_TO_FIXED (FreeType expects 16.16 values
-       in the /BlendDesignMap space).
-
-2008-11-29  James Cloos  <cloos@jhcloos.com>
-
-       * src/type1/t1load.c (mm_axis_unmap): `blend_points' is FT_Fixed*,
-       whereas `design_points' is FT_Long*.  Therefore, return blend rather
-       than design points.
-
-2008-11-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffparse.c (cff_parse_real): Handle more than nine
-       significant digits correctly.  This fixes Savannah bug #24953.
-
-2008-11-25  Daniel Zimmermann  <netzimme@aol.com>
-
-       * src/base/ftstream.c (FT_Stream_ReadFields): Don't access stream
-       before the NULL check.  From Savannah patch #6681.
-
-2008-11-24  Werner Lemberg  <wl@gnu.org>
-
-       Fixes from the gnuwin32 port.
-
-       * src/base/ftlcdfil.c: s/EXPORT/EXPORT_DEF/.
-
-       * src/base/ftotval.c: Include FT_OPENTYPE_VALIDATE_H.
-
-       * src/psaux/psobjs.c (ps_table_add): Check `length'.
-
-2008-11-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (tt_default_graphics_state): The default
-       value for `scan_type' is zero, as confirmed by Greg Hitchcock from
-       Microsoft.  Problem reported by Michal Nowakowski
-       <miszka@limes.com.pl>.
-
-2008-11-12  Tor Andersson  <tor.andersson@gmail.com>
-
-       * src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field.
-       This fixes Savannah bug #24819.
-
-2008-11-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Remove #if 0/#endif guards
-       since OpenType version 1.5 has been released.
-
-       * include/ttnameid.h (TT_NAME_ID_WWS_FAMILY,
-       TT_NAME_ID_WWS_SUBFAMILY): New macros for OpenType 1.5.
-       (TT_URC_COPTIC, TT_URC_VAI, TT_URC_NKO, TT_URC_BALINESE,
-       TT_URC_PHAGSPA, TT_URC_NON_PLANE_0, TT_URC_PHOENICIAN,
-       TT_URC_TAI_LE, TT_URC_NEW_TAI_LUE, TT_URC_BUGINESE,
-       TT_URC_GLAGOLITIC, TT_URC_YIJING, TT_URC_SYLOTI_NAGRI,
-       TT_URC_LINEAR_B, TT_URC_ANCIENT_GREEK_NUMBERS, TT_URC_UGARITIC,
-       TT_URC_OLD_PERSIAN, TT_URC_SHAVIAN, TT_URC_OSMANYA,
-       TT_URC_CYPRIOT_SYLLABARY, TT_URC_KHAROSHTHI, TT_URC_TAI_XUAN_JING,
-       TT_URC_CUNEIFORM, TT_URC_COUNTING_ROD_NUMERALS, TT_URC_SUNDANESE,
-       TT_URC_LEPCHA, TT_URC_OL_CHIKI, TT_URC_SAURASHTRA, TT_URC_KAYAH_LI,
-       TT_URC_REJANG, TT_URC_CHAM, TT_URC_ANCIENT_SYMBOLS,
-       TT_URC_PHAISTOS_DISC, TT_URC_OLD_ANATOLIAN, TT_URC_GAME_TILES): New
-       macros for OpenType 1.5.
-
-2008-11-08  Wenlin Institute  <wenlin@wenlin.com>
-
-       * src/base/ftobjs.c (ft_glyphslot_free_bitmap): Protect against
-       slot->internal == NULL.  Reported by Graham Asher.
-
-2008-11-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (tt_face_get_name): Modified to return an error
-       code so that memory allocation problems can be distinguished from
-       missing table entries.  Reported by Graham Asher.
-       (GET_NAME): New macro.
-       (sfnt_load_face): Use it.
-
-2008-11-05  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Undefine
-       TT_CONFIG_OPTION_UNPATENTED_HINTING.  This fixes the return value of
-       `FT_Get_TrueType_Engine_Type' (and makes it work as documented).
-       Reported in bug #441638 of bugzilla.novell.com.
-
-       * docs/CHANGES: Document it.
-
-2008-11-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_subrs): Use an endless loop.  There are
-       fonts (like HELVI.PFB version 003.001, used on OS/2) which define
-       some `subrs' elements more than once.  Problem reported by Peter
-       Weilbacher <mozilla@weilbacher.org>.
-
-2008-10-15  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/sfnt/ttpost.c (tt_post_default_names): Add `const'.
-
-2008-10-15  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Disambiguate for
-       meddlesome compilers' warning against `for ( ...; ...; ...) ;'.
-
-2008-10-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_face_init): Remove compiler warning.
-       Suggested by Bram Tassyns in Savannah patch #6651.
-
-2008-10-12  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Fix computation of
-       `underline_position'.
-
-2008-10-12  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2008-10-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Fix Savannah bug #24468.
-
-       According to include/freetype/internal/ftobjs.h, the appropriate
-       type to interchange single character codepoint is FT_UInt32. It
-       should be distinguished from FT_UInt which can be 16bit integer.
-
-       * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Change the type
-       of the second argument `pcharcode' from FT_UInt* to FT_UInt32*.
-       (tt_cmap4_char_map_binary): Ditto.
-       (tt_cmap14_get_nondef_chars): Change the type of return value
-       from FT_UInt* to FT_UInt32*.
-
-2008-10-08  John Tytgat  <John.Tytgat@esko.com>
-
-       Fix Savannah bug #24485.
-
-       * src/type1/t1load.c (parse_charstrings): Assure that we always have
-       a .notdef glyph.
-
-2008-10-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Include FT_TRUETYPE_TAGS_H for multi build.
-       * builds/mac/ftmac.c: Ditto.
-
-2008-10-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/tttags.h (TTAG_TYP1, TTAG_typ1): Fix definitions.
-       * src/base/ftobjs.c: Include FT_TRUETYPE_TAGS_H.
-
-2008-10-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/sfnt/sfobjs.c (sfnt_open_font): Allow `typ1' version tag in
-       the beginning of sfnt container.
-       * src/sfnt/ttload.c (check_table_dir): Return
-       `SFNT_Err_Table_Missing' when sfnt table directory structure is
-       correct but essential tables for TrueType fonts (`head', `bhed' or
-       `SING') are missing.  Other errors are returned by
-       SFNT_Err_Unknown_File_Format.
-
-       * src/base/ftobjs.c (FT_Open_Face): When TrueType driver returns
-       `FT_Err_Table_Missing', try `open_face_PS_from_sfnt_stream'.  It is
-       enabled only when old mac font support is configured.
-
-2008-10-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/tttags.h (TTAG_CID, TTAG_FOND, TTAG_LWFN,
-       TTAG_POST, TTAG_sfnt, TTAG_TYP1, TTAG_typ1): New tags to simplify
-       the repeated calculations of these values in ftobjs.c and ftmac.c.
-       * src/base/ftobjs.c: Replace all FT_MAKE_TAG by new tags.
-       * src/base/ftmac.c: Ditto.
-       * builds/mac/ftmac.c: Ditto.
-
-2008-10-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (ft_lookup_PS_in_sfnt_stream): Remove wrong
-       initialization of *is_sfnt_cid.
-
-2008-10-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler
-       warnings.
-
-2008-10-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Replaced by...
-       (ft_lookup_PS_in_sfnt_stream): This.
-       (open_face_PS_from_sfnt_stream): New function.  It checks whether
-       the stream is sfnt-wrapped Type1 PS font or sfnt-wrapped CID-keyed
-       font, then try to open a face for given face_index.
-       (Mac_Read_sfnt_Resource): Replace the combination of
-       `ft_lookup_PS_in_sfnt' and `open_face_from_buffer' by
-       `open_face_PS_from_sfnt_stream'.
-       * src/base/ftmac.c (FT_New_Face_From_SFNT): Ditto.
-       * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto.
-       * src/base/ftbase.h: Remove `ft_lookup_PS_in_sfnt' and add
-       `open_face_PS_from_sfnt_stream'.
-
-2008-10-03  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Set *is_sfnt_cid to
-       FALSE if neither `CID ' nor `TYP1' is found in the sfnt container.
-
-2008-10-03  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/config/ftconfig.h: Define FT_MACINTOSH when SC or
-       MrC compiler of MPW is used.  These compilers do not define the
-       macro __APPLE__ by themselves.
-       * builds/unix/ftconfig.in: Ditto.
-       * builds/vms/ftconfig.h: Ditto.
-       * src/base/ftbase.c: Use FT_MACINTOSH instead of __APPLE__, to
-       include ftmac.c if FreeType 2 is built by MPW.
-       * src/base/ftobjs.c: Use FT_MACINTOSH instead of __APPLE__, to
-       enable shared functions for ftmac.c if FreeType 2 is built by MPW.
-
-       * builds/mac/ftmac.c: Include ftbase.h.
-       (memory_stream_close): Removed.
-       (new_memory_stream): Ditto.
-       (open_face_from_buffer): Removed.  Use the implementation in
-       ftobjs.c.
-       (ft_lookup_PS_in_sfnt): Ditto.
-
-       * builds/mac/FreeType.m68k_far.make.txt: Build ftmac.c as an
-       included part of ftbase.c, to share the functions in ftobjs.c.  The
-       rule compiling ftmac.c separately is removed and the rule copying
-       ftbase.c from src/base/ftbase.c to builds/mac/ftbase.c is added.
-       * builds/mac/FreeType.m68k_cfm.make.txt: Ditto.
-       * builds/mac/FreeType.ppc_classic.make.txt: Ditto.
-       * builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
-
-2008-10-02  Bram Tassyns  <bramt@enfocus.be>
-
-       * src/cff/cffgload.c (cff_slot_load): Map CID 0 to GID 0.  This
-       fixes Savannah bug #24430.
-
-2008-10-02  Werner Lemberg  <wl@gnu.org>
-
-       * builds/freetype.mk (BASE_H): Rename to...
-       (INTERNAL_H): This.
-       (FREETYPE_H): Updated.
-       * src/base/rules.mk: (BASE_OBJ_S, OBJ_DIR/%.$O): Add BASE_H.
-       * src/bdf/rules.mk (BDF_DRV_H): Add bdferror.h.
-       * src/cache/rules.mk (CACHE_DRV_H): Add ftccache.h and ftcsbits.h.
-       * src/pcf/rules.mk (PCF_DRV_H): Add pcfread.h.
-       * src/raster/rules.mk (RASTER_DRV_H): Add ftmisc.h.
-       * src/type42/rules.mk (T42_DRV_H): Add t42types.h.
-
-2008-10-02  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftbase.h: New file to declare the private utility
-       functions shared by the sources of base modules.  Currently,
-       `ft_lookup_PS_in_sfnt' and `open_face_from_buffer' are declared to
-       share between ftobjs.c and ftmac.c.
-
-       * src/base/rule.mk: Add ftbase.h.
-
-       * src/base/ftobjs.c: Include ftbase.h.
-       (memory_stream_close): Build on any platform when old MacOS font
-       support is enabled.
-       (new_memory_stream): Ditto.
-       (open_face_from_buffer): Build on any platform when old MacOS font
-       support is enabled.  The counting of the face in a font file is
-       slightly different between Carbon-dependent parser and Carbon-free
-       parser.  They are merged with the platform-specific conditional.
-       (ft_lookup_PS_in_sfnt): Ditto.
-
-       * src/base/ftmac.c: Include ftbase.h.
-       (memory_stream_close): Removed.
-       (new_memory_stream): Ditto.
-       (open_face_from_buffer): Removed.  Use the implementation in
-       ftobjs.c.
-       (ft_lookup_PS_in_sfnt): Ditto.
-
-2008-10-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): `psnames_error' is only needed
-       if TT_CONFIG_OPTION_POSTSCRIPT_NAMES is defined.
-
-2008-10-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttobjs.c (tt_face_done), src/cff/cffobjs.c
-       (cff_face_done), src/pfr/pfrobjs.c (pfr_face_done),
-       src/pcf/pcfdrivr.c (PCF_Face_Done), src/cid/cidobjs.c
-       (cid_face_done), src/bdf/bdfdrivr. (BDF_Face_Done),
-       src/sfnt/sfobjs.c (sfnt_face_done): Protect against face == 0.
-       Reported by Graham Asher.
-
-2008-09-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/rules.mk: Add conditional source to BASE_SRC, for `make
-       multi' on Mac OS X.  If the macro $(ftmac_c) is defined,
-       $(BASE_DIR)/$(ftmac_c) is added to BASE_SRC.  In a normal build, the
-       lack of ftmac.c in BASE_SRC is not serious because ftbase.c includes
-       ftmac.c.
-       * builds/unix/unix-def.in: Add a macro definition of $(ftmac_c).
-       * builds/unix/configure.raw: Add procedure to set up appropriate
-       value of $(ftmac_c) with the consideration of the availability of
-       Carbon framework.
-
-2008-09-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/Jamfile: Add target for multi build by jam on Mac OS X.
-       * src/base/ftobjs.c (FT_New_Face): Fix the condition to include this
-       function for MPW building.  It is synchronized the condition to
-       include ftmac.c source into ftbase.c.
-
-2008-09-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (CFF_Operator, cff_argument_counts,
-       cff_decoder_parse_charstrings): Handle (invalid)
-       `callothersubr' and `pop' instructions.
-
-2008-09-22  John Tytgat  <John.Tytgat@esko.com>
-
-       Fix Savannah bug #24307.
-
-       * include/freetype/internal/t1types.h (CID_FaceRec),
-       src/type42/t42types.h (T42_FaceRec): Comment out `afm_data'.
-
-2008-09-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/smooth/ftgrays.c (gray_raster_render): Don't dereference
-       `target_map' if FT_RASTER_FLAG_DIRECT is set.  Problem reported by
-       Stephan T. Lavavej <stl@nuwen.net>.
-
-2008-09-21  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/otvalid/Jamfile: Add missing target `otvmath' for multi build
-       by jam.
-       * src/sfnt/Jamfile: Add missing target `ttmtx' for multi build by
-       jam.
-
-2008-09-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/smooth/ftgrays.c (gray_find_cell): Fix threshold.  The values
-       passed to this function are already `normalized'.  Problem reported
-       by Stephan T. Lavavej <stl@nuwen.net>.
-
-       * docs/CHANGES: Document it.
-
-2008-09-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftoutln.c: Include FT_INTERNAL_DEBUG_H.
-       (FT_Outline_Decompose): Decorate with tracing messages.
-
-       * src/smooth/ftgrays.c [DEBUG_GRAYS]: Replace with
-       FT_DEBUG_LEVEL_TRACE.
-       [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: Include stdio.h and
-       stdarg.h.
-
-       (FT_TRACE) [_STANDALONE_]: Remove.
-       (FT_Message) [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: New function.
-       (FT_TRACE5, FT_TRACE7) [_STANDALONE_]: New macros.
-       (FT_ERROR) [_STANDALONE_]: Updated.
-
-       (gray_hline) [FT_DEBUG_LEVEL_TRACE]: Fix condition.
-       Use FT_TRACE7.
-       (gray_dump_cells): Make it `static void'.
-       (gray_convert_glyph): Use FT_TRACE7.
-
-       (FT_Outline_Decompose) [_STANDALONE_]: Synchronize with version in
-       ftoutln.c.
-
-       * src/base/ftadvanc.c (FT_Get_Advance, FT_Get_Advances): Use
-       FT_ERROR_BASE.
-
-       * docs/formats.txt: Updated.
-
-2008-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Import sfnt-wrapped Type1 and sfnt-wrapped
-       CID-keyed font support.
-       * builds/mac/ftmac.c: Ditto.
-
-2008-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Fix double free bug in
-       sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font support code.
-       `open_face_from_buffer' frees the passed buffer if it cannot open a
-       face from the buffer, so the caller must not free it.
-
-2008-09-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Add initial support
-       for sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font.
-       (ft_lookup_PS_in_sfnt): New function to look up `TYP1' or `CID '
-       table in sfnt table directory.  It is used before loading TrueType
-       font driver.
-
-       * docs/CHANGES: Add note about the current status of sfnt-wrapped
-       Type1 and sfnt-wrapped CID-keyed font support.
-
-2008-09-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftsystem.c (FT_Done_Memory): Use ft_sfree directly for
-       orthogonality (ft_free and ft_sfree could belong to different memory
-       pools).  This fixes Savannah bug #24297.
-
-2008-09-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/cff/cffobjs.c (cff_face_init): Use TTAG_OTTO defined
-       in ttags.h instead of numerical value 0x4F54544FL.
-
-2008-09-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.h, src/cff/cffgload.c
-       (cff_decoder_set_width_only): Eliminate function call.
-
-2008-09-15  George Williams  <gww@silcom.com>
-
-       Fix Savannah bug #24179, reported by Bram Tassyns.
-
-       * src/type1/t1load.c (mm_axis_unmap, T1_Get_MM_Var): Fix computation
-       of default values.
-
-2008-09-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/glnames.py (main): Surround `ft_get_adobe_glyph_index'
-       and `ft_adobe_glyph_list' with FT_CONFIG_OPTION_ADOBE_GLYPH_LIST to
-       prevent unconditional definition.  This fixes Savannah bug #24241.
-
-       * src/psnames/pstables.h: Regenerated.
-
-2008-09-13  Werner Lemberg  <wl@gnu.org>
-
-       * autogen.sh, builds/unix/configure.raw,
-       include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor
-       beautifying.
-
-       * include/freetype/ftadvanc.h, include/freetype/ftgasp.h,
-       include/freetype/ftlcdfil.h: Protect against FreeType 1.
-       Some other minor fixes.
-
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
-
-2008-09-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftbase.c: Include ftadvanc.c.
-
-2008-09-11  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/ftconfig.in: Duplicate the cpp computation of
-       FT_SIZEOF_{INT|LONG} from include/freetype/config/ftconfig.h.
-       (FT_USE_AUTOCONF_SIZEOF_TYPES): New macro.  If defined, the cpp
-       computation is disabled and the statically configured sizes are
-       used.  This fixes Savannah bug #21250.
-
-       * builds/unix/configure.raw: Add the checks to compare the cpp
-       computation results of the bit length of int and long versus the
-       sizes detected by running `configure'.  If the results are
-       different, FT_USE_AUTOCONF_SIZEOF_TYPES is defined to prioritize the
-       results.
-       New option --{enable|disable}-biarch-config is added to define or
-       undefine FT_USE_AUTOCONF_SIZEOF_TYPES manually.
-
-2008-09-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Clear FT2_EXTRA_LIBS when Carbon or
-       ApplicationService framework is missing.  Although this value is not
-       used in building of FreeType2, it is written in `freetype2.pc' and
-       `freetype-config'.
-
-2008-09-01  david turner  <david@freetype.org>
-
-       * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Accept a negative cmap
-       index to mean `use default cached FT_Face's charmap'.  This fixes
-       Savannah bug #22625.
-       * include/freetype/ftcache.h: Document it.
-
-
-       Make FT_MulFix an inlined function.  This is done to speed up
-       FreeType a little (on x86 3% when loading+hinting, 10% when
-       rendering, ARM savings are more important though).  Disable this by
-       undefining FT_CONFIG_OPTION_INLINE_MULFIX.
-
-       Use of assembler code can now be controlled with
-       FT_CONFIG_OPTION_NO_ASSEMBLER.
-
-       * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in
-       [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_arm): New assembler
-       implementation.
-       [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_i386): Assembler
-       implementation taken from `ftcalc.c'.
-       [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MULFIX_ASSEMBLER): New macro
-       which is defined to the platform-specific assembler implementation
-       of FT_MulFix.
-       [FT_CONFIG_OPTION_INLINE_MULFIX && FT_MULFIX_ASSEMBLER]
-       (FT_MULFIX_INLINED): New macro.
-
-       * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_NO_ASSEMBLER,
-       FT_CONFIG_OPTION_INLINE_MULFIX): New macros.
-
-       * include/freetype/freetype.h: Updated to handle FT_MULFIX_INLINED.
-
-       * src/base/ftcalc.c: Updated to use FT_MULFIX_ASSEMBLER and
-       FT_MULFIX_INLINED.
-
-
-       Add a new header named FT_ADVANCES_H declaring some new APIs to
-       extract the advances of one or more glyphs without necessarily
-       loading their outlines.  Also provide `fast loaders' for the
-       TrueType, Type1, and CFF font drivers (more to come later).
-
-       * src/base/ftadvanc.c, include/freetype/ftadvanc.h: New files.
-
-       * include/freetype/config/ftheader.h (FT_ADVANCES_H): New macro.
-       * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): New macro.
-
-       * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc):
-       `flags' and `advances' are now of type `FT_UInt' and `FT_Fixed',
-       respectively.
-
-       * src/base/Jamfile (_sources), src/base/rules.mk (BASE_SRC): Add
-       ftadvanc.c.
-
-       * src/cff/cffdrivr.c (cff_get_advances): New function.
-       (cff_driver_class): Register it.
-
-       * src/cff/cffgload.c (cff_decoder_set_width_only): New function.
-       (cff_decoder_parse_charstrings): Handle `width_only'.
-       (cff_slot_load): Handle FT_LOAD_ADVANCE_ONLY.
-
-       * src/cff/cffgload.h (cff_decoder): New element `width_only'.
-       (cff_decoder_set_width_only): New declaration.
-
-       * src/truetype/ttdriver.c (tt_get_advances): New function.
-       (tt_driver_class): Register it.
-
-       * src/truetype/ttgload.c (Get_HMetrics, Get_VMetrics): Renamed to...
-       (TT_Get_HMetrics, TT_Get_VMetrics): This.
-       Update callers.
-       * src/truetype/ttgload.h: Declare them.
-
-       * src/type1/t1gload.h, src/type1/t1gload.c (T1_Get_Advances): New
-       function.
-       * src/type1/t1driver.c (t1_driver_class): Register T1_Get_Advances.
-
-
-       Add checks for minimum version of the `autotools' stuff.
-
-       * autogen.sh: Implement it.
-       (get_major_version, get_minor_version, get_patch_version,
-       compare_to_minimum_version, check_tool_version): New auxiliary
-       functions.
-
-       * README.CVS: Document it.
-
-2008-08-29  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/sfnt/sfobjs.c (sfnt_open_font): Use TTAG_OTTO defined in
-       ttags.h instead of FT_MAKE_TAG( 'O', 'T', 'T', 'O' ).
-
-2008-08-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_encoding): Protect against infinite
-       loop.  This fixes Savannah bug #24150 (where a patch has been posted
-       too).
-
-2008-08-23  Werner Lemberg  <wl@gnu.org>
-
-       * src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c
-       (afm_compare_kern_pairs): Fix comparison.  This fixes Savannah bug
-       #24119.
-
-2008-08-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c (FT_Stream_New): Initialize *astream always,
-       even if passed library or arguments are invalid.  This fixes a bug
-       that an uninitialized stream is freed when an invalid library handle
-       is passed.  Originally proposed by Mike Fabian, 2008/08/18 on
-       freetype-devel.
-       (FT_Open_Face): Ditto (stream).
-       (load_face_in_embedded_rfork): Ditto (stream2).
-
-2008-08-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Add a fallback to guess the availability of the
-       `ResourceIndex' type.  It is used when built without configure
-       (e.g., a build with Jam).
-       * builds/mac/ftmac.c: Ditto.
-       * builds/unix/configure.raw: Set HAVE_TYPE_RESOURCE_INDEX to 1 or 0
-       explicitly, even if `ResourceIndex' is unavailable.
-
-2008-08-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: In checking of Mac OS X features,
-       all-in-one header file `Carbon.h' is replaced by the minimum
-       header file `CoreServices.h', similar to current src/base/ftmac.c.
-
-2008-08-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/sfnt/ttcmap.c (tt_cmap2_validate): Skip the validation of
-       sub-header when its code_count is 0.  Many Japanese Dynalab fonts
-       include such an empty sub-header (code_count == 0, first_code == 0
-       delta == 0, but offset != 0) as the second sub-header in SJIS cmap.
-
-2008-08-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1tokens.h: Handle `ForceBold' keyword.  This fixes
-       Savannah bug #23995.
-
-       * src/cid/cidload.c (parse_expansion_factor): New callback function.
-       (cid_field_records): Use it for `ExpansionFactor'.
-       * src/cod/cidtoken.h: Handle `ForceBold' keyword.
-       Don't handle `ExpansionFactor'.
-
-2008-08-04  Bram Tassyns  <bramt@enfocus.be>
-
-       * src/cff/cffparse.c (cff_parse_fixed_scaled): Fix thinko which
-       resulted in incorrect scaling.  This fixes Savannah bug #23973.
-
-2008-08-04  Werner Lemberg  <wl@gnu.org>
-
-       Be more tolerant w.r.t. invalid entries in SFNT table directory.
-
-       * src/sfnt/ttload.c (check_table_dir): Ignore invalid entries and
-       adjust table count.
-       Add more trace messages.
-       (tt_face_load_font_dir): Updated.
-
-2008-07-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings): No longer
-       assume that the first argument on the stack is the bottom-most
-       element.  Two reasons:
-
-         o According to people from Adobe it is missing in the Type 2
-           specification that pushing of additional, superfluous arguments
-           on the stack is prohibited.
-
-         o Acroread in general handles fonts differently, namely by popping
-           the number of arguments needed for a particular operand (as a PS
-           interpreter would do).  In case of buggy fonts this causes a
-           different interpretation which of the elements on the stack are
-           superfluous and which not.
-
-       Since there are CFF subfonts (embedded in PDFs) which rely on
-       Acroread's behaviour, FreeType now does the same.
-
-2008-07-27  Werner Lemberg  <wl@gnu.org>
-
-       Add extra mappings for `Tcommaaccent' and `tcommaaccent'.  This
-       fixes Savannah bug #23940.
-
-       * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): Rename to...
-       (EXTRA_GLYPH_LIST_SIZE): This.
-       Increase by 2.
-       (ft_wgl_extra_unicodes): Rename to...
-       (ft_extra_glyph_unicodes): This.
-       Add two code values.
-       (ft_wgl_extra_glyph_names): Rename to...
-       (ft_extra_glyph_names): This.
-       Add two glyphs.
-       (ft_wgl_extra_glyph_name_offsets): Rename to...
-       (ft_extra_glyph_name_offsets): This.
-       Add two offsets.
-
-       (ps_check_wgl_name, ps_check_wgl_unicode): Rename to...
-       (ps_check_extra_glyph_name, ps_check_extra_glyph_unicode): This.
-       Updated.
-       (ps_unicodes_init): Updated.
-
-2008-07-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_decoder_prepare,
-       cff_decoder_parse_charstrings): Improve debug output.
-
-2008-07-22  Martin McBride  <mmcbride@emtex.com>
-
-       * src/sfnt/ttcmap.c (tt_cmap4_validate, tt_cmap4_char_map_linear,
-       tt_cmap4_char_map_binary): Handle fonts which treat the last segment
-       specially.  According to the specification, such fonts would be
-       invalid but acroread accepts them.
-
-2008-07-16  Jon Foster  <Jon.Foster@cabot.co.uk>
-
-       * src/pfr/pfrdrivr.c (pfr_get_advance): Fix off-by-one error.
-
-       * src/base/ftcalc.c (FT_MulFix): Fix portability issue.
-
-       * src/sfnt/ttpost.c (MAC_NAME) [!FT_CONFIG_OPTION_POSTSCRIPT_NAMES]:
-       Fix compiler warning.
-
-2008-07-16  Werner Lemberg  <wl@gnu.org>
-
-       Handle CID-keyed fonts wrapped in an SFNT (with cmaps) correctly.
-
-       * src/cff/cffload.c (cff_font_load): Pass `pure_cff'.
-       Invert sids table only if `pure_cff' is set.
-       * src/cff/cffload.h: Udpated.
-
-       * src/cff/cffobjs.c (cff_face_init): Updated.
-       Set FT_FACE_FLAG_CID_KEYED only if pure_cff is set.
-
-       * docs/CHANGES: Updated.
-
-2008-07-09  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttpload.c (tt_face_load_loca): Handle buggy fonts
-       where num_locations < num_glyphs.  Problem reported by Ding Li.
-
-2008-07-05  Werner Lemberg  <wl@gnu.org>
-
-       Since FreeType uses `$(value ...)', we now need GNU make 3.80 or
-       newer.  This fixes Savannah bug #23648.
-
-       * configure: zsh doesn't like ${1+"$@"}.
-       Update needed GNU make version.
-       * builds/toplevel.mk: Check for `$(eval ...)'.
-       * docs/INSTALL.GNU, docs/INSTALL.CROSS, docs/INSTALL.UNIX: Document
-       it.
-
-2008-07-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (Draw_Sweep): If span is smaller than one
-       pixel, only check for dropouts if neither start nor end point lies
-       on a pixel center.  This fixes Savannah bug #23762.
-
-2008-06-29  Werner Lemberg  <wl@gnu.org>
-
-       * Version 2.3.7 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-7'.
-
-       * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
-       version number to 2.3.7.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.6/2.3.7/, s/236/237/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7.
-
-       * builds/unix/configure.raw (version_info): Set to 9:18:3.
-
-       * docs/release: Updated.
-
-2008-06-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/ftglyph.c (FT_Matrix_Multiply, FT_Matrix_Invert): Move to...
-       * src/ftcalc.c: Here.  This fixes Savannah bug #23729.
-
-2008-06-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
-       Horizontal_Gray_Sweep_Drop): Test for intersections which
-       degenerate to a single point can be ignored; this has been confirmed
-       by Greg Hitchcock from Microsoft.  (This was commented out code.)
-
-2008-06-26  Werner Lemberg  <wl@gnu.org>
-
-       Improve navigation in API reference.
-
-       * src/tools/docmaker/tohtml.py (html_header_3): Renamed to...
-       (html_header_6): This.
-       (html_header_3, html_header_3i, html_header_4, html_header_5,
-       html_header_5t): New strings.
-       (toc_footer_start, toc_footer_end): New strings.
-       (HtmlFormatter::html_header): Updated.
-       (HtmlFormatter::html_index_header, HtmlFormatter::html_toc_header):
-       New strings.
-       (HtmlFormatter::index_enter): Use `html_index_header'.
-       (HtmlFormatter::index_exit): Print `html_footer'.
-       (HtmlFormatter::toc_enter): Use `html_toc_header'.
-       (HtmlFormatter::toc_exit): Print proper footer.
-
-       Convert ~ to non-breakable space.
-
-       * src/tools/docmaker/tohtml.py (make_html_para): Implement it.
-       Update header files accordingly.
-
-2008-06-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Check type `ResourceIndex' explicitly
-       and define HAVE_TYPE_RESOURCE_INDEX if it is defined.  Mac OS X 10.5
-       bundles 10.4u SDK with MAC_OS_X_VERSION_10_5 macro but without
-       ResourceIndex type definition.  The macro does not inform the type
-       availability.
-       * src/base/ftmac.c: More parentheses are inserted to clarify the
-       conditionals to disable legacy APIs in `10.5 and later' cases.  If
-       HAVE_TYPE_RESOURCE_INDEX is not defined, ResourceIndex is defined.
-
-2008-06-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (Ins_SCANTYPE): Don't check rendering
-       mode.
-
-       * src/raster/ftraster.c (Render_Glyph, Render_Gray_Glyph,
-       Draw_Sweep): No-dropout mode is value 2, not value 0.
-       (Draw_Sweep): Really skip dropout handling for no-dropout mode.
-
-2008-06-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psobjs.c (t1_builder_close_contour): Don't add contour
-       if it consists of one point only.  Based on a patch from Savannah
-       bug #23683 (from John Tytgat).
-
-2008-06-22  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (TT_Load_Glyph): Protect bytecode stuff
-       with IS_HINTED.
-
-       * docs/CHANGES: Updated.
-
-2008-06-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: If CFLAGS has `-isysroot XXX' option
-       but LDFLAGS does not, import it to LDFLAGS.  The option is used to
-       specify non-default SDK on Mac OS X (e.g., universal binary SDK for
-       Mac OS X 10.4 on PowerPC platform).  Although Apple TechNote 2137
-       recommends to add the option only to CFLAGS, LDFLAGS should include
-       it because libfreetype.la is built with -no-undefined.  This fixes a
-       bug reported by Ryan Schmidt in MacPorts,
-       http://trac.macports.org/ticket/15331.
-
-2008-06-21  Werner Lemberg  <wl@gnu.org>
-
-       Enable access to the various dropout rules of the B&W rasterizer.
-       Pass dropout rules from the TT bytecode interpreter to the
-       rasterizer.
-
-       * include/freetype/ftimage.h (FT_OUTLINE_SMART_DROPOUTS,
-       FT_OUTLINE_EXCLUDE_STUBS): New flags for FT_Outline.
-
-       * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
-       Horizontal_Gray_Sweep_Drop): Use same mode numbers as given in the
-       OpenType specification.
-       Fix mode 4 computation.
-       (Render_Glyph, Render_Gray_Glyph): Handle new outline flags.
-
-       * src/truetype/ttgload.c (TT_Load_Glyph) Convert scan conversion
-       mode to FT_OUTLINE_XXX flags.
-
-       * src/truetype/ttinterp.c (Ins_SCANCTRL): Enable ppem check.
-
-2008-06-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffobjs.c (cff_face_init): Compute final
-       `dict->units_per_em' value before assigning it to
-       `cffface->units_per_EM'.  Otherwise, CFFs without subfonts are
-       scaled incorrectly if the font matrix is non-standard.  This fixes
-       Savannah bug #23630.
-
-       * docs/CHANGES: Updated.
-
-2008-06-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/type/t1objs.c (T1_Face_Init): Slightly improve algorithm fix
-       from 2008-06-19.
-
-2008-06-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/type/t1objs.c (T1_Face_Init): Fix change from 2008-03-21.
-       Reported by Peter Weilbacher <mozilla@weilbacher.org>.
-
-       * docs/CHANGES: Updated.
-
-2008-06-15  George Williams  <gww@silcom.com>
-
-       * src/otvalid/otvgpos.c (otv_MarkBasePos_validate): Set
-       `valid->extra2' to 1.  This is undocumented in the OpenType 1.5
-       specification.
-
-2008-06-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftcalc.c (FT_MulFix) <asm>: Protect registers correctly
-       from clobbering.  Patch from Savannah bug report #23556.
-
-       * docs/CHANGES: Document it.
-
-2008-06-10  Werner Lemberg  <wl@gnu.org>
-
-       * autogen.sh: Add option `--install' to libtoolize.
-
-2008-06-10  Werner Lemberg  <wl@gnu.org>
-
-       * Version 2.3.6 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-6'.
-
-       * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
-       version number to 2.3.6.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.5/2.3.6/, s/235/236/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6.
-
-       * builds/unix/configure.raw (version_info): Set to 9:17:3.
-
-
-       * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `scale_x'
-       and `scale_y'.
-       * src/cff/cffgload.h (CFF_Builder): Remove `scale_x' and `scale_y'.
-
-
-       * src/cff/cffparse.c: Include FT_INTERNAL_DEBUG_H.
-       * src/cff/cffobjs.h: Include FT_INTERNAL_POSTSCRIPT_HINTS_H.
-
-2008-06-10  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (open_face): Check `clazz->init_face' and
-       `clazz->done_face'.
-
-2008-06-09  VaDiM  <s_sliva@rambler.ru>
-
-       Support debugging on WinCE.  From Savannah patch #6536; this fixes
-       bug #23497.
-
-       * builds/win32/ftdebug.c (OutputDebugStringEx): New function/macro
-       as a replacement for OutputDebugStringA (which WinCE doesn't have).
-       Update all callers.
-       (ft_debug_init) [_WIN32_CE]: WinCE apparently doesn't have
-       environment variables.
-
-2008-06-09  Werner Lemberg  <wl@gnu.org>
-
-       * README.CVS: Updated.
-
-       * builds/unix/configure.raw, builds/unix/freetype-config.in: Updated
-       for newer versions of autoconf and friends.
-
-2008-06-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1parse.h (T1_ParserRec): Make `base_len' and
-       `private_len' unsigned.
-
-       * src/type1/t1parse.c (read_pfb_tag): Make `asize' unsigned and read
-       it as such.
-       (T1_New_Parser, T1_Get_Private_Dict): Make `size' unsigned.
-
-
-       * src/base/ftstream.c (FT_Stream_Skip): Reject negative values.
-
-
-       * src/type1/t1load.c (parse_blend_design_positions): Check `n_axis'
-       for sane value.
-       Fix typo.
-
-
-       * src/psaux/psobjs.c (ps_table_add): Check `idx' correctly.
-
-
-       * src/truetype/ttinterp (Ins_SHC): Use BOUNDS() to check
-       `last_point'.
-
-
-       * src/sfnt/ttload.c (tt_face_load_max_profile): Limit
-       `maxTwilightPoints'.
-
-2008-06-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (Ins_IP): Handle case `org_dist == 0'
-       correctly.  This fixes glyphs `t' and `h' of Arial Narrow at 12ppem.
-
-2008-06-03  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ftcache.h (FTC_FaceID): Change type back to
-       FT_Pointer.  Reported by Ian Britten <britten@caris.com>.
-
-2008-06-02  Werner Lemberg  <wl@gnu.org>
-
-       Emit header info for defined FreeType objects in reference.
-
-       * src/tools/docmaker/content.py (re_header_macro): New regexp.
-       (ContentProcessor::__init__): Initialize new dictionary `headers'.
-       (DocBlock::__init__): Collect macro header definitions.
-
-       * src/tools/docmaker/tohtml.py (header_location_header,
-       header_location_footer): New strings.
-       (HtmlFormatter::__init__): Pass `headers' dictionary.
-       (HtmlFormatter::print_html_field): Don't emit paragraph tags.
-       (HtmlFormatter::print_html_field_list): Emit empty paragraph.
-       (HtmlFormatter::block_enter): Emit header info.
-
-2008-06-01  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftheader.h (FT_UNPATENTED_HINTING_H,
-       FT_INCREMENTAL_H): Added.
-
-2008-05-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/docmaker/sources.py (SourceBlock::__init__): While
-       looking for markup tags, return immediately as soon a single one is
-       found.
-
-2008-05-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (Ins_MD): The MD instruction also uses
-       original, unscaled input values.  Confirmed by Greg Hitchcock from
-       Microsoft.
-
-2008-05-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/docmaker/tohtml.py (block_footer_start,
-       block_footer_middle): Beautify output.
-
-2008-05-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (fc_black_render): Return 0 when we are
-       trying to render into a zero-width/height bitmap, not an error code.
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Move initialization
-       of the graphics state for subglyphs to...
-       (TT_Hint_Glyph): This function.
-       Hinting instructions for a composite glyph apparently refer to the
-       just hinted subglyphs, not the unhinted, unscaled outline.  This
-       seems to fix Savannah bugs #20973 and (at least partially) #23310.
-
-2008-05-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (FT_New_Face_From_Suitcase): Check if valid
-       `aface' is returned by FT_New_Face_From_FOND().  The patch was
-       proposed by an anonymous reporter of Savannah bug #23204.
-
-2008-05-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/pshinter/pshalgo.c (ps_hints_apply): Reset scale values after
-       correction for pixel boundary.  Without this patch, the effect can
-       be cumulative under certain circumstances, making glyphs taller and
-       taller after each call.  This fixes Savannah bug #19976.
-
-2008-05-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftdebug.c (FT_Message, FT_Panic): Send output to stderr.
-       This fixes Savannah bug #23280.
-
-       * docs/CHANGES: Updated.
-
-2008-05-18  David Turner  <david@freetype.org>
-
-       * src/psnames/psmodule.c (ft_wgl_extra_unicodes,
-       ft_wgl_extra_glyph_names, ft_wgl_extra_glyph_name_offsets,
-       ps_check_wgl_name, ps_check_wgl_unicode): Use `static' to make
-       declarations non-global.
-
-       * src/type1/t1load.c: Add missing comment.
-
-2008-05-17  Sam Hocevar  <samh>
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle zero-contour
-       glyphs correctly.  Patch from Savannah bug #23277.
-
-2008-05-16  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2008-05-16  Sergey Tolstov  <stolstov@esri.com>
-
-       Improve support for WGL4 encoded fonts.
-
-       * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): New macro.
-       (ft_wgl_extra_unicodes, ft_wgl_extra_glyph_names,
-       ft_wgl_extra_glyph_name_offsets): New arrays.
-       (ps_check_wgl_name, ps_check_wgl_unicode): New functions.
-       (ps_unicodes_init): Use them to add additional Unicode mappings.
-
-2008-05-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
-       <op_closepath>: `closepath' without a path is a no-op, not an error
-       (cf. the PS reference manual).
-
-       Reported by Martin McBride.
-
-2008-05-15  Werner Lemberg  <wl@gnu.org>
-
-       * builds/toplevel.mk (CONFIG_GUESS, CONFIG_SUB): Updated.
-
-2008-05-15  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_subrs): Accept fonts with a subrs array
-       which contains a single but empty entry.  This is technically
-       invalid (since it must end with `return'), but...
-
-       Reported by Martin McBride.
-
-2008-05-14  Werner Lemberg  <wl@gnu.org>
-
-       Finish fix of scaling bug of CID-keyed CFF subfonts.
-
-       * include/freetype/internal/ftcalc.h, src/base/ftcalc.c
-       (FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled): New
-       functions.
-
-       * src/cff/cffobjs.h (CFF_Internal): New struct.  It is used to
-       provide global hinting data for both the top-font and all subfonts
-       (with proper scaling).
-
-       * src/cff/cffobjs.c (cff_make_private_dict): New function, using
-       code from `cff_size_init'.
-       (cff_size_init, cff_size_done, cff_size_select, cff_size_request):
-       Use CFF_Internal and handle subfonts.
-       (cff_face_init): Handle top-dict and subfont matrices correctly;
-       apply some heuristic in case of unlikely matrix concatenation
-       results.  This has been discussed with people from Adobe (thanks
-       goes mainly to David Lemon) who confirm that the CFF specs are fuzzy
-       and not correct.
-
-       * src/cff/cffgload.h (cff_decoder_prepare): Add `size' argument.
-
-       * src/cff/cffgload.c (cff_builder_init): Updated.
-       (cff_decoder_prepare): Handle hints globals for subfonts.
-       Update all callers.
-       (cff_slot_load): Handling scaling of subfonts properly.
-
-       * src/cff/cffparse.c (cff_parse_fixed_dynamic): New function.
-       (cff_parse_font_matrix): Use it.
-
-       * src/cff/cfftypes.h (CFF_FontDictRec): Make `units_per_em'
-       FT_ULong.
-
-       * docs/CHANGES: Document it.
-
-2008-05-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/winfonts/winfnt.c (fnt_face_get_dll_font, FNT_Face_Init):
-       Handle case `face_index < 0'.
-       * docs/CHANGES: Document it.
-
-2008-05-04  Werner Lemberg  <wl@gnu.org>
-
-       First steps to fix the scaling bug of CID-keyed CFF subfonts,
-       reported by Ding Li on 2008/03/28 on freetype-devel.
-
-       * src/base/cff/cffparse.c (power_tens): New array.
-       (cff_parse_real): Rewritten to introduce a fourth parameter which
-       returns the `scaling' of the real number so that we have no
-       precision loss.  This is not used yet.
-       Update all callers.
-       (cff_parse_fixed_thousand): Replace with...
-       (cff_parse_fixed_scaled): This function.  Update all callers.
-
-2008-05-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Call the auto-hinter without
-       transformation since it recursively calls FT_Load_Glyph.  This fixes
-       Savannah bug #23143.
-
-2008-04-26  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/internal/psaux.h (T1_BuilderRec): Mark `scale_x'
-       and `scale_y' as obsolete since they aren't used.
-       * src/psaux/psobjs.c (t1_builder_init): Updated.
-
-       * src/cff/cffgload.h (CFF_Builder): Mark `scale_x' and `scale_y' as
-       obsolete since they aren't used.
-       * src/cff/cffgload.c (cff_builder_init): Updated.
-
-2008-04-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/pcf/pcfdrivr.c (PCF_Face_Init): Protect call to
-       `FT_Stream_OpenLZW' with `FT_CONFIG_OPTION_USE_LZ'.  From Savannah
-       bug #22909.
-
-2008-04-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if
-       integer part is zero.
-
-2008-04-01  Werner Lemberg  <wl@gnu.org>
-
-       Fix compilation with g++ 4.1 (with both `single' and `multi'
-       targets).
-
-       * src/base/ftobjs.c (FT_Open_Face): Don't define a variable in block
-       which is crossed by a `goto'.
-
-       * src/otvalid/otvalid.h (otv_MATH_validate): Add prototype.
-
-2008-03-31  Werner Lemberg  <wl@gnu.org>
-
-       Fix support for subsetted CID-keyed CFFs.
-
-       * include/freetype/freetype.h (FT_FACE_FLAG_CID_KEYED,
-       FT_IS_CID_KEYED): New macros.
-
-       * src/cff/cffobjs.c (cff_face_init): Set number of glyphs to the
-       maximum CID value in CID-keyed CFFs.
-       Handle FT_FACE_FLAG_CID_KEYED flag.
-
-       * docs/CHANGES: Document it.
-
-
-       Fix CFF font matrix calculation and improve precision.
-
-       * src/cff/cffparse.c (cff_parse_real): Increase precision if integer
-       part is zero.
-       (cff_parse_font_matrix): Simplify computation of `units_per_em';
-       this prevents overflow also.
-
-
-       Support FT_Get_CID_Registry_Ordering_Supplement for PS CID fonts.
-
-       * src/cid/cidriver.c: Include FT_SERVICE_CID_H.
-       (cid_get_ros): New function.
-       (cid_service_cid_info): New service structure.
-       (cid_services): Register it.
-
-2008-03-23  Werner Lemberg  <wl@gnu.org>
-
-       Adjustments for Visual C++ 8.0, as reported by Rainer Deyke.
-
-       * builds/compiler/visualc.mk (CFLAGS): Remove /W5.
-       (ANSIFLAGS): Add _CRT_SECURE_NO_DEPRECATE.
-
-2008-03-21  Laurence Darby  <ldarby>
-
-       * src/type1/t1objs.c (T1_Face_Init): Use `/Weight'.  Patch from
-       Savannah bug #22675.
-
-2008-03-13  Derek Clegg  <dclegg@apple.com>
-
-       * src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix named style loop.
-       Patch from Savannah bug #22541.
-
-2008-03-03  Masatoshi Kimura  <VYV03354@nifty.ne.jp>
-
-       * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary,
-       tt_cmap14_find_variant): Return correct value.
-       (tt_cmap14_variant_chars): Fix check for `di'.
-
-2008-02-29  Wermer Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2008-02-29  Wolf
-
-       Add build support for symbian platform.  From Savannah bug #22440.
-
-       * builds/symbian/*: New files.
-
-2008-02-21  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (parse_fond): Fix a bug of PostScript font name
-       synthesis.  For any face of a specified FOND, always the name for
-       the first face was used.  Except of a FOND that refers multiple
-       Type1 font files, wrong synthesized font names are not used at all,
-       so this is an invisible bug.  A few limit checks are added too.
-
-       * builds/mac/ftmac.c: Ditto.
-
-2008-02-21  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Split compiler option to link Carbon
-       frameworks to one option for CoreServices framework and another
-       option for ApplicationServices framework.  The split options can be
-       managed by GNU libtool to avoid unrequired duplication when FreeType
-       is linked with other applications.  Suggested by Daniel Macks,
-       Savannah bug #22366.
-
-2008-02-18  Victor Stinner  <victor.stinner@haypocalc.com>
-
-       * src/truetype/ttinterp.c (Ins_IUP): Check number of points.  Fix
-       from Savannah bug #22356.
-
-2008-02-17  Jonathan Blow  <jon@number-none.com>
-
-       * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
-       Check for valid callback pointers.
-
-2008-02-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (FT_New_Face_From_SFNT): Check the sfnt resource
-       handle by its value instead of ResError(), fix provided by Deron
-       Kazmaier.  According to the Resource Manager Reference,
-       GetResource(), Get1Resource(), GetNamedResource(),
-       Get1NamedResource() and RGetResource() set noErr but return NULL
-       handle when they can not find the requested resource.  These
-       functions never return undefined values, so it is sufficient to
-       check if the handle is not NULL.
-
-       * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto.
-
-2008-02-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftbase.c: <ftmac.c> is replaced by "ftmac.c" as other
-       inclusion styles.  Now it always includes src/base/ftmac.c;
-       builds/mac/ftmac.c is never included in any configuration.
-
-       * builds/unix/configure.raw: Print warning if configure is executed
-       with options to specify Carbon functionalities explicitly.
-
-       * docs/INSTALL.MAC: Note that legacy builds/mac/ftmac.c is not
-       included automatically and manual replacement is required.
-
-2008-02-11  Werner Lemberg  <wl@gnu.org>
-
-       * builds/modules.mk (CLOSE_MODULE, REMOVE_MODULE), builds/detect.mk
-       (dos_setup), builds/freetype.mk (clean_project_dos,
-       distclean_project_dos): Don't use \ but $(SEP).  Reported by Duncan
-       Murdoch.
-
-2008-01-18  Sylvain Pasche  <sylvain.pasche@gmail.com>
-
-       * src/base/ftlcdfil.c (_ft_lcd_filter_legacy): Updated comment to
-       mention intra-pixel algorithm.
-
-       * include/freetype/freetype.h (FT_Render_Mode): Mention that
-       FT_Library_SetLcdFilter can be used to reduce fringes.
-
-2008-01-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (ft_black_render): Check `outline' before
-       using it.  Reported by Allan Yang.
-
-2008-01-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (FT_CONFIG_OPTION_5_GRAY_LEVELS): Remove.
-
-2008-01-12  Allan Yang, Jian Hua - SH  <Allan.Yang@fmc.fujitsu.com>
-
-       * src/raster/ftraster.c (ft_black_init)
-       [FT_RASTER_OPTION_ANTI_ALIASING]: Fix compilation.
-
-2008-01-10  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Handle the case
-       where the number of contours in a simple glyph is zero (and which
-       does contain an entry in the `glyf' table).  This fixes Savannah bug
-       #21990.
-
-2008-01-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Formatting suggested by Sean McBride.
-
-       * builds/mac/ftmac.c: Formatting (tab expanded).
-       * src/autofit/afindic.c: Ditto.
-       * src/base/ftcid.c: Ditto.
-       * src/base/ftmac.c: Ditto.
-
-2007-12-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/smooth/ftgrays.c (gray_raster_render): Check `outline'
-       correctly.
-
-2007-12-21  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Improvement of POSIX resource-fork accessor to load unsorted
-       references in a resource.  In HelveLTMM (resource-fork PostScript
-       Type1 font bundled with Mac OS X since 10.3.x), the appearance order
-       of PFB chunks is not sorted; sorting the chunks by reference IDs is
-       required.
-
-       * include/freetype/internal/ftrfork.h (FT_RFork_Ref): New structure
-       type to store a pair of reference ID and offset to the chunk.
-
-       * src/base/ftrfork.c (ft_raccess_sort_ref_by_id): New function to
-       sort FT_RFork_Ref by their reference IDs.
-
-       (FT_Raccess_Get_DataOffsets): Returns an array of offsets that is
-       sorted by reference ID.
-
-2007-12-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffparse.c (cff_parse_real): Don't apply `power_ten'
-       division too early; otherwise the most significant digit(s) of the
-       final result are lost as the value is truncated to an integer.  This
-       fixes Savannah bug #21794 (where the patch has been posted too).
-
-2007-12-06  Fix  <4d876b82@gmail.com>
-
-       Pass options from one configure script to another as-is (not
-       expanded).  This is needed for options like
-       --includedir='${prefix}/include'.
-
-       * builds/unix/detect.mk, configure: Prevent argument expansion in
-       call to the (real) `configure' script.
-
-2007-12-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fix compilation if
-       TT_USE_BYTECODE_INTERPRETER isn't defined.
-
-2007-12-06  Werner Lemberg  <wl@gnu.org>
-
-       There exist CFFs which contain opcodes for the Type 1 operators
-       `hsbw' and `closepath' which are both invalid in Type 2 charstrings.
-       However, it doesn't harm to support them.
-
-       * src/cff/cffgload.c (CFF_Operator): Add `cff_op_hsbw' and
-       `cff_op_closepath.'
-       (cff_argument_counts): Ditto.
-
-       (cff_decoder_parse_charstrings): Handle Type 1 opcodes 9 (closepath)
-       and 13 (hsbw) which are invalid in Type 2 charstrings.
-
-2007-12-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftrfork.c (raccess_guess_darwin_newvfs): New function to
-       support new pathname syntax `..namedfork/rsrc' to access a resource
-       fork on Mac OS X.  The legacy syntax `/rsrc' does not work on
-       case-sensitive HFS+.
-       (raccess_guess_darwin_hfsplus): Fix a bug in the calculation of
-       buffer size to store a pathname.
-       * include/freetype/internal/ftrfork.h: Increment the number of
-       resource fork guessing rule.
-
-2007-12-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Improve the compile tests to search
-       Carbon functions.
-       * builds/mac/ftmac.c: Import fixes for Carbon incompatibilities
-       proposed by Sean McBride from src/base/ftmac.c (see 2007-11-16).
-
-2007-12-06  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       The documents and comments for Mac OS X are improved by Sean
-       McBride.
-
-       * src/base/ftmac.c: Fix a comment.
-       * include/freetype/ftmac.h: Ditto.
-       * docs/INSTALL.MAC: Improve English and add comment on lowest
-       system version specified by MACOSX_DEPLOYMENT_TARGET.
-
-2007-12-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_subfont_load): Don't use logical OR to
-       concatenate error codes.
-       * src/sfnt/ttsbit.c (Load_SBit_Range): Ditto.
-
-2007-12-04  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/truetype/ttobjs.c (tt_face_init): Don't use logical OR to
-       concatenate error codes.
-
-2007-12-04  Sean McBride  <sean@rogue-research.com>
-
-       * src/pfr/pfrgload.c (pfr_glyph_load_compound): Remove compiler
-       warning.
-
-2007-11-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Fix MacOS legacy font support by Masatake Yamato on Mac OS X.  It is
-       not working since 2.3.5.  In FT_Open_New(), if FT_New_Stream()
-       cannot mmap() the specified file and cannot seek to head of the
-       specified file, it returns NULL stream and FT_Open_New() returns the
-       error immediately.  On MacOS, most legacy MacOS fonts fall into such
-       a scenario because their data forks are zero-sized and cannot be
-       sought.  To proceed to guessing of resource fork fonts, the
-       functions for legacy MacOS font must properly handle the NULL stream
-       returned by FT_New_Stream().
-
-       * src/base/ftobjs.c (IsMacBinary): Return error
-       FT_Err_Invalid_Stream_Operation immediately when NULL stream is
-       passed.
-       (FT_Open_Face): Even when FT_New_Stream() returns an error, proceed
-       to fallback.  Originally, legacy MacOS font is tested in the cases
-       of FT_Err_Invalid_Stream_Operation (occurs when data fork is empty)
-       or FT_Err_Unknown_File_Format (occurs when AppleSingle header or
-       .dfont header is combined).  Now the case of
-       FT_Err_Cannot_Open_Stream is included.
-
-       * src/base/ftrfork.c (FT_Raccess_Guess): When passed stream is NULL,
-       skip FT_Stream_Seek(), which seeks to the head of stream, and
-       proceed to unit testing of raccess_guess_XXX().  FT_Stream_Seek()
-       for a NULL stream causes a Bus error on Mac OS X.
-       (raccess_guess_apple_double): Return FT_Err_Cannot_Open_Stream
-       immediately if passed stream is NULL.
-       (raccess_guess_apple_single): Ditto.
-
-2007-11-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Fix for Carbon incompatibilities since Mac OS X 10.5,
-       proposed by Sean McBride.
-
-       * doc/INSTALL.MAC: Comment on MACOSX_DEPLOYMENT_TARGET.
-
-       * include/freetype/ftmac.h: Deprecate FT_New_Face_From_FOND and
-       FT_GetFilePath_From_Mac_ATS_Name.  Since Mac OS X 10.5, calling
-       Carbon functions from a forked process is classified as unsafe
-       by Apple.  All Carbon-dependent functions should be deprecated.
-
-       * src/base/ftmac.c: Use essential header files
-       <CoreServices/CoreServices.h> and
-       <ApplicationServices/ApplicationServices.h> instead of
-       all-in-one header file <Carbon/Carbon.h>.
-
-       Include <sys/syslimits.h> and replace HFS_MAXPATHLEN by Apple
-       genuine macro PATH_MAX.
-
-       Add fallback macro for kATSOptionFlagsUnRestrictedScope which
-       is not found in Mac OS X 10.0.
-
-       Multi-character constants ('POST', 'sfnt' etc) are replaced by
-       64bit constants calculated by FT_MAKE_TAG() macro.
-
-       For the index in the segment of resource fork, new portable
-       type ResourceIndex is introduced for better compatibility.
-       This type is since Mac OS X 10.5, so it is defined as short
-       when built on older platforms.
-
-       (FT_ATSFontGetFileReference): If build target is only the systems
-       10.5 and newer, it calls Apple genuine ATSFontGetFileReference().
-
-       (FT_GetFile_From_Mac_ATS_Name): Return an error if system is 10.5
-       and newer or 64bit platform, because legacy type FSSpec type is
-       removed completely.
-
-       (FT_New_Face_From_FSSpec): Ditto.
-
-2007-11-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_done_face): Check `sfnt' everywhere.  This
-       fixes Savannah bug #21485.
-
-2007-10-29  Daniel Svoboda  <dasvo@planeta@cz>
-
-       * src/winfonts/winfnt.c (FNT_Face_Init): Check first that the driver
-       can handle the font at all, then check `face_index'.  Otherwise, the
-       driver might return the wrong error code.  This fixes Savannah bug
-       #21468.
-
-2007-10-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Support bit 9 and prepare
-       support for bit 8 of the `fsSelection' field in the `OS/2' table.
-       MS is already using this; hopefully, this becomes part of OpenType
-       1.5.
-       Prepare also support for `name' IDs 21 (WWS_FAMILY) and 22
-       (WWS_SUBFAMILY).
-
-2007-10-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/docmaker/tohtml.py (html_header_2): Fix typo.
-       Add `td.left' element to CSS.
-       (toc_section_enter): Use it.
-
-2007-10-18  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h, src/base/ftobjs.c: Rename API
-       functions related to cmap type 14 support to the
-       `FT_Object_ActionName' scheme:
-
-         FT_Get_Char_Variant_index     -> FT_Face_GetCharVariantIndex
-         FT_Get_Char_Variant_IsDefault -> FT_Face_GetCharVariantIsDefault
-         FT_Get_Variant_Selectors      -> FT_Face_GetVariantSelectors
-         FT_Get_Variants_Of_Char       -> FT_Face_GetVariantsOfChar
-         FT_Get_Chars_Of_Variant       -> FT_Face_GetCharsOfVariant
-
-       Update documentation accordingly.
-
-       * src/sfnt/ttcmap.c: Stronger cmap 14 validation.
-       Make the code a little more consistent with FreeType coding
-       conventions and modify the cmap14 functions that returned a newly
-       allocated array to use a persistent vector from the TT_CMap14 object
-       instead.
-
-       (TT_CMap14Rec): Provide array and auxiliary data for result.
-       (tt_cmap14_done, tt_cmap14_ensure): New functions.
-
-       (tt_cmap14_init, tt_cmap14_validate, tt_cmap14_char_map_def_binary,
-       tt_cmap14_char_map_nondef_binary, tt_cmap14_find_variant,
-       tt_cmap14_char_var_index, tt_cmap14_variants,
-       tt_cmap14_char_variants, tt_cmap14_def_char_count,
-       tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars,
-       tt_cmap14_variant_chars, tt_cmap14_class_rec): Updated and improved.
-
-2007-10-15  George Williams  <gww@silcom.com>
-
-       Add support for cmap type 14.
-
-       * devel/ftoption.h, include/freetype/config/ftoption.h
-       (TT_CONFIG_CMAP_FORMAT_14): New macro.
-
-       * include/freetype/internal/ftobjs.h (FT_CMap_CharVarIndexFunc,
-       FT_CMap_CharVarIsDefaultFunc, FT_CMap_VariantListFunc,
-       FT_CMap_CharVariantListFunc, FT_CMap_VariantCharListFunc): New
-       support function prototypes.
-       (FT_CMap_ClassRec): Add them.
-       Update all users.
-
-       * include/freetype/ttnameid.h (TT_APPLE_ID_VARIANT_SELECTOR): New
-       macro.
-
-       * include/freetype/freetype.h (FT_Get_Char_Variant_Index,
-       FT_Get_Char_Variant_IsDefault, FT_Get_Variant_Selectors,
-       FT_Get_Variants_Of_Char, FT_Get_Chars_Of_Variant): New API
-       functions.
-
-       * src/base/ftobjs.c (find_variant_selector_charmap): New auxiliary
-       function.
-       (FT_Set_Charmap): Disallow cmaps of type 14.
-       (FT_Get_Char_Variant_Index, FT_Get_Char_Variant_IsDefault,
-       FT_Get_Variant_Selectors, FT_Get_Variants_Of_Char,
-       FT_Get_Chars_Of_Variant): New API functions.
-
-       * src/sfnt/ttcmap.c (TT_PEEK_UINT24, TT_NEXT_UINT24): New macros.
-
-       (TT_CMap14Rec, tt_cmap14_init, tt_cmap14_validate,
-       tt_cmap14_char_index, tt_cmap14_char_next, tt_cmap14_get_info,
-       tt_cmap14_char_map_def_binary, tt_cmap14_char_map_nondef_binary,
-       tt_cmap14_find_variant, tt_cmap14_char_var_index,
-       tt_cmap14_char_var_isdefault, tt_cmap14_variants,
-       tt_cmap14_char_variants, tt_cmap14_def_char_count,
-       tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars,
-       tt_cmap14_variant_chars, tt_cmap14_class_rec): New functions and
-       structures for cmap 14 support.
-       (tt_cmap_classes): Register tt_cmap14_class_rec.
-       (tt_face_build_cmaps): One more error message.
-
-       * docs/CHANGES: Mention cmap 14 support.
-
-2007-10-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (find_unicode_charmap): If search for a UCS-4
-       charmap fails, do the loop again while searching a UCS-2 charmap.
-       This favours MS charmaps over Apple ones.
-
-2007-08-29  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Introduction of abstract `short' data types,
-       ResFileRefNum and ResID.  These types were introduced for Copland,
-       then backported to MPW.  The variables exchanged with FileManager
-       QuickDraw frameworks are redefined by these data types.  Patch was
-       proposed by Sean McBride.
-       * builds/mac/ftmac.c: Ditto.
-
-2007-08-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/otvalid/otvcmmn.c (otv_x_y_ux_sy): Skip context glyphs.  Found
-       by Imran Yousaf.  Fixes Savannah bug #20773.
-
-       (otv_Lookup_validate): Correct handling of LookupType.  Found by
-       Imran Yousaf.  Fixes Savannah bug #20782.
-
-2007-08-17  George Williams  <gww@silcom.com>
-
-       * src/otvalid/otvgsub.c (otv_SingleSubst_validate): Fix handling of
-       SingleSubstFormat1.
-
-2007-08-11  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Fix a bug which sets CC_BUILD by
-       ${build-gcc} (unchecked) instead of by ${build}-gcc (checked).
-       Found by Ryan Hill.
-
-2007-08-11  George Williams  <gww@silcom.com>
-
-       * src/otvalid/otvcommn.c, src/otvalid/otvcommn.h
-       (otv_Coverage_validate): Add fourth argument to pass an expected
-       count value.  Update all users.
-       Check glyph IDs.
-       (otv_ClassDef_validate): Check `StartGlyph'.
-
-       * src/otvalid/otvgsub.c (otv_SingleSubst_validate): More glyph ID
-       checks.
-
-       * src/otvalid/otvmath.c (otv_MathConstants_validate): There are only
-       56 constants.
-       (otv_GlyphAssembly_validate, otv_MathGlyphConstruction_validate):
-       Check glyph IDs.
-
-2007-08-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/otvalid/otvbase.c, src/otvalid/otvcommn.c,
-       src/otvalid/otvgdef.c, src/otvalid/otvgpos.c, src/otvalid/otvgsub.c,
-       src/otvalid/otvjstf.c: s/FT_INVALID_DATA/FT_INVALID_FORMAT/ where
-       appropriate.  Reported by George.
-
-       * include/freetype/internal/fttrace.h: Define `trace_otvmath'.
-
-       * src/otvalid/rules.mk (OTV_DRV_SRC): Add otvmath.c.
-
-       * docs/CHANGES: Updated.
-
-2007-08-08  George Williams  <gww@silcom.com>
-
-       Add `MATH' validating support to otvalid module.
-
-       * include/freetype/tttags.h (TTAG_MATH): New macro.
-       * include/freetype/ftotval.h (FT_VALIDATE_MATH): New macro.
-       (FT_VALIDATE_OT): Updated.
-
-       * src/otvalid/otmath.c: New file.
-
-       * src/otvalid/otvalid.c: Include otvmath.c.
-       * src/otvalid/otvmod.c (otv_validate): Handle `MATH' table.
-
-2007-08-04  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/configure.raw: Add call to AC_LIBTOOL_WIN32_DLL.
-       Fixes Savannah bug #20686.
-
-2007-08-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/psnames/psmodule.c: Fix usage of
-       FT_CONFIG_OPTION_POSTSCRIPT_NAMES macro.  Reported by Graham Asher.
-
-2007-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (open_face_from_buffer): The argument
-       `driver_name' is typed as `const char*' to match with the
-       callers in FT_New_Face_From_LWFN and FT_New_Face_From_SFNT.
-       This is same with open_face_from_buffer in src/base/ftobjs.c.
-       Found and fixed by Sean McBride.
-
-2007-07-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/raster/ftraster.c (count_table): Make it conditional.
-       * src/base/ftobjs.c (FT_New_Library): Check FT_RENDER_POOL_SIZE with
-       a preprocessor statement.
-
-2007-07-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftoutln.c (FT_Outline_Translate): Check `outline' before
-       first usage.  From Savannah patch #6115.
-
-2007-07-16  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2007-07-16  Derek Clegg  <dclegg@apple.com>
-
-       Add new service for getting the ROS from a CID font.
-
-       * include/freetype/config/ftheader.h (FT_CID_H): New macro.
-       * include/freetype/ftcid.h: New file.
-
-       * include/freetype/internal/ftserv.h (FT_SERVIVE_CID_H): New macro.
-       * include/freetype/internal/services/svcid.h: New file.
-
-       * src/base/ftcid.c: New file.
-
-       * src/cff/cffdrivr.c: Include FT_SERVICE_CID_H.
-       (cff_get_ros): New function.
-       (cff_service_cid_info): New service structure.
-       (cff_services): Register it.
-
-       * src/cff/cffload.c (cff_font_done): Free registry and ordering.
-
-       * src/cff/cfftypes.h (CFF_FontRec): Add `registry' and `ordering'.
-
-       * modules.cfg (BASE_EXTENSIONS): Add ftcid.c.
-
-2007-07-11  Derek Clegg  <dclegg@apple.com>
-
-       Add support for postscript name service to CFF driver.
-
-       * src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_NAME_H.
-       (cff_get_ps_name): New function.
-       (cff_service_ps_name): New service structure.
-       (cff_services): Register it.
-
-2007-07-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftglyph.c (FT_Glyph_Copy): Fix initialization of
-       `target'.  Reported by Sean McBride.
-
-2007-07-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/pfrcmap.c: Include pfrerror.h.
-
-       * src/autofit/afindic.c: Add some external declarations to pacify
-       `make multi' compilation.
-
-       * src/cid/cidgload.c (cid_load_glyph): Pacify compiler.
-
-       * src/cff/cffdrivr.c (cff_ps_get_font_info), src/cff/cffobjs.c
-       (cff_strcpy), include/freetype/internal/ftmemory.h (FT_MEM_STRDUP),
-       src/autofit/aflatin.c (af_latin_hints_compute_edges),
-       src/autofit/afcjk.c (af_cjk_hints_compute_edges), src/sfnt/ttmtx.c
-       (tt_face_get_metrics), src/base/ftobjs.c (open_face)
-       [FT_CONFIG_OPTION_INCREMENTAL]: Fix compilation with C++ compiler.
-
-       * docs/release: Mention test compilation targets.
-
-2007-07-04  Werner Lemberg  <wl@gnu.org>
-
-       * docs/PROBLEMS: Mention that some PS based fonts can't be
-       handled correctly by FreeType.
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Always allow a
-       recursion depth of 1.  This was the maximum value in TrueType 1.0,
-       and some older fonts don't set this field correctly.
-
-       * src/gxvalid/gxvmort1.c
-       (gxv_mort_subtable_type1_substTable_validate): Fix tracing message.
-
-2007-07-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize
-       `round' to pacify compiler.
-
-2007-07-02  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.5 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-5'.
-
-       * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
-       version number to 2.3.5.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj,
-       builds/win32/visualce/index.html,
-       builds/win32/visualce/freetype.dsp,
-       builds/win32/visualce/freetype.vcproj: s/2.3.4/2.3.5/, s/234/235/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
-
-       * builds/unix/configure.raw (version_info): Set to 9:16:3.
-
-2007-07-01  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h, src/base/ftpatent.c
-       (FT_Face_SetUnpatentedHinting): New function to dynamically change
-       the setting after a face is created.
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Fix a small bug
-       that created distortions in the bytecode interpreter results.
-
-2007-06-30  David Turner  <david@freetype.org>
-
-       * src/truetype/ttinterp.c (Ins_IUP): Add missing variable
-       initialization.
-
-       * src/autofit/aflatin.c (af_latin_metric_init_blues): Get rid of an
-       infinite loop in the case of degenerate fonts.
-
-2007-06-26  Rahul Bhalerao  <b.rahul.pm@gmail.com>
-
-       Add autofit module for Indic scripts.  This currently just reuses
-       the CJK-specific functions.
-
-       * include/freetype/config/ftoption.h (AF_CONFIG_OPTION_INDIC): New
-       macro.
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
-
-       * src/autofit/afindic.c, src/autofit/afindic.h: New files.
-
-       * src/autofit/afglobal.c, src/autofit/aftypes.h,
-       src/autofit/autofit.c: Updated.
-
-       * src/autofit/Jamfile (_sources), * src/autofit/rules.mk
-       (AUTOF_DRV_SRC): Updated.
-
-2007-06-23  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c (TT_Load_Simple): Fix change from
-       2007-06-16 that prevented the TrueType module from loading most
-       glyphs.
-
-2007-06-20  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffgload.c (cff_slot_load): Fix logic of 2007-05-28
-       change.
-
-2007-06-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_encoding): Handle one more error.
-
-2007-06-19  Dmitry Timoshkov  <dmitry@codeweavers.com>
-
-       * src/winfonts/winfnt.c (fnt_face_get_dll_font): Return error
-       FNT_Err_Invalid_File_Format if file format was recognized but
-       the file doesn't contain any FNT(NE) or RT_FONT(PE) resources.
-       Add verbose debug logs to make it easier to debug failing load
-       attempts.
-       (FNT_Face_Init): A single FNT font can't contain more than 1 face,
-       so return an error if requested face index is > 0.
-       Do not do further attempt to load fonts if a previous attempt has
-       failed but returned error FNT_Err_Invalid_File_Format, i.e., the
-       file format has been recognized but no fonts found in the file.
-
-2007-07-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Apply patches proposed by Sean McBride.
-       (FT_GetFile_From_Mac_Name): Insert FT_UNUSED macros to fix
-       the compiler warnings against unused arguments.
-       (FT_ATSFontGetFileReference): Ditto.
-       (FT_GetFile_From_Mac_ATS_Name): Ditto.
-       (FT_New_Face_From_FSSpec): Ditto.
-       (lookup_lwfn_by_fond): Fix wrong comment.
-       Replace `const StringPtr' by more appropriate type
-       `ConstStr255Param'.
-       FSRefMakePathPath always returns UTF8 POSIX pathname in
-       Mach-O, thus HFS pathname support is dropped.
-       (count_faces): Remove HLock and HUnlock which is not
-       required on Mac OS X anymore.
-       (FT_New_Face_From_SFNT): Ditto.
-       (FT_New_Face_From_FOND): Ditto.
-       * builds/mac/ftmac.c: Synchronize to src/base/ftmac.c,
-       except of HFS pathname support and HLock/HUnlock.
-       They are required on classic CFM environment.
-
-2007-06-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psobjs.c (ps_parser_skip_PS_token): Remove incorrect
-       assertion.
-       (ps_parser_to_bytes): Fix error message.
-
-       * src/type42/t42objs.c (T42_Open_Face): Handle one more error.
-       * src/type42/t42parse.c (t42_parse_sfnts): s/alloc/allocated/.
-       Don't allow mixed binary and hex strings.
-       Handle string_size == 0 and string_buf == 0.
-       (t42_parse_encoding): Handle one more error.
-
-2007-06-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/psaux/psobjs.c (ps_tofixedarray, ps_tocoordarray): Fix exit
-       logic.
-       (ps_parser_load_field) <T1_FIELD_TYPE_BBOX>: Skip delimiters
-       correctly.
-       (ps_parser_load_field_table): Use `fields->array_max' instead of
-       T1_MAX_TABLE_ELEMENTS to limit the number of arguments.
-
-       * src/cff/cffgload.c (cff_decoder_prepare): Fix change from
-       2007-06-06.
-
-2007-06-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/ftrandom.c (font_size): New global variable.
-       (TestFace): Use it.
-       (main): Handle new option `--size' to set `font_size'.
-       (Usage): Updated.
-
-       * src/winfonts/winfnt.c (fnt_face_get_dll_font): Exit in case of
-       invalid font.
-       (FNT_Load_Glyph): Protect against invalid bitmap width.
-
-2007-06-16  David Turner  <david@freetype.org>
-
-       * src/smooth/ftgrays.c (gray_find_cell, gray_set_cell, gray_hline):
-       Prevent integer overflows when rendering very large outlines.
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check the
-       well-formedness of the contours array when loading a glyph.
-
-       * src/truetype/ttinterp.c (TT_Load_Context): Initialize `zp0', `zp1',
-       and `zp2'.
-       (Ins_IP): Check argument ranges to reject bogus operations properly.
-       (IUP_WorkerRec): Add `max_points' member.
-       (_iup_worker_interpolate): Check argument ranges.
-       (Ins_IUP): Ignore empty outlines.
-
-2007-06-16  Dmitry Timoshkov  <dmitry@codeweavers.com>
-
-       * src/winfonts/winfnt.h: Add necessary structures for PE resource
-       parsing.
-       (WinPE32_HeaderRec): New structure.
-       (WinPE32_SectionRec): New structure.
-       (WinPE_RsrcDirRec): New structure.
-       (WinPE_RsrcDirEntryRec): New structure.
-       (WinPE_RsrcDataEntryRec): New structure.
-       (FNT_FontRec): Remove unused `size_shift' field.
-
-       * src/winfonts/winfnt.c (fnt_face_get_dll_font): Add support for
-       loading bitmap .fon files in PE format.
-
-2007-06-15  Dmitry Timoshkov  <dmitry@codeweavers.com>
-
-       * builds/win32/ftdebug.c: Unify debug level handling with other
-       platforms.
-
-2007-06-14  Dmitry Timoshkov  <dmitry@codeweavers.com>
-
-       * builds/win32/ftdebug.c (FT_Message): Send debug output to the
-       console as well as to the debugger.
-
-2007-06-14  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/aflatin.c (af_latin_uniranges): Expand structure to
-       cover all ranges which could possibly be handled by the aflatin
-       module (since the default fallback for unknown ranges is now the
-       afcjk module).  It might be necessary to fine-tune this further by
-       splitting off modules for Greek, Cyrillic, or other blocks.
-
-2007-06-11  David Turner  <david@freetype.org>
-
-       * src/autofit/aflatin.c (af_latin_hints_link_segments): Fix
-       incorrect segment linking computation.  This was the root cause of
-       Savannah bug #19565.
-
-
-       * src/autofit/* [FT_OPTION_AUTOFIT2]: Some very experimental changes
-       to improve the Latin auto-hinter.  Note that the new code is
-       disabled by default since it is not stabilized yet.
-
-       * src/autofit/aflatin2.c, src/autofit/aflatin2.h: New files
-       (disabled currently).
-
-       * src/autofit/afhints.c: Remove dead code.
-       (af_axis_hints_new_edge): Add argument to handle segment directions.
-       (af_edge_flags_to_string): New function.
-       (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Handle
-       option flags.
-       (af_glyph_hints_reload): Add argument to handle inflections.
-       Simplify.
-       (af_direction_compute): Fine tuning.
-       (af_glyph_hints_align_edge_points): Fix logic.
-       (af_glyph_hints_align_strong_points): Do linear search for small
-       edge counts.
-       (af_glyph_hints_align_weak_points): Skip any touched neighbors.
-       (af_iup_shift): Handle zero `delta'.
-
-       * src/autofit/afhints.h: Updated.
-       (AF_SORT_SEGMENTS): New macro (disabled).
-       (AF_AxisHintsRec) [AF_SORT_SEGMENTS]: New member `mid_segments'.
-
-       * src/autofit/afglobal.c (af_face_globals_get_metrics): Add
-       argument to pass option flags for handling scripts.
-       * src/autofit/afglobal.h: Updated.
-
-       * src/autofit/afcjk.c: Updated.
-       * src/autofit/aflatin.c: Updated.
-       (af_latin_metrics_scale_dim): Don't reduce scale by 2%.
-
-       (af_latin_hints_compute_segments) [AF_HINT_METRICS]: Remove dead code.
-       (af_latin_hints_compute_edges) [AF_HINT_METRICS]: Remove dead code.
-       Don't set `edge->dir'
-       (af_latin_hint_edges): Add more logging.
-
-       * src/autofit/afloader.c: Updated.
-
-2007-06-11  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Document FT_Face_CheckTrueTypePatents.
-
-2007-06-10  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Slight speed-up to
-       the TrueType glyph loader.
-
-       * include/freetype/config/ftoption.h: Clarify documentation
-       regarding unpatented hinting.
-
-
-       Add new `FT_Face_CheckTrueTypePatents' API.
-
-       * include/freetype/freetype.h (FT_Face_CheckTrueTypePatents): New
-       declaration.
-
-       * include/freetype/internal/services/svttglyf.h,
-       src/base/ftpatent.c: New files.
-
-       * include/freetype/internal/ftserv.h (FT_SERVICE_TRUETYPE_GLYF_H):
-       New macro.
-
-       * src/truetype/ttdriver.c: Include FT_SERVICE_TRUETYPE_GLYF_H and
-       `ttpload.h'.
-       (tt_service_truetype_glyf): New service structure.
-       (tt_services): Register it.
-
-       * modules.cfg (BASE_EXTENSIONS), src/base/Jamfile (_sources): Add
-       `ftpatent.c'.
-
-2007-06-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Undo change from 2007-04-28.
-       Fonts without a cmap must be handled correctly by FreeType (anything
-       else would be a bug).
-
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
-       [FT_DEBUG_LEVEL_TRACE]: Improve tracing message.
-
-2007-06-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttsbit0.c (tt_sbit_decoder_init,
-       tt_sbit_decoder_load_image): Protect against integer overflows.
-
-
-       * src/pfr/pfrgload.c (pfr_glyph_load_simple): More bounding checks
-       for `x_control' and `y_control'.
-
-2007-06-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftoutln.c (FT_Outline_Decompose): Check `last'.
-
-
-       * src/pfr/pfrcmap.c (pfr_cmap_init): Convert assertion into normal
-       FreeType error.
-
-
-       * src/winfonts/winfnt.c (fnt_face_get_dll_font): Do a rough check of
-       `font_count'.
-
-
-       * src/type1/t1load.c (parse_font_matrix): Check `temp_scale'.
-
-
-       * src/cff/cffgload.c (cff_decoder_prepare): Change return type to
-       `FT_Error'.
-       Check `fd_index'.
-       (cff_slot_load): Updated.
-       * src/cff/cffgload.h: Updated.
-
-2007-06-05  Werner Lemberg  <wl@gnu.org>
-
-       * src/pfr/pfrgload.c (pfr_glyph_done): Comment out unused code.
-       (pfr_glyph_load_simple): Convert assertion into normal FreeType
-       error.
-       Check `idx'.
-       (pfr_glyph_load_compound, pfr_glyph_curve_to, pfr_glyph_line_to):
-       Convert assertion into normal FreeType error.
-
-       * src/pfr/pfrtypes.h (PFR_GlyphRec): Comment out unused code.
-
-
-       * src/winfonts/winfnt.c (FNT_Face_Init): Check `family_size'.
-
-
-       * src/psaux/psobjs.c (ps_tocoordarray, ps_tofixedarray): Return -1
-       in case of parsing error.
-       (ps_parser_load_field): Updated.
-
-       * src/type1/t1load.c (parse_font_matrix): Updated.
-
-2007-06-04  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidgload.c (cid_load_glyph): Check `fd_select'.
-
-       * src/tools/ftrandom/Makefile: Depend on `libfreetype.a'.
-
-2007-06-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/tools/ftrandom/*: Add the `ftrandom' test program written by
-       George Williams (with some modifications).
-
-2007-06-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (destroy_charmaps), src/type1/t1objs.c
-       (T1_Face_Done), src/winfonts/winfnt.c (FNT_Face_Done): Check for
-       face == NULL.  Suggested by Graham Asher.
-
-2007-06-03  Ismail Dönmez  <ismail@pardus.org.tr>
-
-       * src/base/ftobjs.c (FT_Request_Metrics): Fix compiler warning.
-
-2007-06-02  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/fterrdef.h (FT_Err_Corrupted_Font_Header,
-       FT_Err_Corrupted_Font_Glyphs): New error codes for BDF files.
-
-       * src/bdf/bdflib.c (bdf_load_font): Use them.
-
-       * src/bdf/bdflib.c (_bdf_parse_start): Check `FONT' better.
-
-2007-06-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Request_Metrics), src/cache/ftccmap.c
-       (FTC_CMapCache_Lookup): Remove unused code.
-
-2007-06-01  Sean McBride  <sean@rogue-research.com>
-
-       * src/truetype/ttinterp.c (Null_Vector, NULL_Vector): Removed,
-       unused.
-
-2007-06-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidparse.c (cid_parser_new): Don't continue second search
-       pass for `StartData' if an error has occurred.
-       Exit properly if no `StartData' has been seen at all.
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Don't use ULONG_MAX but
-       LONG_MAX to avoid compiler warning.  Suggested by Sean McBride.
-
-2007-05-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (parse_subrs, parse_charstrings): Protect
-       against too small binary data strings.
-
-       * src/bdf/bdflib.c (_bdf_parse_glyphs): Check `STARTCHAR' better.
-
-2007-05-28  David Turner  <david@freetype.org>
-
-       * src/cff/cffgload.c (cff_slot_load): Do not apply the identity
-       transformation.  This significantly reduces the loading time of CFF
-       glyphs.
-
-       * docs/CHANGES: Updated.
-
-       * src/autofit/afglobal.c (AF_SCRIPT_LIST_DEFAULT): Change default
-       hinting script to CJK, since it works well with more scripts than
-       latin.  Thanks to Rahul Bhalerao <b.rahul.pm@gmail.com> for pointing
-       this out!
-
-2007-05-25  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Updated.
-
-2007-05-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttobjs.h (tt_size_ready_bytecode): Move declaration
-       into TT_USE_BYTECODE_INTERPRETER preprocessor block.
-
-2007-05-24  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/truetype/ttobjs.c (tt_size_ready_bytecode)
-       [!TT_USE_BYTECODE_INTERPRETER]: Removed.  Unused.
-
-2007-05-22  David Turner  <david@freetype.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Fix last change to
-       avoid crashes in case the bytecode interpreter is not used.
-
-
-       Avoid heap blowup with very large .Z font files.  This fixes
-       Savannah bug #19910.
-
-       * src/lzw/ftzopen.h (FT_LzwStateRec): Remove `in_cursor',
-       `in_limit', `pad', `pad_bits', and `in_buff' members.
-       Add `buf_tab', `buf_offset', `buf_size', `buf_clear', and
-       `buf_total' members.
-
-       * src/lzw/ftzopen.c (ft_lzwstate_get_code): Rewritten.  It now takes
-       only one argument.
-       (ft_lzwstate_refill, ft_lzwstate_reset, ft_lzwstate_io): Updated.
-
-2007-05-20  Ismail Dönmez  <ismail@pardus.org.tr>
-
-       * src/pshinter/pshrec.c (ps_mask_table_set_bits): Add `const'.
-       (ps_dimension_set_mask_bits): Remove `const'.
-
-2007-05-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttmtx.c (tt_face_get_metrics)
-       [!FT_CONFIG_OPTION_OLD_INTERNALS]: Another type-punning fix.
-
-2007-05-19  Derek Clegg  <dclegg@apple.com>
-
-       Savannah patch #5929.
-
-       * include/freetype/tttables.h, src/base/ftobjcs.c
-       (FT_Get_CMap_Format): New function.
-
-       * include/freetype/internal/services/svttcmap.c (TT_CMapInfo): Add
-       `format' member.
-       * src/sfnt/ttcmap.c (tt_cmap{0,2,4,6,8,10,12}_get_info): Set
-       cmap_info->format.
-
-2007-05-19  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Save graphics state
-       before handling subglyphs so that it can be reinitialized each time.
-       This fixes Savannah bug #19859.
-
-2007-05-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/cache/ftccache.c (ftc_node_mru_link, ftc_node_mru_unlink),
-       src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP), src/cache/ftcglyph.h
-       (FTC_GCACHE_LOOKUP_CMP), src/pshinter/pshmod.c (ps_hinter_init),
-       src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_load_hhea,
-       tt_face_get_metrics): Fix type-punning issues.
-
-2007-05-15  David Turner  <david@freetype.org>
-
-       * include/freetype/config/ftstdlib.h,
-       include/freetype/internal/ftobjs.h: As suggested by Graham Asher,
-       ensure that ft_isalnum, ft_isdigit, etc., use hard-coded values
-       instead on relying on the locale-dependent functions provided by
-       <ctypes.h>.
-
-2007-05-15  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Remove unused
-       variable.
-       * src/autofit/afloader.c (af_loader_load_g): Ditto.
-
-       * src/base/ftobjs.c (ft_validator_error): Use `ft_jmp_buf'.
-       (open_face_from_buffer): Initialize `stream'.
-       (FT_Request_Metrics): Remove unused variable.
-       Remove redundant `break' statements.
-       (FT_Get_Track_Kerning): Remove unused variable.
-
-       * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs,
-       afm_parse_kern_data): Remove redundant
-       `break' statements.
-       (afm_parser_parse): Ditto.
-       Don't use uninitialized variables.
-
-       * src/psnames/psmodule.c (VARIANT_BIT): Define as unsigned long.
-       Use `|' operator instead of `^' to set it.
-       Update all users.
-
-       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Use `ft_jmp_buf'.
-       * src/sfnt/ttkern.c (tt_face_load_kern): Remove unused variable.
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant
-       comparison.
-       (TT_Process_Simple_Glyph): Use FT_UInt for `n_points' and `i'.
-       (TT_Load_Glyph): Remove unused variable.
-
-2007-05-13  Derek Clegg  <dclegg@apple.com>
-
-       * src/base/ftobjs.c (FT_New_Library): Only allocate rendering pool
-       if FT_RENDER_POOL_SIZE is > 0.  From Savannah patch #5928.
-
-2007-05-11  David Turner  <david@freetype.org>
-
-       * src/cache/ftbasic.c, include/freetype/ftcache.h
-       (FTC_ImageCache_LookupScaler, FTC_SBit_Cache_LookupScaler): Two new
-       functions that allow us to look up glyphs using an FTC_Scaler object
-       to specify the size, making it possible to use fractional pixel
-       sizes.
-
-       * src/truetype/ttobjs.c (tt_size_ready_bytecode): Set
-       `size->cvt_ready'.  Reported by Boris Letocha.
-
-2007-05-09  Graham Asher  <graham.asher@btinternet.com>
-
-       * src/truetype/ttinterp.c (Ins_IP), src/autofit/aflatin.c
-       (af_latin_metrics_scale_dim): Fix compiler warnings.
-
-2007-05-06  Werner Lemberg  <wl@gnu.org>
-
-       * builds/win32/visualce/freetype.sln: Removed, as requested by
-       Vincent.
-
-2007-05-04  Vincent RICHOMME  <richom.v@free.fr>
-
-       * builds/win32/visualce/*: Add Visual C++ project files for Pocket
-       PC targets.
-
-       * docs/CHANGES: Document them.
-
-2007-05-04  <harry@kdevelop.org>
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Handle return value 0 of
-       mmap (which might happen on some RTOS).  From Savannah patch #5909.
-
-2007-05-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftobjs.c (FT_Set_Char_Size): Simplify code.
-       * include/freetype/freetype.h (FT_Set_Char_Size): Update
-       documentation.
-
-2007-04-28  Victor Stinner  <victor.stinner@inl.fr>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face): Check error code after loading
-       `cmap'.
-
-2007-04-27  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check for negative
-       number of points in contours.  Problem reported by Victor Stinner
-       <victor.stinner@haypocalc.com>.
-       (TT_Process_Simple_Glyph): Synchronize variable types.
-
-2007-04-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftglyph.c (FT_Glyph_Copy): Always set second argument to
-       zero in case of error.  This fixes Savannah bug #19689.
-
-2007-04-25  Boris Letocha  <b.letocha@cz.gmc.net>
-
-       * src/truetype/ttobjs.c: Fix a typo that created a speed regression
-       in the TrueType bytecode loader.
-
-2007-04-10  Martin Horak  <horakm@centrum.cz>
-
-       * src/sfnt/sfobjs.c (sfnt_load_face) [FT_CONFIG_OPTION_INCREMENTAL]:
-       Ignore `hhea' table.  This fixes Savannah bug #19261.
-
-2007-04-09  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.4 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-4'.
-
-       * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
-       version number to 2.3.4.
-
-       * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj: s/2.3.3/2.3.4/, s/233/234/.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
-
-       * builds/unix/configure.raw (version_info): Set to 9:15:3.
-
-2007-04-09  Martin Horak  <horakm@centrum.cz>
-
-       * src/truetype/ttgload.c (load_truetype_glyph): Save and restore
-       memory stream to avoid a crash with the incremental memory
-       interface (Savannah bug #19260).
-
-2007-04-06  David Turner  <david@freetype.org>
-
-       * src/base/ftbimap.c (ft_bitmap_assure_buffer): Fix buffer-overwrite bug
-       (Savannah bug #19536).
-
-2007-04-04  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.3 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-3'.
-
-       * docs/CHANGES: Mention CVE-2007-1351.
-
-2007-04-03  David Turner  <david@freetype.org>
-
-       * src/base/ftobjs.c (FT_Set_Char_Size): As suggested by James Cloos,
-       if one of the resolution values is 0, treat it as if it were the
-       same as the other value.
-
-2007-04-02  David Turner  <david@freetype.org>
-
-       Add special code to detect `extra-light' fonts and do not snap their
-       stem widths too much to avoid bizarre hinting effects.
-
-       * src/autofit/aflatin.h (AF_LatinAxisRec): Add `standard_width' and
-       `extra_light' members.
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_widths): Initialize
-       them.
-       (af_latin_metrics_scale_dim): Set `extra_light'.
-       (af_latin_compute_stem_width): Use `extra_light'.
-
-2007-03-28  David Turner  <david@freetype.org>
-
-       * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Fix zero-ing of the
-       padding.
-
-2007-03-28  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdflib.c (setsbit, sbitset): Handle values >= 128
-       gracefully.
-       (_bdf_set_default_spacing): Increase `name' buffer size to 256 and
-       issue an error for longer names.  This fixes CVE-2007-1351.
-       (_bdf_parse_glyphs): Limit allowed number of glyphs in font to the
-       number of code points in Unicode.
-
-       * builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj, README: s/2.3.2/2.3.3/,
-       s/232/233/.
-
-       * docs/CHANGES: Mention ftdiff.
-
-2007-03-26  David Turner  <david@freetype.org>
-
-       * src/truetype/ttinterp.c [FIX_BYTECODE]: Remove it and
-       corresponding code.
-       (Ins_MD): Last regression fix.
-
-       * src/autofit/aflatin.c (af_latin_metrics_init_blues): Fix blues
-       computations in order to ignore single-point contours.  These are
-       never rasterized and correspond in certain fonts to mark-attach
-       points that are very far from the glyph's real outline, ruining the
-       computation.
-
-       * src/autofit/afloader.c (af_loader_load_g): In the case of
-       monospaced fonts, always set `rsb_delta' and `lsb_delta' to 0.
-       Otherwise code that uses them will most certainly ruin the fixed
-       advance property.
-
-       * docs/CHANGES, docs/VERSION.DLL, README, Jamfile (RefDoc): Update
-       documentation and bump version number to 2.3.3.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
-
-       * builds/unix/configure.raw (version_info): Set to 9:14:3.
-
-2007-03-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/ftconfig.in: Disable Carbon framework dependency on
-       64bit ABI on Mac OS X 10.4.x (ppc & i386).  Found by Sean McBride.
-       * builds/vms/ftconfig.h: Ditto.
-       * include/freetype/config/ftconfig.h: Ditto.
-
-2007-03-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/ftsystem.c (FT_Stream_Open): Temporary fix to prevent
-       32bit unsigned long overflow by 64bit filesize on LP64 platform, as
-       proposed by Sean McBride:
-       http://lists.gnu.org/archive/html/freetype-devel/2007-03/msg00032.html
-
-2007-03-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/ftconfig.in: Suppress SGI compiler's warning against
-       setjmp, proposed by Sean McBride:
-       http://lists.gnu.org/archive/html/freetype-devel/2007-03/msg00032.html
-
-2007-03-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Dequote `OS_INLINE' in comment of
-       conftest.c, to avoid unexpected shell evaluation.  Possibly it is a
-       bug or undocumented behaviour of autoconf.
-
-2007-03-18  David Turner   <david@freetype.org>
-
-       * src/truetype/ttinterp.c (Ins_MDRP): Another bytecode regression
-       fix; testing still needed.
-
-       * src/truetype/ttinterp.c (Ins_MD): Another bytecode regression fix.
-
-2007-03-17  David Turner   <david@freetype.org>
-
-       * src/truetype/ttinterp.c (Ins_IP): Fix wrong handling of the
-       (undocumented) twilight zone special case.
-
-2007-03-09  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.2 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-2'.
-
-       * builds/win32/visualc/index.html,
-       builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj, README: s/2.3.1/2.3.2/,
-       s/231/232/.
-
-2007-03-08  David Turner  <david@freetype.org>
-
-       * docs/CHANGES, docs/VERSION.DLL: Updated for upcoming release.
-
-       * builds/unix/configure.raw (version_info): Set to 9:13:3.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
-
-       * README, Jamfile (RefDoc): s/2.3.1/2.3.2/.
-
-       * src/base/ftutil.c (ft_mem_strcpyn): Fix a bug that prevented the
-       function to work properly, over-writing user-provided buffers in
-       some cases.  Reported by James Cloos <cloos@jhcloos.com>.
-
-
-2007-03-05  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/config/ftstdlib.h (ft_strstr): New wrapper
-       macro for `strstr'.
-
-       * src/truetype/ttobjs.c (tt_face_init): Use ft_strstr for scanning
-       `trick_names', as suggested by Ivan Nincic.
-
-2007-03-05  David Turner  <david@freetype.org>
-
-       * src/base/ftinit.c (FT_Init_FreeType): Fix a small memory leak in
-       case FT_Init_FreeType fails for some reason.  Problem reported by
-       Maximilian Schwerin <maximilian.schwerin@buelowssiege.de>.
-
-       * src/truetype/ttobs.c (tt_size_init_bytecode): Clear the `x_ppem'
-       and `y_ppem' fields of the `TT_Size.metrics' structure, not those of
-       `TT_Size.root.metrics'.  Problem reported by Daniel Glöckner
-       <daniel-gl@gmx.net>.
-
-       * src/type1/t1afm.c (T1_Read_PFM): Read kerning values as 16-bit
-       signed values, not unsigned ones.  Problem reported by Johannes
-       Walther <joh_walt@yahoo.de>.
-
-2007-02-21  David Turner  <david@freetype.org>
-
-       * src/pshinter/pshalgo.c (psh_hint_align): Fix a bug in the hinting
-       of small and ghost stems in the Postscript interpreter.
-
-2007-02-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (FT_GetFileRef_From_Mac_ATS_Name): Fix memory
-       leak, patch by "Jjgod Jiang" <gzjjgod@gmail.com>.
-       * builds/mac/ftmac.c (FT_GetFileRef_From_Mac_ATS_Name): Ditto.
-
-2007-02-16  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (Ins_MD): Remove unused variable.
-       * src/autofit/aflatin.c (af_latin_hints_link_segments): Ditto.
-
-2007-02-14  David Turner  <david@freetype.org>
-
-       It seems that the following changes fix most of the known
-       interpreter problems with my fonts, but more testing is needed,
-       though.
-
-       * src/truetype/ttinterp.c (FIX_BYTECODE): Activate.
-       (TT_MulFix14): Rewrite.
-       (Ins_MD, Ins_MDRP, Ins_IP) [FIX_BYTECODE]: Improved and updated.
-       (Ins_MIRP): Ditto.
-
-2007-02-12  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttinterp.c (Project_x, Project_y): Remove compiler
-       warnings.
-
-       * src/pcf/pcfread.c (pcf_interpret_style), src/bdf/bdfdrivr.c
-       (bdf_interpret_style): Ditto.
-
-2007-02-12  David Turner  <david@freetype.org>
-
-       Simplify projection and dual-projection code interface.
-
-       * src/truetype/ttinterp.h (TT_Project_Func): Use `FT_Pos', not
-       FT_Vector' as argument type.
-       * src/truetype/ttinterp.c (CUR_Func_project, CUR_Func_dualproj):
-       Updated.
-       (CUR_fast_project, CUR_fast_dualproj): New macros.
-       (Project, Dual_Project, Project_x, Project_y): Updated.
-       (Ins_GC, Ins_SCFS, Ins_MDAP, Ins_MIAP, Ins_IP): Use new `fast'
-       macros.
-
-
-       * src/autofit/afloader.c (af_loader_load_g): Improve spacing
-       adjustments for the non-light auto-hinted modes.  Gets rid of
-       `inter-letter spacing is too wide' problems.
-
-       * src/autofit/aflatin.c (af_latin_hints_link_segments,
-       af_latin_hints_compute_edges): Slight optimization of the segment
-       linker and better handling of serif segments to get rid of broken
-       `9' in Arial at 9pt (96dpi).
-
-
-       Introduce new string functions and the corresponding macros to get
-       rid of various uses of strcpy and other `evil' functions, as well as
-       to simplify a few things.
-
-       * include/freetype/internal/ftmemory.h (ft_mem_strdup, ft_mem_dup,
-       ft_mem_strcpyn): New declarations.
-       (FT_MEM_STRDUP, FT_STRDUP, FT_MEM_DUP, FT_DUP, FT_STRCPYN): New
-       macros.
-       * src/base/ftutil.c (ft_mem_dup, ft_mem_strdup, ft_mem_strcpyn): New
-       functions.
-
-       * src/bfd/bfddrivr.c (bdf_interpret_style, BDF_Face_Init),
-       src/bdf/bdflib.c (_bdf_add_property), src/pcf/pcfread.c
-       (pcf_get_properties, pcf_interpret_style, pcf_load_font),
-       src/cff/cffdrivr.c (cff_get_glyph_name), src/cff/cffload.c
-       (cff_index_get_sid_string), src/cff/cffobjs.c (cff_strcpy),
-       src/sfnt/sfdriver.c (sfnt_get_glyph_name), src/type1/t1driver.c
-       (t1_get_glyph_name), src/type42/t42drivr.c (t42_get_glyph_name,
-       t42_get_name_index): Use new functions and simplify code.
-
-       * builds/mac/ftmac.c (FT_FSPathMakeSpec): Don't use FT_MIN.
-
-2007-02-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/autofit/afloader.c (af_loader_load_g): Don't change width for
-       non-spacing glyphs.
-
-2007-02-07  Tom Parker  <palfrey@tevp.net>
-
-       * src/cff/cffdrivr.c (cff_get_name_index): Protect against NULL
-       pointer.
-
-2007-02-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/ftmac.h (FT_DEPRECATED_ATTRIBUTE):
-       Introduce __attribute((deprecated))__ to warn functions
-       which use non-ANSI data types in its interfaces.
-       (FT_GetFile_From_Mac_Name): Deprecated, using FSSpec.
-       (FT_GetFile_From_Mac_ATS_Name): Deprecated, using FSSpec.
-       (FT_New_Face_From_FSSpec): Deprecated, using FSSpec.
-       (FT_New_Face_From_FSRef): Deprecated, using FSRef.
-
-       * src/base/ftmac.c: Predefine FT_DEPRECATED_ATTRIBUTE as void
-       to avoid warning in building FreeType.
-       * builds/mac/ftmac.c: Ditto.
-
-2007-02-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftbase.c: Fix to use builds/mac/ftmac.c, if configured
-       `--with-fsspec' etc.  Replace #include "ftmac.c" with
-       #include <ftmac.c>.
-
-2007-02-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/ftmac.h (FT_GetFilePath_From_Mac_ATS_Name):
-       Introduced as replacement of FT_GetFile_From_Mac_ATS_Name.
-       * src/base/ftmac.c (FT_GetFilePath_From_Mac_ATS_Name): Ditto.
-       (FT_GetFile_From_Mac_ATS_Name): Rewritten as wrapper of
-       FT_GetFilePath_From_Mac_ATS_Name.
-       * builds/mac/ftmac.c: Ditto.
-
-2007-02-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/ftmac.h: Fixed wrong comment: FSSpec of
-       FT_GetFile_From_Mac_Name, FT_GetFile_From_Mac_ATS_Name are
-       for passing to FT_New_Face_From_FSSpec.
-
-2007-02-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw: Check whether Mac OS X system headers
-       can be built under ANSI C mode.
-
-       * src/base/ftmac.c (OS_INLINE): Redefine OS_INLINE by a version
-       compatible to ANSI C in case system headers are ANSI C incompatible.
-       * builds/mac/ftmac.c (OS_INLINE): Ditto.
-
-2007-02-01  Werner Lemberg  <wl@gnu.org>
-
-       * include/freetype/ttnameid.h (TT_MS_LANGID_DZONGHKA_BHUTAN):
-       Explain why applications shouldn't use it.  Found by Alexei.
-
-2007-02-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
-
-       * builds/unix/freetype2.m4 (AC_CHECK_FT2): Fix spelling of warning
-       message.
-
-       * src/gxvalid/gxvmort1.c
-       (gxv_mort_subtable_type1_substTable_validate): Fix debugging
-       message.
-
-2007-01-31  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.1 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-1-FINAL'.
-
-       * builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj: s/230/231/.
-       * builds/win32/visualc/index.html: s/221/231/.
-
-       * vms_make.com: Add `ftgasp'.
-
-2007-01-30  David Turner  <david@freetype.org>
-
-       Tag sources with VER-2-3-1 to prepare release.
-
-       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
-       * docs/VERSION.DLL, docs/release, README, Jamfile (RefDoc):
-       s/2.3.0/2.3.1/.
-
-       * builds/unix/configure.raw (version_info): Set to 9:12:3.
-
-
-       * src/autofit/aftypes.h (AF_USE_WARPER), src/autofit/afloader.c
-       (af_loader_load_g): Disable the warper (i.e., the light hinting
-       improvements) to make a 2.3.1 bugfix release before introducing a
-       new feature.  This should give us more time to tune and improve the
-       warper for the next release.
-
-       * docs/CHANGES: Update accordingly.
-
-2007-01-25  David Turner  <david@freetype.org>
-
-       For light auto-hinting, improve glyph advance widths and resurrect
-       normal/full hinting to its normal quality.
-
-       * src/autofit/afhints.h (AF_GlyphHintsRec): New members `xmin_delta'
-       and `xmax_delta'.
-       * src/autofit/afhints.c (af_glyph_hints_reload): Reset `xmin_delta'
-       and `xmax_delta'.
-
-       * src/autofit/afloader.c (af_loader_load_g) <AF_USE_WARPER>: Replace
-       preprocessor conditional with if-clause, handling both light and
-       normal mode.
-
-       * src/autofit/afwarp.c (AF_WarpScore): Fine-tune again.
-       (af_warper_compute): Handle `xmin_delta' and `xmax_delta'.
-
-2007-01-25  Werner Lemberg  <wl@gnu.org>
-
-       * docs/release: Updated -- Savannah uses a new uploading scheme.
-
-2007-01-25  David Turner  <david@freetype.org>
-
-       * src/cff/cffload.c (cff_index_get_pointers): Improve previous fix.
-
-       * src/cff/cffgload.c (cff_decoder_parse_charstrings)
-       <cff_op_callsubr, cff_op_callgsubr>: Fix sanity check for empty
-       functions.
-
-       * docs/CHANGES: Document light auto-hinting improvement.
-
-2007-01-25  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_index_get_pointers): Handle last entry
-       correctly in a sanity check.  Since this function is only used to
-       load local and global functions, any charstring that called the last
-       local/global function would fail otherwise.  This fixes Savannah bug
-       #18867.
-
-       * docs/CHANGES: Document it.
-
-2007-01-23  David Turner  <david@freetype.org>
-
-       * src/truetype/ttobjs.c (tt_size_ready_bytecode): Fix typo that
-       prevented compilation when disabling both the unpatented and the
-       bytecode interpreter in the TrueType font driver.
-
-
-       Fix and enable the warper to improve `light' hinting mode.  This is
-       not necessarily a final version, but it seems to work well.
-
-       * src/autofit/aflatin.c (af_latin_hints_init) [AF_USE_WARPER]:
-       Disable code.
-       (af_latin_hints_apply) [AF_USE_WARPER]: Handle FT_RENDER_MODE_LIGHT.
-       * src/autofit/aftypes.h: Activate AF_USE_WARPER.
-
-       * src/autofit/afwarp.c (AF_WarpScore): Tune table.
-       (af_warper_compute_line_best): Fix array size of `scores'.
-       (af_warper_compute): Better handling of border cases.
-       * src/autofit/afwarp.h (AF_WarperRec): Remove unused members `X1'
-       and `X2'.
-
-2007-01-21  Werner Lemberg  <wl@gnu.org>
-
-       * ChangeLog: Split off older entries into...
-       * ChangeLog.22: This new file.
-
-2007-01-21  Werner Lemberg  <wl@gnu.org>
-
-       * docs/CHANGES: Document SHZ fix.
-
-2007-01-21  George Williams  <gww@silcom.com>
-
-       * src/truetype/ttinterp.c (Ins_SHZ): SHZ doesn't move phantom
-       points.
-
-2007-01-21  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttmtx.c (tt_face_get_metrics)
-       [!FT_CONFIG_OPTION_OLD_INTERNALS]: Fix limit check.
-
-2007-01-17  Werner Lemberg  <wl@gnu.org>
-
-
-       * Version 2.3.0 released.
-       =========================
-
-
-       Tag sources with `VER-2-3-0-FINAL'.
-
-2007-01-17  Werner Lemberg  <wl@gnu.org>
-
-       * docs/release: Updated.
-
-2007-01-16  David Turner  <david@freetype.org>
-
-       * src/autofit/aflatin.c (af_latin_hints_compute_segments),
-       src/cff/cffdriver.c (cff_ps_get_font_info), src/truetype/ttobjs.c
-       (tt_face_init), src/truetype/ttinterp.c (Ins_SHC): Fix compiler
-       warnings.
-
-2007-01-15  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       * builds/amiga/makefile, builds/amiga/makefile.os4,
-       builds/amiga/smakefile: Add `ftgasp.c' and `ftlcdfil.c'.
-
-       * builds/amiga/include/freetype/config/ftconfig.h: Synchronize.
-
-2007-01-14  Detlef Würkner  <TetiSoft@apg.lahn.de>
-
-       Fix various compiler warnings.
-
-       * src/truetype/ttdriver.c (tt_size_select), src/cff/cffobjs.h,
-       src/cff/cffobjs.c (cff_size_request), src/type42/t42objs.h:
-       s/index/strike_index/.
-       * src/base/ftobjs.c (FT_Match_Size): s/index/size_index/.
-
-       * src/gxvalid/gxvmorx5.c
-       (gxv_morx_subtable_type5_InsertList_validate): s/index/table_index/.
-
-       * src/truetype/ttinterp.c (Compute_Point_Displacement),
-       src/pcf/pcfread.c (pcf_seek_to_table_type): Avoid possibly
-       uninitialized variables.
-
-2007-01-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * docs/CHANGES, docs/INSTALL.MAC: Improvements.
-
-2007-01-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1afm.c (T1_Read_Metrics): MS Windows allows PFM
-       versions up to 0x3FF without complaining.
-
-2007-01-13  Derek Clegg  <dclegg@apple.com>
-
-       Add FT_Get_PS_Font_Info interface to CFF driver.
-
-       * src/cff/cfftypes.h: Include FT_TYPE1_TABLES_H.
-       (CFF_FontRec): Add `font_info' field.
-
-       * src/cff/cffload.c: Include FT_TYPE1_TABLES_H.
-       (cff_font_done): Free font->font_info if necessary.
-
-       * src/cff/cffdrvr.c (cff_ps_get_font_info): New function.
-       (cff_service_ps_info): Register cff_ps_get_font_info.
-
-2007-01-13  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Fix compilation
-       with C++ compiler.
-
-       * src/autofit/afhints.c (af_glyph_hints_dump_segments,
-       af_glyph_hints_dump_edges): Ditto.
-
-       * src/base/rules.mk (BASE_SRC): Remove ftgasp.c (it's already in
-       `modules.cfg').
-
-       * src/sfnt/ttsbit0.h: Remove.
-
-       * src/sfnt/rules.mk (SFNT_DRV_SRC): Don't include ttsbit0.c.
-
-2007-01-12  David Turner  <david@freetype.org>
-
-       * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Fix memory stomping
-       bug in the bitmap emboldener if the pitch of the source bitmap is
-       much larger than its width.
-
-       * src/truetype/ttinterp.c (Update_Max): Fix aliasing-related
-       compilation warning.
-
-2007-01-12  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
-       `automake' CVS module from sources.redhat.com.
-
-2007-01-11  Werner Lemberg  <wl@gnu.org>
-
-       * src/type1/t1load.c (is_space): Removed.
-       (parse_encoding, parse_charstrings): Use IS_PS_DELIM.
-       (parse_charstrings): Use IS_PS_TOKEN.
-
-
-       * autogen.sh: Avoid bash specific syntax.
-
-2007-01-11  David Turner  <david@freetype.org>
-
-       * docs/CHANGES: Small update.
-
-       * builds/unix/configure.raw (version_info): Set to 9:11:3.
-
-       * src/base/ftobjs.c (IsMacResource): Fix a small bug that caused a
-       crash with some Mac OS X .dfont files.  Submitted by Masatake
-       Yamato.
-
-       * autogen.sh: Small fix to get it working on Mac OS X properly:
-       The issue is that GNU libtool is called `glibtool' on this platform,
-       and we must call `glibtoolize', since `libtoolize' doesn't exist.
-
-2007-01-10  David Turner  <david@freetype.org>
-
-       * all-sources: Tag all sources with VER-2-3-0-RC1 and
-       VER-2-3-0.
-
-       * Jamfile (RefDoc), README, builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj, docs/VERSION.DLL: Update
-       version number to 2.3.0.
-
-       * include/freetype/freetype.h (FREETYPE_MINOR): Set to 3.
-       (FREETYPE_PATCH): Set to 0.
-
-       * include/freetype/ftchapters.h, include/freetype/ftgasp.h,
-       include/freetype/ftlcdfil.h: Update reference documentation with
-       GASP support and LCD filtering sections.
-
-       * src/pshinter/pshalgo.c (psh_glyph_compute_inflections): Fix a typo
-       which created an endless loop with some malformed font files.
-
-2007-01-10  Derek Clegg  <dclegg@apple.com>
-
-       * src/type1/t1load.c (T1_Get_MM_Var): Always return fixed point
-       values.
-
-2007-01-08  David Turner  <david@freetype.org>
-
-       * docs/CHANGES: Updated.
-
-       * include/freetype/ftgasp.h, src/base/ftgasp.c: New files which add
-       a new API `FT_Get_Gasp' to return entries of the `gasp' table
-       corresponding to a given character pixel size.
-
-       * src/sfnt/ttload.c (tt_face_load_gasp): Add version check for the
-       `gasp' table, in order to avoid potential problems with later
-       versions.
-
-       * include/freetype/config/ftheader.h (FT_GASP_H): New macro for
-       <freetype/ftgasp.h>.
-
-       * src/base/rules.mk (BASE_SRC), src/base/Jamfile (_sources),
-       modules.cfg (BASE_EXTENSIONS), builds/win32/visualc/freetype.dsp,
-       builds/win32/visualc/freetype.vcproj: Add src/base/ftgasp.c to the
-       default build.
-
-2007-01-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidparse.c (cid_parser_new): Improve error message for
-       Type 11 fonts.
-       Scan for `/sfnts' token.
-
-2007-01-07  Werner Lemberg  <wl@gnu.org>
-
-       * src/cid/cidparse.c (cid_parser_new): Reject Type 11 fonts.
-
-2007-01-06  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_index_init): Remove unused variable.
-       (cff_index_read_offset): s/perror/errorp/ to avoid global shadowing.
-
-2007-01-04  David Turner  <david@freetype.org>
-
-       * src/pfr/pfrobjs.c (pfr_face_init): Detect non-scalable fonts
-       correctly.  This fixes Savannah bug #17876.
-
-
-       Do not allocate interpreter-specific tables in memory if we are not
-       going to load glyphs with the bytecode interpreter anyway.
-
-       * src/truetype/ttgload.c (tt_loader_init): Load execution context
-       only if glyph is hinted.
-       Updated.
-       * src/truetype/ttobjs.h (TT_SizeRec): Add members `bytecode_ready'
-       and `cvs_ready'.
-       Add `tt_size_ready_bytecode' declaration.
-       * src/truetype/ttobjs.c (tt_size_done_bytecode,
-       tt_size_init_bytecode, tt_size_ready_bytecode): New functions.
-       (tt_size_init): Move most code into `tt_size_init_bytecode'.
-       (tt_size_done): Move most code into `tt_size_done_bytecode'.
-       (tt_size_reset): Move some code to `tt_size_ready_bytecode'.
-
-
-       Don't extract the metrics table from the SFNT font file.  Instead,
-       reparse it on each glyph load.  The runtime difference is not
-       noticeable, and it can save a lot of heap memory when memory-mapped
-       files are not used.
-
-       * include/freetype/internal/tttypes.h (TT_FaceRec): Add members
-       `horz_metrics_offset' and `vert_metrics_ofset'.
-       * src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_get_metrics):
-       Updated.
-
-
-       * src/sfnt/ttcmap.c (tt_cmap4_validate): Slight optimization.
-
-
-       Do not load the CFF index offsets into memory, since this wastes a
-       *lot* of heap memory with large Asian CFF fonts.  There is no
-       significant performance loss.
-
-       * src/cff/cffload.h: Add `cff_charset_cid_to_gindex' declaration.
-       * src/cff/cfftypes.h (CFF_IndexRec): Add fields `start' and
-       `data_size'.
-       (CFF_CharsetRec): Add field `num_glyphs'.
-
-       * src/cff/cffload.c (cff_index_read_offset, cff_index_load_offsets,
-       cff_charset_cid_to_gindex): New functions.
-       (cff_new_index): Renamed to...
-       (cff_index_init): This.  Update all callers.
-       Updated -- some code has been moved to `cff_index_load_offsets'.
-       (cff_done_index): Renamed to...
-       (cff_index_done): This.  Update all callers.
-       (cff_index_get_pointers, cff_index_access_element): Updated to use
-       stream offsets.
-       (cff_charset_compute_cids): Set `num_glyphs' field.
-       (cff_encoding_load): Updated.
-
-       * src/cff/cffgload.c (cff_slot_load): Updated.
-
-2007-01-04  David Turner  <david@freetype.org>
-
-       * docs/INSTALL.UNIX: Simplify some parts, add reference to
-       autogen.sh and pointer to README.CVS.
-
-       * README.CVS: Add common problem description and solution
-       when running autogen.sh.
-
-       * docs/INSTALL: Add reference to MacOS X.
-
-       * docs/MAKEPP, docs/INSTALL.MAC: New documentation files.
-
-       * docs/TODO: Remove obsolete items.
-
-       * src/raster/ftraster.c: (TRaster_Instance): Replace it with...
-       (TWorker): This.
-       Remove `count_table' and `memory'.
-       Make `grays' a pointer.
-       (TRaster): New structure.
-       (count_table): New static array.
-       (RAS_ARGS, RAS_ARG, RAS_VARS, RAS_VAR, FT_UNUSED_RASTER, cur_ras,
-       Vertical_Gray_Sweep_Step, ft_black_new, ft_black_done,
-       ft_black_set_mode, ft_black_render): Updated.
-       (ft_black_init): Don't initialize `count_table'.
-       (ft_black_reset): Use the render pool.  This saves about 6KB of
-       heap space for each FT_Library instance.
-
-       * src/smooth/ftgrays.c (TRaster): Replaced with...
-       (TWorker): This.
-       Remove `memory'.
-       (TRaster): New structure.
-
-       (RAS_ARG_, RAS_ARG, RAS_VAR_, RAS_VAR, ras, gray_render_line,
-       gray_move_to, gray_line_to, gray_conic_to, gray_cubic_to,
-       gray_render_span, gray_raster_render): Updated.
-       (gray_raster_reset): Use the render pool.  This saves about 6KB of
-       heap space for each FT_Library instance.
-
-       * src/sfnt/sfobjs.c, src/sfnt/ttkern.c, src/sfnt/ttkern.h,
-       src/sfnt/ttmtx.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
-       src/truetype/ttpload.c, include/freetype/config/ftoption.h: Remove
-       FT_OPTIMIZE_MEMORY macro (and code for !FT_OPTIMIZE_MEMORY) since
-       the optimization is no longer experimental.
-
-       * src/pshinter/pshalgo.c (psh_glyph_interpolate_normal_points):
-       Remove a typo that results in no hinting and a memory leak with some
-       large Asian CFF fonts.
-
-       * src/base/ftobjs.c (FT_Done_Library): Remove a subtle memory leak
-       which happens when FT_Done_Library is called with still opened
-       CFF_Faces in it.  We need to close all faces before destroying the
-       modules, or else some bad things (memory leaks) may happen.
-
-2007-01-02  Werner Lemberg  <wl@gnu.org>
-
-       * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt0_pairs_validate):
-       Remove compiler warning.
-
-2007-01-02  David Turner  <david@freetype.org>
-
-       * src/sfnt/sfobjs.c: Add documentation comment.
-
-2006-12-31  Masatake YAMATO  <jet@gyve.org>
-
-       * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt0_pairs_validate): New
-       function.
-       Check uniqueness of the gid pairs.
-       (gxv_kern_subtable_fmt0_validate): Move some code to
-       `gxv_kern_subtable_fmt0_pairs_validate'.
-
-2006-12-22  David Turner  <david@freetype.org>
-
-       * src/autofit/aflatin.c, src/truetype/ttgload.c: Remove compiler
-       warnings.
-
-       * builds/win32/visualc/freetype.vcproj: Add _CRT_SECURE_NO_DEPRECATE
-       to avoid deprecation warnings with Visual C++ 8.
-
-2006-12-16  Anders Kaseorg  <anders@kaseorg.com>
-
-       * src/base/ftlcdfil.c (FT_Library_SetLcdFilter)
-       [FT_FORCE_LIGHT_LCD_FILTER]: Fix typo.
-
-2006-12-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * include/freetype/internal/services/svotval.h: Add `volatile' to
-       sync with the modification by Jens Claudius on 2006-08-22; cf.
-         http://cvs.savannah.gnu.org/viewcvs/freetype/freetype2/src/otvalid/otvmod.c?r1=1.4&r2=1.5
-
-2006-12-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c: Specialized for Mac OS X only.
-       * builds/unix/ftconfig.in: Fixed for ppc64 missing Carbon framework.
-       * builds/unix/configure.raw: Ditto.  When explicit switches for
-       FSSpec/FSRef/QuickDraw/ATS availability are given to configure,
-       builds/mac/ftmac.c is used instead of default src/base/ftmac.c.
-
-2006-12-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/mac/ftmac.c: Copied src/base/ftmac.c for legacy system.
-       * builds/mac/FreeType.m68k_cfm.make.txt: Fix to use builds/mac/ftmac.c
-       instead of src/base/ftmac.c
-       * builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
-       * builds/mac/FreeType.ppc_classic.make.txt: Ditto.
-       * builds/mac/FreeType.m68k_far.make.txt: Ditto, and exclude gxvalid.c
-       that cannot be built at present.
-
-2006-12-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftobjs.c: Improvement of resource fork handler for
-       POSIX, cf.
-         http://lists.gnu.org/archive/html/freetype-devel/2006-10/msg00025.html
-       (Mac_Read_sfnt_Resource): Count only `sfnt' resource of suitcase font
-       format or .dfont, to simulate the face index number counted by ftmac.c.
-       (IsMacResource): Return the number of scalable faces correctly.
-
-2006-12-10  Werner Lemberg  <wl@gnu.org>
-
-       * builds/toplevel.mk (version): Protect against `distclean' target.
-
-2006-12-09  Werner Lemberg  <wl@gnu.org>
-
-       * builds/*/*def.mk, builds/*/detect.mk (CAT): Define to either `cat'
-       or `type'.
-
-       * builds/freetype.mk (version): Extracted from freetype.h, using
-       GNU make's built-in string functions.
-       (refdoc): Use $(version) instead of static version number.
-
-2006-12-08  Werner Lemberg  <wl@gnu.org>
-
-       * builds/toplevel.mk (dist): Extract version number from freetype.h.
-
-2006-12-08  Vladimir Volovich  <vvv@vsu.ru>
-
-       * 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>
-
-       * src/autofit/afloader.c (af_loader_load_g): Small adjustment
-       to the spacing of auto-fitted glyphs.  This only impacts rare
-       cases (e.g., Arial Bold at rather small character sizes).
-
-2006-12-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/rules.mk (SFNT_DRV_SRC): Add ttsbit0.c.
-
-2006-12-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/sfobjs.c (tt_face_get_name): All Unicode strings are
-       encoded in UTF-16BE.  Patch from Rajeev Pahuja <rpahuja@esri.com>.
-       (tt_name_entry_ascii_from_ucs4): Removed.
-
-
-       * include/freetype/ftxf86.h: Fix and extend comment so that it
-       appears in the documentation.
-
-       * include/freetype/ftchapters.h: Add `font_format' section.
-
-
-       * src/tools/docmaker/tohtml.py (HtmlFormatter::index_exit): Add link
-       to TOC in index page.
-
-2006-11-28  David Turner  <david@freetype.org>
-
-       * src/smooth/ftgrays.c (gray_raster_render): Return 0 when we are
-       trying to render into a zero-width/height bitmap, not an error code.
-
-       * src/truetype/ttobjs.c (tt_face_init): Fix typo in previous patch.
-
-       * src/smooth/ftgrays.c: Remove hard-coded error values; use FreeType
-       ones instead.
-
-       * src/autofit/afhints.c (af_glyph_hints_dump_segments): Remove unused
-       variable.
-
-2006-11-26  Pierre Hanser  <hanser@club-internet.fr>
-
-       * src/truetype/ttobjs.c (tt_face_init): Protect against NULL pointer.
-
-2006-11-25  David Turner  <david@freetype.org>
-
-       * src/autofit/afhints.c (af_glyph_hints_dump_points,
-       af_glyph_hints_dump_segments, af_glyph_hints_dumpedges) [!AF_DEBUG]:
-       Add stubs to link the `ftgrid' test program when debugging is
-       disabled in the auto-hinter.
-
-2006-11-23  David Turner  <david@freetype.org>
-
-       * src/autofit/afhints.c, src/autofit/afhints.h, src/autofit/aflatin.c,
-       src/autofit/aftypes.h: Miscellaneous auto-hinter improvements.
-
-       * src/autofit/afhints.c (af_glyph_hints_dump_segments) [AF_DEBUG]:
-       Emit more sensible information.
-
-       * src/autofit/afhints.h (AF_SegmentRec): Add `height' member.
-
-       * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Improve
-       rounding of blue values.
-       (af_latin_hints_compute_segments): Hint segment heights.
-       (af_latin_hints_link_segments): Reduce `len_score' value.
-       (af_latin_hints_compute_edges): Increase `segment_length_threshold'
-       value and use `height' member for comparisons.
-       (af_latin_hint_edges): Extend logging message.
-       Improve handling of remaining edges.
-
-2006-11-22  Werner Lemberg  <wl@gnu.org>
-
-       Fix Savannah bug #15553.
-
-       * src/truetype/ttgload.c (tt_loader_init): Re-execute the CVT
-       program after a change from mono to grayscaling (and vice versa).
-       Use correct constant for comparison to get `exec->grayscale'.
-
-2006-11-18  Werner Lemberg  <wl@gnu.org>
-
-       Because FT_Load_Glyph expects CID values for CID-keyed fonts, the
-       test for a valid glyph index must be deferred to the font drivers.
-       This patch fixes Savannah bug #18301.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Don't check `glyph_index'.
-       * src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/cff/cffgload.c
-       (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph),
-       src/pcf/pcfdrivr.c (PCF_Glyph_Load), src/pfr/pfrobjs.c
-       (pfr_slot_load), src/truetype/ttdriver.c (Load_Glyph),
-       src/type1/t1gload.c (T1_Load_Glyph), src/winfonts/winfnt.c
-       (FNT_Load_Glyph): Check validity of `glyph_index'.
-
-2006-11-13  David Turner  <david@freetype.org>
-
-       * src/truetype/ttinterp.c (FIX_BYTECODE): Undefine.  The interpreter
-       `enhancements' are still too buggy for general use.
-
-       * src/base/ftlcdfil.c: Add support for FT_FORCE_LIGHT_LCD_FILTER and
-       FT_FORCE_LEGACY_LCD_FILTER at compile time.  Define these macros
-       when building the library to change the default LCD filter to be
-       used.  This is only useful for experimentation.
-
-       * include/freetype/ftlcdfil.h: Update documentation.
-
-2006-11-10  David Turner  <david@freetype.org>
-
-       * src/smooth/ftsmooth.c: API change for the LCD
-       filter.  The FT_LcdFilter value is an enumeration describing which
-       filter to apply, with new values FT_LCD_FILTER_LIGHT and
-       FT_LCD_FILTER_LEGACY (the latter implements the LibXft original
-       algorithm which produces strong color fringes for everything
-       except very-well hinted text).
-
-       * include/freetype/ftlcdfil.h (FT_Library_SetLcdFilter): Change
-       second parameter to an enum type.
-
-       * src/base/ftlcdfil.c (USE_LEGACY): Define.
-       (_ft_lcd_filter): Rename to...
-       (_ft_lcd_filter_fir): This.
-       Update parameters.
-       (_ft_lcd_filter_legacy) [USE_LEGACY]: New filter function.
-       (FT_Library_Set_LcdFilter): Update parameters.
-       Handle new filter modes.
-
-       * include/internal/ftobjs.h: Include FT_LCD_FILTER_H.
-       (FT_Bitmap_LcdFilterFunc): Change third argument to `FT_Library'.
-       (FT_LibraryRec) [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Add filtering
-       callback and update other fields.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic)
-       [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Update.
-       Other minor improvements.
-
-       * src/autofit/aflatin.c: Various tiny improvements that drastically
-       improve the handling of serif fonts and of LCD/LCD_V hinting modes.
-       (af_latin_hints_compute_edges): Fix typo.
-       (af_latin_compute_stem_width): Take better care of diagonal stems.
-
-2006-11-09  David Turner  <david@freetype.org>
-
-       * src/pshinter/pshalgo.c (psh_glyph_compute_inflections): Fix
-       typo which created a variable-used-before-initialized bug.
-
-2006-11-07  Zhe Su  <james.su@gmail.com>
-
-       * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Handle vertical layout
-       also.
-
-2006-11-03  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftcalc.c: Don't use `long long' but `FT_Int64'.
-
-2006-11-02  David Turner  <david@freetype.org>
-
-       Add a few tweaks to better handle serif fonts.
-       Add more debugging messages.
-
-       * src/autofit/aflatin.c (af_latin_hints_compute_edges): Ignore
-       segments that are less than 1.5 pixels high.  This gets rid of
-       *many* corner cases with serifs.
-       (af_latin_align_linked_edge): Add logging message.
-       (af_latin_hint_edges): Use AF_HINTS_DO_BLUES.
-       Add logging messages.
-       Handle AF_EDGE_FLAG flag specially.
-
-       * src/autofit/afmodule.c [AF_DEBUG]: Add _af_debug,
-       _af_debug_disable_blue_hints, and _af_debug_hints variables.
-
-       * src/autofit/aftypes.h (AF_LOG) [AF_DEBUG]: Use _af_debug.
-       Update external declarations.
-       (af_corner_orientation, af_corner_is_flat): Replaced by...
-
-       * include/freetype/internal/ftcalc.h (ft_corner_orientation,
-       ft_corner_is_flat): These declarations.
-
-       * src/autofit/afangles.c (af_corner_orientation, af_corner_is_flat):
-       Comment out.  Replaced by...
-
-       * src/base/ftcalc.h (ft_corner_orientation, ft_corner_is_flat):
-       These functions.  Update all callers.
-       (FT_Add64) [!FT_LONG64]: Simplify.
-
-       * src/autofit/afhints.c: Include FT_INTERNAL_CALC_H.
-       (af_direction_compute): Add a missing FT_ABS call.  This bug caused
-       production of garbage by missing lots of segments.
-
-       * src/autofit/afhints.h (AF_HINTS_DO_BLUES): New macro.
-
-       * src/autofit/afloader.c (af_loader_init, af_loader_done)
-       [AF_DEBUG]: Set _af_debug_hints.
-
-
-       * src/pshinter/pshalgo.c: Include FT_INTERNAL_CALC_H.
-       (psh_corner_is_flat, psh_corner_orientation): Use ft_corner_is_flat
-       and ft_corner_orientation.
-
-
-       * src/gzip/inftrees.c (huft_build): Remove compiler warning.
-
-2006-10-24  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_encoding_load): Remove unused variable.
-
-       * src/base/ftobjs.c (FT_Select_Charmap): Disallow FT_ENCODING_NONE
-       as argument.
-
-2006-10-23  Zhe Su  <zsu@novell.com>
-
-       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Re-implement to
-       better deal with broken Asian fonts with strange glyphs, having
-       self-intersections and other peculiarities.  The used algorithm is
-       based on the nonzero winding rule.
-
-2006-10-23  David Turner  <david@freetype.org>
-
-       Speed up the CFF font loader.  With some large CFF fonts,
-       FT_Open_Face is now more than three times faster.
-
-       * src/cff/cffload.c (cff_get_offset): Removed.
-       (cff_new_index): Inline functionality of `cff_get_offset'.
-       (cff_charset_compute_cids, cff_charset_free_cids): New functions.
-       (cff_charset_done): Call `cff_charset_free_cids'.
-       (cff_charset_load): Call `cff_charset_compute_cids'.
-       (cff_encoding_load) <Populate>: Ditto, to replace inefficient loop.
-
-       * src/sfnt/ttmtx.c (tt_face_load_hmtx): Replace calls to FT_GET_XXX
-       with FT_NEXT_XXX.
-
-
-       Speed up the Postscript hinter, with more than 100% speed increase
-       on my machine.
-
-       * src/pshinter/pshalgo.c (psh_corner_is_flat,
-       psh_corner_orientation): New functions.
-       (psh_glyph_compute_inflections): Merge loops for efficiency.
-       Use `psh_corner_orientation'.
-       (psh_glyph_init): Use `psh_corner_is_flat'.
-       (psh_hint_table_find_strong_point): Renamed to...
-       (psh_hint_table_find_strong_points): This.
-       Rewrite, adding argument to handle all points at once.
-       Update all callers.
-       (PSH_MAX_STRONG_INTERNAL): New macro.
-       (psh_glyph_interpolate_normal_points): Rewrite for efficiency.
-
-2006-10-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (FT_New_Face_From_FOND): Initialize variable
-       `error' with FT_Err_Ok.
-
-2006-10-14  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * docs/INSTALL.CROSS: New document file for cross-building.
-
-       * builds/unix/configure.raw: Preliminary cross-building support.
-       Find native C compiler and pass it by CC_BUILD, and
-       find suffix for native executable and pass it by EXEEXT_BUILD.
-       Also suffix for target executable is passed by EXEEXT.
-
-       * builds/unix/unix-cc.in (CCraw_build, E_BUILD): New variables to
-       build `apinames' which runs on building system.  They are set by
-       CC_BUILD and EXEEXT_BUILD.
-
-       * builds/exports.mk (APINAMES_EXE): Change the extension for
-       apinames from the suffix for target (E) to that for building host
-       (E_BUILD).
-
-2006-10-12  Werner Lemberg  <wl@gnu.org>
-
-       * docs/INSTALL.UNX, docs/UPGRADE.UNX: Renamed to...
-       * docs/INSTALL.UNIX, docs/UPGRADE.UNIX: This.  Update all documents
-       which reference those files.
-
-2006-10-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * builds/unix/configure.raw (FT2_EXTRA_LIBS): New variable.  It is
-       embedded in freetype2.pc and freetype-config.  Use it to record
-       Carbon dependency of MacOSX.
-
-       * builds/unix/freetype2.in: Embed FT2_EXTRA_LIBS.
-
-       * builds/unix/freetype-config.in: Ditto.
-
-2006-10-11  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h (FT_CONFIG_OPTION_SUBPIXEL_RENDERING): Define for
-       development.
-
-2006-10-03  Jens Claudius  <jens.claudius@yahoo.com>
-
-       * include/freetype/config/ftstdlib.h: Cast away volatileness from
-       argument to ft_setjmp.
-
-       * include/freetype/internal/ftvalid.h: Add comment that
-       ft_validator_run must not be used.
-
-2006-10-01  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/ftbase.c: Undo change from 2006-09-30.
-
-       * src/base/rules.mk (BASE_SRC): Remove `ftlcdfil.c'.
-
-2006-09-30  David Turner  <david@freetype.org>
-
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec):
-       s/unpatented_hinting/ignore_unpatented_hinter/.
-       Update all callers.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Refine the algorithm whether
-       auto-hinting shall be used or not.
-
-       * src/truetype/ttobjs.c (tt_face_init): Ditto.
-
-2006-09-30  Werner Lemberg  <wl@gnu.org>
-
-       * src/base/rules.mk (BASE_SRC): Remove `ftapi.c' (which is no longer
-       in use).
-
-       * src/base/ftbase.c: Include `ftlcdfil.c'.
-
-2006-09-29  Werner Lemberg  <wl@gnu.org>
-
-       * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary): Fix algorithm for
-       overlapping segments.  Bug reported by Stefan Koch.
-
-2006-09-28  David Turner  <david@freetype.org>
-
-       Fix a bug in the automatic unpatented hinting support which prevents
-       normal bytecode hinting to work properly.
-
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec):
-       s/force_autohint/unpatented_hinting/.  Update all callers.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Updated code.
-
-       * src/autofit/aftypes.h (AF_DEBUG): Undefine to get rid of traces.
-
-2006-09-27  David Turner  <david@freetype.org>
-
-       * include/freetype/freetype.h (FT_FREETYPE_PATCH): Set to 2.
-
-
-       Add a new API to support color filtering of subpixel glyph bitmaps.
-       In a default build, the function `FT_Library_SetLcdFilter' returns
-       `FT_Err_Unimplemented_Feature'; you need to #define
-       FT_CONFIG_OPTION_SUBPIXEL_RENDERING in ftoption.h to compile the
-       real implementation.
-
-       * include/freetype/ftlcdfil.h, src/base/ftlcdfil.c: New files.
-
-       * include/freetype/internal/ftobjs.h (FT_Bitmap_LcdFilterFunc): New
-       typedef.
-       (FT_LibraryRec) [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: New members
-       `lcd_filter_weights' and `lcd_filter'.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove arguments
-       `hmul' and `vmul'.
-
-       Handle subpixel rendering.
-       Simplify function.
-       (ft_smooth_render_lcd): Use `FT_RENDER_MODE_LCD'.
-       (ft_smooth_render_lcd_v): Use `FT_RENDER_MODE_LCD_V'.
-
-       * include/freetype/config/ftheader.h (FT_LCD_FILTER_H): New macro,
-       pointing to <freetype/ftlcdfil.h>.
-
-       * src/base/Jamfile (_sources), src/base/rules.mk (BASE_SRC),
-       vms_make.com: Add `ftlcdfil.c' to the list of compiled source files.
-
-       * modules.cfg (BASE_EXTENSIONS): Add ftlcdfil.c.
-
-2006-09-26  David Bustin
-
-       * src/pfr/pfrobjs.c (pfr_face_get_kerning): Skip adjustment bytes
-       correctly.  Reported as Savannah bug #17843.
-
-2006-09-26  David Turner  <david@freetype.org>
-
-       * src/autofit/afhints.h (AF_HINTS_DO_HORIZONTAL,
-       AF_HINTS_DO_VERTICAL, AF_HINTS_DO_ADVANCE): New macros to disable
-       horizontal and vertical hinting for the purpose of debugging the
-       auto-fitter.
-
-       * src/autofit/afmodule.c (_af_debug_disable_horz_hints,
-       _af_debug_disable_vert_hints) [AF_DEBUG]: New global variables.
-
-       * src/autofit/aftypes.h [AF_DEBUG]: Declare above variables.
-
-       * include/freetype/config/ftoption.h, devel/ftoption.h
-       (FT_CONFIG_OPTION_SUBPIXEL_RENDERING): New macro to control whether
-       we want to compile LCD-optimized rendering code (à la ClearType) or
-       not.  The macro *must* be disabled in default builds of the library
-       for patent reasons.
-
-       * src/smooth/ftsmooth.c (ft_smooth_render_generic): Disable
-       LCD-specific rendering when FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-       isn't defined at compile time.  This only changes the content of the
-       rendered glyph to match the one of normal gray-level rendering,
-       hence clients should not need to be modified.
-
-       * docs/CHANGES: Updated.
-
-2006-09-18  Garrick Meeker  <garrick@digitalanarchy.com>
-
-       * src/base/ftmac.c (FT_New_Face_From_FOND): Fall back to SFNT if
-       LWFN fails and both are available.
-
-2006-09-11  David Turner  <david@freetype.org>
-
-       * src/sfnt/sfobjs.c (tt_face_get_name): Support some fonts which
-       report their English names through an Apple Roman
-       (platform,encoding) pair, with language_id != English.
-
-       If the font uses another name entry with language_id == English, it
-       will be selected correctly, though.
-
-       * src/truetype/ttobjs.c (tt_face_init): Add unpatented hinting
-       selection for `mingli.ttf'.
-
-2006-09-05  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttpload.c (tt_face_load_hdmx): Handle `record_size'
-       values which have the upper two bytes set to 0xFF instead of 0x00
-       (as it happens in at least two CJKV fonts, `HAN NOM A.ttf' and
-       `HAN NOM B.ttf').
-
-       * src/smooth/ftgrays.c [GRAYS_USE_GAMMA]: Really remove all code.
-
-2006-09-05  David Turner  <david@freetype.org>
-
-       Minor source cleanups and optimizations.
-
-       * src/smooth/ftgrays.c (GRAYS_COMPACT): Removed.
-       (TRaster): Remove `count_ex' and `count_ey'.
-       (gray_find_cell): Remove 2nd and 3rd argument.
-       (gray_alloc_cell): Merged with `gray_find_cell'.
-       (gray_record_cell): Simplify.
-       (gray_set_cell): Rewrite.
-       (gray_start_cell): Apply offsets to `ras.ex' and `ras.ey'.
-       (gray_render_span): Don't use FT_MEM_SET for small values.
-       (gray_dump_cells) [DEBUG_GRAYS]: New function.
-       (gray_sweep): Avoid buffer overwrites when to drawing the end of a
-       bitmap scanline.
-       (gray_convert_glyph): Fix speed-up.
-
-2006-09-04  David Turner  <david@freetype.org>
-
-       * src/smooth/ftgrays.c (gray_convert_glyphs): Make it work with
-       64bit processors.
-
-2006-09-03  Werner Lemberg  <wl@gnu.org>
-
-       * devel/ftoption.h: Synchronize with
-       include/freetype/config/ftoption.h.
-
-       * src/smooth/ftgrays.c (gray_record_cell): Remove shadowing
-       variable declaration.
-       (gray_convert_glyph): Fix compiler warnings.
-
-2006-09-01  David Turner  <david@freetype.org>
-
-       * src/truetype/ttobjs.c (tt_face_init): Update the TrueType loader
-       to recognize a few fonts that require the automatic unpatented
-       loader.
-
-       * src/smooth/ftgrays.c: Optmize the performance of the anti-aliased
-       rasterizer.  The speed improvement is between 15% and 25%, depending
-       on the font data.
-
-       (GRAYS_USE_GAMMA, GRAYS_COMPACT): Removed, and all associated code.
-       (TCell): Redefine.
-       (TRaster): New members `buffer', `buffer_size', `ycells', `ycount'.
-       (gray_init_cells): Updated.
-       (gray_find_cell, gray_alloc_cell): New functions.
-       (gray_record_cell): Rewritten to use `gray_find_cell' and
-       `gray_alloc_cell'.
-       (PACK, LESS_THAN, SWAP_CELLS, DEBUG_SORT, QUICK_SORT, SHELL_SORT,
-       QSORT_THRESHOLD):
-       Removed.
-       (gray_shell_sort, gray_quick_sort, gray_check_sort,
-       gray_dump_cells): Removed.
-       (gray_sweep): Rewritten.
-       (gray_convert_glyph): Rewrite code which used one of the sorting
-       functions.
-       (gray_raster_render): Updated.
-
-2006-08-29  Dr. Werner Fink  <werner@suse.de>
-
-       * configure: Make it possible to handle configure options which
-       have strings containing spaces.
-
-2006-08-27  David Turner  <david@freetype.org>
-
-       * include/freetype/config/ftoption.h (TT_USE_BYTECODE_INTERPRETER):
-       New macro, defined if either TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-       or TT_CONFIG_OPTION_UNPATENTED_HINTING is defined.
-
-       * include/freetype/internal/ftcalc.h, src/base/ftcalc.c,
-       src/truetype/truetype.c, src/truetype/ttdriver.c,
-       src/truetype/ttgload.c, src/truetype/ttgload.h,
-       src/truetype/ttinterp.c, src/truetype/ttobjs.c,
-       src/truetype/ttobjs.h, src/truetype/ttpload.c, src/type42/t42drivr.c:
-       s/TT_CONFIG_OPTION_BYTECODE_INTERPRETER/TT_USE_BYTECODE_INTERPRETER/.
-
-       * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): New
-       member `force_autohint'.
-
-       * src/base/ftobjs.c (FT_Load_Glyph): Use `force_autohint'.
-
-       * src/truetype/ttobjs.c (tt_face_init): Prepare code for testing
-       against a list of font names which need the bytecode interpreter.
-
-2006-08-27  Jens Claudius  <jens.claudius@yahoo.com>
-
-       Fix miscellaneous compiler warnings.
-
-       * include/freetype/internal/ftobjs.h: Close comment with `*/' to
-       avoid `/* in comment' compiler warning.
-
-       * src/base/ftdbgmem.c (ft_mem_table_get_source): Turn cast
-       `(FT_UInt32)(void*)' into `(FT_UInt32)(FT_PtrDist)(void*)' since on
-       64-bit platforms void* is larger than FT_UInt32.
-
-       * src/base/ftobjs.c (t_validator_error): Cast away
-       volatileness of argument to ft_longjmp.  Spotted by Werner
-       `Putzfrau' Lemberg.
-
-       * src/bdf/bdflib.c (bdf_load_font): Initialize local
-       variable `lineno'.
-
-       * src/gxvalid/gxvmod.c (classic_kern_validate): Mark local variable
-       `error' as volatile.
-
-2006-08-27  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/ftconfig.in: Synchronize with main ftconfig.h.
-       Reported by Jens.
-
-2006-08-22  Jens Claudius  <jens.claudius@yahoo.com>
-
-       Fix for previous commit, which caused many compiler warnings/errors
-       about addresses of volatile objects passed as function arguments as
-       non-volatile pointers.
-
-       * include/freetype/internal/ftvalid.h: Make FT_Validator typedef a
-       pointer to a volatile object.
-
-       * src/gxvalid/gxvmod.c (gxv_load_table): Make function argument
-       `table' a pointer to a volatile object.
-
-       * src/otvalid/otvmod.c (otv_load_table): Make function argument
-       `table' a pointer to a volatile object.
-
-2006-08-18  Jens Claudius  <jens.claudius@yahoo.com>
-
-       * src/gxvalid/gxvmod.c (GXV_TABLE_DECL): Mark local variable `_sfnt'
-       as volatile since it must keep its value across a call to ft_setjmp.
-       (gxv_validate): Same for local variables `memory' and `valid'.
-       (classic_kern_validate): Same for local variables `memory',
-       `ckern', and `valid'.
-
-       * src/otvalid/otvmod.c (otv_validate): Same for function parameter
-       `face' and local variables `base', `gdef', `gpos', `gsub', `jstf',
-       and 'valid'.
-
-       * src/sfnt/ttcmap.c (tt_face_build_cmaps): Same for local variable
-       `cmap'.
-
-2006-08-16  David Turner  <david@freetype.org>
-
-       * src/cid/cidgload.c (cid_slot_load_glyph): Remove compiler
-       warnings.
-
-       * src/base/ftobjs.c (ft_validator_run): Disable function; it is
-       buggy by design.  Always return -1.
-
-
-       Improvements to native TrueType hinting.  This is a first try,
-       controlled by the FIX_BYTECODE macro in src/truetype/ttinterp.c.
-
-       * include/freetype/internal/ftgloadr.h (FT_GlyphLoadRec): Add member
-       `extra_points2'.
-
-       * include/freetype/internal/tttypes.h (TT_GlyphZoneRec): Add member
-       `orus'.
-
-       * src/base/ftgloadr.c (FT_GlyphLoader_Reset,
-       FT_GlyphLoader_Adjust_Points, FT_GlyphLoader_CreateExtra,
-       FT_GlyphLoader_CheckPoints, FT_GlyphLoader_CopyPoints): Updated to
-       handle `extra_points2'.
-
-       * src/truetype/ttgload.c (tt_prepare_zone): Handle `orus'.
-       Remove compiler warning.
-       (cur_to_arg): Remove macro.
-       (TT_Hint_Glyph): Updated.
-       (TT_Process_Simple_Glyph): Handle `orus'.
-
-       * src/truetype/ttinterp.c (FIX_BYTECODE): New macro.
-       (Ins_MD, Ins_MDRP, Ins_IP) [FIX_BYTECODE]: Handle `orus'.
-       (LOC_Ins_IUP): Renamed to...
-       (IUP_WorkerRec): This.
-       Add `orus' member.
-       (Shift): Renamed to...
-       (_iup_worker_shift): This.
-       Updated.
-       (Interp): Renamed to...
-       (_iup_worker_interpolate): This.
-       Updated to handle `orus'.
-       (Ins_IUP): Updated.
-
-       * src/truetype/ttobjs.c (tt_glyphzone_done, tt_glyphzone_new):
-       Handle `orus'.
-
-2006-08-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * modules.cfg (BASE_EXTENSIONS): Compile in ftgxval.c by default to
-       build ftvalid in ft2demos.  This has been inadvertedly changed
-       2006-08-13.
-
-2006-08-15  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       `ft_validator_run' wrapping `setjmp' can cause a crash, as found by
-       Jens:
-       http://lists.gnu.org/archive/html/freetype-devel/2006-08/msg00004.htm.
-
-       * src/otvalid/otvmod.c: Replace `ft_validator_run' by `ft_setjmp'.
-       It reverts the change introduced on 2005-08-20.
-
-       * src/gxvalid/gxvmod.c: Ditto.
-
-2006-08-13  Jens Claudius  <jens.claudius@yahoo.com>
-
-       * finclude/freetype/internal/psaux.h: (T1_TokenType): Add
-       T1_TOKEN_TYPE_KEY.
-       (T1_FieldRec): Add `dict'.
-       (T1_FIELD_DICT_FONTDICT, T1_FIELD_DICT_PRIVATE): New macros.
-       (T1_NEW_XXX, T1_FIELD_XXX): Update to take the dictionary where a PS
-       keyword is expected as an additional argument.
-
-       * src/cid/cidload.c: (cid_field_records): Adjust invocations of
-       T1_FIELD_XXX.
-
-       * src/cid/cidtoken.h: Adjust invocations of T1_FIELD_XXX.
-
-       * src/psaux/psobjs.c: Add macro FT_COMPONENT for tracing.
-       (ps_parser_to_token): Report a PostScript key as T1_TOKEN_TYPE_KEY,
-       not T1_TOKEN_TYPE_ANY.
-       (ps_parser_load_field): Make sure a token that should be a string or
-       name is really a string or name.
-       Avoid memory leak if a keyword has been already encountered and its
-       value is overwritten.
-       * src/type1/t1load.c: (t1_keywords): Adjust invocations of
-       T1_FIELD_XXX.
-       (parse_dict): Ignore keywords that occur in the wrong dictionary
-       (e.g., in `Private' instead of `FontDict').
-
-       * src/type1/t1tokens.h: Adjust invocations of T1_FIELD_XXX.
-
-       * src/type42/t42parse.c: (t42_keywords): Adjust invocations of
-       T1_FIELD_XXX.
-
-2006-07-18  Jens Claudius  <jens.claudius@yahoo.com>
-
-       Move creation of field `buildchar' of T1_DecoderRec out of
-       `t1_decoder_init' and let the caller of `t1_decoder_init' take care
-       of it.
-
-       Call the finisher for T1_Decoder in `cid_face_compute_max_advance'
-       and `T1_Compute_Max_Advance'.
-
-       * include/freetype/internal/psaux.h (T1_DecoderRec): Remove field
-       `face', add `len_buildchar'.
-
-       * include/freetype/internal/t1types.h (T1_FaceRec): Add field
-       `buildchar'.
-
-       * src/cid/cidgload.c (cid_face_compute_max_advance): Call finisher
-       for T1_Decoder.
-       (cid_slot_load_glyph): Do not ignore failure when initializing the
-       T1_Decoder.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Updated.
-       (t1_decoder_init): Remove initialization of fields `buildchar' and
-       `len_buildchar'.
-       (t1_decoder_done): Remove deallocation of field `buildchar'.
-
-       * freetype/src/type1/t1gload.c (T1_Compute_Max_Advance): Initialize
-       T1_Decoder's `buildchar' and `len_buildchar'; call finisher for
-       T1_Decoder.
-       (T1_Load_Glyph): Initialize T1_Decoder's `buildchar' and
-       `len_buildchar'; make sure to call finisher for T1_Decoder even in
-       case of error.
-
-       * src/type1/t1load.c (T1_Open_Face): Allocate new field `buildchar'
-       of T1_FaceRec.
-
-       * src/type1/t1objs.c (T1_Face_Done): Free new field `buildchar' of
-       T1_FaceRec.
-
-2006-07-14  Jens Claudius  <jens.claudius@yahoo.com>
-
-       * include/freetype/internal/psaux.h: New macros IS_PS_NEWLINE,
-       IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT,
-       and IS_PS_BASE85 (from src/psaux/psconv.h).
-       (T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER,
-       T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND.
-       (T1_DecoderRec): New fields `buildchar' and `face'.
-       (IS_PS_TOKEN): New macro.
-
-       * include/freetype/internal/t1types.h (T1_FaceRec): New fields
-       `ndv_idx', `cdv_idx', and `len_buildchar'.
-
-       * include/freetype/t1tables.h (PS_BlendRec): New fields
-       `default_design_vector' and `num_default_design_vector'.
-
-       * src/psaux/psconv.h: Move macros IS_PS_NEWLINE, IS_PS_SPACE,
-       IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT, and
-       IS_PS_BASE85 to include/freetype/internal/psaux.h.
-
-       * src/psaux/psobjs.c (ps_parser_to_token_array): Allow `token'
-       argument to be NULL if we want only to count the number of tokens.
-       (ps_tocoordarray): Allow `coords' argument to be NULL if we just
-       want to skip the array.
-       (ps_tofixedarray): Allow `values' argument to be NULL if we just
-       want to skip the array.
-
-       * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add support
-       for (partially commented out) othersubrs 19-25, 27, and 28.
-       (t1_decoder_init): Initialize new fields `face' and `buildchar'.
-       (t1_decoder_done): Release new field `buildchar'.
-
-       * src/type1/t1load.c (parse_buildchar, parse_private): New
-       functions.
-       (t1_keywords): Register them.
-       (t1_allocate_blend): Updated.
-       (t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER,
-       T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND.
-       (parse_dict): Remove `keyword_flags' argument.
-       Use new macro IS_PS_TOKEN.
-       Changed function so that later PostScript definitions override
-       earlier ones.
-       (t1_init_loader): Initialize new field `keywords_encountered'.
-       (T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and
-       `len_buildchar'.
-       Remove `keywords_flags'.
-
-       * src/type1/t1load.h (T1_LoaderRect): New field
-       `keywords_encountered'.
-       (T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros.
-
-       * src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: New
-       entries for parsing /NDV, /CDV, and /DesignVector.
-
-2006-07-07  Werner Lemberg  <wl@gnu.org>
-
-       Add many checks to protect against malformed PCF files.
-
-       * src/pcf/pcfdrivr.c (PCF_Face_Done): Protect against NULL pointers.
-       (PCF_Face_Init): Add calls to PCF_Face_Done in case of errors.
-
-       * src/pcf/pcfread.c (pcf_read_TOC): Protect against malformed table
-       data and check that tables don't overlap (using a simple
-       bubblesort).
-       (PCF_METRIC_SIZE, PCF_COMPRESSED_METRIC_SIZE, PCF_PROPERTY_SIZE):
-       New macros which give the size of data structures in the data
-       stream.
-       (pcf_get_properties): Use rough estimates to get array size limits.
-       Assign `face->nprops' and `face->properties' earlier so that a call
-       to PCF_Face_Done can do the clean-up in case of error.
-       Protect against invalid string offsets.
-       (pcf_get_metrics): Clean up code.
-       Adjust tracing message levels.
-       Use rough estimate to get array size limit.
-       (pcf_get_bitmaps): Clean up code.
-       Adjust tracing message levels.
-       Use rough estimates to get offset limits.
-       (pcf_get_encodings): Adjust tracing message level.
-       (pcf_get_accel): Clean up code.
-
-2006-06-26  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdfdrivr.c (BDF_Face_Init): Handle fonts correctly which
-       don't have a POINT_SIZE property.  This fixes Savannah bug #16914.
-
-2006-06-26  Jens Claudius  <jens.claudius@yahoo.com>
-
-       * src/psaux/t1decode.c (T1_Operator, t1_args_count): Add opcode 15.
-       (t1_decoder_parse_charstrings): Operator with
-       opcode 15 pops its two arguments.
-       Handle the case where the pops of an othersubr may be part of a
-       subroutine.
-       Handle unknown othersubrs gracefully: count their operands and let
-       the following pop operators push the operands as the results onto
-       the Type1 stack.
-       Improve handling of setcurrentpoint opcode.
-
-2006-06-25  Jens Claudius  <jens.claudius@yahoo.com>
-
-       The Type 1 parser now skips over top-level procedures as required
-       for a `Simplified Parser'.  This makes the parser more robust as it
-       doesn't poke around in PostScript code.  Additionally, it makes the
-       FontDirectory hackery in src/type1/t1load.c unnecessary.
-
-       * src/psaux/psobjs.c (IS_OCTAL_DIGIT): New macro.
-       (skip_literal_string): Add FT_Error as return value.
-       Handle escapes better.
-       (skip_string): Add FT_Error as return value.
-       Don't set `parser->error' but return error code directly.
-       (skip_procedure): New function.
-       (ps_parser_skip_PS_token): Handle procedures.
-       Update code.
-       (ps_parser_to_token): Update code.
-       (ps_parser_load_field_table): Handle bbox entries also.
-
-       * src/type1/t1load.c (parse_dict): Remove FontDirectory hackery.
-       Add commented-out code for synthetic fonts.
-
-2006-06-24  Eugeniy Meshcheryakov  <eugen@univ.kiev.ua>
-
-       Fix two hinting bugs as reported in
-       http://lists.gnu.org/archive/html/freetype-devel/2006-06/msg00057.html.
-
-       * include/freetype/internal/tttypes.h (TT_GlyphZoneRec): Add
-       `first_point' member.
-
-       * src/truetype/ttgload.c (tt_prepare_zone): Initialize
-       `first_point'.
-       (TT_Process_Composite_Glyph): Always untouch points.
-
-       * src/truetype/ttinterp.c (Ins_SHC): Fix computation of
-       `first_point' and `last_point' in case of composite glyphs.
-       (Ins_IUP): Fix computation of `end_point'.
-
-2006-06-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Insert EndianS16_BtoN and EndianS32_BtoN as workaround for Intel
-       Mac.  The original patch was written by David Sachitano and Lawrence
-       Coopet, and modified by Sean McBride for MPW compatibility.  Only
-       required data are converted; unused data are left in big endian.
-
-       * src/base/ftmac.c: Include <Endian.h> for byteorder macros for non
-       Mac OS X platforms.
-       (OS_INLINE): Undefine before definition.
-       (count_faces_sfnt): Insert EndianS16_BtoN to parse the header of
-       FontAssociation table in FOND resource.
-       (count_faces_scalable): Insert EndianS16_BtoN to parse the header
-       and fontSize at each entry of FontAssociation table in FOND
-       resource.
-       (parse_fond): Insert EndianS16_BtoN and EndianS32_BtoN to parse
-       ffStylOff of FamilyRecord header of FOND resource, the header,
-       fontSize, fontID at each entry of FontAssociation table, and
-       StyleMapping table.
-       (count_faces): Call `HUnlock' after all FOND utilization.
-
-2006-06-08  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Public API of TrueTypeGX, OpenType, and classic kern table validator
-       should return `FT_Err_Unimplemented_Feature' if validation service
-       is unavailable (disabled in `modules.cfg').  It is originally
-       suggested by David Turner, cf.
-       http://lists.gnu.org/archive/html/freetype-devel/2005-11/msg00078.html
-
-       * src/base/ftgxval.c (FT_TrueTypeGX_Validate): Return
-       FT_Err_Unimplemented_Feature if TrueTypeGX validation service is
-       unavailable.
-       (FT_ClassicKern_Validate): Return FT_Err_Unimplemented_Feature if
-       classic kern table validation service is unavailable.
-
-       * src/base/ftotval.c (FT_OpenType_Validate): Return
-       FT_Err_Unimplemented_Feature if OpenType validation service is
-       unavailable.
-
-2006-06-08  Werner Lemberg  <wl@gnu.org>
-
-       * src/bdf/bdflib.c (bdf_load_font): Fix memory leaks in case of
-       errors.
-
-2006-06-07  David Turner  <david@freetype.org>
-
-       * src/type1/t1afm.c (KERN_INDEX): Make it more robust.
-       (T1_Read_Metrics): Fix memory leak which happened when the metrics
-       file doesn't have kerning pairs.  This fixes Savannah bug #16768.
-
-2006-06-06  David Turner  <david@freetype.org>
-
-       Fix memory leak described in Savannah bug #16759.
-
-       We change `ps_unicodes_init' so that it also takes a
-       `free_glyph_name' callback to release the glyph names returned by
-       `get_glyph_name'
-
-       * include/freetype/internal/services/svpscmap.h (PS_Glyph_NameFunc):
-       Renamed to ...
-       (PS_GetGlyphNameFunc): This.
-       (PS_FreeGlyphNameFunc): New typedef.
-       (PS_Unicodes_InitFunc): Add variable for PS_FreeGlyphNameFunc.
-
-       * src/cff/cffcmap.c (cff_sid_to_glyph_name): Use `TT_Face' for first
-       argument.
-       (cff_sid_free_glyph_name): New function.
-       (cff_cmap_unicode_init): Updated.
-
-       * src/psaux/t1cmap.c (t1_cmap_unicode_init): Updated.
-
-       * src/psnames/psmodule.c (ps_unicodes_init): Add variable for
-       PS_FreeGlyphNameFunc and use it.
-
-
-2006-06-04  David Turner  <david@freetype.org>
-
-       * src/base/ftutil.c (ft_mem_qrealloc): Fix the function to accept
-       `item_size == 0' as well -- though this sounds weird, it can
-       theoretically happen.  This fixes Savannah bug #16669.
-
-       * src/pfr/pfrobjs.c (pfr_face_init): Fix the computation
-       of `face->num_glyphs' which missed the last glyph, due to
-       the offset-by-1 computation, since the PFR format doesn't
-       guarantee that glyph index 0 corresponds to the `missing
-       glyph.  This fixes Savannah bug #16668.
-
-2006-05-25  Werner Lemberg  <wl@gnu.org>
-
-       * builds/unix/unix-cc.in (LINK_LIBRARY): Don't comment out
-       `-no-undefined'.  Reported by Christian Biesinger.
-
-2006-05-19  Brian Weed  <bw@imaginengine.com>
-
-       * builds/win32/visualc/freetype.dsp: Release libraries no longer
-       have debug information, and debug libraries use `C7 compatible'
-       debug info.
-
-2006-05-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       Apply patch by Derek Clegg to fix two memory leaks in the MacOS
-       resource fork handler.  This fixes Savannah bug #16631.
-
-       * src/base/ftobjs.c (load_face_in_embedded_rfork): Replace
-       `FT_Stream_Close' by `FT_Stream_Free' to fix memory leak.
-
-       * src/base/ftrfrk.c (raccess_guess_linux_double_from_file_name):
-       Replace `FT_Stream_Close' by `FT_Stream_Free' to fix memory leak.
-
-2006-05-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * build/unix/configure.raw: Add a fallback to disable Carbon
-       dependency, if configured with no options on Mac OS X.
-
-2006-05-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
-
-       * src/base/ftmac.c (open_face_from_buffer): Deallocate stream when
-       its content cannot be parsed as supported font.  This fixes
-       the second part of Savannah bug #16590.
-
-2006-05-18  Werner Lemberg  <wl@gnu.org>
-
-       * src/truetype/ttgload.c (TT_Load_Composite_Glyph)
-       [FT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Make it compilable again.
-
-2006-05-17  David Turner  <david@freetype.org>
-
-       This is a major patch used to drastically improve the performance of
-       loading glyphs.  This both speeds up loading the glyph vectors
-       themselves and the auto-fitter module.
-
-       We now use inline assembler code with GCC to implement `FT_MulFix',
-       which is probably the most important function related to the
-       engine's performance.
-
-       The resulting speed-up is about 25%.
-
-
-       * include/freetype/internal/tttypes.h (TT_LoaderRec): Add fields
-       `cursor' and `limit'.
-
-       * src/autofit/afangles.c (af_corner_is_flat, af_corner_orientation):
-       New functions.
-       (AF_ATAN_BITS, af_arctan, af_angle_atan): Comment out.
-       [TEST]: Remove.
-
-       * src/autofit/afcjk.c (AF_Script_UniRangeRec): Comment out test
-       code.
-
-       * src/autofit/afhints.c (af_axis_hints_new_segment): Don't call
-       `FT_ZERO'
-       (af_direction_compute, af_glyph_hints_compute_inflections): Rewritten.
-       (af_glyph_hints_reload: Rewrite recognition of weak points.
-
-       * src/autofit/aflatin.c (af_latin_hints_compute_segments): Move
-       constant values out of the loops.
-
-       * src/autofit/aftypes.h: Updated.
-
-       * src/base/ftcalc.c (FT_MulFix): Use inline assembler code.
-
-       * src/base/ftoutln.c (FT_Outline_Get_Orientation): Use vector
-       product to get orientation.
-
-       * src/gzip/ftgzip.c (ft_get_uncompressed_size): New function.
-       (FT_Stream_OpenGzip): Use it to handle small files directly in
-       memory.
-
-       * src/psaux/psconv.c (PS_Conv_ASCIIHexDecode, PS_ConvEexecDecode):
-       Improve performance.
-
-       * src/truetype/ttgload.c (TT_Access_Glyph_Frame): Set `cursor' and
-       `limit'.
-
-       (TT_Load_Glyph_Header, TT_Load_Simple_Glyph,
-       TT_Load_Composite_Glyph): Updated.  Add threshold to protect against
-       exceedingly large values of number of contours.  Speed up by
-       reducing the number of loops.
-
-       * src/type1/t1gload.c (T1_Load_Glyph): Don't apply unit matrix.
-
-
-       * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Change the threshold
-       used to detect rogue clients from 4 to 16.  This is to prevent some
-       segmentation faults with fonts like `KozMinProVI-Regular.otf' which
-       comes from the Japanese Adobe Reader Asian Font pack.
-
-2007-05-17  Werner Lemberg  <wl@gnu.org>
-
-       * src/cff/cffload.c (cff_font_done): Deallocate subfont array.  This
-       fixes the first part of Savannah bug #16590.
-
-2006-05-16  Werner Lemberg  <wl@gnu.org>
-
-       * docs/PROBLEMS: Updated icl issues.
-
-----------------------------------------------------------------------------
-
-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,
-and distributed under the terms of the FreeType project license,
-LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-indicate that you have read the license and understand and accept it
-fully.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/reactos/lib/3rdparty/freetype/Jamfile b/reactos/lib/3rdparty/freetype/Jamfile
deleted file mode 100644 (file)
index 0ef8b62..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-# FreeType 2 top Jamfile.
-#
-# Copyright 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, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-
-# The HDRMACRO is already defined in FTJam and is used to add
-# the content of certain macros to the list of included header
-# files.
-#
-# We can compile FreeType 2 with classic Jam however thanks to
-# the following code
-#
-if ! $(JAM_TOOLSET)
-{
-  rule HDRMACRO
-  {
-    # nothing
-  }
-}
-
-
-# We need to invoke a SubDir rule if the FT2 source directory top is not the
-# current directory.  This allows us to build FreeType 2 as part of a larger
-# project easily.
-#
-if $(FT2_TOP) != $(DOT)
-{
-  SubDir  FT2_TOP ;
-}
-
-
-# The following macros define the include directory, the source directory,
-# and the final library name (without library extensions).  They can be
-# replaced by other definitions when the library is compiled as part of
-# a larger project.
-#
-
-# Name of FreeType include directory during compilation.
-# This is relative to FT2_TOP.
-#
-FT2_INCLUDE_DIR ?= include ;
-
-# Name of FreeType source directory during compilation.
-# This is relative to FT2_TOP.
-#
-FT2_SRC_DIR ?= src ;
-
-# Name of final library, without extension.
-#
-FT2_LIB ?= $(LIBPREFIX)freetype ;
-
-
-# Define FT2_BUILD_INCLUDE to point to your build-specific directory.
-# This is prepended to FT2_INCLUDE_DIR.  It can be used to specify
-# the location of a custom <ft2build.h> which will point to custom
-# versions of `ftmodule.h' and `ftoption.h', for example.
-#
-FT2_BUILD_INCLUDE ?= ;
-
-# The list of modules to compile on any given build of the library.
-# By default, this will contain _all_ modules defined in FT2_SRC_DIR.
-#
-# IMPORTANT: You'll need to change the content of `ftmodule.h' as well
-#            if you modify this list or provide your own.
-#
-FT2_COMPONENTS ?= autofit    # auto-fitter
-                  base       # base component (public APIs)
-                  bdf        # BDF font driver
-                  cache      # cache sub-system
-                  cff        # CFF/CEF font driver
-                  cid        # PostScript CID-keyed font driver
-                  gzip       # support for gzip-compressed files
-                  lzw        # support for LZW-compressed files
-                  pcf        # PCF font driver
-                  pfr        # PFR/TrueDoc font driver
-                  psaux      # common PostScript routines module
-                  pshinter   # PostScript hinter module
-                  psnames    # PostScript names handling
-                  raster     # monochrome rasterizer
-                  smooth     # anti-aliased rasterizer
-                  sfnt       # SFNT-based format support routines
-                  truetype   # TrueType font driver
-                  type1      # PostScript Type 1 font driver
-                  type42     # PostScript Type 42 (embedded TrueType) driver
-                  winfonts   # Windows FON/FNT font driver
-                  ;
-
-
-# Don't touch.
-#
-FT2_INCLUDE  = $(FT2_BUILD_INCLUDE)
-               [ FT2_SubDir $(FT2_INCLUDE_DIR) ] ;
-
-FT2_SRC      = [ FT2_SubDir $(FT2_SRC_DIR) ] ;
-
-# Location of API Reference Documentation
-#
-if $(DOC_DIR)
-{
-  DOC_DIR = $(DOCDIR:T) ;
-}
-else
-{
-  DOC_DIR = docs/reference ;
-}
-
-
-# Only used by FreeType developers.
-#
-if $(DEBUG_HINTER)
-{
-  CCFLAGS += -DDEBUG_HINTER ;
-}
-
-
-# We need `freetype2/include' in the current include path in order to
-# compile any part of FreeType 2.
-#: updating documentation for upcoming release
-
-HDRS += $(FT2_INCLUDE) ;
-
-
-# We need to #define FT2_BUILD_LIBRARY so that our sources find the
-# internal headers
-#
-DEFINES += FT2_BUILD_LIBRARY ;
-
-# Uncomment the following line if you want to build individual source files
-# for each FreeType 2 module.  This is only useful during development, and
-# is better defined as an environment variable anyway!
-#
-# FT2_MULTI = true ;
-
-
-# The file <freetype/config/ftheader.h> is used to define macros that are
-# later used in #include statements.  It needs to be parsed in order to
-# record these definitions.
-#
-HDRMACRO  [ FT2_SubDir  include freetype config ftheader.h ] ;
-HDRMACRO  [ FT2_SubDir  include freetype internal internal.h ] ;
-
-
-# Now include the Jamfile in `freetype2/src', used to drive the compilation
-# of each FreeType 2 component and/or module.
-#
-SubInclude  FT2_TOP $(FT2_SRC_DIR) ;
-
-# Handle the generation of the `ftexport.sym' file which contain the list
-# of exported symbols.  This can be used on Unix by libtool.
-#
-SubInclude FT2_TOP $(FT2_SRC_DIR) tools ;
-
-rule GenExportSymbols
-{
-  local  apinames = apinames$(SUFEXE) ;
-  local  headers  = [ Glob $(2) : *.h ] ;
-
-  LOCATE on $(1) = $(ALL_LOCATE_TARGET) ;
-
-  APINAMES on $(1) = apinames$(SUFEXE) ;
-
-  Depends            $(1) : $(apinames) $(headers) ;
-  GenExportSymbols1  $(1) : $(headers) ;
-  Clean              clean : $(1) ;
-}
-
-actions GenExportSymbols1 bind APINAMES
-{
-  $(APINAMES) $(2) > $(1)
-}
-
-GenExportSymbols  ftexport.sym : include/freetype include/freetype/cache ;
-
-# Test files (hinter debugging).  Only used by FreeType developers.
-#
-if $(DEBUG_HINTER)
-{
-  SubInclude FT2_TOP tests ;
-}
-
-rule RefDoc
-{
-  Depends  $1 : all ;
-  NotFile  $1 ;
-  Always   $1 ;
-}
-
-actions RefDoc
-{
-  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.4.4 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h
-}
-
-RefDoc  refdoc ;
-
-
-# end of top Jamfile
diff --git a/reactos/lib/3rdparty/freetype/Jamrules b/reactos/lib/3rdparty/freetype/Jamrules
deleted file mode 100644 (file)
index d8d1c7e..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# FreeType 2 JamRules.
-#
-# Copyright 2001, 2002, 2003 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-
-# This file contains the Jam rules needed to build the FreeType 2 library.
-# It is shared by all Jamfiles and is included only once in the build
-# process.
-#
-
-
-# Call SubDirHdrs on a list of directories.
-#
-rule AddSubDirHdrs
-{
-  local x ;
-
-  for x in $(<)
-  {
-    SubDirHdrs $(x) ;
-  }
-}
-
-
-# Determine prefix of library file.  We must use "libxxxxx" on Unix systems,
-# while all other simply use the real name.
-#
-if $(UNIX)
-{
-  LIBPREFIX ?= lib ;
-}
-else
-{
-  LIBPREFIX ?= "" ;
-}
-
-# FT2_TOP contains the location of the FreeType source directory.  You can
-# set it to a specific value if you want to compile the library as part of a
-# larger project.
-#
-FT2_TOP ?= $(DOT) ;
-
-# Define a new rule used to declare a sub directory of the Nirvana source
-# tree.
-#
-rule FT2_SubDir
-{
-  if $(FT2_TOP) = $(DOT)
-  {
-    return [ FDirName  $(<) ] ;
-  }
-  else
-  {
-    return [ FDirName  $(FT2_TOP) $(<) ] ;
-  }
-}
-
-# We also set ALL_LOCATE_TARGET in order to place all object and library
-# files in "objs".
-#
-ALL_LOCATE_TARGET ?= [ FT2_SubDir  objs ] ;
-
-
-# end of Jamrules
diff --git a/reactos/lib/3rdparty/freetype/Makefile b/reactos/lib/3rdparty/freetype/Makefile
deleted file mode 100644 (file)
index c1fa16c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# FreeType 2 build system -- top-level Makefile
-#
-
-
-# Copyright 1996-2000, 2002, 2006 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-
-# Project names
-#
-PROJECT       := freetype
-PROJECT_TITLE := FreeType
-
-# The variable TOP_DIR holds the path to the topmost directory in the project
-# engine source hierarchy.  If it is not defined, default it to `.'.
-#
-TOP_DIR ?= .
-
-# The variable OBJ_DIR gives the location where object files and the
-# FreeType library are built.
-#
-OBJ_DIR ?= $(TOP_DIR)/objs
-
-
-include $(TOP_DIR)/builds/toplevel.mk
-
-# EOF
index 07c6f5f..798715a 100644 (file)
@@ -1,21 +1,19 @@
-  Special notes to Unix users
-  ===========================
-
-  Please  read  the file  `docs/UPGRADE.UNIX'.  It contains  important
-  information regarding the installation  of FreeType on Unix systems,
-  especially GNU based operating systems like GNU/Linux.
+  FreeType 2.5.0
+  ==============
 
 
-  FreeType 2's  library is called `libfreetype',  FreeType 1's library
-  is called `libttf'.  They are *not* compatible!
+  Homepage: http://www.freetype.org
 
 
+  FreeType is a freely available software library to render fonts.
 
 
-  FreeType 2.4.4
-  ==============
+  It  is  written  in  C,  designed to  be  small,  efficient,  highly
+  customizable, and  portable while capable of  producing high-quality
+  output  (glyph  images) of  most  vector  and bitmap  font  formats.
 
   Please   read   the  docs/CHANGES   file,   it  contains   IMPORTANT
   INFORMATION.
 
 
   Please   read   the  docs/CHANGES   file,   it  contains   IMPORTANT
   INFORMATION.
 
-  Read the files `docs/INSTALL' for installation instructions.
+  Read the  files `docs/INSTALL*'  for installation  instructions; see
+  the file `docs/LICENSE.TXT' for the available licenses.
 
   The FreeType 2 API reference is located in `docs/reference'; use the
   file   `ft2-doc.html'   as   the   top  entry   point.    Additional
 
   The FreeType 2 API reference is located in `docs/reference'; use the
   file   `ft2-doc.html'   as   the   top  entry   point.    Additional
 
   and download one of the following files.
 
 
   and download one of the following files.
 
-    freetype-doc-2.4.4.tar.bz2
-    freetype-doc-2.4.4.tar.gz
-    ftdoc244.zip
+    freetype-doc-2.5.0.tar.bz2
+    freetype-doc-2.5.0.tar.gz
+    ftdoc250.zip
+
+  To view the documentation online, go to
+
+    http://www.freetype.org/freetype2/documentation.html
+
+
+  Mailing Lists
+  =============
+
+  The preferred way  of communication with the FreeType  team is using
+  e-mail lists.
+
+    general use and discussion:      freetype@nongnu.org
+    engine internals, porting, etc.: freetype-devel@nongnu.org
+    announcements:                   freetype-announce@nongnu.org
+
+  The lists are moderated; see
+
+    http://www.freetype.org/contact.html
+
+  how to subscribe.
 
 
   Bugs
 
 
   Bugs
@@ -51,7 +70,7 @@
 
 ----------------------------------------------------------------------
 
 
 ----------------------------------------------------------------------
 
-Copyright 2006, 2007, 2008, 2009, 2010 by
+Copyright 2006-2013 by
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file is  part of  the FreeType  project, and  may only  be used,
 David Turner, Robert Wilhelm, and Werner Lemberg.
 
 This  file is  part of  the FreeType  project, and  may only  be used,
diff --git a/reactos/lib/3rdparty/freetype/README.ROS b/reactos/lib/3rdparty/freetype/README.ROS
deleted file mode 100644 (file)
index 5d4eb63..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-CREDITS
-
-The code in this tree is based (it is actually an exact copy with some
-ReactOS specific extra files) on the FreeType library, version 2.3.0
-It was written and is being maintained by the FreeType team. The projects
-website is http://www.freetype.org.
-
-
-NOTES
-
-Please note that there are two Makefiles in the freetype directory:
-- Makefile.freetype which is the original Makefile from the FreeType
-  distribution
-- Makefile which is the ReactOS specific Makefile. It will use the
-  original Makefile.freetype when needed.
-Normally you will just use Makefile and not worry about Makefile.freetype.
-There will also be 2 FreeType libraries, lib/freetype/objs/libfreetype.a
-and dk/nkm/lib/freetype.a. The second one is the import library for
-freetype.dll and is the one that is used in the rest of ReactOS.
-lib/freetype/objs/libfreetype.a is a static library which is used to
-create the DLL.
-
-
-PORTING A NEW VERSION
-
-Please note that the procedure below is a one-time only procedure, to be
-performed by whoever imports a new FreeType version into the ReactOS
-source tree. Once the new version has been committed to CVS all other
-developers can just use the normal build procedure.
-
-First, save the old version:
-
-move lib\freetype lib\freetype.old
-
-Unpack the FreeType distribution and copy the files to lib/freetype
-(note: without the version number which is present in the pathnames in
-the distribution archive).
-Setup the FreeType build by copying the correct configuration file:
-
-copy lib\freetype\builds\win32\w32-mingw32.mk lib\freetype\config.mk
-
-Copy the ReactOS specific files from the old directory to the new:
-
-move lib\freetype\Makefile lib\freetype\Makefile.freetype
-mkdir lib\freetype\i386
-copy lib\freetype.old\rosglue.c lib\freetype
-copy lib\freetype.old\i386\setjmplongjmp.s lib\freetype\i386
-copy lib\freetype.old\freetype.rc lib\freetype
-copy lib\freetype.old\Makefile lib\freetype
-copy lib\freetype.old\README.ROS lib\freetype
-copy lib\freetype.old\Doxyfile lib\freetype
-copy lib\freetype.old\.cvsignore lib\freetype
-copy lib\freetype.old\objs\.cvsignore lib\freetype\objs
-copy lib\freetype.old\i386\.cvsignore lib\freetype\i386
-
-Next you need to create the freetype.def file. Since this depends on the
-"gawk" command, you'll need to have MSYS installed, which is not one of
-the normally required packages to build ReactOS. You can get MSYS from the
-MinGW site at http://sourceforge.net/projects/mingw. Once you have MSYS
-installed you can create the new freetype.def file:
-
-make freetype_def
-
-Well, that's all there is to it. You can delete the old version in
-lib\freetype.old. Please adjust the version number in the heading of this
-file, so it is obvious to everyone which FreeType version we're using.
-After testing, you can commit the new/changed files to CVS. ALthough files
-config.mk and freetype.def are generated, they should be included in CVS.
-
-$Id: README.ROS 25663 2007-01-31 06:11:48Z greatlrd $
diff --git a/reactos/lib/3rdparty/freetype/README.git b/reactos/lib/3rdparty/freetype/README.git
deleted file mode 100644 (file)
index 673200a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-The git  archive doesn't  contain pre-built configuration  scripts for\r
-UNIXish platforms.  To generate them say\r
-\r
-  sh autogen.sh\r
-\r
-which in turn depends on the following packages:\r
-\r
-  automake (1.10.1)\r
-  libtool (2.2.4)\r
-  autoconf (2.62)\r
-\r
-The versions given  in parentheses are known to  work.  Newer versions\r
-should work too, of course.   Note that autogen.sh also sets up proper\r
-file permissions for the `configure' and auxiliary scripts.\r
-\r
-The autogen.sh script  now checks the version of  above three packages\r
-whether they match the numbers  above.  Otherwise it will complain and\r
-suggest either upgrading or using  an environment variable to point to\r
-a more recent version of the required tool(s).\r
-\r
-Note that  `aclocal' is provided  by the `automake' package  on Linux,\r
-and that `libtoolize' is called `glibtoolize' on Darwin (OS X).\r
-\r
-\r
-For static builds which  don't use platform specific optimizations, no\r
-configure script is necessary at all; saying\r
-\r
-  make setup ansi\r
-  make\r
-\r
-should work on all platforms which have GNU make (or makepp).\r
-\r
-\r
-----------------------------------------------------------------------\r
-\r
-Copyright 2005, 2006, 2007, 2008, 2009, 2010 by\r
-David Turner, Robert Wilhelm, and Werner Lemberg.\r
-\r
-This  file is  part of  the FreeType  project, and  may only  be used,\r
-modified,  and distributed  under the  terms of  the  FreeType project\r
-license,  LICENSE.TXT.  By  continuing to  use, modify,  or distribute\r
-this file you  indicate that you have read  the license and understand\r
-and accept it fully.\r
-\r
-\r
---- end of README.git ---\r
index c28a51c..0eaba39 100644 (file)
@@ -55,7 +55,7 @@ compare_to_minimum_version ()
   if test $MAJOR1 -lt $MAJOR2; then
     echo 0
     return
   if test $MAJOR1 -lt $MAJOR2; then
     echo 0
     return
-  else 
+  else
     if test $MAJOR1 -gt $MAJOR2; then
       echo 1
       return
     if test $MAJOR1 -gt $MAJOR2; then
       echo 1
       return
@@ -67,7 +67,7 @@ compare_to_minimum_version ()
   if test $MINOR1 -lt $MINOR2; then
     echo 0
     return
   if test $MINOR1 -lt $MINOR2; then
     echo 0
     return
-  else 
+  else
     if test $MINOR1 -gt $MINOR2; then
       echo 1
       return
     if test $MINOR1 -gt $MINOR2; then
       echo 1
       return
@@ -118,9 +118,12 @@ fi
 
 # On MacOS X, the GNU libtool is named `glibtool'.
 HOSTOS=`uname`
 
 # On MacOS X, the GNU libtool is named `glibtool'.
 HOSTOS=`uname`
-LIBTOOLIZE=libtoolize
-if test "$HOSTOS"x = Darwinx; then
+if test "$LIBTOOLIZE"x != x; then
+  :
+elif test "$HOSTOS"x = Darwinx; then
   LIBTOOLIZE=glibtoolize
   LIBTOOLIZE=glibtoolize
+else
+  LIBTOOLIZE=libtoolize
 fi
 
 if test "$ACLOCAL"x = x; then
 fi
 
 if test "$ACLOCAL"x = x; then
index b397556..4d8a945 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
 #!/bin/sh
 #
-# Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by
+# Copyright 2002-2006, 2008-2010, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 
 rm -f config.mk builds/unix/unix-def.mk builds/unix/unix-cc.mk
 
 
 rm -f config.mk builds/unix/unix-def.mk builds/unix/unix-cc.mk
 
+# respect GNUMAKE environment variable for backwards compatibility
 if test "x$GNUMAKE" = x; then
 if test "x$GNUMAKE" = x; then
-  GNUMAKE=make
+  if test "x$MAKE" = x; then
+    if test "x`make -v 2>/dev/null | egrep 'GNU|makepp'`" = x; then
+      MAKE=gmake
+    else
+      MAKE=make
+    fi
+  fi
+else
+  MAKE=$GNUMAKE
 fi
 
 fi
 
-if test -z "`$GNUMAKE -v 2>/dev/null | grep GNU`"; then
-  if test -z "`$GNUMAKE -v 2>/dev/null | grep makepp`"; then
-    echo "GNU make (>= 3.80) or makepp (>= 1.19) is required to build FreeType2." >&2
-    echo "Please try" >&2
-    echo "  \`GNUMAKE=<GNU make command name> $0'." >&2
-    echo "or >&2"
-    echo "  \`GNUMAKE=\"makepp --norc-substitution\" $0'." >&2
-    exit 1
-  fi
+if test "x`$MAKE -v 2>/dev/null | egrep 'GNU|makepp'`" = x; then
+  echo "GNU make (>= 3.80) or makepp (>= 1.19) is required to build FreeType2." >&2
+  echo "Please try" >&2
+  echo >&2
+  echo "  MAKE=<GNU make command name> $0" >&2
+  echo >&2
+  echo "or" >&2
+  echo >&2
+  echo "  MAKE=\"makepp --norc-substitution\" $0" >&2
+  exit 1
 fi
 
 # Get `dirname' functionality.  This is taken and adapted from autoconf's
 fi
 
 # Get `dirname' functionality.  This is taken and adapted from autoconf's
@@ -92,19 +102,19 @@ if test $inode_src -ne $inode_dst; then
     cp $abs_ft2_dir/modules.cfg $abs_curr_dir
   fi
   echo "Generating \`Makefile'"
     cp $abs_ft2_dir/modules.cfg $abs_curr_dir
   fi
   echo "Generating \`Makefile'"
-  echo "TOP_DIR   := $abs_ft2_dir"               > Makefile
-  echo "OBJ_DIR   := $abs_curr_dir"             >> Makefile
-  echo "OBJ_BUILD := \$(OBJ_DIR)"               >> Makefile
-  echo "DOC_DIR   := \$(OBJ_DIR)/reference"     >> Makefile
-  echo "FT_LIBTOOL_DIR   := \$(OBJ_DIR)"        >> Makefile
-  echo "ifndef FT2DEMOS"                        >> Makefile
-  echo "  include \$(TOP_DIR)/Makefile"         >> Makefile
-  echo "else"                                   >> Makefile
-  echo "  TOP_DIR_2 := \$(TOP_DIR)/../ft2demos" >> Makefile
-  echo "  PROJECT   := freetype"                >> Makefile
-  echo "  CONFIG_MK := \$(OBJ_DIR)/config.mk"   >> Makefile
-  echo "  include \$(TOP_DIR_2)/Makefile"       >> Makefile
-  echo "endif"                                  >> Makefile
+  echo "TOP_DIR        := $abs_ft2_dir"           > Makefile
+  echo "OBJ_DIR        := $abs_curr_dir"         >> Makefile
+  echo "OBJ_BUILD      := \$(OBJ_DIR)"           >> Makefile
+  echo "DOC_DIR        := \$(OBJ_DIR)/reference" >> Makefile
+  echo "FT_LIBTOOL_DIR := \$(OBJ_DIR)"           >> Makefile
+  echo "ifndef FT2DEMOS"                         >> Makefile
+  echo "  include \$(TOP_DIR)/Makefile"          >> Makefile
+  echo "else"                                    >> Makefile
+  echo "  TOP_DIR_2 := \$(TOP_DIR)/../ft2demos"  >> Makefile
+  echo "  PROJECT   := freetype"                 >> Makefile
+  echo "  CONFIG_MK := \$(OBJ_DIR)/config.mk"    >> Makefile
+  echo "  include \$(TOP_DIR_2)/Makefile"        >> Makefile
+  echo "endif"                                   >> Makefile
 fi
 
 # call make
 fi
 
 # call make
@@ -120,6 +130,6 @@ case $# in
      esac
    done ;;
 esac
      esac
    done ;;
 esac
-CFG=$CFG $GNUMAKE setup unix
+CFG=$CFG $MAKE setup unix
 
 # eof
 
 # eof
diff --git a/reactos/lib/3rdparty/freetype/devel/ftoption.h b/reactos/lib/3rdparty/freetype/devel/ftoption.h
deleted file mode 100644 (file)
index 5392d1e..0000000
+++ /dev/null
@@ -1,733 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftoption.h (for development)                                           */
-/*                                                                         */
-/*    User-selectable configuration macros (specification only).           */
-/*                                                                         */
-/*  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,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __FTOPTION_H__
-#define __FTOPTION_H__
-
-
-#include <ft2build.h>
-
-
-FT_BEGIN_HEADER
-
-  /*************************************************************************/
-  /*                                                                       */
-  /*                 USER-SELECTABLE CONFIGURATION MACROS                  */
-  /*                                                                       */
-  /* This file contains the default configuration macro definitions for    */
-  /* a standard build of the FreeType library.  There are three ways to    */
-  /* use this file to build project-specific versions of the library:      */
-  /*                                                                       */
-  /*  - You can modify this file by hand, but this is not recommended in   */
-  /*    cases where you would like to build several versions of the        */
-  /*    library from a single source directory.                            */
-  /*                                                                       */
-  /*  - You can put a copy of this file in your build directory, more      */
-  /*    precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD'   */
-  /*    is the name of a directory that is included _before_ the FreeType  */
-  /*    include path during compilation.                                   */
-  /*                                                                       */
-  /*    The default FreeType Makefiles and Jamfiles use the build          */
-  /*    directory `builds/<system>' by default, but you can easily change  */
-  /*    that for your own projects.                                        */
-  /*                                                                       */
-  /*  - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it    */
-  /*    slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to       */
-  /*    locate this file during the build.  For example,                   */
-  /*                                                                       */
-  /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */
-  /*      #include <freetype/config/ftheader.h>                            */
-  /*                                                                       */
-  /*    will use `$BUILD/myftoptions.h' instead of this file for macro     */
-  /*    definitions.                                                       */
-  /*                                                                       */
-  /*    Note also that you can similarly pre-define the macro              */
-  /*    FT_CONFIG_MODULES_H used to locate the file listing of the modules */
-  /*    that are statically linked to the library at compile time.  By     */
-  /*    default, this file is <freetype/config/ftmodule.h>.                */
-  /*                                                                       */
-  /*  We highly recommend using the third method whenever possible.        */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /**** G E N E R A L   F R E E T Y P E   2   C O N F I G U R A T I O N ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Uncomment the line below if you want to activate sub-pixel rendering  */
-  /* (a.k.a. LCD rendering, or ClearType) in this build of the library.    */
-  /*                                                                       */
-  /* Note that this feature is covered by several Microsoft patents        */
-  /* and should not be activated in any default build of the library.      */
-  /*                                                                       */
-  /* This macro has no impact on the FreeType API, only on its             */
-  /* _implementation_.  For example, using FT_RENDER_MODE_LCD when calling */
-  /* FT_Render_Glyph still generates a bitmap that is 3 times wider than   */
-  /* the original size in case this macro isn't defined; however, each     */
-  /* triplet of subpixels has R=G=B.                                       */
-  /*                                                                       */
-  /* This is done to allow FreeType clients to run unmodified, forcing     */
-  /* them to display normal gray-level anti-aliased glyphs.                */
-  /*                                                                       */
-#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Many compilers provide a non-ANSI 64-bit data type that can be used   */
-  /* by FreeType to speed up some computations.  However, this will create */
-  /* some problems when compiling the library in strict ANSI mode.         */
-  /*                                                                       */
-  /* For this reason, the use of 64-bit integers is normally disabled when */
-  /* the __STDC__ macro is defined.  You can however disable this by       */
-  /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here.                 */
-  /*                                                                       */
-  /* For most compilers, this will only create compilation warnings when   */
-  /* building the library.                                                 */
-  /*                                                                       */
-  /* ObNote: The compiler-specific 64-bit integers are detected in the     */
-  /*         file `ftconfig.h' either statically or through the            */
-  /*         `configure' script on supported platforms.                    */
-  /*                                                                       */
-#undef FT_CONFIG_OPTION_FORCE_INT64
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* If this macro is defined, do not try to use an assembler version of   */
-  /* performance-critical functions (e.g. FT_MulFix).  You should only do  */
-  /* that to verify that the assembler function works properly, or to      */
-  /* execute benchmark tests of the various implementations.               */
-/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* If this macro is defined, try to use an inlined assembler version of  */
-  /* the `FT_MulFix' function, which is a `hotspot' when loading and       */
-  /* hinting glyphs, and which should be executed as fast as possible.     */
-  /*                                                                       */
-  /* Note that if your compiler or CPU is not supported, this will default */
-  /* to the standard and portable implementation found in `ftcalc.c'.      */
-  /*                                                                       */
-#define FT_CONFIG_OPTION_INLINE_MULFIX
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* LZW-compressed file support.                                          */
-  /*                                                                       */
-  /*   FreeType now handles font files that have been compressed with the  */
-  /*   `compress' program.  This is mostly used to parse many of the PCF   */
-  /*   files that come with various X11 distributions.  The implementation */
-  /*   uses NetBSD's `zopen' to partially uncompress the file on the fly   */
-  /*   (see src/lzw/ftgzip.c).                                             */
-  /*                                                                       */
-  /*   Define this macro if you want to enable this `feature'.             */
-  /*                                                                       */
-#define FT_CONFIG_OPTION_USE_LZW
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Gzip-compressed file support.                                         */
-  /*                                                                       */
-  /*   FreeType now handles font files that have been compressed with the  */
-  /*   `gzip' program.  This is mostly used to parse many of the PCF files */
-  /*   that come with XFree86.  The implementation uses `zlib' to          */
-  /*   partially uncompress the file on the fly (see src/gzip/ftgzip.c).   */
-  /*                                                                       */
-  /*   Define this macro if you want to enable this `feature'.  See also   */
-  /*   the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below.                       */
-  /*                                                                       */
-#define FT_CONFIG_OPTION_USE_ZLIB
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* ZLib library selection                                                */
-  /*                                                                       */
-  /*   This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined.  */
-  /*   It allows FreeType's `ftgzip' component to link to the system's     */
-  /*   installation of the ZLib library.  This is useful on systems like   */
-  /*   Unix or VMS where it generally is already available.                */
-  /*                                                                       */
-  /*   If you let it undefined, the component will use its own copy        */
-  /*   of the zlib sources instead.  These have been modified to be        */
-  /*   included directly within the component and *not* export external    */
-  /*   function names.  This allows you to link any program with FreeType  */
-  /*   _and_ ZLib without linking conflicts.                               */
-  /*                                                                       */
-  /*   Do not #undef this macro here since the build system might define   */
-  /*   it for certain configurations only.                                 */
-  /*                                                                       */
-/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* DLL export compilation                                                */
-  /*                                                                       */
-  /*   When compiling FreeType as a DLL, some systems/compilers need a     */
-  /*   special keyword in front OR after the return type of function       */
-  /*   declarations.                                                       */
-  /*                                                                       */
-  /*   Two macros are used within the FreeType source code to define       */
-  /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */
-  /*                                                                       */
-  /*     FT_EXPORT( return_type )                                          */
-  /*                                                                       */
-  /*       is used in a function declaration, as in                        */
-  /*                                                                       */
-  /*         FT_EXPORT( FT_Error )                                         */
-  /*         FT_Init_FreeType( FT_Library*  alibrary );                    */
-  /*                                                                       */
-  /*                                                                       */
-  /*     FT_EXPORT_DEF( return_type )                                      */
-  /*                                                                       */
-  /*       is used in a function definition, as in                         */
-  /*                                                                       */
-  /*         FT_EXPORT_DEF( FT_Error )                                     */
-  /*         FT_Init_FreeType( FT_Library*  alibrary )                     */
-  /*         {                                                             */
-  /*           ... some code ...                                           */
-  /*           return FT_Err_Ok;                                           */
-  /*         }                                                             */
-  /*                                                                       */
-  /*   You can provide your own implementation of FT_EXPORT and            */
-  /*   FT_EXPORT_DEF here if you want.  If you leave them undefined, they  */
-  /*   will be later automatically defined as `extern return_type' to      */
-  /*   allow normal compilation.                                           */
-  /*                                                                       */
-  /*   Do not #undef these macros here since the build system might define */
-  /*   them for certain configurations only.                               */
-  /*                                                                       */
-/* #define FT_EXPORT(x)      extern x */
-/* #define FT_EXPORT_DEF(x)  x */
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Glyph Postscript Names handling                                       */
-  /*                                                                       */
-  /*   By default, FreeType 2 is compiled with the `psnames' module.  This */
-  /*   module is in charge of converting a glyph name string into a        */
-  /*   Unicode value, or return a Macintosh standard glyph name for the    */
-  /*   use with the TrueType `post' table.                                 */
-  /*                                                                       */
-  /*   Undefine this macro if you do not want `psnames' compiled in your   */
-  /*   build of FreeType.  This has the following effects:                 */
-  /*                                                                       */
-  /*   - The TrueType driver will provide its own set of glyph names,      */
-  /*     if you build it to support postscript names in the TrueType       */
-  /*     `post' table.                                                     */
-  /*                                                                       */
-  /*   - The Type 1 driver will not be able to synthesize a Unicode        */
-  /*     charmap out of the glyphs found in the fonts.                     */
-  /*                                                                       */
-  /*   You would normally undefine this configuration macro when building  */
-  /*   a version of FreeType that doesn't contain a Type 1 or CFF driver.  */
-  /*                                                                       */
-#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Postscript Names to Unicode Values support                            */
-  /*                                                                       */
-  /*   By default, FreeType 2 is built with the `PSNames' module compiled  */
-  /*   in.  Among other things, the module is used to convert a glyph name */
-  /*   into a Unicode value.  This is especially useful in order to        */
-  /*   synthesize on the fly a Unicode charmap from the CFF/Type 1 driver  */
-  /*   through a big table named the `Adobe Glyph List' (AGL).             */
-  /*                                                                       */
-  /*   Undefine this macro if you do not want the Adobe Glyph List         */
-  /*   compiled in your `PSNames' module.  The Type 1 driver will not be   */
-  /*   able to synthesize a Unicode charmap out of the glyphs found in the */
-  /*   fonts.                                                              */
-  /*                                                                       */
-#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Support for Mac fonts                                                 */
-  /*                                                                       */
-  /*   Define this macro if you want support for outline fonts in Mac      */
-  /*   format (mac dfont, mac resource, macbinary containing a mac         */
-  /*   resource) on non-Mac platforms.                                     */
-  /*                                                                       */
-  /*   Note that the `FOND' resource isn't checked.                        */
-  /*                                                                       */
-#define FT_CONFIG_OPTION_MAC_FONTS
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Guessing methods to access embedded resource forks                    */
-  /*                                                                       */
-  /*   Enable extra Mac fonts support on non-Mac platforms (e.g.           */
-  /*   GNU/Linux).                                                         */
-  /*                                                                       */
-  /*   Resource forks which include fonts data are stored sometimes in     */
-  /*   locations which users or developers don't expected.  In some cases, */
-  /*   resource forks start with some offset from the head of a file.  In  */
-  /*   other cases, the actual resource fork is stored in file different   */
-  /*   from what the user specifies.  If this option is activated,         */
-  /*   FreeType tries to guess whether such offsets or different file      */
-  /*   names must be used.                                                 */
-  /*                                                                       */
-  /*   Note that normal, direct access of resource forks is controlled via */
-  /*   the FT_CONFIG_OPTION_MAC_FONTS option.                              */
-  /*                                                                       */
-#ifdef FT_CONFIG_OPTION_MAC_FONTS
-#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
-#endif
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Allow the use of FT_Incremental_Interface to load typefaces that      */
-  /* contain no glyph data, but supply it via a callback function.         */
-  /* 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
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* The size in bytes of the render pool used by the scan-line converter  */
-  /* to do all of its work.                                                */
-  /*                                                                       */
-  /* This must be greater than 4KByte if you use FreeType to rasterize     */
-  /* glyphs; otherwise, you may set it to zero to avoid unnecessary        */
-  /* allocation of the render pool.                                        */
-  /*                                                                       */
-#define FT_RENDER_POOL_SIZE  16384L
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* FT_MAX_MODULES                                                        */
-  /*                                                                       */
-  /*   The maximum number of modules that can be registered in a single    */
-  /*   FreeType library object.  32 is the default.                        */
-  /*                                                                       */
-#define FT_MAX_MODULES  32
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Debug level                                                           */
-  /*                                                                       */
-  /*   FreeType can be compiled in debug or trace mode.  In debug mode,    */
-  /*   errors are reported through the `ftdebug' component.  In trace      */
-  /*   mode, additional messages are sent to the standard output during    */
-  /*   execution.                                                          */
-  /*                                                                       */
-  /*   Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode.     */
-  /*   Define FT_DEBUG_LEVEL_TRACE to build it in trace mode.              */
-  /*                                                                       */
-  /*   Don't define any of these macros to compile in `release' mode!      */
-  /*                                                                       */
-  /*   Do not #undef these macros here since the build system might define */
-  /*   them for certain configurations only.                               */
-  /*                                                                       */
-#define FT_DEBUG_LEVEL_ERROR
-#define FT_DEBUG_LEVEL_TRACE
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Memory Debugging                                                      */
-  /*                                                                       */
-  /*   FreeType now comes with an integrated memory debugger that is       */
-  /*   capable of detecting simple errors like memory leaks or double      */
-  /*   deletes.  To compile it within your build of the library, you       */
-  /*   should define FT_DEBUG_MEMORY here.                                 */
-  /*                                                                       */
-  /*   Note that the memory debugger is only activated at runtime when     */
-  /*   when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
-  /*                                                                       */
-  /*   Do not #undef this macro here since the build system might define   */
-  /*   it for certain configurations only.                                 */
-  /*                                                                       */
-#define FT_DEBUG_MEMORY
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Module errors                                                         */
-  /*                                                                       */
-  /*   If this macro is set (which is _not_ the default), the higher byte  */
-  /*   of an error code gives the module in which the error has occurred,  */
-  /*   while the lower byte is the real error code.                        */
-  /*                                                                       */
-  /*   Setting this macro makes sense for debugging purposes only, since   */
-  /*   it would break source compatibility of certain programs that use    */
-  /*   FreeType 2.                                                         */
-  /*                                                                       */
-  /*   More details can be found in the files ftmoderr.h and fterrors.h.   */
-  /*                                                                       */
-#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 */
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****        S F N T   D R I V E R    C O N F I G U R A T I O N       ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support       */
-  /* embedded bitmaps in all formats using the SFNT module (namely         */
-  /* TrueType & OpenType).                                                 */
-  /*                                                                       */
-#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to    */
-  /* load and enumerate the glyph Postscript names in a TrueType or        */
-  /* OpenType file.                                                        */
-  /*                                                                       */
-  /* Note that when you do not compile the `PSNames' module by undefining  */
-  /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will   */
-  /* contain additional code used to read the PS Names table from a font.  */
-  /*                                                                       */
-  /* (By default, the module uses `PSNames' to extract glyph names.)       */
-  /*                                                                       */
-#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to       */
-  /* access the internal name table in a SFNT-based format like TrueType   */
-  /* or OpenType.  The name table contains various strings used to         */
-  /* describe the font, like family name, copyright, version, etc.  It     */
-  /* does not contain any glyph name though.                               */
-  /*                                                                       */
-  /* Accessing SFNT names is done through the functions declared in        */
-  /* `freetype/ftsnames.h'.                                                */
-  /*                                                                       */
-#define TT_CONFIG_OPTION_SFNT_NAMES
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* TrueType CMap support                                                 */
-  /*                                                                       */
-  /*   Here you can fine-tune which TrueType CMap table format shall be    */
-  /*   supported.                                                          */
-#define TT_CONFIG_CMAP_FORMAT_0
-#define TT_CONFIG_CMAP_FORMAT_2
-#define TT_CONFIG_CMAP_FORMAT_4
-#define TT_CONFIG_CMAP_FORMAT_6
-#define TT_CONFIG_CMAP_FORMAT_8
-#define TT_CONFIG_CMAP_FORMAT_10
-#define TT_CONFIG_CMAP_FORMAT_12
-#define TT_CONFIG_CMAP_FORMAT_13
-#define TT_CONFIG_CMAP_FORMAT_14
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****    T R U E T Y P E   D R I V E R    C O N F I G U R A T I O N   ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile   */
-  /* a bytecode interpreter in the TrueType driver.                        */
-  /*                                                                       */
-  /* By undefining this, you will only compile the code necessary to load  */
-  /* TrueType glyphs without hinting.                                      */
-  /*                                                                       */
-  /*   Do not #undef this macro here, since the build system might         */
-  /*   define it for certain configurations only.                          */
-  /*                                                                       */
-#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version  */
-  /* of the TrueType bytecode interpreter is used that doesn't implement   */
-  /* any of the patented opcodes and algorithms.  The patents related to   */
-  /* TrueType hinting have expired worldwide since May 2010; this option   */
-  /* is now deprecated.                                                    */
-  /*                                                                       */
-  /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored*  */
-  /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words,  */
-  /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or                */
-  /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time.    */
-  /*                                                                       */
-  /* This macro is only useful for a small number of font files (mostly    */
-  /* for Asian scripts) that require bytecode interpretation to properly   */
-  /* load glyphs.  For all other fonts, this produces unpleasant results,  */
-  /* thus the unpatented interpreter is never used to load glyphs from     */
-  /* TrueType fonts unless one of the following two options is used.       */
-  /*                                                                       */
-  /*   - The unpatented interpreter is explicitly activated by the user    */
-  /*     through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag         */
-  /*     when opening the FT_Face.                                         */
-  /*                                                                       */
-  /*   - FreeType detects that the FT_Face corresponds to one of the       */
-  /*     `trick' fonts (e.g., `Mingliu') it knows about.  The font engine  */
-  /*     contains a hard-coded list of font names and other matching       */
-  /*     parameters (see function `tt_face_init' in file                   */
-  /*     `src/truetype/ttobjs.c').                                         */
-  /*                                                                       */
-  /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
-  /*                                                                       */
-  /*   {                                                                   */
-  /*     FT_Parameter  parameter;                                          */
-  /*     FT_Open_Args  open_args;                                          */
-  /*                                                                       */
-  /*                                                                       */
-  /*     parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING;                  */
-  /*                                                                       */
-  /*     open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;         */
-  /*     open_args.pathname   = my_font_pathname;                          */
-  /*     open_args.num_params = 1;                                         */
-  /*     open_args.params     = &parameter;                                */
-  /*                                                                       */
-  /*     error = FT_Open_Face( library, &open_args, index, &face );        */
-  /*     ...                                                               */
-  /*   }                                                                   */
-  /*                                                                       */
-/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType    */
-  /* bytecode interpreter with a huge switch statement, rather than a call */
-  /* table.  This results in smaller and faster code for a number of       */
-  /* architectures.                                                        */
-  /*                                                                       */
-  /* Note however that on some compiler/processor combinations, undefining */
-  /* this macro will generate faster, though larger, code.                 */
-  /*                                                                       */
-#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the        */
-  /* TrueType glyph loader to use Apple's definition of how to handle      */
-  /* component offsets in composite glyphs.                                */
-  /*                                                                       */
-  /* Apple and MS disagree on the default behavior of component offsets    */
-  /* in composites.  Apple says that they should be scaled by the scaling  */
-  /* factors in the transformation matrix (roughly, it's more complex)     */
-  /* while MS says they should not.  OpenType defines two bits in the      */
-  /* composite flags array which can be used to disambiguate, but old      */
-  /* fonts will not have them.                                             */
-  /*                                                                       */
-  /*   http://partners.adobe.com/asn/developer/opentype/glyf.html          */
-  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */
-  /*                                                                       */
-#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include         */
-  /* support for Apple's distortable font technology (fvar, gvar, cvar,    */
-  /* and avar tables).  This has many similarities to Type 1 Multiple      */
-  /* Masters support.                                                      */
-  /*                                                                       */
-#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define TT_CONFIG_OPTION_BDF if you want to include support for        */
-  /* an embedded `BDF ' table within SFNT-based bitmap formats.            */
-  /*                                                                       */
-#define TT_CONFIG_OPTION_BDF
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and       */
-  /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */
-  /* required.                                                             */
-  /*                                                                       */
-#define T1_MAX_DICT_DEPTH  5
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */
-  /* calls during glyph loading.                                           */
-  /*                                                                       */
-#define T1_MAX_SUBRS_CALLS  16
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */
-  /* minimum of 16 is required.                                            */
-  /*                                                                       */
-  /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
-  /*                                                                       */
-#define T1_MAX_CHARSTRINGS_OPERANDS  256
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define this configuration macro if you want to prevent the            */
-  /* compilation of `t1afm', which is in charge of reading Type 1 AFM      */
-  /* files into an existing face.  Note that if set, the T1 driver will be */
-  /* unable to produce kerning distances.                                  */
-  /*                                                                       */
-#undef T1_CONFIG_OPTION_NO_AFM
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Define this configuration macro if you want to prevent the            */
-  /* compilation of the Multiple Masters font support in the Type 1        */
-  /* driver.                                                               */
-  /*                                                                       */
-#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****    A U T O F I T   M O D U L E    C O N F I G U R A T I O N     ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Compile autofit module with CJK (Chinese, Japanese, Korean) script    */
-  /* support.                                                              */
-  /*                                                                       */
-#define AF_CONFIG_OPTION_CJK
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Compile autofit module with Indic script support.                     */
-  /*                                                                       */
-#define AF_CONFIG_OPTION_INDIC
-
-  /* */
-
-
-  /*
-   * Define this variable if you want to keep the layout of internal
-   * structures that was used prior to FreeType 2.2.  This also compiles in
-   * a few obsolete functions to avoid linking problems on typical Unix
-   * distributions.
-   *
-   * For embedded systems or building a new distribution from scratch, it
-   * is recommended to disable the macro since it reduces the library's code
-   * size and activates a few memory-saving optimizations as well.
-   */
-/* #define FT_CONFIG_OPTION_OLD_INTERNALS xxx */
-
-
-  /*
-   *  To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
-   *  we restrict the number of charmaps in a font.  The current API of
-   *  FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
-   *  takes charcode only.  To determine the passed value is for cmap_index
-   *  or charcode, the possible cmap_index is restricted not to exceed
-   *  the minimum possible charcode by a rogue client.  It is also very
-   *  unlikely that a rogue client is interested in Unicode values 0 to 15.
-   *
-   *  NOTE: The original threshold was 4 deduced from popular number of
-   *        cmap subtables in UCS-4 TrueType fonts, but now it is not
-   *        irregular for OpenType fonts to have more than 4 subtables,
-   *        because variation selector subtables are available for Apple
-   *        and Microsoft platforms.
-   */
-
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_MAX_CHARMAP_CACHEABLE 15
-#endif
-
-
-  /*
-   * This macro is defined if either unpatented or native TrueType
-   * hinting is requested by the definitions above.
-   */
-#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-#define  TT_USE_BYTECODE_INTERPRETER
-#undef   TT_CONFIG_OPTION_UNPATENTED_HINTING
-#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
-#define  TT_USE_BYTECODE_INTERPRETER
-#endif
-
-FT_END_HEADER
-
-
-#endif /* __FTOPTION_H__ */
-
-
-/* END */
index 00ec67f..f37ab32 100644 (file)
@@ -3,6 +3,6 @@
 #define REACTOS_STR_INTERNAL_NAME      "freetype\0"
 #define REACTOS_STR_ORIGINAL_FILENAME  "freetype.dll\0"
 #define REACTOS_STR_COMPANY_NAME       "ReactOS Development Team/FreeType Team\0"
 #define REACTOS_STR_INTERNAL_NAME      "freetype\0"
 #define REACTOS_STR_ORIGINAL_FILENAME  "freetype.dll\0"
 #define REACTOS_STR_COMPANY_NAME       "ReactOS Development Team/FreeType Team\0"
-#define REACTOS_STR_LEGAL_COPYRIGHT    "Copyright 1998-2007 ReactOS Team\0"
-#define REACTOS_STR_ORIGINAL_COPYRIGHT "Copyright 1996-2007 FreeType Team\0"
+#define REACTOS_STR_LEGAL_COPYRIGHT    "Copyright 1998-2011 ReactOS Team\0"
+#define REACTOS_STR_ORIGINAL_COPYRIGHT "Copyright 1996-2013 FreeType Team\0"
 #include <reactos/version.rc>
 #include <reactos/version.rc>
index cbe30f2..5dce30e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    ANSI-specific configuration file (specification only).               */
 /*                                                                         */
 /*                                                                         */
 /*    ANSI-specific configuration file (specification only).               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2010 by       */
+/*  Copyright 1996-2004, 2006-2008, 2010-2011, 2013 by                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -95,10 +95,6 @@ FT_BEGIN_HEADER
 #endif
 
 
 #endif
 
 
-  /* Preferred alignment of data */
-#define FT_ALIGNMENT  8
-
-
   /* FT_UNUSED is a macro used to indicate that a given parameter is not  */
   /* used -- this is only used to get rid of unpleasant compiler warnings */
 #ifndef FT_UNUSED
   /* FT_UNUSED is a macro used to indicate that a given parameter is not  */
   /* used -- this is only used to get rid of unpleasant compiler warnings */
 #ifndef FT_UNUSED
@@ -124,15 +120,17 @@ FT_BEGIN_HEADER
   /*   This is the only necessary change, so it is defined here instead    */
   /*   providing a new configuration file.                                 */
   /*                                                                       */
   /*   This is the only necessary change, so it is defined here instead    */
   /*   providing a new configuration file.                                 */
   /*                                                                       */
-#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
-    ( defined( __MWERKS__ ) && defined( macintosh )        )
+#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
   /* no Carbon frameworks for 64bit 10.4.x */
   /* no Carbon frameworks for 64bit 10.4.x */
+  /* AvailabilityMacros.h is available since Mac OS X 10.2,        */
+  /* so guess the system version by maximum errno before inclusion */
+#include <errno.h>
+#ifdef ECANCELED /* defined since 10.2 */
 #include "AvailabilityMacros.h"
 #include "AvailabilityMacros.h"
+#endif
 #if defined( __LP64__ ) && \
     ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
 #if defined( __LP64__ ) && \
     ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
-#define DARWIN_NO_CARBON 1
-#else
-#define FT_MACINTOSH 1
+#undef FT_MACINTOSH
 #endif
 
 #elif defined( __SC__ ) || defined( __MRC__ )
 #endif
 
 #elif defined( __SC__ ) || defined( __MRC__ )
@@ -202,6 +200,30 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef unsigned XXX  FT_UInt32;
 
   /*                                                                       */
   typedef unsigned XXX  FT_UInt32;
 
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_Int64                                                           */
+  /*                                                                       */
+  /*    A typedef for a 64bit signed integer type.  The size depends on    */
+  /*    the configuration.  Only defined if there is real 64bit support;   */
+  /*    otherwise, it gets emulated with a structure (if necessary).       */
+  /*                                                                       */
+  typedef signed XXX  FT_Int64;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Type>                                                                */
+  /*    FT_UInt64                                                          */
+  /*                                                                       */
+  /*    A typedef for a 64bit unsigned integer type.  The size depends on  */
+  /*    the configuration.  Only defined if there is real 64bit support;   */
+  /*    otherwise, it gets emulated with a structure (if necessary).       */
+  /*                                                                       */
+  typedef unsigned XXX  FT_UInt64;
+
   /* */
 
 #endif
   /* */
 
 #endif
@@ -241,13 +263,15 @@ FT_BEGIN_HEADER
 
   /* FT_LONG64 must be defined if a 64-bit type is available */
 #define FT_LONG64
 
   /* FT_LONG64 must be defined if a 64-bit type is available */
 #define FT_LONG64
-#define FT_INT64  long
+#define FT_INT64   long
+#define FT_UINT64  unsigned long
 
 #elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */
 
   /* this compiler provides the __int64 type */
 #define FT_LONG64
 
 #elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */
 
   /* this compiler provides the __int64 type */
 #define FT_LONG64
-#define FT_INT64  __int64
+#define FT_INT64   __int64
+#define FT_UINT64  unsigned __int64
 
 #elif defined( __BORLANDC__ )  /* Borland C++ */
 
 
 #elif defined( __BORLANDC__ )  /* Borland C++ */
 
@@ -256,7 +280,8 @@ FT_BEGIN_HEADER
 
   /* this compiler provides the __int64 type */
 #define FT_LONG64
 
   /* this compiler provides the __int64 type */
 #define FT_LONG64
-#define FT_INT64  __int64
+#define FT_INT64   __int64
+#define FT_UINT64  unsigned __int64
 
 #elif defined( __WATCOMC__ )   /* Watcom C++ */
 
 
 #elif defined( __WATCOMC__ )   /* Watcom C++ */
 
@@ -265,13 +290,15 @@ FT_BEGIN_HEADER
 #elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */
 
 #define FT_LONG64
 #elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */
 
 #define FT_LONG64
-#define FT_INT64  long long int
+#define FT_INT64   long long int
+#define FT_UINT64  unsigned long long int
 
 #elif defined( __GNUC__ )
 
   /* GCC provides the `long long' type */
 #define FT_LONG64
 
 #elif defined( __GNUC__ )
 
   /* GCC provides the `long long' type */
 #define FT_LONG64
-#define FT_INT64  long long int
+#define FT_INT64   long long int
+#define FT_UINT64  unsigned long long int
 
 #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
 
 
 #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
 
@@ -295,6 +322,11 @@ FT_BEGIN_HEADER
 
 #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
 
 
 #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
 
+#ifdef FT_LONG64
+  typedef FT_INT64   FT_Int64;
+  typedef FT_UINT64  FT_UInt64;
+#endif
+
 
 #define FT_BEGIN_STMNT  do {
 #define FT_END_STMNT    } while ( 0 )
 
 #define FT_BEGIN_STMNT  do {
 #define FT_END_STMNT    } while ( 0 )
@@ -348,16 +380,17 @@ FT_BEGIN_HEADER
     register FT_Int32  t, t2;
 
 
     register FT_Int32  t, t2;
 
 
-    asm __volatile__ (
-      "smull  %1, %2, %4, %3\n\t"   /* (lo=%1,hi=%2) = a*b */
-      "mov    %0, %2, asr #31\n\t"  /* %0  = (hi >> 31) */
-      "add    %0, %0, #0x8000\n\t"  /* %0 += 0x8000 */
-      "adds   %1, %1, %0\n\t"       /* %1 += %0 */
-      "adc    %2, %2, #0\n\t"       /* %2 += carry */
-      "mov    %0, %1, lsr #16\n\t"  /* %0  = %1 >> 16 */
-      "orr    %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
+    __asm__ __volatile__ (
+      "smull  %1, %2, %4, %3\n\t"       /* (lo=%1,hi=%2) = a*b */
+      "mov    %0, %2, asr #31\n\t"      /* %0  = (hi >> 31) */
+      "add    %0, %0, #0x8000\n\t"      /* %0 += 0x8000 */
+      "adds   %1, %1, %0\n\t"           /* %1 += %0 */
+      "adc    %2, %2, #0\n\t"           /* %2 += carry */
+      "mov    %0, %1, lsr #16\n\t"      /* %0  = %1 >> 16 */
+      "orr    %0, %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
       : "=r"(a), "=&r"(t2), "=&r"(t)
       : "=r"(a), "=&r"(t2), "=&r"(t)
-      : "r"(a), "r"(b) );
+      : "r"(a), "r"(b)
+      : "cc" );
     return a;
   }
 
     return a;
   }
 
@@ -395,6 +428,43 @@ FT_BEGIN_HEADER
 
 #endif /* __GNUC__ */
 
 
 #endif /* __GNUC__ */
 
+
+#ifdef _MSC_VER /* Visual C++ */
+
+#ifdef _M_IX86
+
+#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
+
+  /* documentation is in freetype.h */
+
+  static __inline FT_Int32
+  FT_MulFix_i386( FT_Int32  a,
+                  FT_Int32  b )
+  {
+    register FT_Int32  result;
+
+    __asm
+    {
+      mov eax, a
+      mov edx, b
+      imul edx
+      mov ecx, edx
+      sar ecx, 31
+      add ecx, 8000h
+      add eax, ecx
+      adc edx, 0
+      shr eax, 16
+      shl edx, 16
+      add eax, edx
+      mov result, eax
+    }
+    return result;
+  }
+
+#endif /* _M_IX86 */
+
+#endif /* _MSC_VER */
+
 #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
 
 
 #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
 
 
index b63945d..8371a31 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Build macros of the FreeType 2 library.                              */
 /*                                                                         */
 /*                                                                         */
 /*    Build macros of the FreeType 2 library.                              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by       */
+/*  Copyright 1996-2008, 2010, 2012, 2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #define FT_RENDER_H  <freetype/ftrender.h>
 
 
 #define FT_RENDER_H  <freetype/ftrender.h>
 
 
+  /*************************************************************************
+   *
+   * @macro:
+   *   FT_AUTOHINTER_H
+   *
+   * @description:
+   *   A macro used in #include statements to name the file containing
+   *   structures and macros related to the auto-hinting module.
+   *
+   */
+#define FT_AUTOHINTER_H  <freetype/ftautoh.h>
+
+
+  /*************************************************************************
+   *
+   * @macro:
+   *   FT_CFF_DRIVER_H
+   *
+   * @description:
+   *   A macro used in #include statements to name the file containing
+   *   structures and macros related to the CFF driver module.
+   *
+   */
+#define FT_CFF_DRIVER_H  <freetype/ftcffdrv.h>
+
+
+  /*************************************************************************
+   *
+   * @macro:
+   *   FT_TRUETYPE_DRIVER_H
+   *
+   * @description:
+   *   A macro used in #include statements to name the file containing
+   *   structures and macros related to the TrueType driver module.
+   *
+   */
+#define FT_TRUETYPE_DRIVER_H  <freetype/ftttdrv.h>
+
+
   /*************************************************************************
    *
    * @macro:
   /*************************************************************************
    *
    * @macro:
 #define FT_LZW_H  <freetype/ftlzw.h>
 
 
 #define FT_LZW_H  <freetype/ftlzw.h>
 
 
+  /*************************************************************************
+   *
+   * @macro:
+   *   FT_BZIP2_H
+   *
+   * @description:
+   *   A macro used in #include statements to name the file containing the
+   *   definitions of an API which supports bzip2-compressed files.
+   *
+   */
+#define FT_BZIP2_H  <freetype/ftbzip2.h>
+
+
   /*************************************************************************
    *
    * @macro:
   /*************************************************************************
    *
    * @macro:
index 2b46259..90057c3 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    User-selectable configuration macros (specification only).           */
 /*                                                                         */
 /*                                                                         */
 /*    User-selectable configuration macros (specification only).           */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -188,6 +187,47 @@ FT_BEGIN_HEADER
 /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
 
 
 /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* Bzip2-compressed file support.                                        */
+  /*                                                                       */
+  /*   FreeType now handles font files that have been compressed with the  */
+  /*   `bzip2' program.  This is mostly used to parse many of the PCF      */
+  /*   files that come with XFree86.  The implementation uses `libbz2' to  */
+  /*   partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */
+  /*   Contrary to gzip, bzip2 currently is not included and need to use   */
+  /*   the system available bzip2 implementation.                          */
+  /*                                                                       */
+  /*   Define this macro if you want to enable this `feature'.             */
+  /*                                                                       */
+/* #define FT_CONFIG_OPTION_USE_BZIP2 */
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* Define to disable the use of file stream functions and types, FILE,   */
+  /* fopen() etc.  Enables the use of smaller system libraries on embedded */
+  /* systems that have multiple system libraries, some with or without     */
+  /* file stream support, in the cases where file stream support is not    */
+  /* necessary such as memory loading of font files.                       */
+  /*                                                                       */
+/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /*  PNG bitmap support.                                                  */
+  /*                                                                       */
+  /*   FreeType now handles loading color bitmap glyphs in the PNG format. */
+  /*   This requires help from the external libpng library.  Uncompressed  */
+  /*   color bitmaps do not need any external libraries and will be        */
+  /*   supported regardless of this configuration.                         */
+  /*                                                                       */
+  /*   Define this macro if you want to enable this `feature'.             */
+  /*                                                                       */
+/* #define FT_CONFIG_OPTION_USE_PNG */
+
+
   /*************************************************************************/
   /*                                                                       */
   /* DLL export compilation                                                */
   /*************************************************************************/
   /*                                                                       */
   /* DLL export compilation                                                */
@@ -283,7 +323,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*   Note that the `FOND' resource isn't checked.                        */
   /*                                                                       */
   /*                                                                       */
   /*   Note that the `FOND' resource isn't checked.                        */
   /*                                                                       */
-#define FT_CONFIG_OPTION_MAC_FONTS
+/*#define FT_CONFIG_OPTION_MAC_FONTS */
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
@@ -363,6 +403,39 @@ FT_BEGIN_HEADER
 /* #define FT_DEBUG_LEVEL_TRACE */
 
 
 /* #define FT_DEBUG_LEVEL_TRACE */
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* Autofitter debugging                                                  */
+  /*                                                                       */
+  /*   If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to     */
+  /*   control the autofitter behaviour for debugging purposes with global */
+  /*   boolean variables (consequently, you should *never* enable this     */
+  /*   while compiling in `release' mode):                                 */
+  /*                                                                       */
+  /*     _af_debug_disable_horz_hints                                      */
+  /*     _af_debug_disable_vert_hints                                      */
+  /*     _af_debug_disable_blue_hints                                      */
+  /*                                                                       */
+  /*   Additionally, the following functions provide dumps of various      */
+  /*   internal autofit structures to stdout (using `printf'):             */
+  /*                                                                       */
+  /*     af_glyph_hints_dump_points                                        */
+  /*     af_glyph_hints_dump_segments                                      */
+  /*     af_glyph_hints_dump_edges                                         */
+  /*                                                                       */
+  /*   As an argument, they use another global variable:                   */
+  /*                                                                       */
+  /*     _af_debug_hints                                                   */
+  /*                                                                       */
+  /*   Please have a look at the `ftgrid' demo program to see how those    */
+  /*   variables and macros should be used.                                */
+  /*                                                                       */
+  /*   Do not #undef these macros here since the build system might define */
+  /*   them for certain configurations only.                               */
+  /*                                                                       */
+/* #define FT_DEBUG_AUTOFIT */
+
+
   /*************************************************************************/
   /*                                                                       */
   /* Memory Debugging                                                      */
   /*************************************************************************/
   /*                                                                       */
   /* Memory Debugging                                                      */
@@ -499,6 +572,28 @@ FT_BEGIN_HEADER
 #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
 
 
 #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile       */
+  /* EXPERIMENTAL subpixel hinting support into the TrueType driver.  This */
+  /* replaces the native TrueType hinting mechanism when anything but      */
+  /* FT_RENDER_MODE_MONO is requested.                                     */
+  /*                                                                       */
+  /* Enabling this causes the TrueType driver to ignore instructions under */
+  /* certain conditions.  This is done in accordance with the guide here,  */
+  /* with some minor differences:                                          */
+  /*                                                                       */
+  /*  http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
+  /*                                                                       */
+  /* By undefining this, you only compile the code necessary to hint       */
+  /* TrueType glyphs with native TT hinting.                               */
+  /*                                                                       */
+  /*   This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be    */
+  /*   defined.                                                            */
+  /*                                                                       */
+/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+
   /*************************************************************************/
   /*                                                                       */
   /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version  */
   /*************************************************************************/
   /*                                                                       */
   /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version  */
@@ -575,7 +670,7 @@ FT_BEGIN_HEADER
   /* composite flags array which can be used to disambiguate, but old      */
   /* fonts will not have them.                                             */
   /*                                                                       */
   /* composite flags array which can be used to disambiguate, but old      */
   /* fonts will not have them.                                             */
   /*                                                                       */
-  /*   http://partners.adobe.com/asn/developer/opentype/glyf.html          */
+  /*   http://www.microsoft.com/typography/otspec/glyf.htm                 */
   /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */
   /*                                                                       */
 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
   /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */
   /*                                                                       */
 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
@@ -610,7 +705,7 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
-  /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and       */
+  /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and       */
   /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */
   /* required.                                                             */
   /*                                                                       */
   /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */
   /* required.                                                             */
   /*                                                                       */
@@ -654,6 +749,25 @@ FT_BEGIN_HEADER
 #undef T1_CONFIG_OPTION_NO_MM_SUPPORT
 
 
 #undef T1_CONFIG_OPTION_NO_MM_SUPPORT
 
 
+  /*************************************************************************/
+  /*************************************************************************/
+  /****                                                                 ****/
+  /****         C F F   D R I V E R    C O N F I G U R A T I O N        ****/
+  /****                                                                 ****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF       */
+  /* engine gets compiled into FreeType.  If defined, it is possible to    */
+  /* switch between the two engines using the `hinting-engine' property of */
+  /* the cff driver module.                                                */
+  /*                                                                       */
+/* #define CFF_CONFIG_OPTION_OLD_ENGINE */
+
+
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
@@ -676,41 +790,27 @@ FT_BEGIN_HEADER
   /*                                                                       */
 #define AF_CONFIG_OPTION_INDIC
 
   /*                                                                       */
 #define AF_CONFIG_OPTION_INDIC
 
-  /* */
-
+  /*************************************************************************/
+  /*                                                                       */
+  /* Compile autofit module with warp hinting.  The idea of the warping    */
+  /* code is to slightly scale and shift a glyph within a single dimension */
+  /* so that as much of its segments are aligned (more or less) on the     */
+  /* grid.  To find out the optimal scaling and shifting value, various    */
+  /* parameter combinations are tried and scored.                          */
+  /*                                                                       */
+  /* This experimental option is only active if the render mode is         */
+  /* FT_RENDER_MODE_LIGHT.                                                 */
+  /*                                                                       */
+/* #define AF_CONFIG_OPTION_USE_WARPER */
 
 
-  /*
-   * Define this variable if you want to keep the layout of internal
-   * structures that was used prior to FreeType 2.2.  This also compiles in
-   * a few obsolete functions to avoid linking problems on typical Unix
-   * distributions.
-   *
-   * For embedded systems or building a new distribution from scratch, it
-   * is recommended to disable the macro since it reduces the library's code
-   * size and activates a few memory-saving optimizations as well.
-   */
-#define FT_CONFIG_OPTION_OLD_INTERNALS
+  /* */
 
 
   /*
 
 
   /*
-   *  To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
-   *  we restrict the number of charmaps in a font.  The current API of
-   *  FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
-   *  takes charcode only.  To determine the passed value is for cmap_index
-   *  or charcode, the possible cmap_index is restricted not to exceed
-   *  the minimum possible charcode by a rogue client.  It is also very
-   *  unlikely that a rogue client is interested in Unicode values 0 to 15.
-   *
-   *  NOTE: The original threshold was 4 deduced from popular number of
-   *        cmap subtables in UCS-4 TrueType fonts, but now it is not
-   *        irregular for OpenType fonts to have more than 4 subtables,
-   *        because variation selector subtables are available for Apple
-   *        and Microsoft platforms.
+   *  This macro is obsolete.  Support has been removed in FreeType
+   *  version 2.5.
    */
    */
-
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_MAX_CHARMAP_CACHEABLE 15
-#endif
+/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
 
 
   /*
 
 
   /*
index 30ec14e..b940efc 100644 (file)
@@ -5,7 +5,7 @@
 /*    ANSI-specific library and header configuration file (specification   */
 /*    only).                                                               */
 /*                                                                         */
 /*    ANSI-specific library and header configuration file (specification   */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2009 by                  */
+/*  Copyright 2002-2007, 2009, 2011-2012 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #include <limits.h>
 
 
 #include <limits.h>
 
-#define FT_CHAR_BIT   CHAR_BIT
-#define FT_INT_MAX    INT_MAX
-#define FT_INT_MIN    INT_MIN
-#define FT_UINT_MAX   UINT_MAX
-#define FT_ULONG_MAX  ULONG_MAX
+#define FT_CHAR_BIT    CHAR_BIT
+#define FT_USHORT_MAX  USHRT_MAX
+#define FT_INT_MAX     INT_MAX
+#define FT_INT_MIN     INT_MIN
+#define FT_UINT_MAX    UINT_MAX
+#define FT_ULONG_MAX   ULONG_MAX
 
 
   /**********************************************************************/
 
 
   /**********************************************************************/
                                 /*       on certain platforms           */
 
 #define ft_longjmp     longjmp
                                 /*       on certain platforms           */
 
 #define ft_longjmp     longjmp
-#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) )    /* same thing here */
+#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
 
 
   /* the following is only used for debugging purposes, i.e., if */
 
 
   /* the following is only used for debugging purposes, i.e., if */
index 70c3900..fe46d22 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    FreeType high-level API and common types (specification only).       */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType high-level API and common types (specification only).       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
+#ifndef __FREETYPE_H__
+#define __FREETYPE_H__
+
+
 #ifndef FT_FREETYPE_H
 #error "`ft2build.h' hasn't been included yet!"
 #error "Please always use macros to include FreeType header files."
 #ifndef FT_FREETYPE_H
 #error "`ft2build.h' hasn't been included yet!"
 #error "Please always use macros to include FreeType header files."
 #endif
 
 
 #endif
 
 
-#ifndef __FREETYPE_H__
-#define __FREETYPE_H__
-
-
 #include <ft2build.h>
 #include FT_CONFIG_CONFIG_H
 #include <ft2build.h>
 #include FT_CONFIG_CONFIG_H
-#include FT_ERRORS_H
 #include FT_TYPES_H
 #include FT_TYPES_H
+#include FT_ERRORS_H
 
 
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
@@ -227,15 +226,21 @@ FT_BEGIN_HEADER
   /*      Left side bearing for vertical layout.                           */
   /*                                                                       */
   /*    vertBearingY ::                                                    */
   /*      Left side bearing for vertical layout.                           */
   /*                                                                       */
   /*    vertBearingY ::                                                    */
-  /*      Top side bearing for vertical layout.                            */
+  /*      Top side bearing for vertical layout.  Larger positive values    */
+  /*      mean further below the vertical glyph origin.                    */
   /*                                                                       */
   /*    vertAdvance ::                                                     */
   /*                                                                       */
   /*    vertAdvance ::                                                     */
-  /*      Advance height for vertical layout.                              */
+  /*      Advance height for vertical layout.  Positive values mean the    */
+  /*      glyph has a positive advance downward.                           */
   /*                                                                       */
   /* <Note>                                                                */
   /*    If not disabled with @FT_LOAD_NO_HINTING, the values represent     */
   /*    dimensions of the hinted glyph (in case hinting is applicable).    */
   /*                                                                       */
   /*                                                                       */
   /* <Note>                                                                */
   /*    If not disabled with @FT_LOAD_NO_HINTING, the values represent     */
   /*    dimensions of the hinted glyph (in case hinting is applicable).    */
   /*                                                                       */
+  /*    Stroking a glyph with an outside border does not increase          */
+  /*    `horiAdvance' or `vertAdvance'; you have to manually adjust these  */
+  /*    values to account for the added width and height.                  */
+  /*                                                                       */
   typedef struct  FT_Glyph_Metrics_
   {
     FT_Pos  width;
   typedef struct  FT_Glyph_Metrics_
   {
     FT_Pos  width;
@@ -324,12 +329,14 @@ FT_BEGIN_HEADER
   /*    It also embeds a memory manager (see @FT_Memory), as well as a     */
   /*    scan-line converter object (see @FT_Raster).                       */
   /*                                                                       */
   /*    It also embeds a memory manager (see @FT_Memory), as well as a     */
   /*    scan-line converter object (see @FT_Raster).                       */
   /*                                                                       */
-  /*    For multi-threading applications each thread should have its own   */
-  /*    FT_Library object.                                                 */
+  /*    In multi-threaded applications, make sure that the same FT_Library */
+  /*    object or any of its children doesn't get accessed in parallel.    */
   /*                                                                       */
   /* <Note>                                                                */
   /*    Library objects are normally created by @FT_Init_FreeType, and     */
   /*                                                                       */
   /* <Note>                                                                */
   /*    Library objects are normally created by @FT_Init_FreeType, and     */
-  /*    destroyed with @FT_Done_FreeType.                                  */
+  /*    destroyed with @FT_Done_FreeType.  If you need reference-counting  */
+  /*    (cf. @FT_Reference_Library), use @FT_New_Library and               */
+  /*    @FT_Done_Library.                                                  */
   /*                                                                       */
   typedef struct FT_LibraryRec_  *FT_Library;
 
   /*                                                                       */
   typedef struct FT_LibraryRec_  *FT_Library;
 
@@ -843,8 +850,8 @@ FT_BEGIN_HEADER
   /*                           expressed in font units (see                */
   /*                           `units_per_EM').  The box is large enough   */
   /*                           to contain any glyph from the font.  Thus,  */
   /*                           expressed in font units (see                */
   /*                           `units_per_EM').  The box is large enough   */
   /*                           to contain any glyph from the font.  Thus,  */
-  /*                           `bbox.yMax' can be seen as the `maximal     */
-  /*                           ascender', and `bbox.yMin' as the `minimal  */
+  /*                           `bbox.yMax' can be seen as the `maximum     */
+  /*                           ascender', and `bbox.yMin' as the `minimum  */
   /*                           descender'.  Only relevant for scalable     */
   /*                           formats.                                    */
   /*                                                                       */
   /*                           descender'.  Only relevant for scalable     */
   /*                           formats.                                    */
   /*                                                                       */
@@ -870,19 +877,22 @@ FT_BEGIN_HEADER
   /*                           usually negative.  Only relevant for        */
   /*                           scalable formats.                           */
   /*                                                                       */
   /*                           usually negative.  Only relevant for        */
   /*                           scalable formats.                           */
   /*                                                                       */
-  /*    height              :: The height is the vertical distance         */
+  /*    height              :: This value is the vertical distance         */
   /*                           between two consecutive baselines,          */
   /*                           expressed in font units.  It is always      */
   /*                           positive.  Only relevant for scalable       */
   /*                           formats.                                    */
   /*                                                                       */
   /*                           between two consecutive baselines,          */
   /*                           expressed in font units.  It is always      */
   /*                           positive.  Only relevant for scalable       */
   /*                           formats.                                    */
   /*                                                                       */
-  /*    max_advance_width   :: The maximal advance width, in font units,   */
+  /*                           If you want the global glyph height, use    */
+  /*                           `ascender - descender'.                     */
+  /*                                                                       */
+  /*    max_advance_width   :: The maximum advance width, in font units,   */
   /*                           for all glyphs in this face.  This can be   */
   /*                           used to make word wrapping computations     */
   /*                           faster.  Only relevant for scalable         */
   /*                           formats.                                    */
   /*                                                                       */
   /*                           for all glyphs in this face.  This can be   */
   /*                           used to make word wrapping computations     */
   /*                           faster.  Only relevant for scalable         */
   /*                           formats.                                    */
   /*                                                                       */
-  /*    max_advance_height  :: The maximal advance height, in font units,  */
+  /*    max_advance_height  :: The maximum advance height, in font units,  */
   /*                           for all glyphs in this face.  This is only  */
   /*                           relevant for vertical layouts, and is set   */
   /*                           to `height' for fonts that do not provide   */
   /*                           for all glyphs in this face.  This is only  */
   /*                           relevant for vertical layouts, and is set   */
   /*                           to `height' for fonts that do not provide   */
@@ -957,8 +967,8 @@ FT_BEGIN_HEADER
 
     FT_ListRec        sizes_list;
 
 
     FT_ListRec        sizes_list;
 
-    FT_Generic        autohint;
-    void*             extensions;
+    FT_Generic        autohint;   /* face-specific auto-hinter data */
+    void*             extensions; /* unused                         */
 
     FT_Face_Internal  internal;
 
 
     FT_Face_Internal  internal;
 
@@ -1058,12 +1068,12 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*      It is not possible to autohint such fonts using                  */
   /*      @FT_LOAD_FORCE_AUTOHINT; it will also ignore                     */
   /*                                                                       */
   /*      It is not possible to autohint such fonts using                  */
   /*      @FT_LOAD_FORCE_AUTOHINT; it will also ignore                     */
-  /*      @FT_LOAD_NO_HINTING.  You have to set both FT_LOAD_NO_HINTING    */
+  /*      @FT_LOAD_NO_HINTING.  You have to set both @FT_LOAD_NO_HINTING   */
   /*      and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
   /*      probably never want this except for demonstration purposes.      */
   /*                                                                       */
   /*      and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
   /*      probably never want this except for demonstration purposes.      */
   /*                                                                       */
-  /*      Currently, there are six TrueType fonts in the list of tricky    */
-  /*      fonts; they are hard-coded in file `ttobjs.c'.                   */
+  /*      Currently, there are about a dozen TrueType fonts in the list of */
+  /*      tricky fonts; they are hard-coded in file `ttobjs.c'.            */
   /*                                                                       */
 #define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )
 #define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )
   /*                                                                       */
 #define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )
 #define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )
@@ -1104,8 +1114,8 @@ FT_BEGIN_HEADER
    *   FT_HAS_VERTICAL( face )
    *
    * @description:
    *   FT_HAS_VERTICAL( face )
    *
    * @description:
-   *   A macro that returns true whenever a face object contains vertical
-   *   metrics.
+   *   A macro that returns true whenever a face object contains real
+   *   vertical metrics (and not only synthesized ones).
    *
    */
 #define FT_HAS_VERTICAL( face ) \
    *
    */
 #define FT_HAS_VERTICAL( face ) \
@@ -1337,7 +1347,7 @@ FT_BEGIN_HEADER
   /*    height       :: The height in 26.6 fractional pixels.  See         */
   /*                    @FT_FaceRec for the details.                       */
   /*                                                                       */
   /*    height       :: The height in 26.6 fractional pixels.  See         */
   /*                    @FT_FaceRec for the details.                       */
   /*                                                                       */
-  /*    max_advance  :: The maximal advance width in 26.6 fractional       */
+  /*    max_advance  :: The maximum advance width in 26.6 fractional       */
   /*                    pixels.  See @FT_FaceRec for the details.          */
   /*                                                                       */
   /* <Note>                                                                */
   /*                    pixels.  See @FT_FaceRec for the details.          */
   /*                                                                       */
   /* <Note>                                                                */
@@ -1667,6 +1677,12 @@ FT_BEGIN_HEADER
   /*    use @FT_New_Library instead, followed by a call to                 */
   /*    @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module).  */
   /*                                                                       */
   /*    use @FT_New_Library instead, followed by a call to                 */
   /*    @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module).  */
   /*                                                                       */
+  /*    For multi-threading applications each thread should have its own   */
+  /*    FT_Library object.                                                 */
+  /*                                                                       */
+  /*    If you need reference-counting (cf. @FT_Reference_Library), use    */
+  /*    @FT_New_Library and @FT_Done_Library.                              */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Init_FreeType( FT_Library  *alibrary );
 
   FT_EXPORT( FT_Error )
   FT_Init_FreeType( FT_Library  *alibrary );
 
@@ -1861,6 +1877,10 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    Use @FT_Done_Face to destroy the created @FT_Face object (along    */
+  /*    with its slot and sizes).                                          */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_New_Face( FT_Library   library,
                const char*  filepathname,
   FT_EXPORT( FT_Error )
   FT_New_Face( FT_Library   library,
                const char*  filepathname,
@@ -1952,6 +1972,10 @@ FT_BEGIN_HEADER
   /*    Each new face object created with this function also owns a        */
   /*    default @FT_Size object, accessible as `face->size'.               */
   /*                                                                       */
   /*    Each new face object created with this function also owns a        */
   /*    default @FT_Size object, accessible as `face->size'.               */
   /*                                                                       */
+  /*    One @FT_Library instance can have multiple face objects, this is,  */
+  /*    @FT_Open_Face and its siblings can be called multiple times using  */
+  /*    the same `library' argument.                                       */
+  /*                                                                       */
   /*    See the discussion of reference counters in the description of     */
   /*    @FT_Reference_Face.                                                */
   /*                                                                       */
   /*    See the discussion of reference counters in the description of     */
   /*    @FT_Reference_Face.                                                */
   /*                                                                       */
@@ -2106,8 +2130,8 @@ FT_BEGIN_HEADER
   /*      used to determine both scaling values.                           */
   /*                                                                       */
   /*    FT_SIZE_REQUEST_TYPE_REAL_DIM ::                                   */
   /*      used to determine both scaling values.                           */
   /*                                                                       */
   /*    FT_SIZE_REQUEST_TYPE_REAL_DIM ::                                   */
-  /*      The real dimension.  The sum of the the `Ascender' and (minus    */
-  /*      of) the `Descender' fields of @FT_FaceRec are used to determine  */
+  /*      The real dimension.  The sum of the the `ascender' and (minus    */
+  /*      of) the `descender' fields of @FT_FaceRec are used to determine  */
   /*      both scaling values.                                             */
   /*                                                                       */
   /*    FT_SIZE_REQUEST_TYPE_BBOX ::                                       */
   /*      both scaling values.                                             */
   /*                                                                       */
   /*    FT_SIZE_REQUEST_TYPE_BBOX ::                                       */
@@ -2219,6 +2243,12 @@ FT_BEGIN_HEADER
   /*    particular bitmap strike.  Use @FT_Select_Size instead in that     */
   /*    case.                                                              */
   /*                                                                       */
   /*    particular bitmap strike.  Use @FT_Select_Size instead in that     */
   /*    case.                                                              */
   /*                                                                       */
+  /*    The relation between the requested size and the resulting glyph    */
+  /*    size is dependent entirely on how the size is defined in the       */
+  /*    source face.  The font designer chooses the final size of each     */
+  /*    glyph relative to this size.  For more information refer to        */
+  /*    `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'      */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Request_Size( FT_Face          face,
                    FT_Size_Request  req );
   FT_EXPORT( FT_Error )
   FT_Request_Size( FT_Face          face,
                    FT_Size_Request  req );
@@ -2288,6 +2318,11 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    You should not rely on the resulting glyphs matching, or being     */
+  /*    constrained, to this pixel size.  Refer to @FT_Request_Size to     */
+  /*    understand how requested sizes relate to actual sizes.             */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Set_Pixel_Sizes( FT_Face  face,
                       FT_UInt  pixel_width,
   FT_EXPORT( FT_Error )
   FT_Set_Pixel_Sizes( FT_Face  face,
                       FT_UInt  pixel_width,
@@ -2401,14 +2436,20 @@ FT_BEGIN_HEADER
    *     behaviour to more specific and useful cases.
    *
    *   FT_LOAD_NO_SCALE ::
    *     behaviour to more specific and useful cases.
    *
    *   FT_LOAD_NO_SCALE ::
-   *     Don't scale the outline glyph loaded, but keep it in font units.
+   *     Don't scale the loaded outline glyph but keep it in font units.
    *
    *     This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
    *     unsets @FT_LOAD_RENDER.
    *
    *
    *     This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
    *     unsets @FT_LOAD_RENDER.
    *
+   *     If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using
+   *     FT_LOAD_NO_SCALE usually yields meaningless outlines because the
+   *     subglyphs must be scaled and positioned with hinting instructions.
+   *     This can be solved by loading the font without FT_LOAD_NO_SCALE and
+   *     setting the character size to `font->units_per_EM'.
+   *
    *   FT_LOAD_NO_HINTING ::
    *   FT_LOAD_NO_HINTING ::
-   *     Disable hinting.  This generally generates `blurrier' bitmap glyph
-   *     when the glyph is rendered in any of the anti-aliased modes.  See
+   *     Disable hinting.  This generally generates `blurrier' bitmap glyphs
+   *     when the glyph are rendered in any of the anti-aliased modes.  See
    *     also the note below.
    *
    *     This flag is implied by @FT_LOAD_NO_SCALE.
    *     also the note below.
    *
    *     This flag is implied by @FT_LOAD_NO_SCALE.
@@ -2427,8 +2468,14 @@ FT_BEGIN_HEADER
    *     @FT_LOAD_NO_SCALE always sets this flag.
    *
    *   FT_LOAD_VERTICAL_LAYOUT ::
    *     @FT_LOAD_NO_SCALE always sets this flag.
    *
    *   FT_LOAD_VERTICAL_LAYOUT ::
-   *     Load the glyph for vertical text layout.  _Don't_ use it as it is
-   *     problematic currently.
+   *     Load the glyph for vertical text layout.  In particular, the
+   *     `advance' value in the @FT_GlyphSlotRec structure is set to the
+   *     `vertAdvance' value of the `metrics' field.
+   *
+   *     In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use
+   *     this flag currently.  Reason is that in this case vertical metrics
+   *     get synthesized, and those values are not always consistent across
+   *     various font formats.
    *
    *   FT_LOAD_FORCE_AUTOHINT ::
    *     Indicates that the auto-hinter is preferred over the font's native
    *
    *   FT_LOAD_FORCE_AUTOHINT ::
    *     Indicates that the auto-hinter is preferred over the font's native
@@ -2444,14 +2491,13 @@ FT_BEGIN_HEADER
    *     during glyph loading.  This is mostly used to detect broken glyphs
    *     in fonts.  By default, FreeType tries to handle broken fonts also.
    *
    *     during glyph loading.  This is mostly used to detect broken glyphs
    *     in fonts.  By default, FreeType tries to handle broken fonts also.
    *
-   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
-   *     Indicates that the font driver should ignore the global advance
-   *     width defined in the font.  By default, that value is used as the
-   *     advance width for all glyphs when the face has
-   *     @FT_FACE_FLAG_FIXED_WIDTH set.
+   *     In particular, errors from the TrueType bytecode engine are not
+   *     passed to the application if this flag is not set; this might
+   *     result in partially hinted or distorted glyphs in case a glyph's
+   *     bytecode is buggy.
    *
    *
-   *     This flag exists for historical reasons (to support buggy CJK
-   *     fonts).
+   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
+   *     Ignored.  Deprecated.
    *
    *   FT_LOAD_NO_RECURSE ::
    *     This flag is only used internally.  It merely indicates that the
    *
    *   FT_LOAD_NO_RECURSE ::
    *     This flag is only used internally.  It merely indicates that the
@@ -2486,6 +2532,14 @@ FT_BEGIN_HEADER
    *   FT_LOAD_NO_AUTOHINT ::
    *     Disable auto-hinter.  See also the note below.
    *
    *   FT_LOAD_NO_AUTOHINT ::
    *     Disable auto-hinter.  See also the note below.
    *
+   *   FT_LOAD_COLOR ::
+   *     This flag is used to request loading of color embedded-bitmap
+   *     images.  The resulting color bitmaps, if available, will have the
+   *     @FT_PIXEL_MODE_BGRA format.  When the flag is not used and color
+   *     bitmaps are found, they will be converted to 256-level gray
+   *     bitmaps transparently.  Those bitmaps will be in the
+   *     @FT_PIXEL_MODE_GRAY format.
+   *
    * @note:
    *   By default, hinting is enabled and the font's native hinter (see
    *   @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter.  You can
    * @note:
    *   By default, hinting is enabled and the font's native hinter (see
    *   @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter.  You can
@@ -2500,28 +2554,37 @@ FT_BEGIN_HEADER
    *   Besides deciding which hinter to use, you can also decide which
    *   hinting algorithm to use.  See @FT_LOAD_TARGET_XXX for details.
    *
    *   Besides deciding which hinter to use, you can also decide which
    *   hinting algorithm to use.  See @FT_LOAD_TARGET_XXX for details.
    *
+   *   Note that the auto-hinter needs a valid Unicode cmap (either a native
+   *   one or synthesized by FreeType) for producing correct results.  If a
+   *   font provides an incorrect mapping (for example, assigning the
+   *   character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a
+   *   mathematical integral sign), the auto-hinter might produce useless
+   *   results.
+   *
    */
 #define FT_LOAD_DEFAULT                      0x0
    */
 #define FT_LOAD_DEFAULT                      0x0
-#define FT_LOAD_NO_SCALE                     0x1
-#define FT_LOAD_NO_HINTING                   0x2
-#define FT_LOAD_RENDER                       0x4
-#define FT_LOAD_NO_BITMAP                    0x8
-#define FT_LOAD_VERTICAL_LAYOUT              0x10
-#define FT_LOAD_FORCE_AUTOHINT               0x20
-#define FT_LOAD_CROP_BITMAP                  0x40
-#define FT_LOAD_PEDANTIC                     0x80
-#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  0x200
-#define FT_LOAD_NO_RECURSE                   0x400
-#define FT_LOAD_IGNORE_TRANSFORM             0x800
-#define FT_LOAD_MONOCHROME                   0x1000
-#define FT_LOAD_LINEAR_DESIGN                0x2000
-#define FT_LOAD_NO_AUTOHINT                  0x8000U
+#define FT_LOAD_NO_SCALE                     ( 1L << 0 )
+#define FT_LOAD_NO_HINTING                   ( 1L << 1 )
+#define FT_LOAD_RENDER                       ( 1L << 2 )
+#define FT_LOAD_NO_BITMAP                    ( 1L << 3 )
+#define FT_LOAD_VERTICAL_LAYOUT              ( 1L << 4 )
+#define FT_LOAD_FORCE_AUTOHINT               ( 1L << 5 )
+#define FT_LOAD_CROP_BITMAP                  ( 1L << 6 )
+#define FT_LOAD_PEDANTIC                     ( 1L << 7 )
+#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  ( 1L << 9 )
+#define FT_LOAD_NO_RECURSE                   ( 1L << 10 )
+#define FT_LOAD_IGNORE_TRANSFORM             ( 1L << 11 )
+#define FT_LOAD_MONOCHROME                   ( 1L << 12 )
+#define FT_LOAD_LINEAR_DESIGN                ( 1L << 13 )
+#define FT_LOAD_NO_AUTOHINT                  ( 1L << 15 )
+  /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
+#define FT_LOAD_COLOR                        ( 1L << 20 )
 
   /* */
 
   /* used internally only by certain font drivers! */
 
   /* */
 
   /* used internally only by certain font drivers! */
-#define FT_LOAD_ADVANCE_ONLY                 0x100
-#define FT_LOAD_SBITS_ONLY                   0x4000
+#define FT_LOAD_ADVANCE_ONLY                 ( 1L << 8 )
+#define FT_LOAD_SBITS_ONLY                   ( 1L << 14 )
 
 
   /**************************************************************************
 
 
   /**************************************************************************
@@ -2573,7 +2636,8 @@ FT_BEGIN_HEADER
    *
    *   If @FT_LOAD_RENDER is also set, the glyph is rendered in the
    *   corresponding mode (i.e., the mode which matches the used algorithm
    *
    *   If @FT_LOAD_RENDER is also set, the glyph is rendered in the
    *   corresponding mode (i.e., the mode which matches the used algorithm
-   *   best) unless @FT_LOAD_MONOCHROME is set.
+   *   best).  An exeption is FT_LOAD_TARGET_MONO since it implies
+   *   @FT_LOAD_MONOCHROME.
    *
    *   You can use a hinting algorithm that doesn't correspond to the same
    *   rendering mode.  As an example, it is possible to use the `light'
    *
    *   You can use a hinting algorithm that doesn't correspond to the same
    *   rendering mode.  As an example, it is possible to use the `light'
@@ -2874,14 +2938,26 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    point_size :: The point size in 16.16 fractional points.           */
   /*                                                                       */
   /*                                                                       */
   /*    point_size :: The point size in 16.16 fractional points.           */
   /*                                                                       */
-  /*    degree     :: The degree of tightness.                             */
+  /*    degree     :: The degree of tightness.  Increasingly negative      */
+  /*                  values represent tighter track kerning, while        */
+  /*                  increasingly positive values represent looser track  */
+  /*                  kerning.  Value zero means no track kerning.         */
   /*                                                                       */
   /* <Output>                                                              */
   /*                                                                       */
   /* <Output>                                                              */
-  /*    akerning   :: The kerning in 16.16 fractional points.              */
+  /*    akerning   :: The kerning in 16.16 fractional points, to be        */
+  /*                  uniformly applied between all glyphs.                */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    Currently, only the Type~1 font driver supports track kerning,     */
+  /*    using data from AFM files (if attached with @FT_Attach_File or     */
+  /*    @FT_Attach_Stream).                                                */
+  /*                                                                       */
+  /*    Only very few AFM files come with track kerning data; please refer */
+  /*    to the Adobe's AFM specification for more details.                 */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Get_Track_Kerning( FT_Face    face,
                         FT_Fixed   point_size,
   FT_EXPORT( FT_Error )
   FT_Get_Track_Kerning( FT_Face    face,
                         FT_Fixed   point_size,
@@ -2903,7 +2979,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    glyph_index :: The glyph index.                                    */
   /*                                                                       */
   /*                                                                       */
   /*    glyph_index :: The glyph index.                                    */
   /*                                                                       */
-  /*    buffer_max  :: The maximal number of bytes available in the        */
+  /*    buffer_max  :: The maximum number of bytes available in the        */
   /*                   buffer.                                             */
   /*                                                                       */
   /* <Output>                                                              */
   /*                   buffer.                                             */
   /*                                                                       */
   /* <Output>                                                              */
@@ -2921,6 +2997,10 @@ FT_BEGIN_HEADER
   /*    The glyph name is truncated to fit within the buffer if it is too  */
   /*    long.  The returned string is always zero-terminated.              */
   /*                                                                       */
   /*    The glyph name is truncated to fit within the buffer if it is too  */
   /*    long.  The returned string is always zero-terminated.              */
   /*                                                                       */
+  /*    Be aware that FreeType reorders glyph indices internally so that   */
+  /*    glyph index~0 always corresponds to the `missing glyph' (called    */
+  /*    `.notdef').                                                        */
+  /*                                                                       */
   /*    This function is not compiled within the library if the config     */
   /*    macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in              */
   /*    `include/freetype/config/ftoptions.h'.                             */
   /*    This function is not compiled within the library if the config     */
   /*    macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in              */
   /*    `include/freetype/config/ftoptions.h'.                             */
@@ -3058,9 +3138,15 @@ FT_BEGIN_HEADER
   /* <Note>                                                                */
   /*    If you use FreeType to manipulate the contents of font files       */
   /*    directly, be aware that the glyph index returned by this function  */
   /* <Note>                                                                */
   /*    If you use FreeType to manipulate the contents of font files       */
   /*    directly, be aware that the glyph index returned by this function  */
-  /*    doesn't always correspond to the internal indices used within      */
-  /*    the file.  This is done to ensure that value~0 always corresponds  */
-  /*    to the `missing glyph'.                                            */
+  /*    doesn't always correspond to the internal indices used within the  */
+  /*    file.  This is done to ensure that value~0 always corresponds to   */
+  /*    the `missing glyph'.  If the first glyph is not named `.notdef',   */
+  /*    then for Type~1 and Type~42 fonts, `.notdef' will be moved into    */
+  /*    the glyph ID~0 position, and whatever was there will be moved to   */
+  /*    the position `.notdef' had.  For Type~1 fonts, if there is no      */
+  /*    `.notdef' glyph at all, then one will be created at index~0 and    */
+  /*    whatever was there will be moved to the last index -- Type~42      */
+  /*    fonts are considered invalid under this condition.                 */
   /*                                                                       */
   FT_EXPORT( FT_UInt )
   FT_Get_Char_Index( FT_Face   face,
   /*                                                                       */
   FT_EXPORT( FT_UInt )
   FT_Get_Char_Index( FT_Face   face,
@@ -3331,6 +3417,9 @@ FT_BEGIN_HEADER
   /*    in the @PS_FontInfoRec structure which is only guaranteed to       */
   /*    return the correct results for Type~1 fonts.                       */
   /*                                                                       */
   /*    in the @PS_FontInfoRec structure which is only guaranteed to       */
   /*    return the correct results for Type~1 fonts.                       */
   /*                                                                       */
+  /* <Since>                                                               */
+  /*    2.3.8                                                              */
+  /*                                                                       */
   FT_EXPORT( FT_UShort )
   FT_Get_FSType_Flags( FT_Face  face );
 
   FT_EXPORT( FT_UShort )
   FT_Get_FSType_Flags( FT_Face  face );
 
@@ -3357,9 +3446,13 @@ FT_BEGIN_HEADER
   /*    code range for CJK characters.                                     */
   /*                                                                       */
   /*    An IVS is registered and unique; for further details please refer  */
   /*    code range for CJK characters.                                     */
   /*                                                                       */
   /*    An IVS is registered and unique; for further details please refer  */
-  /*    to Unicode Technical Report #37, the Ideographic Variation         */
-  /*    Database.  To date (October 2007), the character with the most     */
-  /*    variants is U+908A, having 8~such IVS.                             */
+  /*    to Unicode Technical Standard #37, the Ideographic Variation       */
+  /*    Database:                                                          */
+  /*                                                                       */
+  /*      http://www.unicode.org/reports/tr37/                             */
+  /*                                                                       */
+  /*    To date (November 2012), the character with the most variants is   */
+  /*    U+9089, having 31 such IVS.                                        */
   /*                                                                       */
   /*    Adobe and MS decided to support IVS with a new cmap subtable       */
   /*    (format~14).  It is an odd subtable because it is not a mapping of */
   /*                                                                       */
   /*    Adobe and MS decided to support IVS with a new cmap subtable       */
   /*    (format~14).  It is an odd subtable because it is not a mapping of */
@@ -3588,7 +3681,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    A very simple function used to perform the computation `(a*b)/c'   */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A very simple function used to perform the computation `(a*b)/c'   */
-  /*    with maximal accuracy (it uses a 64-bit intermediate integer       */
+  /*    with maximum accuracy (it uses a 64-bit intermediate integer       */
   /*    whenever necessary).                                               */
   /*                                                                       */
   /*    This function isn't necessarily as fast as some processor specific */
   /*    whenever necessary).                                               */
   /*                                                                       */
   /*    This function isn't necessarily as fast as some processor specific */
@@ -3623,8 +3716,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    A very simple function used to perform the computation             */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A very simple function used to perform the computation             */
-  /*    `(a*b)/0x10000' with maximal accuracy.  Most of the time this is   */
-  /*    used to multiply a given value by a 16.16 fixed float factor.      */
+  /*    `(a*b)/0x10000' with maximum accuracy.  Most of the time this is   */
+  /*    used to multiply a given value by a 16.16 fixed-point factor.      */
   /*                                                                       */
   /* <Input>                                                               */
   /*    a :: The first multiplier.                                         */
   /*                                                                       */
   /* <Input>                                                               */
   /*    a :: The first multiplier.                                         */
@@ -3668,8 +3761,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    A very simple function used to perform the computation             */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A very simple function used to perform the computation             */
-  /*    `(a*0x10000)/b' with maximal accuracy.  Most of the time, this is  */
-  /*    used to divide a given value by a 16.16 fixed float factor.        */
+  /*    `(a*0x10000)/b' with maximum accuracy.  Most of the time, this is  */
+  /*    used to divide a given value by a 16.16 fixed-point factor.        */
   /*                                                                       */
   /* <Input>                                                               */
   /*    a :: The first multiplier.                                         */
   /*                                                                       */
   /* <Input>                                                               */
   /*    a :: The first multiplier.                                         */
@@ -3807,8 +3900,8 @@ FT_BEGIN_HEADER
    *
    */
 #define FREETYPE_MAJOR  2
    *
    */
 #define FREETYPE_MAJOR  2
-#define FREETYPE_MINOR  4
-#define FREETYPE_PATCH  4
+#define FREETYPE_MINOR  5
+#define FREETYPE_PATCH  0
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
index b2451be..012b74b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Quick computation of advance widths (specification only).            */
 /*                                                                         */
 /*                                                                         */
 /*    Quick computation of advance widths (specification only).            */
 /*                                                                         */
-/*  Copyright 2008 by                                                      */
+/*  Copyright 2008, 2013 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -82,8 +82,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    Retrieve the advance value of a given glyph outline in an          */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Retrieve the advance value of a given glyph outline in an          */
-  /*    @FT_Face.  By default, the unhinted advance is returned in font    */
-  /*    units.                                                             */
+  /*    @FT_Face.                                                          */
   /*                                                                       */
   /* <Input>                                                               */
   /*    face       :: The source @FT_Face handle.                          */
   /*                                                                       */
   /* <Input>                                                               */
   /*    face       :: The source @FT_Face handle.                          */
@@ -94,8 +93,9 @@ FT_BEGIN_HEADER
   /*                  calling @FT_Load_Glyph, used to determine what kind  */
   /*                  of advances you need.                                */
   /* <Output>                                                              */
   /*                  calling @FT_Load_Glyph, used to determine what kind  */
   /*                  of advances you need.                                */
   /* <Output>                                                              */
-  /*    padvance :: The advance value, in either font units or 16.16       */
-  /*                format.                                                */
+  /*    padvance :: The advance value.  If scaling is performed (based on  */
+  /*                the value of `load_flags'), the advance value is in    */
+  /*                16.16 format.  Otherwise, it is in font units.         */
   /*                                                                       */
   /*                If @FT_LOAD_VERTICAL_LAYOUT is set, this is the        */
   /*                vertical advance corresponding to a vertical layout.   */
   /*                                                                       */
   /*                If @FT_LOAD_VERTICAL_LAYOUT is set, this is the        */
   /*                vertical advance corresponding to a vertical layout.   */
@@ -127,8 +127,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    Retrieve the advance values of several glyph outlines in an        */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Retrieve the advance values of several glyph outlines in an        */
-  /*    @FT_Face.  By default, the unhinted advances are returned in font  */
-  /*    units.                                                             */
+  /*    @FT_Face.                                                          */
   /*                                                                       */
   /* <Input>                                                               */
   /*    face        :: The source @FT_Face handle.                         */
   /*                                                                       */
   /* <Input>                                                               */
   /*    face        :: The source @FT_Face handle.                         */
@@ -141,8 +140,12 @@ FT_BEGIN_HEADER
   /*                   calling @FT_Load_Glyph.                             */
   /*                                                                       */
   /* <Output>                                                              */
   /*                   calling @FT_Load_Glyph.                             */
   /*                                                                       */
   /* <Output>                                                              */
-  /*    padvance :: The advances, in either font units or 16.16 format.    */
-  /*                This array must contain at least `count' elements.     */
+  /*    padvance :: The advance values.  This array, to be provided by the */
+  /*                caller, must contain at least `count' elements.        */
+  /*                                                                       */
+  /*                If scaling is performed (based on the value of         */
+  /*                `load_flags'), the advance values are in 16.16 format. */
+  /*                Otherwise, they are in font units.                     */
   /*                                                                       */
   /*                If @FT_LOAD_VERTICAL_LAYOUT is set, these are the      */
   /*                vertical advances corresponding to a vertical layout.  */
   /*                                                                       */
   /*                If @FT_LOAD_VERTICAL_LAYOUT is set, these are the      */
   /*                vertical advances corresponding to a vertical layout.  */
diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftautoh.h b/reactos/lib/3rdparty/freetype/include/freetype/ftautoh.h
new file mode 100644 (file)
index 0000000..5e1153a
--- /dev/null
@@ -0,0 +1,357 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftautoh.h                                                              */
+/*                                                                         */
+/*    FreeType API for controlling the auto-hinter (specification only).   */
+/*                                                                         */
+/*  Copyright 2012, 2013 by                                                */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __FTAUTOH_H__
+#define __FTAUTOH_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+  /**************************************************************************
+   *
+   * @section:
+   *   auto_hinter
+   *
+   * @title:
+   *   The auto-hinter
+   *
+   * @abstract:
+   *   Controlling the auto-hinting module.
+   *
+   * @description:
+   *   While FreeType's auto-hinter doesn't expose API functions by itself,
+   *   it is possible to control its behaviour with @FT_Property_Set and
+   *   @FT_Property_Get.  The following lists the available properties
+   *   together with the necessary macros and structures.
+   *
+   *   Note that the auto-hinter's module name is `autofitter' for
+   *   historical reasons.
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @property:
+   *   glyph-to-script-map
+   *
+   * @description:
+   *   *Experimental* *only*
+   *
+   *   The auto-hinter provides various script modules to hint glyphs.
+   *   Examples of supported scripts are Latin or CJK.  Before a glyph is
+   *   auto-hinted, the Unicode character map of the font gets examined, and
+   *   the script is then determined based on Unicode character ranges, see
+   *   below.
+   *
+   *   OpenType fonts, however, often provide much more glyphs than
+   *   character codes (small caps, superscripts, ligatures, swashes, etc.),
+   *   to be controlled by so-called `features'.  Handling OpenType features
+   *   can be quite complicated and thus needs a separate library on top of
+   *   FreeType.
+   *
+   *   The mapping between glyph indices and scripts (in the auto-hinter
+   *   sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an
+   *   array with `num_glyphs' elements, as found in the font's @FT_Face
+   *   structure.  The `glyph-to-script-map' property returns a pointer to
+   *   this array which can be modified as needed.  Note that the
+   *   modification should happen before the first glyph gets processed by
+   *   the auto-hinter so that the global analysis of the font shapes
+   *   actually uses the modified mapping.
+   *
+   *   The following example code demonstrates how to access it (omitting
+   *   the error handling).
+   *
+   *   {
+   *     FT_Library                library;
+   *     FT_Face                   face;
+   *     FT_Prop_GlyphToScriptMap  prop;
+   *
+   *
+   *     FT_Init_FreeType( &library );
+   *     FT_New_Face( library, "foo.ttf", 0, &face );
+   *
+   *     prop.face = face;
+   *
+   *     FT_Property_Get( library, "autofitter",
+   *                               "glyph-to-script-map", &prop );
+   *
+   *     // adjust `prop.map' as needed right here
+   *
+   *     FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
+   *   }
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @enum:
+   *   FT_AUTOHINTER_SCRIPT_XXX
+   *
+   * @description:
+   *   *Experimental* *only*
+   *
+   *   A list of constants used for the @glyph-to-script-map property to
+   *   specify the script submodule the auto-hinter should use for hinting a
+   *   particular glyph.
+   *
+   * @values:
+   *   FT_AUTOHINTER_SCRIPT_NONE ::
+   *     Don't auto-hint this glyph.
+   *
+   *   FT_AUTOHINTER_SCRIPT_LATIN ::
+   *     Apply the latin auto-hinter.  For the auto-hinter, `latin' is a
+   *     very broad term, including Cyrillic and Greek also since characters
+   *     from those scripts share the same design constraints.
+   *
+   *     By default, characters from the following Unicode ranges are
+   *     assigned to this submodule.
+   *
+   *     {
+   *       U+0020 - U+007F  // Basic Latin (no control characters)
+   *       U+00A0 - U+00FF  // Latin-1 Supplement (no control characters)
+   *       U+0100 - U+017F  // Latin Extended-A
+   *       U+0180 - U+024F  // Latin Extended-B
+   *       U+0250 - U+02AF  // IPA Extensions
+   *       U+02B0 - U+02FF  // Spacing Modifier Letters
+   *       U+0300 - U+036F  // Combining Diacritical Marks
+   *       U+0370 - U+03FF  // Greek and Coptic
+   *       U+0400 - U+04FF  // Cyrillic
+   *       U+0500 - U+052F  // Cyrillic Supplement
+   *       U+1D00 - U+1D7F  // Phonetic Extensions
+   *       U+1D80 - U+1DBF  // Phonetic Extensions Supplement
+   *       U+1DC0 - U+1DFF  // Combining Diacritical Marks Supplement
+   *       U+1E00 - U+1EFF  // Latin Extended Additional
+   *       U+1F00 - U+1FFF  // Greek Extended
+   *       U+2000 - U+206F  // General Punctuation
+   *       U+2070 - U+209F  // Superscripts and Subscripts
+   *       U+20A0 - U+20CF  // Currency Symbols
+   *       U+2150 - U+218F  // Number Forms
+   *       U+2460 - U+24FF  // Enclosed Alphanumerics
+   *       U+2C60 - U+2C7F  // Latin Extended-C
+   *       U+2DE0 - U+2DFF  // Cyrillic Extended-A
+   *       U+2E00 - U+2E7F  // Supplemental Punctuation
+   *       U+A640 - U+A69F  // Cyrillic Extended-B
+   *       U+A720 - U+A7FF  // Latin Extended-D
+   *       U+FB00 - U+FB06  // Alphab. Present. Forms (Latin Ligatures)
+   *      U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
+   *      U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
+   *     }
+   *
+   *   FT_AUTOHINTER_SCRIPT_CJK ::
+   *     Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
+   *     Vietnamese, and some other scripts.
+   *
+   *     By default, characters from the following Unicode ranges are
+   *     assigned to this submodule.
+   *
+   *     {
+   *       U+1100 - U+11FF  // Hangul Jamo
+   *       U+2E80 - U+2EFF  // CJK Radicals Supplement
+   *       U+2F00 - U+2FDF  // Kangxi Radicals
+   *       U+2FF0 - U+2FFF  // Ideographic Description Characters
+   *       U+3000 - U+303F  // CJK Symbols and Punctuation
+   *       U+3040 - U+309F  // Hiragana
+   *       U+30A0 - U+30FF  // Katakana
+   *       U+3100 - U+312F  // Bopomofo
+   *       U+3130 - U+318F  // Hangul Compatibility Jamo
+   *       U+3190 - U+319F  // Kanbun
+   *       U+31A0 - U+31BF  // Bopomofo Extended
+   *       U+31C0 - U+31EF  // CJK Strokes
+   *       U+31F0 - U+31FF  // Katakana Phonetic Extensions
+   *       U+3200 - U+32FF  // Enclosed CJK Letters and Months
+   *       U+3300 - U+33FF  // CJK Compatibility
+   *       U+3400 - U+4DBF  // CJK Unified Ideographs Extension A
+   *       U+4DC0 - U+4DFF  // Yijing Hexagram Symbols
+   *       U+4E00 - U+9FFF  // CJK Unified Ideographs
+   *       U+A960 - U+A97F  // Hangul Jamo Extended-A
+   *       U+AC00 - U+D7AF  // Hangul Syllables
+   *       U+D7B0 - U+D7FF  // Hangul Jamo Extended-B
+   *       U+F900 - U+FAFF  // CJK Compatibility Ideographs
+   *       U+FE10 - U+FE1F  // Vertical forms
+   *       U+FE30 - U+FE4F  // CJK Compatibility Forms
+   *       U+FF00 - U+FFEF  // Halfwidth and Fullwidth Forms
+   *      U+1B000 - U+1B0FF // Kana Supplement
+   *      U+1D300 - U+1D35F // Tai Xuan Hing Symbols
+   *      U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
+   *      U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
+   *      U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
+   *      U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
+   *      U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
+   *     }
+   *
+   *   FT_AUTOHINTER_SCRIPT_INDIC ::
+   *     Apply the indic auto-hinter, covering all major scripts from the
+   *     Indian sub-continent and some other related scripts like Thai, Lao,
+   *     or Tibetan.
+   *
+   *     By default, characters from the following Unicode ranges are
+   *     assigned to this submodule.
+   *
+   *     {
+   *       U+0900 - U+0DFF  // Indic Range
+   *       U+0F00 - U+0FFF  // Tibetan
+   *       U+1900 - U+194F  // Limbu
+   *       U+1B80 - U+1BBF  // Sundanese
+   *       U+1C80 - U+1CDF  // Meetei Mayak
+   *       U+A800 - U+A82F  // Syloti Nagri
+   *      U+11800 - U+118DF // Sharada
+   *     }
+   *
+   *     Note that currently Indic support is rudimentary only, missing blue
+   *     zone support.
+   *
+   */
+#define FT_AUTOHINTER_SCRIPT_NONE   0
+#define FT_AUTOHINTER_SCRIPT_LATIN  1
+#define FT_AUTOHINTER_SCRIPT_CJK    2
+#define FT_AUTOHINTER_SCRIPT_INDIC  3
+
+
+  /**************************************************************************
+   *
+   * @struct:
+   *   FT_Prop_GlyphToScriptMap
+   *
+   * @description:
+   *   *Experimental* *only*
+   *
+   *   The data exchange structure for the @glyph-to-script-map property.
+   *
+   */
+   typedef struct  FT_Prop_GlyphToScriptMap_
+   {
+     FT_Face   face;
+     FT_Byte*  map;
+
+   } FT_Prop_GlyphToScriptMap;
+
+
+  /**************************************************************************
+   *
+   * @property:
+   *   fallback-script
+   *
+   * @description:
+   *   *Experimental* *only*
+   *
+   *   If no auto-hinter script module can be assigned to a glyph, a
+   *   fallback script gets assigned to it (see also the
+   *   @glyph-to-script-map property).  By default, this is
+   *   @FT_AUTOHINTER_SCRIPT_CJK.  Using the `fallback-script' property,
+   *   this fallback value can be changed.
+   *
+   *   {
+   *     FT_Library  library;
+   *     FT_UInt     fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
+   *
+   *
+   *     FT_Init_FreeType( &library );
+   *
+   *     FT_Property_Set( library, "autofitter",
+   *                               "fallback-script", &fallback_script );
+   *   }
+   *
+   * @note:
+   *   This property can be used with @FT_Property_Get also.
+   *
+   *   It's important to use the right timing for changing this value: The
+   *   creation of the glyph-to-script map which eventually uses the
+   *   fallback script value gets triggered either by setting or reading a
+   *   face-specific property like @glyph-to-script-map, or by auto-hinting
+   *   any glyph from that face.  In particular, if you have already created
+   *   an @FT_Face structure but not loaded any glyph (using the
+   *   auto-hinter), a change of the fallback glyph will affect this face.
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @property:
+   *   increase-x-height
+   *
+   * @description:
+   *   For ppem values in the range 6~<= ppem <= `increase-x-height', round
+   *   up the font's x~height much more often than normally.  If the value
+   *   is set to~0, which is the default, this feature is switched off.  Use
+   *   this property to improve the legibility of small font sizes if
+   *   necessary.
+   *
+   *   {
+   *     FT_Library               library;
+   *     FT_Face                  face;
+   *     FT_Prop_IncreaseXHeight  prop;
+   *
+   *
+   *     FT_Init_FreeType( &library );
+   *     FT_New_Face( library, "foo.ttf", 0, &face );
+   *     FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
+   *
+   *     prop.face  = face;
+   *     prop.limit = 14;
+   *
+   *     FT_Property_Set( library, "autofitter",
+   *                               "increase-x-height", &prop );
+   *   }
+   *
+   * @note:
+   *   This property can be used with @FT_Property_Get also.
+   *
+   *   Set this value right after calling @FT_Set_Char_Size, but before
+   *   loading any glyph (using the auto-hinter).
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @struct:
+   *   FT_Prop_IncreaseXHeight
+   *
+   * @description:
+   *   The data exchange structure for the @increase-x-height property.
+   *
+   */
+   typedef struct  FT_Prop_IncreaseXHeight_
+   {
+     FT_Face  face;
+     FT_UInt  limit;
+
+   } FT_Prop_IncreaseXHeight;
+
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __FTAUTOH_H__ */
+
+
+/* END */
index 01fe3fb..9766919 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType exact bbox computation (specification).                     */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType exact bbox computation (specification).                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003, 2007 by                                     */
+/*  Copyright 1996-2001, 2003, 2007, 2011 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -73,6 +73,14 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0~means success.                             */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    If the font is tricky and the glyph has been loaded with           */
+  /*    @FT_LOAD_NO_SCALE, the resulting BBox is meaningless.  To get      */
+  /*    reasonable values for the BBox it is necessary to load the glyph   */
+  /*    at a large ppem value (so that the hinting instructions can        */
+  /*    properly shift and scale the subglyphs), then extracting the BBox  */
+  /*    which can be eventually converted back to font units.              */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Outline_Get_BBox( FT_Outline*  outline,
                        FT_BBox     *abbox );
   FT_EXPORT( FT_Error )
   FT_Outline_Get_BBox( FT_Outline*  outline,
                        FT_BBox     *abbox );
index 9274236..7dbf5ba 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility functions for bitmaps (specification).              */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType utility functions for bitmaps (specification).              */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2008 by                                    */
+/*  Copyright 2004-2006, 2008, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -135,9 +135,9 @@ FT_BEGIN_HEADER
   /*    FT_Bitmap_Convert                                                  */
   /*                                                                       */
   /* <Description>                                                         */
   /*    FT_Bitmap_Convert                                                  */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a  */
-  /*    bitmap object with depth 8bpp, making the number of used bytes per */
-  /*    line (a.k.a. the `pitch') a multiple of `alignment'.               */
+  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */
+  /*    to a bitmap object with depth 8bpp, making the number of used      */
+  /*    bytes line (a.k.a. the `pitch') a multiple of `alignment'.         */
   /*                                                                       */
   /* <Input>                                                               */
   /*    library   :: A handle to a library object.                         */
   /*                                                                       */
   /* <Input>                                                               */
   /*    library   :: A handle to a library object.                         */
diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftbzip2.h b/reactos/lib/3rdparty/freetype/include/freetype/ftbzip2.h
new file mode 100644 (file)
index 0000000..1bf81b1
--- /dev/null
@@ -0,0 +1,102 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftbzip2.h                                                              */
+/*                                                                         */
+/*    Bzip2-compressed stream support.                                     */
+/*                                                                         */
+/*  Copyright 2010 by                                                      */
+/*  Joel Klinghed.                                                         */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __FTBZIP2_H__
+#define __FTBZIP2_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Section>                                                             */
+  /*    bzip2                                                              */
+  /*                                                                       */
+  /* <Title>                                                               */
+  /*    BZIP2 Streams                                                      */
+  /*                                                                       */
+  /* <Abstract>                                                            */
+  /*    Using bzip2-compressed font files.                                 */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    This section contains the declaration of Bzip2-specific functions. */
+  /*                                                                       */
+  /*************************************************************************/
+
+
+ /************************************************************************
+  *
+  * @function:
+  *   FT_Stream_OpenBzip2
+  *
+  * @description:
+  *   Open a new stream to parse bzip2-compressed font files.  This is
+  *   mainly used to support the compressed `*.pcf.bz2' fonts that come
+  *   with XFree86.
+  *
+  * @input:
+  *   stream ::
+  *     The target embedding stream.
+  *
+  *   source ::
+  *     The source stream.
+  *
+  * @return:
+  *   FreeType error code.  0~means success.
+  *
+  * @note:
+  *   The source stream must be opened _before_ calling this function.
+  *
+  *   Calling the internal function `FT_Stream_Close' on the new stream will
+  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream
+  *   objects will be released to the heap.
+  *
+  *   The stream implementation is very basic and resets the decompression
+  *   process each time seeking backwards is needed within the stream.
+  *
+  *   In certain builds of the library, bzip2 compression recognition is
+  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.
+  *   This means that if no font driver is capable of handling the raw
+  *   compressed file, the library will try to open a bzip2 compressed stream
+  *   from it and re-open the face with it.
+  *
+  *   This function may return `FT_Err_Unimplemented_Feature' if your build
+  *   of FreeType was not compiled with bzip2 support.
+  */
+  FT_EXPORT( FT_Error )
+  FT_Stream_OpenBzip2( FT_Stream  stream,
+                       FT_Stream  source );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTBZIP2_H__ */
+
+
+/* END */
index 6af5306..4ec9587 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Cache subsystem (specification).                            */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType Cache subsystem (specification).                            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
+/*  Copyright 1996-2008, 2010, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -214,17 +214,6 @@ FT_BEGIN_HEADER
 
  /* */
 
 
  /* */
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  /* these macros are incompatible with LLP64, should not be used */
-
-#define FT_POINTER_TO_ULONG( p )  ( (FT_ULong)(FT_Pointer)(p) )
-
-#define FTC_FACE_ID_HASH( i )                                \
-          ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^   \
-                       ( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
@@ -381,7 +370,7 @@ FT_BEGIN_HEADER
   /*    should never try to discard it yourself.                           */
   /*                                                                       */
   /*    The @FT_Face object doesn't necessarily have a current size object */
   /*    should never try to discard it yourself.                           */
   /*                                                                       */
   /*    The @FT_Face object doesn't necessarily have a current size object */
-  /*    (i.e., face->size can be 0).  If you need a specific `font size',  */
+  /*    (i.e., face->size can be~0).  If you need a specific `font size',  */
   /*    use @FTC_Manager_LookupSize instead.                               */
   /*                                                                       */
   /*    Never change the face's transformation matrix (i.e., never call    */
   /*    use @FTC_Manager_LookupSize instead.                               */
   /*                                                                       */
   /*    Never change the face's transformation matrix (i.e., never call    */
@@ -705,17 +694,6 @@ FT_BEGIN_HEADER
             (d1)->width   == (d2)->width   && \
             (d1)->flags   == (d2)->flags   )
 
             (d1)->width   == (d2)->width   && \
             (d1)->flags   == (d2)->flags   )
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  /* this macro is incompatible with LLP64, should not be used */
-
-#define FTC_IMAGE_TYPE_HASH( d )                          \
-          (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id )  ^ \
-                      ( (d)->width << 8 ) ^ (d)->height ^ \
-                      ( (d)->flags << 4 )               )
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
@@ -723,7 +701,7 @@ FT_BEGIN_HEADER
   /*    FTC_ImageCache                                                     */
   /*                                                                       */
   /* <Description>                                                         */
   /*    FTC_ImageCache                                                     */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    A handle to an glyph image cache object.  They are designed to     */
+  /*    A handle to a glyph image cache object.  They are designed to      */
   /*    hold many distinct glyph images while not exceeding a certain      */
   /*    memory threshold.                                                  */
   /*                                                                       */
   /*    hold many distinct glyph images while not exceeding a certain      */
   /*    memory threshold.                                                  */
   /*                                                                       */
@@ -1069,67 +1047,6 @@ FT_BEGIN_HEADER
                               FTC_Node      *anode );
 
 
                               FTC_Node      *anode );
 
 
- /* */
-
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  /*@***********************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    FTC_FontRec                                                        */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A simple structure used to describe a given `font' to the cache    */
-  /*    manager.  Note that a `font' is the combination of a given face    */
-  /*    with a given character size.                                       */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    face_id    :: The ID of the face to use.                           */
-  /*                                                                       */
-  /*    pix_width  :: The character width in integer pixels.               */
-  /*                                                                       */
-  /*    pix_height :: The character height in integer pixels.              */
-  /*                                                                       */
-  typedef struct  FTC_FontRec_
-  {
-    FTC_FaceID  face_id;
-    FT_UShort   pix_width;
-    FT_UShort   pix_height;
-
-  } FTC_FontRec;
-
-
-  /* */
-
-
-#define FTC_FONT_COMPARE( f1, f2 )                  \
-          ( (f1)->face_id    == (f2)->face_id    && \
-            (f1)->pix_width  == (f2)->pix_width  && \
-            (f1)->pix_height == (f2)->pix_height )
-
-  /* this macro is incompatible with LLP64, should not be used */
-#define FTC_FONT_HASH( f )                              \
-          (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
-                       ((f)->pix_width << 8)          ^ \
-                       ((f)->pix_height)              )
-
-  typedef FTC_FontRec*  FTC_Font;
-
-
-  FT_EXPORT( FT_Error )
-  FTC_Manager_Lookup_Face( FTC_Manager  manager,
-                           FTC_FaceID   face_id,
-                           FT_Face     *aface );
-
-  FT_EXPORT( FT_Error )
-  FTC_Manager_Lookup_Size( FTC_Manager  manager,
-                           FTC_Font     font,
-                           FT_Face     *aface,
-                           FT_Size     *asize );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
  /* */
 
 FT_END_HEADER
  /* */
 
 FT_END_HEADER
diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h b/reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h
new file mode 100644 (file)
index 0000000..ccbcbcc
--- /dev/null
@@ -0,0 +1,151 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftcffdrv.h                                                             */
+/*                                                                         */
+/*    FreeType API for controlling the CFF driver (specification only).    */
+/*                                                                         */
+/*  Copyright 2013 by                                                      */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __FTCFFDRV_H__
+#define __FTCFFDRV_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+  /**************************************************************************
+   *
+   * @section:
+   *   cff_driver
+   *
+   * @title:
+   *   The CFF driver
+   *
+   * @abstract:
+   *   Controlling the CFF driver module.
+   *
+   * @description:
+   *   While FreeType's CFF driver doesn't expose API functions by itself,
+   *   it is possible to control its behaviour with @FT_Property_Set and
+   *   @FT_Property_Get.  The following lists the available properties
+   *   together with the necessary macros and structures.
+   *
+   *   The CFF driver's module name is `cff'.
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @property:
+   *   hinting-engine
+   *
+   * @description:
+   *   Thanks to Adobe, which contributed a new hinting (and parsing)
+   *   engine, an application can select between `freetype' and `adobe' if
+   *   compiled with CFF_CONFIG_OPTION_OLD_ENGINE.  If this configuration
+   *   macro isn't defined, `hinting-engine' does nothing.
+   *
+   *   The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is
+   *   defined, and `adobe' otherwise.
+   *
+   *   The following example code demonstrates how to select Adobe's hinting
+   *   engine (omitting the error handling).
+   *
+   *   {
+   *     FT_Library  library;
+   *     FT_Face     face;
+   *     FT_UInt     hinting_engine = FT_CFF_HINTING_ADOBE;
+   *
+   *
+   *     FT_Init_FreeType( &library );
+   *
+   *     FT_Property_Set( library, "cff",
+   *                               "hinting-engine", &hinting_engine );
+   *   }
+   *
+   * @note:
+   *   This property can be used with @FT_Property_Get also.
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @enum:
+   *   FT_CFF_HINTING_XXX
+   *
+   * @description:
+   *   A list of constants used for the @hinting-engine property to select
+   *   the hinting engine for CFF fonts.
+   *
+   * @values:
+   *   FT_CFF_HINTING_FREETYPE ::
+   *     Use the old FreeType hinting engine.
+   *
+   *   FT_CFF_HINTING_ADOBE ::
+   *     Use the hinting engine contributed by Adobe.
+   *
+   */
+#define FT_CFF_HINTING_FREETYPE  0
+#define FT_CFF_HINTING_ADOBE     1
+
+
+  /**************************************************************************
+   *
+   * @property:
+   *   no-stem-darkening
+   *
+   * @description:
+   *   By default, the Adobe CFF engine darkens stems at smaller sizes,
+   *   regardless of hinting, to enhance contrast.  Setting this property,
+   *   stem darkening gets switched off.
+   *
+   *   Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
+   *
+   *   {
+   *     FT_Library  library;
+   *     FT_Face     face;
+   *     FT_Bool     no_stem_darkening = TRUE;
+   *
+   *
+   *     FT_Init_FreeType( &library );
+   *
+   *     FT_Property_Set( library, "cff",
+   *                               "no-stem-darkening", &no_stem_darkening );
+   *   }
+   *
+   * @note:
+   *   This property can be used with @FT_Property_Get also.
+   *
+   */
+
+
+ /* */
+
+FT_END_HEADER
+
+
+#endif /* __FTCFFDRV_H__ */
+
+
+/* END */
index 7775a6b..c55670d 100644 (file)
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
+/***************************************************************************/
+/*                                                                         */
+/* <Chapter>                                                               */
+/*    module_specific                                                      */
+/*                                                                         */
+/* <Title>                                                                 */
+/*    Controlling FreeType Modules                                         */
+/*                                                                         */
+/* <Sections>                                                              */
+/*    auto_hinter                                                          */
+/*    cff_driver                                                           */
+/*    tt_driver                                                            */
+/*                                                                         */
+/***************************************************************************/
+
+
 /***************************************************************************/
 /*                                                                         */
 /* <Chapter>                                                               */
 /***************************************************************************/
 /*                                                                         */
 /* <Chapter>                                                               */
 /*    module_management                                                    */
 /*    gzip                                                                 */
 /*    lzw                                                                  */
 /*    module_management                                                    */
 /*    gzip                                                                 */
 /*    lzw                                                                  */
+/*    bzip2                                                                */
 /*    lcd_filtering                                                        */
 /*                                                                         */
 /***************************************************************************/
 /*    lcd_filtering                                                        */
 /*                                                                         */
 /***************************************************************************/
index bf52220..76c7b9e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType error codes (specification).                                */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType error codes (specification).                                */
 /*                                                                         */
-/*  Copyright 2002, 2004, 2006, 2007, 2010 by                              */
+/*  Copyright 2002, 2004, 2006, 2007, 2010-2013 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
                 "broken offset within table" )
   FT_ERRORDEF_( Array_Too_Large,                             0x0A, \
                 "array allocation size too large" )
                 "broken offset within table" )
   FT_ERRORDEF_( Array_Too_Large,                             0x0A, \
                 "array allocation size too large" )
+  FT_ERRORDEF_( Missing_Module,                              0x0B, \
+                "missing module" )
+  FT_ERRORDEF_( Missing_Property,                            0x0C, \
+                "missing property" )
 
   /* glyph/character errors */
 
 
   /* glyph/character errors */
 
                 "ignore" )
   FT_ERRORDEF_( No_Unicode_Glyph_Name,                       0xA3, \
                 "no Unicode glyph name found" )
                 "ignore" )
   FT_ERRORDEF_( No_Unicode_Glyph_Name,                       0xA3, \
                 "no Unicode glyph name found" )
-
+  FT_ERRORDEF_( Glyph_Too_Big,                               0xA4, \
+                "glyph to big for hinting" )
 
   /* BDF errors */
 
 
   /* BDF errors */
 
index 6600dad..0fa3e4d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType error code handling (specification).                        */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType error code handling (specification).                        */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2007 by                               */
+/*  Copyright 1996-2002, 2004, 2007, 2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -28,9 +28,8 @@
   /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */
   /*   defined in ftoption.h in order to make the higher byte indicate     */
   /*   the module where the error has happened (this is not compatible     */
   /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */
   /*   defined in ftoption.h in order to make the higher byte indicate     */
   /*   the module where the error has happened (this is not compatible     */
-  /*   with standard builds of FreeType 2).  You can then use the macro    */
-  /*   FT_ERROR_BASE macro to extract the generic error code from an       */
-  /*   FT_Error value.                                                     */
+  /*   with standard builds of FreeType 2).  See the file `ftmoderr.h' for */
+  /*   more details.                                                       */
   /*                                                                       */
   /*                                                                       */
   /* II - Error Message strings                                            */
   /*                                                                       */
   /*                                                                       */
   /* II - Error Message strings                                            */
 
 #undef  FT_NEED_EXTERN_C
 
 
 #undef  FT_NEED_EXTERN_C
 
-#undef  FT_ERR_XCAT
-#undef  FT_ERR_CAT
-
-#define FT_ERR_XCAT( x, y )  x ## y
-#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )
-
 
   /* FT_ERR_PREFIX is used as a prefix for error identifiers. */
   /* By default, we use `FT_Err_'.                            */
 
   /* FT_ERR_PREFIX is used as a prefix for error identifiers. */
   /* By default, we use `FT_Err_'.                            */
 
 
   /* this macro is used to define an error */
 
 
   /* this macro is used to define an error */
-#define FT_ERRORDEF_( e, v, s )   \
+#define FT_ERRORDEF_( e, v, s )                                             \
           FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
 
   /* this is only used for <module>_Err_Ok, which must be 0! */
           FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
 
   /* this is only used for <module>_Err_Ok, which must be 0! */
-#define FT_NOERRORDEF_( e, v, s ) \
+#define FT_NOERRORDEF_( e, v, s )                             \
           FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
 
 
           FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
 
 
 #undef FT_NOERRORDEF_
 
 #undef FT_NEED_EXTERN_C
 #undef FT_NOERRORDEF_
 
 #undef FT_NEED_EXTERN_C
-#undef FT_ERR_CONCAT
 #undef FT_ERR_BASE
 
 #undef FT_ERR_BASE
 
-  /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */
-#ifndef FT_KEEP_ERR_PREFIX
+  /* FT_ERR_PREFIX is needed internally */
+#ifndef FT2_BUILD_LIBRARY
 #undef FT_ERR_PREFIX
 #endif
 
 #undef FT_ERR_PREFIX
 #endif
 
index 91a769e..453d4fa 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Access of TrueType's `gasp' table (specification).                   */
 /*                                                                         */
 /*                                                                         */
 /*    Access of TrueType's `gasp' table (specification).                   */
 /*                                                                         */
-/*  Copyright 2007, 2008 by                                                */
+/*  Copyright 2007, 2008, 2011 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
    *
    *   FT_GASP_DO_GRIDFIT ::
    *     Grid-fitting and hinting should be performed at the specified ppem.
    *
    *   FT_GASP_DO_GRIDFIT ::
    *     Grid-fitting and hinting should be performed at the specified ppem.
-   *     This *really* means TrueType bytecode interpretation.
+   *     This *really* means TrueType bytecode interpretation.  If this bit
+   *     is not set, no hinting gets applied.
    *
    *   FT_GASP_DO_GRAY ::
    *     Anti-aliased rendering should be performed at the specified ppem.
    *
    *   FT_GASP_DO_GRAY ::
    *     Anti-aliased rendering should be performed at the specified ppem.
+   *     If not set, do monochrome rendering.
    *
    *   FT_GASP_SYMMETRIC_SMOOTHING ::
    *
    *   FT_GASP_SYMMETRIC_SMOOTHING ::
-   *     Smoothing along multiple axes must be used with ClearType.
+   *     If set, smoothing along multiple axes must be used with ClearType.
    *
    *   FT_GASP_SYMMETRIC_GRIDFIT ::
    *     Grid-fitting must be used with ClearType's symmetric smoothing.
    *
    * @note:
    *
    *   FT_GASP_SYMMETRIC_GRIDFIT ::
    *     Grid-fitting must be used with ClearType's symmetric smoothing.
    *
    * @note:
+   *   The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
+   *   used for standard font rasterization only.  Independently of that,
+   *   `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
+   *   be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
+   *   `FT_GASP_DO_GRAY' are consequently ignored).
+   *
    *   `ClearType' is Microsoft's implementation of LCD rendering, partly
    *   protected by patents.
    *
    *   `ClearType' is Microsoft's implementation of LCD rendering, partly
    *   protected by patents.
    *
index 0b8f0c0..31dc331 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType convenience functions to handle glyphs (specification).     */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType convenience functions to handle glyphs (specification).     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by                   */
+/*  Copyright 1996-2003, 2006, 2008, 2009, 2011 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -94,7 +94,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    The root glyph structure contains a given glyph image plus its     */
   /*                                                                       */
   /* <Description>                                                         */
   /*    The root glyph structure contains a given glyph image plus its     */
-  /*    advance width in 16.16 fixed float format.                         */
+  /*    advance width in 16.16 fixed-point format.                         */
   /*                                                                       */
   /* <Fields>                                                              */
   /*    library :: A handle to the FreeType library object.                */
   /*                                                                       */
   /* <Fields>                                                              */
   /*    library :: A handle to the FreeType library object.                */
@@ -384,6 +384,13 @@ FT_BEGIN_HEADER
   /*    units in 26.6 pixel format.  The value @FT_GLYPH_BBOX_SUBPIXELS    */
   /*    is another name for this constant.                                 */
   /*                                                                       */
   /*    units in 26.6 pixel format.  The value @FT_GLYPH_BBOX_SUBPIXELS    */
   /*    is another name for this constant.                                 */
   /*                                                                       */
+  /*    If the font is tricky and the glyph has been loaded with           */
+  /*    @FT_LOAD_NO_SCALE, the resulting CBox is meaningless.  To get      */
+  /*    reasonable values for the CBox it is necessary to load the glyph   */
+  /*    at a large ppem value (so that the hinting instructions can        */
+  /*    properly shift and scale the subglyphs), then extracting the CBox  */
+  /*    which can be eventually converted back to font units.              */
+  /*                                                                       */
   /*    Note that the maximum coordinates are exclusive, which means that  */
   /*    one can compute the width and height of the glyph image (be it in  */
   /*    integer or 26.6 pixels) as:                                        */
   /*    Note that the maximum coordinates are exclusive, which means that  */
   /*    one can compute the width and height of the glyph image (be it in  */
   /*    integer or 26.6 pixels) as:                                        */
index 04b5e04..3b826b1 100644 (file)
@@ -5,8 +5,7 @@
 /*    FreeType glyph image formats and default raster interface            */
 /*    (specification).                                                     */
 /*                                                                         */
 /*    FreeType glyph image formats and default raster interface            */
 /*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2010, 2013 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -54,7 +53,7 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    The type FT_Pos is used to store vectorial coordinates.  Depending */
   /*    on the context, these can represent distances in integer font      */
   /* <Description>                                                         */
   /*    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.            */
+  /*    units, or 16.16, or 26.6 fixed-point pixel coordinates.            */
   /*                                                                       */
   typedef signed long  FT_Pos;
 
   /*                                                                       */
   typedef signed long  FT_Pos;
 
@@ -169,6 +168,15 @@ FT_BEGIN_HEADER
   /*      times taller than the original glyph image.  See also            */
   /*      @FT_RENDER_MODE_LCD_V.                                           */
   /*                                                                       */
   /*      times taller than the original glyph image.  See also            */
   /*      @FT_RENDER_MODE_LCD_V.                                           */
   /*                                                                       */
+  /*    FT_PIXEL_MODE_BGRA ::                                              */
+  /*      An image with four 8-bit channels per pixel, representing a      */
+  /*      color image (such as emoticons) with alpha channel.  For each    */
+  /*      pixel, the format is BGRA, which means, the blue channel comes   */
+  /*      first in memory.  The color channels are pre-multiplied and in   */
+  /*      the sRGB colorspace.  For example, full red at half-translucent  */
+  /*      opacity will be represented as `00,00,80,80', not `00,00,FF,80'. */
+  /*      See also @FT_LOAD_COLOR.                                         */
+  /*                                                                       */
   typedef enum  FT_Pixel_Mode_
   {
     FT_PIXEL_MODE_NONE = 0,
   typedef enum  FT_Pixel_Mode_
   {
     FT_PIXEL_MODE_NONE = 0,
@@ -178,6 +186,7 @@ FT_BEGIN_HEADER
     FT_PIXEL_MODE_GRAY4,
     FT_PIXEL_MODE_LCD,
     FT_PIXEL_MODE_LCD_V,
     FT_PIXEL_MODE_GRAY4,
     FT_PIXEL_MODE_LCD,
     FT_PIXEL_MODE_LCD_V,
+    FT_PIXEL_MODE_BGRA,
 
     FT_PIXEL_MODE_MAX      /* do not remove */
 
 
     FT_PIXEL_MODE_MAX      /* do not remove */
 
index 0b55ebe..8b253f1 100644 (file)
@@ -53,6 +53,44 @@ FT_BEGIN_HEADER
    *   *not* implemented in default builds of the library.  You need to
    *   #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
    *   in order to activate it.
    *   *not* implemented in default builds of the library.  You need to
    *   #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
    *   in order to activate it.
+   *
+   *   FreeType generates alpha coverage maps, which are linear by nature.
+   *   For instance, the value 0x80 in bitmap representation means that
+   *   (within numerical precision) 0x80/0xff fraction of that pixel is
+   *   covered by the glyph's outline.  The blending function for placing
+   *   text over a background is
+   *
+   *   {
+   *     dst = alpha * src + (1 - alpha) * dst    ,
+   *   }
+   *
+   *   which is known as OVER.  However, when calculating the output of the
+   *   OVER operator, the source colors should first be transformed to a
+   *   linear color space, then alpha blended in that space, and transformed
+   *   back to the output color space.
+   *
+   *   When linear light blending is used, the default FIR5 filtering
+   *   weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as
+   *   they have been designed for black on white rendering while lacking
+   *   gamma correction.  To preserve color neutrality, weights for a FIR5
+   *   filter should be chosen according to two free parameters `a' and `c',
+   *   and the FIR weights should be
+   *
+   *   {
+   *     [a - c, a + c, 2 * a, a + c, a - c]    .
+   *   }
+   *
+   *   This formula generates equal weights for all the color primaries
+   *   across the filter kernel, which makes it colorless.  One suggested
+   *   set of weights is
+   *
+   *   {
+   *     [0x10, 0x50, 0x60, 0x50, 0x10]    ,
+   *   }
+   *
+   *   where `a' has value 0x30 and `b' value 0x20.  The weights in filter
+   *   may have a sum larger than 0x100, which increases coloration slightly
+   *   but also improves contrast.
    */
 
 
    */
 
 
index 8f2e017..8abffb5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType modules public interface (specification).                   */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType modules public interface (specification).                   */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by             */
+/*  Copyright 1996-2003, 2006, 2008-2010, 2012, 2013 by                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -42,11 +42,38 @@ FT_BEGIN_HEADER
   /*    Module Management                                                  */
   /*                                                                       */
   /* <Abstract>                                                            */
   /*    Module Management                                                  */
   /*                                                                       */
   /* <Abstract>                                                            */
-  /*    How to add, upgrade, and remove modules from FreeType.             */
+  /*    How to add, upgrade, remove, and control modules from FreeType.    */
   /*                                                                       */
   /* <Description>                                                         */
   /*    The definitions below are used to manage modules within FreeType.  */
   /*    Modules can be added, upgraded, and removed at runtime.            */
   /*                                                                       */
   /* <Description>                                                         */
   /*    The definitions below are used to manage modules within FreeType.  */
   /*    Modules can be added, upgraded, and removed at runtime.            */
+  /*    Additionally, some module properties can be controlled also.       */
+  /*                                                                       */
+  /*    Here is a list of possible values of the `module_name' field in    */
+  /*    the @FT_Module_Class structure.                                    */
+  /*                                                                       */
+  /*    {                                                                  */
+  /*      autofitter                                                       */
+  /*      bdf                                                              */
+  /*      cff                                                              */
+  /*      gxvalid                                                          */
+  /*      otvalid                                                          */
+  /*      pcf                                                              */
+  /*      pfr                                                              */
+  /*      psaux                                                            */
+  /*      pshinter                                                         */
+  /*      psnames                                                          */
+  /*      raster1, raster5                                                 */
+  /*      sfnt                                                             */
+  /*      smooth, smooth-lcd, smooth-lcdv                                  */
+  /*      truetype                                                         */
+  /*      type1                                                            */
+  /*      type42                                                           */
+  /*      t1cid                                                            */
+  /*      winfonts                                                         */
+  /*    }                                                                  */
+  /*                                                                       */
+  /*    Note that the FreeType Cache sub-system is not a FreeType module.  */
   /*                                                                       */
   /*************************************************************************/
 
   /*                                                                       */
   /*************************************************************************/
 
@@ -118,7 +145,7 @@ FT_BEGIN_HEADER
   /*    A function used to query a given module for a specific interface.  */
   /*                                                                       */
   /* <Input>                                                               */
   /*    A function used to query a given module for a specific interface.  */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    module :: The module to finalize.                                  */
+  /*    module :: The module to be searched.                               */
   /*                                                                       */
   /*    name ::   The name of the interface in the module.                 */
   /*                                                                       */
   /*                                                                       */
   /*    name ::   The name of the interface in the module.                 */
   /*                                                                       */
@@ -249,6 +276,137 @@ FT_BEGIN_HEADER
                     FT_Module   module );
 
 
                     FT_Module   module );
 
 
+  /**********************************************************************
+   *
+   * @function:
+   *    FT_Property_Set
+   *
+   * @description:
+   *    Set a property for a given module.
+   *
+   * @input:
+   *    library ::
+   *       A handle to the library the module is part of.
+   *
+   *    module_name ::
+   *       The module name.
+   *
+   *    property_name ::
+   *       The property name.  Properties are described in the `Synopsis'
+   *       subsection of the module's documentation.
+   *
+   *       Note that only a few modules have properties.
+   *
+   *    value ::
+   *       A generic pointer to a variable or structure which gives the new
+   *       value of the property.  The exact definition of `value' is
+   *       dependent on the property; see the `Synopsis' subsection of the
+   *       module's documentation.
+   *
+   * @return:
+   *   FreeType error code.  0~means success.
+   *
+   * @note:
+   *    If `module_name' isn't a valid module name, or `property_name'
+   *    doesn't specify a valid property, or if `value' doesn't represent a
+   *    valid value for the given property, an error is returned.
+   *
+   *    The following example sets property `bar' (a simple integer) in
+   *    module `foo' to value~1.
+   *
+   *    {
+   *      FT_UInt  bar;
+   *
+   *
+   *      bar = 1;
+   *      FT_Property_Set( library, "foo", "bar", &bar );
+   *    }
+   *
+   *    Note that the FreeType Cache sub-system doesn't recognize module
+   *    property changes.  To avoid glyph lookup confusion within the cache
+   *    you should call @FTC_Manager_Reset to completely flush the cache if
+   *    a module property gets changed after @FTC_Manager_New has been
+   *    called.
+   *
+   *    It is not possible to set properties of the FreeType Cache
+   *    sub-system itself with FT_Property_Set; use @FTC_Property_Set
+   *    instead.
+   *
+   *  @since:
+   *    2.4.11
+   *
+   */
+  FT_EXPORT( FT_Error )
+  FT_Property_Set( FT_Library        library,
+                   const FT_String*  module_name,
+                   const FT_String*  property_name,
+                   const void*       value );
+
+
+  /**********************************************************************
+   *
+   * @function:
+   *    FT_Property_Get
+   *
+   * @description:
+   *    Get a module's property value.
+   *
+   * @input:
+   *    library ::
+   *       A handle to the library the module is part of.
+   *
+   *    module_name ::
+   *       The module name.
+   *
+   *    property_name ::
+   *       The property name.  Properties are described in the `Synopsis'
+   *       subsection of the module's documentation.
+   *
+   * @inout:
+   *    value ::
+   *       A generic pointer to a variable or structure which gives the
+   *       value of the property.  The exact definition of `value' is
+   *       dependent on the property; see the `Synopsis' subsection of the
+   *       module's documentation.
+   *
+   * @return:
+   *   FreeType error code.  0~means success.
+   *
+   * @note:
+   *    If `module_name' isn't a valid module name, or `property_name'
+   *    doesn't specify a valid property, or if `value' doesn't represent a
+   *    valid value for the given property, an error is returned.
+   *
+   *    The following example gets property `baz' (a range) in module `foo'.
+   *
+   *    {
+   *      typedef  range_
+   *      {
+   *        FT_Int32  min;
+   *        FT_Int32  max;
+   *
+   *      } range;
+   *
+   *      range  baz;
+   *
+   *
+   *      FT_Property_Get( library, "foo", "baz", &baz );
+   *    }
+   *
+   *    It is not possible to retrieve properties of the FreeType Cache
+   *    sub-system with FT_Property_Get; use @FTC_Property_Get instead.
+   *
+   *  @since:
+   *    2.4.11
+   *
+   */
+  FT_EXPORT( FT_Error )
+  FT_Property_Get( FT_Library        library,
+                   const FT_String*  module_name,
+                   const FT_String*  property_name,
+                   void*             value );
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -430,13 +588,13 @@ FT_BEGIN_HEADER
    *       scale glyph components with bytecode instructions.  It produces
    *       bad output for most other fonts.
    *
    *       scale glyph components with bytecode instructions.  It produces
    *       bad output for most other fonts.
    *
-   *    FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
+   *     FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
    *       The library implements a bytecode interpreter that covers
    *       the full instruction set of the TrueType virtual machine (this
    *       was governed by patents until May 2010, hence the name).
    *
    *  @since:
    *       The library implements a bytecode interpreter that covers
    *       the full instruction set of the TrueType virtual machine (this
    *       was governed by patents until May 2010, hence the name).
    *
    *  @since:
-   *       2.2
+   *     2.2
    *
    */
   typedef enum  FT_TrueTypeEngineType_
    *
    */
   typedef enum  FT_TrueTypeEngineType_
index b0115dd..5a27db1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType module error offsets (specification).                       */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType module error offsets (specification).                       */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2005 by                              */
+/*  Copyright 2001-2005, 2010, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
-  /* This file is used to define the FreeType module error offsets.        */
+  /* This file is used to define the FreeType module error codes.          */
   /*                                                                       */
   /*                                                                       */
-  /* The lower byte gives the error code, the higher byte gives the        */
-  /* module.  The base module has error offset 0.  For example, the error  */
-  /* `FT_Err_Invalid_File_Format' has value 0x003, the error               */
-  /* `TT_Err_Invalid_File_Format' has value 0x1103, the error              */
-  /* `T1_Err_Invalid_File_Format' has value 0x1203, etc.                   */
+  /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is    */
+  /* set, the lower byte of an error value identifies the error code as    */
+  /* usual.  In addition, the higher byte identifies the module.  For      */
+  /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */
+  /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error        */
+  /* `T1_Err_Invalid_File_Format' has value 0x1403, etc.                   */
+  /*                                                                       */
+  /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero,    */
+  /* including the high byte.                                              */
+  /*                                                                       */
+  /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of   */
+  /* an error value is set to zero.                                        */
+  /*                                                                       */
+  /* To hide the various `XXX_Err_' prefixes in the source code, FreeType  */
+  /* provides some macros in `fttypes.h'.                                  */
+  /*                                                                       */
+  /*   FT_ERR( err )                                                       */
+  /*     Add current error module prefix (as defined with the              */
+  /*     `FT_ERR_PREFIX' macro) to `err'.  For example, in the BDF module  */
+  /*     the line                                                          */
+  /*                                                                       */
+  /*       error = FT_ERR( Invalid_Outline );                              */
+  /*                                                                       */
+  /*     expands to                                                        */
+  /*                                                                       */
+  /*       error = BDF_Err_Invalid_Outline;                                */
+  /*                                                                       */
+  /*     For simplicity, you can always use `FT_Err_Ok' directly instead   */
+  /*     of `FT_ERR( Ok )'.                                                */
+  /*                                                                       */
+  /*   FT_ERR_EQ( errcode, err )                                           */
+  /*   FT_ERR_NEQ( errcode, err )                                          */
+  /*     Compare error code `errcode' with the error `err' for equality    */
+  /*     and inequality, respectively.  Example:                           */
+  /*                                                                       */
+  /*       if ( FT_ERR_EQ( error, Invalid_Outline ) )                      */
+  /*         ...                                                           */
+  /*                                                                       */
+  /*     Using this macro you don't have to think about error prefixes.    */
+  /*     Of course, if module errors are not active, the above example is  */
+  /*     the same as                                                       */
+  /*                                                                       */
+  /*       if ( error == FT_Err_Invalid_Outline )                          */
+  /*         ...                                                           */
+  /*                                                                       */
+  /*   FT_ERROR_BASE( errcode )                                            */
+  /*   FT_ERROR_MODULE( errcode )                                          */
+  /*     Get base error and module error code, respectively.               */
   /*                                                                       */
   /*                                                                       */
-  /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h   */
-  /* to make the higher byte always zero (disabling the module error       */
-  /* mechanism).                                                           */
   /*                                                                       */
   /* It can also be used to create a module error message table easily     */
   /* with something like                                                   */
   /*                                                                       */
   /* It can also be used to create a module error message table easily     */
   /* with something like                                                   */
@@ -48,9 +88,6 @@
   /*     #include FT_MODULE_ERRORS_H                                       */
   /*   }                                                                   */
   /*                                                                       */
   /*     #include FT_MODULE_ERRORS_H                                       */
   /*   }                                                                   */
   /*                                                                       */
-  /* To use such a table, all errors must be ANDed with 0xFF00 to remove   */
-  /* the error code.                                                       */
-  /*                                                                       */
   /*************************************************************************/
 
 
   /*************************************************************************/
 
 
   FT_MODERRDEF( Base,      0x000, "base module" )
   FT_MODERRDEF( Autofit,   0x100, "autofitter module" )
   FT_MODERRDEF( BDF,       0x200, "BDF module" )
   FT_MODERRDEF( Base,      0x000, "base module" )
   FT_MODERRDEF( Autofit,   0x100, "autofitter module" )
   FT_MODERRDEF( BDF,       0x200, "BDF module" )
-  FT_MODERRDEF( Cache,     0x300, "cache module" )
-  FT_MODERRDEF( CFF,       0x400, "CFF module" )
-  FT_MODERRDEF( CID,       0x500, "CID module" )
-  FT_MODERRDEF( Gzip,      0x600, "Gzip module" )
-  FT_MODERRDEF( LZW,       0x700, "LZW module" )
-  FT_MODERRDEF( OTvalid,   0x800, "OpenType validation module" )
-  FT_MODERRDEF( PCF,       0x900, "PCF module" )
-  FT_MODERRDEF( PFR,       0xA00, "PFR module" )
-  FT_MODERRDEF( PSaux,     0xB00, "PS auxiliary module" )
-  FT_MODERRDEF( PShinter,  0xC00, "PS hinter module" )
-  FT_MODERRDEF( PSnames,   0xD00, "PS names module" )
-  FT_MODERRDEF( Raster,    0xE00, "raster module" )
-  FT_MODERRDEF( SFNT,      0xF00, "SFNT module" )
-  FT_MODERRDEF( Smooth,   0x1000, "smooth raster module" )
-  FT_MODERRDEF( TrueType, 0x1100, "TrueType module" )
-  FT_MODERRDEF( Type1,    0x1200, "Type 1 module" )
-  FT_MODERRDEF( Type42,   0x1300, "Type 42 module" )
-  FT_MODERRDEF( Winfonts, 0x1400, "Windows FON/FNT module" )
+  FT_MODERRDEF( Bzip2,     0x300, "Bzip2 module" )
+  FT_MODERRDEF( Cache,     0x400, "cache module" )
+  FT_MODERRDEF( CFF,       0x500, "CFF module" )
+  FT_MODERRDEF( CID,       0x600, "CID module" )
+  FT_MODERRDEF( Gzip,      0x700, "Gzip module" )
+  FT_MODERRDEF( LZW,       0x800, "LZW module" )
+  FT_MODERRDEF( OTvalid,   0x900, "OpenType validation module" )
+  FT_MODERRDEF( PCF,       0xA00, "PCF module" )
+  FT_MODERRDEF( PFR,       0xB00, "PFR module" )
+  FT_MODERRDEF( PSaux,     0xC00, "PS auxiliary module" )
+  FT_MODERRDEF( PShinter,  0xD00, "PS hinter module" )
+  FT_MODERRDEF( PSnames,   0xE00, "PS names module" )
+  FT_MODERRDEF( Raster,    0xF00, "raster module" )
+  FT_MODERRDEF( SFNT,     0x1000, "SFNT module" )
+  FT_MODERRDEF( Smooth,   0x1100, "smooth raster module" )
+  FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
+  FT_MODERRDEF( Type1,    0x1300, "Type 1 module" )
+  FT_MODERRDEF( Type42,   0x1400, "Type 42 module" )
+  FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
+  FT_MODERRDEF( GXvalid,  0x1600, "GX validation module" )
 
 
 #ifdef FT_MODERR_END_LIST
 
 
 #ifdef FT_MODERR_END_LIST
index 2829a05..fd69f28 100644 (file)
@@ -5,7 +5,7 @@
 /*    Support for the FT_Outline type used to store glyph shapes of        */
 /*    most scalable font formats (specification).                          */
 /*                                                                         */
 /*    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, 2010 by */
+/*  Copyright 1996-2003, 2005-2012 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -59,6 +59,7 @@ FT_BEGIN_HEADER
   /*    FT_Outline_Translate                                               */
   /*    FT_Outline_Transform                                               */
   /*    FT_Outline_Embolden                                                */
   /*    FT_Outline_Translate                                               */
   /*    FT_Outline_Transform                                               */
   /*    FT_Outline_Embolden                                                */
+  /*    FT_Outline_EmboldenXY                                              */
   /*    FT_Outline_Reverse                                                 */
   /*    FT_Outline_Check                                                   */
   /*                                                                       */
   /*    FT_Outline_Reverse                                                 */
   /*    FT_Outline_Check                                                   */
   /*                                                                       */
@@ -124,9 +125,11 @@ FT_BEGIN_HEADER
   /*                   outline will *not* necessarily be *freed*, when     */
   /*                   destroying the library, by @FT_Done_FreeType.       */
   /*                                                                       */
   /*                   outline will *not* necessarily be *freed*, when     */
   /*                   destroying the library, by @FT_Done_FreeType.       */
   /*                                                                       */
-  /*    numPoints   :: The maximal number of points within the outline.    */
+  /*    numPoints   :: The maximum number of points within the outline.    */
+  /*                   Must be smaller than or equal to 0xFFFF (65535).    */
   /*                                                                       */
   /*                                                                       */
-  /*    numContours :: The maximal number of contours within the outline.  */
+  /*    numContours :: The maximum number of contours within the outline.  */
+  /*                   This value must be in the range 0 to `numPoints'.   */
   /*                                                                       */
   /* <Output>                                                              */
   /*    anoutline   :: A handle to the new outline.                        */
   /*                                                                       */
   /* <Output>                                                              */
   /*    anoutline   :: A handle to the new outline.                        */
@@ -227,6 +230,9 @@ FT_BEGIN_HEADER
   /* <Output>                                                              */
   /*    acbox   :: The outline's control box.                              */
   /*                                                                       */
   /* <Output>                                                              */
   /*    acbox   :: The outline's control box.                              */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    See @FT_Glyph_Get_CBox for a discussion of tricky fonts.           */
+  /*                                                                       */
   FT_EXPORT( void )
   FT_Outline_Get_CBox( const FT_Outline*  outline,
                        FT_BBox           *acbox );
   FT_EXPORT( void )
   FT_Outline_Get_CBox( const FT_Outline*  outline,
                        FT_BBox           *acbox );
@@ -332,7 +338,7 @@ FT_BEGIN_HEADER
   /*    handled incorrectly.                                               */
   /*                                                                       */
   /*    If you need `better' metrics values you should call                */
   /*    handled incorrectly.                                               */
   /*                                                                       */
   /*    If you need `better' metrics values you should call                */
-  /*    @FT_Outline_Get_CBox ot @FT_Outline_Get_BBox.                      */
+  /*    @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.                      */
   /*                                                                       */
   /*    Example call:                                                      */
   /*                                                                       */
   /*                                                                       */
   /*    Example call:                                                      */
   /*                                                                       */
@@ -347,6 +353,23 @@ FT_BEGIN_HEADER
                        FT_Pos       strength );
 
 
                        FT_Pos       strength );
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Outline_EmboldenXY                                              */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Embolden an outline.  The new outline will be `xstrength' pixels   */
+  /*    wider and `ystrength' pixels higher.  Otherwise, it is similar to  */
+  /*    @FT_Outline_Embolden, which uses the same strength in both         */
+  /*    directions.                                                        */
+  /*                                                                       */
+  FT_EXPORT( FT_Error )
+  FT_Outline_EmboldenXY( FT_Outline*  outline,
+                         FT_Pos       xstrength,
+                         FT_Pos       ystrength );
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
index e06a814..dd0229b 100644 (file)
@@ -212,6 +212,14 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    This doesn't change the current renderer for other formats.        */
   /*                                                                       */
   /*                                                                       */
   /*    This doesn't change the current renderer for other formats.        */
   /*                                                                       */
+  /*    Currently, only the B/W renderer, if compiled with                 */
+  /*    FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels               */
+  /*    anti-aliasing mode; this option must be set directly in            */
+  /*    `ftraster.c' and is undefined by default) accepts a single tag     */
+  /*    `pal5' to set its gray palette as a character string with          */
+  /*    5~elements.  Consequently, the third and fourth argument are zero  */
+  /*    normally.                                                          */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Set_Renderer( FT_Library     library,
                    FT_Renderer    renderer,
   FT_EXPORT( FT_Error )
   FT_Set_Renderer( FT_Library     library,
                    FT_Renderer    renderer,
index 3afb87d..a498e4a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType path stroker (specification).                               */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType path stroker (specification).                               */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by                  */
+/*  Copyright 2002-2006, 2008, 2009, 2011-2012 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -75,20 +75,44 @@ FT_BEGIN_HEADER
    *     to join two lines smoothly.
    *
    *   FT_STROKER_LINEJOIN_BEVEL ::
    *     to join two lines smoothly.
    *
    *   FT_STROKER_LINEJOIN_BEVEL ::
-   *     Used to render beveled line joins; i.e., the two joining lines
-   *     are extended until they intersect.
-   *
+   *     Used to render beveled line joins.  The outer corner of
+   *     the joined lines is filled by enclosing the triangular
+   *     region of the corner with a straight line between the
+   *     outer corners of each stroke.
+   *
+   *   FT_STROKER_LINEJOIN_MITER_FIXED ::
+   *     Used to render mitered line joins, with fixed bevels if the
+   *     miter limit is exceeded.  The outer edges of the strokes
+   *     for the two segments are extended until they meet at an
+   *     angle.  If the segments meet at too sharp an angle (such
+   *     that the miter would extend from the intersection of the
+   *     segments a distance greater than the product of the miter
+   *     limit value and the border radius), then a bevel join (see
+   *     above) is used instead.  This prevents long spikes being
+   *     created.  FT_STROKER_LINEJOIN_MITER_FIXED generates a miter
+   *     line join as used in PostScript and PDF.
+   *
+   *   FT_STROKER_LINEJOIN_MITER_VARIABLE ::
    *   FT_STROKER_LINEJOIN_MITER ::
    *   FT_STROKER_LINEJOIN_MITER ::
-   *     Same as beveled rendering, except that an additional line
-   *     break is added if the angle between the two joining lines
-   *     is too closed (this is useful to avoid unpleasant spikes
-   *     in beveled rendering).
+   *     Used to render mitered line joins, with variable bevels if
+   *     the miter limit is exceeded.  The intersection of the
+   *     strokes is clipped at a line perpendicular to the bisector
+   *     of the angle between the strokes, at the distance from the
+   *     intersection of the segments equal to the product of the
+   *     miter limit value and the border radius.  This prevents
+   *     long spikes being created.
+   *     FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line
+   *     join as used in XPS.  FT_STROKER_LINEJOIN_MITER is an alias
+   *     for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for
+   *     backwards compatibility.
    */
   typedef enum  FT_Stroker_LineJoin_
   {
    */
   typedef enum  FT_Stroker_LineJoin_
   {
-    FT_STROKER_LINEJOIN_ROUND = 0,
-    FT_STROKER_LINEJOIN_BEVEL,
-    FT_STROKER_LINEJOIN_MITER
+    FT_STROKER_LINEJOIN_ROUND          = 0,
+    FT_STROKER_LINEJOIN_BEVEL          = 1,
+    FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,
+    FT_STROKER_LINEJOIN_MITER          = FT_STROKER_LINEJOIN_MITER_VARIABLE,
+    FT_STROKER_LINEJOIN_MITER_FIXED    = 3
 
   } FT_Stroker_LineJoin;
 
 
   } FT_Stroker_LineJoin;
 
@@ -245,8 +269,9 @@ FT_BEGIN_HEADER
    *     The line join style.
    *
    *   miter_limit ::
    *     The line join style.
    *
    *   miter_limit ::
-   *     The miter limit for the FT_STROKER_LINEJOIN_MITER style,
-   *     expressed as 16.16 fixed point value.
+   *     The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and
+   *     FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,
+   *     expressed as 16.16 fixed-point value.
    *
    * @note:
    *   The radius is expressed in the same units as the outline
    *
    * @note:
    *   The radius is expressed in the same units as the outline
@@ -657,6 +682,11 @@ FT_BEGIN_HEADER
    *
    * @note:
    *   The source glyph is untouched in case of error.
    *
    * @note:
    *   The source glyph is untouched in case of error.
+   *
+   *   Adding stroke may yield a significantly wider and taller glyph
+   *   depending on how large of a radius was used to stroke the glyph.  You
+   *   may need to manually adjust horizontal and vertical advance amounts
+   *   to account for this added size.
    */
   FT_EXPORT( FT_Error )
   FT_Glyph_Stroke( FT_Glyph    *pglyph,
    */
   FT_EXPORT( FT_Error )
   FT_Glyph_Stroke( FT_Glyph    *pglyph,
@@ -694,6 +724,11 @@ FT_BEGIN_HEADER
    *
    * @note:
    *   The source glyph is untouched in case of error.
    *
    * @note:
    *   The source glyph is untouched in case of error.
+   *
+   *   Adding stroke may yield a significantly wider and taller glyph
+   *   depending on how large of a radius was used to stroke the glyph.  You
+   *   may need to manually adjust horizontal and vertical advance amounts
+   *   to account for this added size.
    */
   FT_EXPORT( FT_Error )
   FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,
    */
   FT_EXPORT( FT_Error )
   FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,
index a068b79..2074503 100644 (file)
@@ -5,7 +5,7 @@
 /*    FreeType synthesizing code for emboldening and slanting              */
 /*    (specification).                                                     */
 /*                                                                         */
 /*    FreeType synthesizing code for emboldening and slanting              */
 /*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 2000-2001, 2003, 2006, 2008 by                               */
+/*  Copyright 2000-2001, 2003, 2006, 2008, 2012 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -61,8 +61,9 @@ FT_BEGIN_HEADER
   /* taste).  This function is actually a convenience function, providing  */
   /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden.           */
   /*                                                                       */
   /* taste).  This function is actually a convenience function, providing  */
   /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden.           */
   /*                                                                       */
-  /* For emboldened outlines the metrics are estimates only; if you need   */
-  /* precise values you should call @FT_Outline_Get_CBox.                  */
+  /* For emboldened outlines the height, width, and advance metrics are    */
+  /* increased by the strength of the emboldening.  You can also call      */
+  /* @FT_Outline_Get_CBox to get precise values.                           */
   FT_EXPORT( void )
   FT_GlyphSlot_Embolden( FT_GlyphSlot  slot );
 
   FT_EXPORT( void )
   FT_GlyphSlot_Embolden( FT_GlyphSlot  slot );
 
index 6b77d2e..65143cb 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType trigonometric functions (specification).                    */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType trigonometric functions (specification).                    */
 /*                                                                         */
-/*  Copyright 2001, 2003, 2005, 2007 by                                    */
+/*  Copyright 2001, 2003, 2005, 2007, 2013 by                              */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -46,7 +46,7 @@ FT_BEGIN_HEADER
    *
    * @description:
    *   This type is used to model angle values in FreeType.  Note that the
    *
    * @description:
    *   This type is used to model angle values in FreeType.  Note that the
-   *   angle is a 16.16 fixed float value expressed in degrees.
+   *   angle is a 16.16 fixed-point value expressed in degrees.
    *
    */
   typedef FT_Fixed  FT_Angle;
    *
    */
   typedef FT_Fixed  FT_Angle;
@@ -106,7 +106,7 @@ FT_BEGIN_HEADER
    *   FT_Sin
    *
    * @description:
    *   FT_Sin
    *
    * @description:
-   *   Return the sinus of a given angle in fixed point format.
+   *   Return the sinus of a given angle in fixed-point format.
    *
    * @input:
    *   angle ::
    *
    * @input:
    *   angle ::
@@ -130,7 +130,7 @@ FT_BEGIN_HEADER
    *   FT_Cos
    *
    * @description:
    *   FT_Cos
    *
    * @description:
-   *   Return the cosinus of a given angle in fixed point format.
+   *   Return the cosinus of a given angle in fixed-point format.
    *
    * @input:
    *   angle ::
    *
    * @input:
    *   angle ::
@@ -154,7 +154,7 @@ FT_BEGIN_HEADER
    *   FT_Tan
    *
    * @description:
    *   FT_Tan
    *
    * @description:
-   *   Return the tangent of a given angle in fixed point format.
+   *   Return the tangent of a given angle in fixed-point format.
    *
    * @input:
    *   angle ::
    *
    * @input:
    *   angle ::
diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftttdrv.h b/reactos/lib/3rdparty/freetype/include/freetype/ftttdrv.h
new file mode 100644 (file)
index 0000000..d5d3f1c
--- /dev/null
@@ -0,0 +1,150 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftttdrv.h                                                              */
+/*                                                                         */
+/*    FreeType API for controlling the TrueType driver                     */
+/*    (specification only).                                                */
+/*                                                                         */
+/*  Copyright 2013 by                                                      */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __FTTTDRV_H__
+#define __FTTTDRV_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+  /**************************************************************************
+   *
+   * @section:
+   *   tt_driver
+   *
+   * @title:
+   *   The TrueType driver
+   *
+   * @abstract:
+   *   Controlling the TrueType driver module.
+   *
+   * @description:
+   *   While FreeType's TrueType driver doesn't expose API functions by
+   *   itself, it is possible to control its behaviour with @FT_Property_Set
+   *   and @FT_Property_Get.  The following lists the available properties
+   *   together with the necessary macros and structures.
+   *
+   *   The TrueType driver's module name is `truetype'.
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @property:
+   *   interpreter-version
+   *
+   * @description:
+   *   Currently, two versions are available which represent the bytecode
+   *   interpreter with and without subpixel hinting support,
+   *   respectively.  The default is subpixel support if
+   *   TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel
+   *   support otherwise (since it isn't available then).
+   *
+   *   If subpixel hinting is on, many TrueType bytecode instructions
+   *   behave differently compared to B/W or grayscale rendering.  The
+   *   main idea is to render at a much increased horizontal resolution,
+   *   then sampling down the created output to subpixel precision.
+   *   However, many older fonts are not suited to this and must be
+   *   specially taken care of by applying (hardcoded) font-specific
+   *   tweaks.
+   *
+   *   Details on subpixel hinting and some of the necessary tweaks can be
+   *   found in Greg Hitchcock's whitepaper at
+   *   `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
+   *
+   *   The following example code demonstrates how to activate subpixel
+   *   hinting (omitting the error handling).
+   *
+   *   {
+   *     FT_Library  library;
+   *     FT_Face     face;
+   *     FT_UInt     interpreter_version = TT_INTERPRETER_VERSION_38;
+   *
+   *
+   *     FT_Init_FreeType( &library );
+   *
+   *     FT_Property_Set( library, "truetype",
+   *                               "interpreter-version",
+   *                               &interpreter_version );
+   *   }
+   *
+   * @note:
+   *   This property can be used with @FT_Property_Get also.
+   *
+   */
+
+
+  /**************************************************************************
+   *
+   * @enum:
+   *   TT_INTERPRETER_VERSION_XXX
+   *
+   * @description:
+   *   A list of constants used for the @interpreter-version property to
+   *   select the hinting engine for Truetype fonts.
+   *
+   *   The numeric value in the constant names represents the version
+   *   number as returned by the `GETINFO' bytecode instruction.
+   *
+   * @values:
+   *   TT_INTERPRETER_VERSION_35 ::
+   *     Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
+   *     Windows~98; only grayscale and B/W rasterizing is supported.
+   *
+   *   TT_INTERPRETER_VERSION_38 ::
+   *     Version~38 corresponds to MS rasterizer v.1.9; it is roughly
+   *     equivalent to the hinting provided by DirectWrite ClearType (as
+   *     can be found, for example, in the Internet Explorer~9 running on
+   *     Windows~7).
+   *
+   * @note:
+   *   This property controls the behaviour of the bytecode interpreter
+   *   and thus how outlines get hinted.  It does *not* control how glyph
+   *   get rasterized!  In particular, it does not control subpixel color
+   *   filtering.
+   *
+   *   If FreeType has not been compiled with configuration option
+   *   FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an
+   *   `FT_Err_Unimplemented_Feature' error.
+   *
+   */
+#define TT_INTERPRETER_VERSION_35  35
+#define TT_INTERPRETER_VERSION_38  38
+
+
+ /* */
+
+FT_END_HEADER
+
+
+#endif /* __FTTTDRV_H__ */
+
+
+/* END */
index a57ffa6..027e59c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType simple types definitions (specification only).              */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType simple types definitions (specification only).              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008 by                   */
+/*  Copyright 1996-2002, 2004, 2006-2009, 2012, 2013 by                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -255,7 +255,7 @@ FT_BEGIN_HEADER
   /*    FT_F2Dot14                                                         */
   /*                                                                       */
   /* <Description>                                                         */
   /*    FT_F2Dot14                                                         */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    A signed 2.14 fixed float type used for unit vectors.              */
+  /*    A signed 2.14 fixed-point type used for unit vectors.              */
   /*                                                                       */
   typedef signed short  FT_F2Dot14;
 
   /*                                                                       */
   typedef signed short  FT_F2Dot14;
 
@@ -266,7 +266,7 @@ FT_BEGIN_HEADER
   /*    FT_F26Dot6                                                         */
   /*                                                                       */
   /* <Description>                                                         */
   /*    FT_F26Dot6                                                         */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    A signed 26.6 fixed float type used for vectorial pixel            */
+  /*    A signed 26.6 fixed-point type used for vectorial pixel            */
   /*    coordinates.                                                       */
   /*                                                                       */
   typedef signed long  FT_F26Dot6;
   /*    coordinates.                                                       */
   /*                                                                       */
   typedef signed long  FT_F26Dot6;
@@ -278,7 +278,7 @@ FT_BEGIN_HEADER
   /*    FT_Fixed                                                           */
   /*                                                                       */
   /* <Description>                                                         */
   /*    FT_Fixed                                                           */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    This type is used to store 16.16 fixed float values, like scaling  */
+  /*    This type is used to store 16.16 fixed-point values, like scaling  */
   /*    values or matrix coefficients.                                     */
   /*                                                                       */
   typedef signed long  FT_Fixed;
   /*    values or matrix coefficients.                                     */
   /*                                                                       */
   typedef signed long  FT_Fixed;
@@ -362,7 +362,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */
-  /*    in 16.16 fixed float format.  The computation performed is:        */
+  /*    in 16.16 fixed-point format.  The computation performed is:        */
   /*                                                                       */
   /*       {                                                               */
   /*          x' = x*xx + y*xy                                             */
   /*                                                                       */
   /*       {                                                               */
   /*          x' = x*xx + y*xy                                             */
@@ -434,7 +434,7 @@ FT_BEGIN_HEADER
   /*    variety of FreeType core objects.  For example, a text layout API  */
   /*    might want to associate a glyph cache to a given size object.      */
   /*                                                                       */
   /*    variety of FreeType core objects.  For example, a text layout API  */
   /*    might want to associate a glyph cache to a given size object.      */
   /*                                                                       */
-  /*    Most FreeType object contains a `generic' field, of type           */
+  /*    Some FreeType object contains a `generic' field, of type           */
   /*    FT_Generic, which usage is left to client applications and font    */
   /*    servers.                                                           */
   /*                                                                       */
   /*    FT_Generic, which usage is left to client applications and font    */
   /*    servers.                                                           */
   /*                                                                       */
@@ -571,14 +571,24 @@ FT_BEGIN_HEADER
   /* */
 
 #define FT_IS_EMPTY( list )  ( (list).head == 0 )
   /* */
 
 #define FT_IS_EMPTY( list )  ( (list).head == 0 )
+#define FT_BOOL( x )  ( (FT_Bool)( x ) )
 
 
-  /* return base error code (without module-specific prefix) */
-#define FT_ERROR_BASE( x )    ( (x) & 0xFF )
+  /* concatenate C tokens */
+#define FT_ERR_XCAT( x, y )  x ## y
+#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )
+
+  /* see `ftmoderr.h' for descriptions of the following macros */
+
+#define FT_ERR( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )
 
 
-  /* return module error code */
+#define FT_ERROR_BASE( x )    ( (x) & 0xFF )
 #define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )
 
 #define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )
 
-#define FT_BOOL( x )  ( (FT_Bool)( x ) )
+#define FT_ERR_EQ( x, e )                                        \
+          ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )
+#define FT_ERR_NEQ( x, e )                                       \
+          ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )
+
 
 FT_END_HEADER
 
 
 FT_END_HEADER
 
index 7e3a08a..545de93 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    High-level `autohint' module-specific interface (specification).     */
 /*                                                                         */
 /*                                                                         */
 /*    High-level `autohint' module-specific interface (specification).     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2007 by                                     */
+/*  Copyright 1996-2002, 2007, 2009, 2012 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -86,20 +86,20 @@ FT_BEGIN_HEADER
   /*    FT_AutoHinter_GlobalGetFunc                                        */
   /*                                                                       */
   /* <Description>                                                         */
   /*    FT_AutoHinter_GlobalGetFunc                                        */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Retrieves the global hints computed for a given face object the    */
+  /*    Retrieve the global hints computed for a given face object.  The   */
   /*    resulting data is dissociated from the face and will survive a     */
   /*    call to FT_Done_Face().  It must be discarded through the API      */
   /*    FT_AutoHinter_GlobalDoneFunc().                                    */
   /*                                                                       */
   /* <Input>                                                               */
   /*    resulting data is dissociated from the face and will survive a     */
   /*    call to FT_Done_Face().  It must be discarded through the API      */
   /*    FT_AutoHinter_GlobalDoneFunc().                                    */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    hinter        :: A handle to the source auto-hinter.               */
+  /*    hinter       :: A handle to the source auto-hinter.                */
   /*                                                                       */
   /*                                                                       */
-  /*    face          :: A handle to the source face object.               */
+  /*    face         :: A handle to the source face object.                */
   /*                                                                       */
   /* <Output>                                                              */
   /*                                                                       */
   /* <Output>                                                              */
-  /*    global_hints  :: A typeless pointer to the global hints.           */
+  /*    global_hints :: A typeless pointer to the global hints.            */
   /*                                                                       */
   /*                                                                       */
-  /*    global_len    :: The size in bytes of the global hints.            */
+  /*    global_len   :: The size in bytes of the global hints.             */
   /*                                                                       */
   typedef void
   (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter  hinter,
   /*                                                                       */
   typedef void
   (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter  hinter,
@@ -114,7 +114,7 @@ FT_BEGIN_HEADER
   /*    FT_AutoHinter_GlobalDoneFunc                                       */
   /*                                                                       */
   /* <Description>                                                         */
   /*    FT_AutoHinter_GlobalDoneFunc                                       */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Discards the global hints retrieved through                        */
+  /*    Discard the global hints retrieved through                         */
   /*    FT_AutoHinter_GlobalGetFunc().  This is the only way these hints   */
   /*    are freed from memory.                                             */
   /*                                                                       */
   /*    FT_AutoHinter_GlobalGetFunc().  This is the only way these hints   */
   /*    are freed from memory.                                             */
   /*                                                                       */
@@ -168,8 +168,8 @@ FT_BEGIN_HEADER
   /*    This function is capable of loading composite glyphs by hinting    */
   /*    each sub-glyph independently (which improves quality).             */
   /*                                                                       */
   /*    This function is capable of loading composite glyphs by hinting    */
   /*    each sub-glyph independently (which improves quality).             */
   /*                                                                       */
-  /*    It will call the font driver with FT_Load_Glyph(), with            */
-  /*    FT_LOAD_NO_SCALE set.                                              */
+  /*    It will call the font driver with @FT_Load_Glyph, with             */
+  /*    @FT_LOAD_NO_SCALE set.                                             */
   /*                                                                       */
   typedef FT_Error
   (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter  hinter,
   /*                                                                       */
   typedef FT_Error
   (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter  hinter,
@@ -182,46 +182,59 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*                                                                       */
   /* <Struct>                                                              */
   /*************************************************************************/
   /*                                                                       */
   /* <Struct>                                                              */
-  /*    FT_AutoHinter_ServiceRec                                           */
+  /*    FT_AutoHinter_InterfaceRec                                         */
   /*                                                                       */
   /* <Description>                                                         */
   /*    The auto-hinter module's interface.                                */
   /*                                                                       */
   /*                                                                       */
   /* <Description>                                                         */
   /*    The auto-hinter module's interface.                                */
   /*                                                                       */
-  typedef struct  FT_AutoHinter_ServiceRec_
+  typedef struct  FT_AutoHinter_InterfaceRec_
   {
     FT_AutoHinter_GlobalResetFunc  reset_face;
     FT_AutoHinter_GlobalGetFunc    get_global_hints;
     FT_AutoHinter_GlobalDoneFunc   done_global_hints;
     FT_AutoHinter_GlyphLoadFunc    load_glyph;
 
   {
     FT_AutoHinter_GlobalResetFunc  reset_face;
     FT_AutoHinter_GlobalGetFunc    get_global_hints;
     FT_AutoHinter_GlobalDoneFunc   done_global_hints;
     FT_AutoHinter_GlyphLoadFunc    load_glyph;
 
-  } FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service;
+  } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
+
 
 #ifndef FT_CONFIG_OPTION_PIC
 
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \
-                                     done_global_hints_, load_glyph_)        \
-  FT_CALLBACK_TABLE_DEF                                                      \
-  const FT_AutoHinter_ServiceRec class_ =                                    \
-  {                                                                          \
-    reset_face_, get_global_hints_, done_global_hints_, load_glyph_          \
+#define FT_DEFINE_AUTOHINTER_INTERFACE(       \
+          class_,                             \
+          reset_face_,                        \
+          get_global_hints_,                  \
+          done_global_hints_,                 \
+          load_glyph_ )                       \
+  FT_CALLBACK_TABLE_DEF                       \
+  const FT_AutoHinter_InterfaceRec  class_ =  \
+  {                                           \
+    reset_face_,                              \
+    get_global_hints_,                        \
+    done_global_hints_,                       \
+    load_glyph_                               \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
-
-#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \
-                                     done_global_hints_, load_glyph_)        \
-  void                                                                       \
-  FT_Init_Class_##class_( FT_Library library,                                \
-                          FT_AutoHinter_ServiceRec* clazz)                   \
-  {                                                                          \
-    FT_UNUSED(library);                                                      \
-    clazz->reset_face = reset_face_;                                         \
-    clazz->get_global_hints = get_global_hints_;                             \
-    clazz->done_global_hints = done_global_hints_;                           \
-    clazz->load_glyph = load_glyph_;                                         \
-  } 
-
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_AUTOHINTER_INTERFACE(                            \
+          class_,                                                  \
+          reset_face_,                                             \
+          get_global_hints_,                                       \
+          done_global_hints_,                                      \
+          load_glyph_ )                                            \
+  void                                                             \
+  FT_Init_Class_ ## class_( FT_Library                   library,  \
+                            FT_AutoHinter_InterfaceRec*  clazz )   \
+  {                                                                \
+    FT_UNUSED( library );                                          \
+                                                                   \
+    clazz->reset_face        = reset_face_;                        \
+    clazz->get_global_hints  = get_global_hints_;                  \
+    clazz->done_global_hints = done_global_hints_;                 \
+    clazz->load_glyph        = load_glyph_;                        \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
 
 FT_END_HEADER
 
 
 FT_END_HEADER
 
index f8b4324..faac3a3 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Arithmetic computations (specification).                             */
 /*                                                                         */
 /*                                                                         */
 /*    Arithmetic computations (specification).                             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by       */
+/*  Copyright 1996-2006, 2008, 2009, 2012-2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -33,7 +33,7 @@ FT_BEGIN_HEADER
   /*    FT_FixedSqrt                                                       */
   /*                                                                       */
   /* <Description>                                                         */
   /*    FT_FixedSqrt                                                       */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Computes the square root of a 16.16 fixed point value.             */
+  /*    Computes the square root of a 16.16 fixed-point value.             */
   /*                                                                       */
   /* <Input>                                                               */
   /*    x :: The value to compute the root for.                            */
   /*                                                                       */
   /* <Input>                                                               */
   /*    x :: The value to compute the root for.                            */
@@ -48,29 +48,6 @@ FT_BEGIN_HEADER
   FT_SqrtFixed( FT_Int32  x );
 
 
   FT_SqrtFixed( FT_Int32  x );
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    FT_Sqrt32                                                          */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Computes the square root of an Int32 integer (which will be        */
-  /*    handled as an unsigned long value).                                */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    x :: The value to compute the root for.                            */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    The result of `sqrt(x)'.                                           */
-  /*                                                                       */
-  FT_EXPORT( FT_Int32 )
-  FT_Sqrt32( FT_Int32  x );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
   /*************************************************************************/
   /*                                                                       */
   /* FT_MulDiv() and FT_MulFix() are declared in freetype.h.               */
   /*************************************************************************/
   /*                                                                       */
   /* FT_MulDiv() and FT_MulFix() are declared in freetype.h.               */
@@ -78,8 +55,6 @@ FT_BEGIN_HEADER
   /*************************************************************************/
 
 
   /*************************************************************************/
 
 
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -87,7 +62,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    A very simple function used to perform the computation `(a*b)/c'   */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A very simple function used to perform the computation `(a*b)/c'   */
-  /*    (without rounding) with maximal accuracy (it uses a 64-bit         */
+  /*    (without rounding) with maximum accuracy (it uses a 64-bit         */
   /*    intermediate integer whenever necessary).                          */
   /*                                                                       */
   /*    This function isn't necessarily as fast as some processor specific */
   /*    intermediate integer whenever necessary).                          */
   /*                                                                       */
   /*    This function isn't necessarily as fast as some processor specific */
@@ -108,8 +83,6 @@ FT_BEGIN_HEADER
                       FT_Long  b,
                       FT_Long  c );
 
                       FT_Long  b,
                       FT_Long  c );
 
-#endif /* TT_USE_BYTECODE_INTERPRETER */
-
 
   /*
    *  A variant of FT_Matrix_Multiply which scales its result afterwards.
 
   /*
    *  A variant of FT_Matrix_Multiply which scales its result afterwards.
@@ -129,7 +102,6 @@ FT_BEGIN_HEADER
    *  A variant of FT_Vector_Transform.  See comments for
    *  FT_Matrix_Multiply_Scaled.
    */
    *  A variant of FT_Vector_Transform.  See comments for
    *  FT_Matrix_Multiply_Scaled.
    */
-
   FT_BASE( void )
   FT_Vector_Transform_Scaled( FT_Vector*        vector,
                               const FT_Matrix*  matrix,
   FT_BASE( void )
   FT_Vector_Transform_Scaled( FT_Vector*        vector,
                               const FT_Matrix*  matrix,
@@ -160,6 +132,22 @@ FT_BEGIN_HEADER
                      FT_Pos  out_y );
 
 
                      FT_Pos  out_y );
 
 
+  /*
+   *  Return the most significant bit index.
+   */
+  FT_BASE( FT_Int )
+  FT_MSB( FT_UInt32  z );
+
+
+  /*
+   *  Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses
+   *  two fixed-point arguments instead.
+   */
+  FT_BASE( FT_Fixed )
+  FT_Hypot( FT_Fixed  x,
+            FT_Fixed  y );
+
+
 #define INT_TO_F26DOT6( x )    ( (FT_Long)(x) << 6  )
 #define INT_TO_F2DOT14( x )    ( (FT_Long)(x) << 14 )
 #define INT_TO_FIXED( x )      ( (FT_Long)(x) << 16 )
 #define INT_TO_F26DOT6( x )    ( (FT_Long)(x) << 6  )
 #define INT_TO_F2DOT14( x )    ( (FT_Long)(x) << 14 )
 #define INT_TO_FIXED( x )      ( (FT_Long)(x) << 16 )
index 7baae35..58a3916 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Debugging and logging component (specification).                     */
 /*                                                                         */
 /*                                                                         */
 /*    Debugging and logging component (specification).                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008, 2009 by             */
+/*  Copyright 1996-2002, 2004, 2006-2009, 2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -185,7 +185,8 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
-  /* Define the FT_ASSERT macro.                                           */
+  /* Define the FT_ASSERT and FT_THROW macros.  The call to `FT_Throw'     */
+  /* makes it possible to easily set a breakpoint at this function.        */
   /*                                                                       */
   /*************************************************************************/
 
   /*                                                                       */
   /*************************************************************************/
 
@@ -199,10 +200,18 @@ FT_BEGIN_HEADER
                         __LINE__, __FILE__ );                       \
           } while ( 0 )
 
                         __LINE__, __FILE__ );                       \
           } while ( 0 )
 
+#define FT_THROW( e )                                   \
+          ( FT_Throw( FT_ERR_CAT( FT_ERR_PREFIX, e ),   \
+                      __LINE__,                         \
+                      __FILE__ )                      | \
+            FT_ERR_CAT( FT_ERR_PREFIX, e )            )
+
 #else /* !FT_DEBUG_LEVEL_ERROR */
 
 #define FT_ASSERT( condition )  do { } while ( 0 )
 
 #else /* !FT_DEBUG_LEVEL_ERROR */
 
 #define FT_ASSERT( condition )  do { } while ( 0 )
 
+#define FT_THROW( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )
+
 #endif /* !FT_DEBUG_LEVEL_ERROR */
 
 
 #endif /* !FT_DEBUG_LEVEL_ERROR */
 
 
@@ -226,22 +235,18 @@ FT_BEGIN_HEADER
   FT_Panic( const char*  fmt,
             ... );
 
   FT_Panic( const char*  fmt,
             ... );
 
+  /* report file name and line number of an error */
+  FT_BASE( int )
+  FT_Throw( FT_Error     error,
+            int          line,
+            const char*  file );
+
 #endif /* FT_DEBUG_LEVEL_ERROR */
 
 
   FT_BASE( void )
   ft_debug_init( void );
 
 #endif /* FT_DEBUG_LEVEL_ERROR */
 
 
   FT_BASE( void )
   ft_debug_init( void );
 
-
-#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */
-
-  /* We disable the warning `conditional expression is constant' here */
-  /* in order to compile cleanly with the maximum level of warnings.  */
-#pragma warning( disable : 4127 )
-
-#endif /* _MSC_VER */
-
-
 FT_END_HEADER
 
 #endif /* __FTDEBUG_H__ */
 FT_END_HEADER
 
 #endif /* __FTDEBUG_H__ */
index 1d06997..940218e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType font driver interface (specification).                      */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType font driver interface (specification).                      */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2006, 2008 by                         */
+/*  Copyright 1996-2003, 2006, 2008, 2011-2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -60,22 +60,6 @@ FT_BEGIN_HEADER
   (*FT_Size_SelectFunc)( FT_Size   size,
                          FT_ULong  size_index );
 
   (*FT_Size_SelectFunc)( FT_Size   size,
                          FT_ULong  size_index );
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  typedef FT_Error
-  (*FT_Size_ResetPointsFunc)( FT_Size     size,
-                              FT_F26Dot6  char_width,
-                              FT_F26Dot6  char_height,
-                              FT_UInt     horz_resolution,
-                              FT_UInt     vert_resolution );
-
-  typedef FT_Error
-  (*FT_Size_ResetPixelsFunc)( FT_Size  size,
-                              FT_UInt  pixel_width,
-                              FT_UInt  pixel_height );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
   typedef FT_Error
   (*FT_Slot_LoadFunc)( FT_GlyphSlot  slot,
                        FT_Size       size,
   typedef FT_Error
   (*FT_Slot_LoadFunc)( FT_GlyphSlot  slot,
                        FT_Size       size,
@@ -162,10 +146,9 @@ FT_BEGIN_HEADER
   /*                        starting at `first'.  The `vertical' flag must */
   /*                        be set to get vertical advance heights.  The   */
   /*                        `advances' buffer is caller-allocated.         */
   /*                        starting at `first'.  The `vertical' flag must */
   /*                        be set to get vertical advance heights.  The   */
   /*                        `advances' buffer is caller-allocated.         */
-  /*                        Currently not implemented.  The idea of this   */
-  /*                        function is to be able to perform              */
-  /*                        device-independent text layout without loading */
-  /*                        a single glyph image.                          */
+  /*                        The idea of this function is to be able to     */
+  /*                        perform device-independent text layout without */
+  /*                        loading a single glyph image.                  */
   /*                                                                       */
   /*    request_size     :: A handle to a function used to request the new */
   /*                        character size.  Can be set to 0 if the        */
   /*                                                                       */
   /*    request_size     :: A handle to a function used to request the new */
   /*                        character size.  Can be set to 0 if the        */
@@ -182,72 +165,42 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  FT_Driver_ClassRec_
   {
   /*                                                                       */
   typedef struct  FT_Driver_ClassRec_
   {
-    FT_Module_Class           root;
-
-    FT_Long                   face_object_size;
-    FT_Long                   size_object_size;
-    FT_Long                   slot_object_size;
-
-    FT_Face_InitFunc          init_face;
-    FT_Face_DoneFunc          done_face;
+    FT_Module_Class          root;
 
 
-    FT_Size_InitFunc          init_size;
-    FT_Size_DoneFunc          done_size;
+    FT_Long                  face_object_size;
+    FT_Long                  size_object_size;
+    FT_Long                  slot_object_size;
 
 
-    FT_Slot_InitFunc          init_slot;
-    FT_Slot_DoneFunc          done_slot;
+    FT_Face_InitFunc         init_face;
+    FT_Face_DoneFunc         done_face;
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
+    FT_Size_InitFunc         init_size;
+    FT_Size_DoneFunc         done_size;
 
 
-    FT_Size_ResetPointsFunc   set_char_sizes;
-    FT_Size_ResetPixelsFunc   set_pixel_sizes;
+    FT_Slot_InitFunc         init_slot;
+    FT_Slot_DoneFunc         done_slot;
 
 
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
+    FT_Slot_LoadFunc         load_glyph;
 
 
-    FT_Slot_LoadFunc          load_glyph;
-
-    FT_Face_GetKerningFunc    get_kerning;
-    FT_Face_AttachFunc        attach_file;
-    FT_Face_GetAdvancesFunc   get_advances;
+    FT_Face_GetKerningFunc   get_kerning;
+    FT_Face_AttachFunc       attach_file;
+    FT_Face_GetAdvancesFunc  get_advances;
 
     /* since version 2.2 */
 
     /* since version 2.2 */
-    FT_Size_RequestFunc       request_size;
-    FT_Size_SelectFunc        select_size;
+    FT_Size_RequestFunc      request_size;
+    FT_Size_SelectFunc       select_size;
 
   } FT_Driver_ClassRec, *FT_Driver_Class;
 
 
 
   } FT_Driver_ClassRec, *FT_Driver_Class;
 
 
-  /*
-   *  The following functions are used as stubs for `set_char_sizes' and
-   *  `set_pixel_sizes'; the code uses `request_size' and `select_size'
-   *  functions instead.
-   *
-   *  Implementation is in `src/base/ftobjs.c'.
-   */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  FT_BASE( FT_Error )
-  ft_stub_set_char_sizes( FT_Size     size,
-                          FT_F26Dot6  width,
-                          FT_F26Dot6  height,
-                          FT_UInt     horz_res,
-                          FT_UInt     vert_res );
-
-  FT_BASE( FT_Error )
-  ft_stub_set_pixel_sizes( FT_Size  size,
-                           FT_UInt  width,
-                           FT_UInt  height );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
   /*    FT_DECLARE_DRIVER                                                  */
   /*                                                                       */
   /* <Description>                                                         */
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
   /*    FT_DECLARE_DRIVER                                                  */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Used to create a forward declaration of a                          */
-  /*    FT_Driver_ClassRec stract instance.                                */
+  /*    Used to create a forward declaration of an FT_Driver_ClassRec      */
+  /*    struct instance.                                                   */
   /*                                                                       */
   /* <Macro>                                                               */
   /*    FT_DEFINE_DRIVER                                                   */
   /*                                                                       */
   /* <Macro>                                                               */
   /*    FT_DEFINE_DRIVER                                                   */
@@ -255,161 +208,195 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    Used to initialize an instance of FT_Driver_ClassRec struct.       */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Used to initialize an instance of FT_Driver_ClassRec struct.       */
   /*                                                                       */
-  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */
-  /*    to called with a pointer where the allocated stracture is returned.*/
-  /*    And when it is no longer needed a Destroy function needs           */
-  /*    to be called to release that allocation.                           */
-  /*    fcinit.c (ft_create_default_module_classes) already contains       */
-  /*    a mechanism to call these functions for the default modules        */
-  /*    described in ftmodule.h                                            */
+  /*    When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */
+  /*    called with a pointer where the allocated structure is returned.   */
+  /*    And when it is no longer needed a `destroy' function needs to be   */
+  /*    called to release that allocation.                                 */
+  /*                                                                       */
+  /*    `fcinit.c' (ft_create_default_module_classes) already contains a   */
+  /*    mechanism to call these functions for the default modules          */
+  /*    described in `ftmodule.h'.                                         */
   /*                                                                       */
   /*                                                                       */
-  /*    Notice that the created Create and Destroy functions call          */
-  /*    pic_init and pic_free function to allow you to manually allocate   */
-  /*    and initialize any additional global data, like module specific    */
+  /*    Notice that the created `create' and `destroy' functions call      */
+  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */
+  /*    initialize any additional global data, like a module specific      */
   /*    interface, and put them in the global pic container defined in     */
   /*    interface, and put them in the global pic container defined in     */
-  /*    ftpic.h. if you don't need them just implement the functions as    */
-  /*    empty to resolve the link error.                                   */
+  /*    `ftpic.h'.  If you don't need them just implement the functions as */
+  /*    empty to resolve the link error.  Also the `pic_init' and          */
+  /*    `pic_free' functions should be declared in `pic.h', to be referred */
+  /*    by driver definition calling `FT_DEFINE_DRIVER' in following.      */
   /*                                                                       */
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*                                                                       */
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
-  /*    allocated in the global scope (or the scope where the macro        */
-  /*    is used).                                                          */
+  /*    allocated in the global scope (or the scope where the macro is     */
+  /*    used).                                                             */
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \
-  a_, b_,
-#else
-  #define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_)
-#endif
-
-#define FT_DECLARE_DRIVER(class_)    \
+#define FT_DECLARE_DRIVER( class_ )  \
   FT_CALLBACK_TABLE                  \
   FT_CALLBACK_TABLE                  \
-  const FT_Driver_ClassRec  class_;  
-
-#define FT_DEFINE_DRIVER(class_,                                             \
-                         flags_, size_, name_, version_, requires_,          \
-                         interface_, init_, done_, get_interface_,           \
-                         face_object_size_, size_object_size_,               \
-                         slot_object_size_, init_face_, done_face_,          \
-                         init_size_, done_size_, init_slot_, done_slot_,     \
-                         old_set_char_sizes_, old_set_pixel_sizes_,          \
-                         load_glyph_, get_kerning_, attach_file_,            \
-                         get_advances_, request_size_, select_size_ )        \
-  FT_CALLBACK_TABLE_DEF                                                      \
-  const FT_Driver_ClassRec class_ =                                          \
-  {                                                                          \
-    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_,  \
-                          init_,done_,get_interface_)                        \
-                                                                             \
-    face_object_size_,                                                       \
-    size_object_size_,                                                       \
-    slot_object_size_,                                                       \
-                                                                             \
-    init_face_,                                                              \
-    done_face_,                                                              \
-                                                                             \
-    init_size_,                                                              \
-    done_size_,                                                              \
-                                                                             \
-    init_slot_,                                                              \
-    done_slot_,                                                              \
-                                                                             \
-    FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \
-                                                                             \
-    load_glyph_,                                                             \
-                                                                             \
-    get_kerning_,                                                            \
-    attach_file_,                                                            \
-    get_advances_,                                                           \
-                                                                             \
-    request_size_,                                                           \
-    select_size_                                                             \
+  const FT_Driver_ClassRec  class_;
+
+#define FT_DEFINE_DRIVER(                    \
+          class_,                            \
+          flags_,                            \
+          size_,                             \
+          name_,                             \
+          version_,                          \
+          requires_,                         \
+          interface_,                        \
+          init_,                             \
+          done_,                             \
+          get_interface_,                    \
+          face_object_size_,                 \
+          size_object_size_,                 \
+          slot_object_size_,                 \
+          init_face_,                        \
+          done_face_,                        \
+          init_size_,                        \
+          done_size_,                        \
+          init_slot_,                        \
+          done_slot_,                        \
+          load_glyph_,                       \
+          get_kerning_,                      \
+          attach_file_,                      \
+          get_advances_,                     \
+          request_size_,                     \
+          select_size_ )                     \
+  FT_CALLBACK_TABLE_DEF                      \
+  const FT_Driver_ClassRec  class_ =         \
+  {                                          \
+    FT_DEFINE_ROOT_MODULE( flags_,           \
+                           size_,            \
+                           name_,            \
+                           version_,         \
+                           requires_,        \
+                           interface_,       \
+                           init_,            \
+                           done_,            \
+                           get_interface_ )  \
+                                             \
+    face_object_size_,                       \
+    size_object_size_,                       \
+    slot_object_size_,                       \
+                                             \
+    init_face_,                              \
+    done_face_,                              \
+                                             \
+    init_size_,                              \
+    done_size_,                              \
+                                             \
+    init_slot_,                              \
+    done_slot_,                              \
+                                             \
+    load_glyph_,                             \
+                                             \
+    get_kerning_,                            \
+    attach_file_,                            \
+    get_advances_,                           \
+                                             \
+    request_size_,                           \
+    select_size_                             \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
-
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \
-  clazz->set_char_sizes = a_; \
-  clazz->set_pixel_sizes = b_;
-#else
-  #define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_)
-#endif
-
-#define FT_DECLARE_DRIVER(class_)    FT_DECLARE_MODULE(class_)
-
-#define FT_DEFINE_DRIVER(class_,                                             \
-                         flags_, size_, name_, version_, requires_,          \
-                         interface_, init_, done_, get_interface_,           \
-                         face_object_size_, size_object_size_,               \
-                         slot_object_size_, init_face_, done_face_,          \
-                         init_size_, done_size_, init_slot_, done_slot_,     \
-                         old_set_char_sizes_, old_set_pixel_sizes_,          \
-                         load_glyph_, get_kerning_, attach_file_,            \
-                         get_advances_, request_size_, select_size_ )        \
-  void class_##_pic_free( FT_Library library );                              \
-  FT_Error class_##_pic_init( FT_Library library );                          \
-                                                                             \
-  void                                                                       \
-  FT_Destroy_Class_##class_( FT_Library        library,                      \
-                             FT_Module_Class*  clazz )                       \
-  {                                                                          \
-    FT_Memory       memory = library->memory;                                \
-    FT_Driver_Class dclazz = (FT_Driver_Class)clazz;                         \
-    class_##_pic_free( library );                                            \
-    if ( dclazz )                                                            \
-      FT_FREE( dclazz );                                                     \
-  }                                                                          \
-                                                                             \
-  FT_Error                                                                   \
-  FT_Create_Class_##class_( FT_Library        library,                       \
-                            FT_Module_Class**  output_class )                \
-  {                                                                          \
-    FT_Driver_Class  clazz;                                                  \
-    FT_Error         error;                                                  \
-    FT_Memory        memory = library->memory;                               \
-                                                                             \
-    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )                                 \
-      return error;                                                          \
-                                                                             \
-    error = class_##_pic_init( library );                                    \
-    if(error)                                                                \
-    {                                                                        \
-      FT_FREE( clazz );                                                      \
-      return error;                                                          \
-    }                                                                        \
-                                                                             \
-    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_,  \
-                          init_,done_,get_interface_)                        \
-                                                                             \
-    clazz->face_object_size    = face_object_size_;                          \
-    clazz->size_object_size    = size_object_size_;                          \
-    clazz->slot_object_size    = slot_object_size_;                          \
-                                                                             \
-    clazz->init_face           = init_face_;                                 \
-    clazz->done_face           = done_face_;                                 \
-                                                                             \
-    clazz->init_size           = init_size_;                                 \
-    clazz->done_size           = done_size_;                                 \
-                                                                             \
-    clazz->init_slot           = init_slot_;                                 \
-    clazz->done_slot           = done_slot_;                                 \
-                                                                             \
-    FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \
-                                                                             \
-    clazz->load_glyph          = load_glyph_;                                \
-                                                                             \
-    clazz->get_kerning         = get_kerning_;                               \
-    clazz->attach_file         = attach_file_;                               \
-    clazz->get_advances        = get_advances_;                              \
-                                                                             \
-    clazz->request_size        = request_size_;                              \
-    clazz->select_size         = select_size_;                               \
-                                                                             \
-    *output_class = (FT_Module_Class*)clazz;                                 \
-    return FT_Err_Ok;                                                        \
-  }                
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DECLARE_DRIVER( class_ )  FT_DECLARE_MODULE( class_ )
+
+#define FT_DEFINE_DRIVER(                                        \
+          class_,                                                \
+          flags_,                                                \
+          size_,                                                 \
+          name_,                                                 \
+          version_,                                              \
+          requires_,                                             \
+          interface_,                                            \
+          init_,                                                 \
+          done_,                                                 \
+          get_interface_,                                        \
+          face_object_size_,                                     \
+          size_object_size_,                                     \
+          slot_object_size_,                                     \
+          init_face_,                                            \
+          done_face_,                                            \
+          init_size_,                                            \
+          done_size_,                                            \
+          init_slot_,                                            \
+          done_slot_,                                            \
+          load_glyph_,                                           \
+          get_kerning_,                                          \
+          attach_file_,                                          \
+          get_advances_,                                         \
+          request_size_,                                         \
+          select_size_ )                                         \
+  void                                                           \
+  FT_Destroy_Class_ ## class_( FT_Library        library,        \
+                               FT_Module_Class*  clazz )         \
+  {                                                              \
+    FT_Memory        memory = library->memory;                   \
+    FT_Driver_Class  dclazz = (FT_Driver_Class)clazz;            \
+                                                                 \
+                                                                 \
+    class_ ## _pic_free( library );                              \
+    if ( dclazz )                                                \
+      FT_FREE( dclazz );                                         \
+  }                                                              \
+                                                                 \
+                                                                 \
+  FT_Error                                                       \
+  FT_Create_Class_ ## class_( FT_Library         library,        \
+                              FT_Module_Class**  output_class )  \
+  {                                                              \
+    FT_Driver_Class  clazz  = NULL;                              \
+    FT_Error         error;                                      \
+    FT_Memory        memory = library->memory;                   \
+                                                                 \
+                                                                 \
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \
+      return error;                                              \
+                                                                 \
+    error = class_ ## _pic_init( library );                      \
+    if ( error )                                                 \
+    {                                                            \
+      FT_FREE( clazz );                                          \
+      return error;                                              \
+    }                                                            \
+                                                                 \
+    FT_DEFINE_ROOT_MODULE( flags_,                               \
+                           size_,                                \
+                           name_,                                \
+                           version_,                             \
+                           requires_,                            \
+                           interface_,                           \
+                           init_,                                \
+                           done_,                                \
+                           get_interface_ )                      \
+                                                                 \
+    clazz->face_object_size = face_object_size_;                 \
+    clazz->size_object_size = size_object_size_;                 \
+    clazz->slot_object_size = slot_object_size_;                 \
+                                                                 \
+    clazz->init_face        = init_face_;                        \
+    clazz->done_face        = done_face_;                        \
+                                                                 \
+    clazz->init_size        = init_size_;                        \
+    clazz->done_size        = done_size_;                        \
+                                                                 \
+    clazz->init_slot        = init_slot_;                        \
+    clazz->done_slot        = done_slot_;                        \
+                                                                 \
+    clazz->load_glyph       = load_glyph_;                       \
+                                                                 \
+    clazz->get_kerning      = get_kerning_;                      \
+    clazz->attach_file      = attach_file_;                      \
+    clazz->get_advances     = get_advances_;                     \
+                                                                 \
+    clazz->request_size     = request_size_;                     \
+    clazz->select_size      = select_size_;                      \
+                                                                 \
+    *output_class = (FT_Module_Class*)clazz;                     \
+                                                                 \
+    return FT_Err_Ok;                                            \
+  }
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
index 026aa63..3d51aee 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType memory management macros (specification).               */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType memory management macros (specification).               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by             */
+/*  Copyright 1996-2002, 2004-2007, 2010, 2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg                       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg                       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -141,8 +141,10 @@ FT_BEGIN_HEADER
                const void*  P );
 
 
                const void*  P );
 
 
-#define FT_MEM_ALLOC( ptr, size )                                         \
-          FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) )
+#define FT_MEM_ALLOC( ptr, size )                               \
+          FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory,          \
+                                               (FT_Long)(size), \
+                                               &error ) )
 
 #define FT_MEM_FREE( ptr )                \
           FT_BEGIN_STMNT                  \
 
 #define FT_MEM_FREE( ptr )                \
           FT_BEGIN_STMNT                  \
@@ -154,45 +156,60 @@ FT_BEGIN_HEADER
           FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
 
 #define FT_MEM_REALLOC( ptr, cursz, newsz )                        \
           FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
 
 #define FT_MEM_REALLOC( ptr, cursz, newsz )                        \
-          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, 1,        \
-                                                 (cursz), (newsz), \
-                                                 (ptr), &error ) )
-
-#define FT_MEM_QALLOC( ptr, size )                                         \
-          FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, (size), &error ) )
+          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,           \
+                                                 1,                \
+                                                 (FT_Long)(cursz), \
+                                                 (FT_Long)(newsz), \
+                                                 (ptr),            \
+                                                 &error ) )
+
+#define FT_MEM_QALLOC( ptr, size )                               \
+          FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory,          \
+                                                (FT_Long)(size), \
+                                                &error ) )
 
 #define FT_MEM_QNEW( ptr )                        \
           FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
 
 
 #define FT_MEM_QNEW( ptr )                        \
           FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
 
-#define FT_MEM_QREALLOC( ptr, cursz, newsz )                         \
-          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, 1,        \
-                                                  (cursz), (newsz), \
-                                                  (ptr), &error ) )
-
-#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                             \
-          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
-                                                  (cursz), (newsz),          \
-                                                  (ptr), &error ) )
-
-#define FT_MEM_ALLOC_MULT( ptr, count, item_size )                    \
-          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (item_size), \
-                                                 0, (count),          \
-                                                 NULL, &error ) )
-
-#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )            \
-          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (itmsz),    \
-                                                 (oldcnt), (newcnt), \
-                                                 (ptr), &error ) )
-
-#define FT_MEM_QALLOC_MULT( ptr, count, item_size )                    \
-          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (item_size), \
-                                                  0, (count),          \
-                                                  NULL, &error ) )
-
-#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz)             \
-          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (itmsz),    \
-                                                  (oldcnt), (newcnt), \
-                                                  (ptr), &error ) )
+#define FT_MEM_QREALLOC( ptr, cursz, newsz )                        \
+          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,           \
+                                                  1,                \
+                                                  (FT_Long)(cursz), \
+                                                  (FT_Long)(newsz), \
+                                                  (ptr),            \
+                                                  &error ) )
+
+#define FT_MEM_ALLOC_MULT( ptr, count, item_size )                     \
+          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,               \
+                                                 (FT_Long)(item_size), \
+                                                 0,                    \
+                                                 (FT_Long)(count),     \
+                                                 NULL,                 \
+                                                 &error ) )
+
+#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )           \
+          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \
+                                                 (FT_Long)(itmsz),  \
+                                                 (FT_Long)(oldcnt), \
+                                                 (FT_Long)(newcnt), \
+                                                 (ptr),             \
+                                                 &error ) )
+
+#define FT_MEM_QALLOC_MULT( ptr, count, item_size )                     \
+          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,               \
+                                                  (FT_Long)(item_size), \
+                                                  0,                    \
+                                                  (FT_Long)(count),     \
+                                                  NULL,                 \
+                                                  &error ) )
+
+#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz)            \
+          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \
+                                                  (FT_Long)(itmsz),  \
+                                                  (FT_Long)(oldcnt), \
+                                                  (FT_Long)(newcnt), \
+                                                  (ptr),             \
+                                                  &error ) )
 
 
 #define FT_MEM_SET_ERROR( cond )  ( (cond), error != 0 )
 
 
 #define FT_MEM_SET_ERROR( cond )  ( (cond), error != 0 )
@@ -236,26 +253,37 @@ FT_BEGIN_HEADER
   /* _typed_ in order to automatically compute array element sizes.        */
   /*                                                                       */
 
   /* _typed_ in order to automatically compute array element sizes.        */
   /*                                                                       */
 
-#define FT_MEM_NEW_ARRAY( ptr, count )                                      \
-          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
-                                                 0, (count),                \
-                                                 NULL, &error ) )
-
-#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz )                             \
-          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
-                                                 (cursz), (newsz),          \
-                                                 (ptr), &error ) )
-
-#define FT_MEM_QNEW_ARRAY( ptr, count )                                      \
-          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
-                                                  0, (count),                \
-                                                  NULL, &error ) )
-
-#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                             \
-          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
-                                                  (cursz), (newsz),          \
-                                                  (ptr), &error ) )
-
+#define FT_MEM_NEW_ARRAY( ptr, count )                              \
+          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \
+                                                 sizeof ( *(ptr) ), \
+                                                 0,                 \
+                                                 (FT_Long)(count),  \
+                                                 NULL,              \
+                                                 &error ) )
+
+#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz )                     \
+          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \
+                                                 sizeof ( *(ptr) ), \
+                                                 (FT_Long)(cursz),  \
+                                                 (FT_Long)(newsz),  \
+                                                 (ptr),             \
+                                                 &error ) )
+
+#define FT_MEM_QNEW_ARRAY( ptr, count )                              \
+          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \
+                                                  sizeof ( *(ptr) ), \
+                                                  0,                 \
+                                                  (FT_Long)(count),  \
+                                                  NULL,              \
+                                                  &error ) )
+
+#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                     \
+          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \
+                                                  sizeof ( *(ptr) ), \
+                                                  (FT_Long)(cursz),  \
+                                                  (FT_Long)(newsz),  \
+                                                  (ptr),             \
+                                                  &error ) )
 
 #define FT_ALLOC( ptr, size )                           \
           FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
 
 #define FT_ALLOC( ptr, size )                           \
           FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
@@ -303,37 +331,6 @@ FT_BEGIN_HEADER
           FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
 
 
           FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  FT_BASE( FT_Error )
-  FT_Alloc( FT_Memory  memory,
-            FT_Long    size,
-            void*     *P );
-
-  FT_BASE( FT_Error )
-  FT_QAlloc( FT_Memory  memory,
-             FT_Long    size,
-             void*     *p );
-
-  FT_BASE( FT_Error )
-  FT_Realloc( FT_Memory  memory,
-              FT_Long    current,
-              FT_Long    size,
-              void*     *P );
-
-  FT_BASE( FT_Error )
-  FT_QRealloc( FT_Memory  memory,
-               FT_Long    current,
-               FT_Long    size,
-               void*     *p );
-
-  FT_BASE( void )
-  FT_Free( FT_Memory  memory,
-           void*     *P );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
   FT_BASE( FT_Pointer )
   ft_mem_strdup( FT_Memory    memory,
                  const char*  str,
   FT_BASE( FT_Pointer )
   ft_mem_strdup( FT_Memory    memory,
                  const char*  str,
@@ -345,6 +342,7 @@ FT_BEGIN_HEADER
               FT_ULong     size,
               FT_Error    *p_error );
 
               FT_ULong     size,
               FT_Error    *p_error );
 
+
 #define FT_MEM_STRDUP( dst, str )                                            \
           (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
 
 #define FT_MEM_STRDUP( dst, str )                                            \
           (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
 
index 670eb78..701c850 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType private base classes (specification).                   */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType private base classes (specification).                   */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by       */
+/*  Copyright 1996-2006, 2008, 2010, 2012-2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -206,46 +206,79 @@ FT_BEGIN_HEADER
 
   } FT_CMap_ClassRec;
 
 
   } FT_CMap_ClassRec;
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DECLARE_CMAP_CLASS(class_) \
-    FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
-
-#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_,       \
-        char_next_, char_var_index_, char_var_default_, variant_list_,       \
-        charvariant_list_, variantchar_list_)                                \
-  FT_CALLBACK_TABLE_DEF                                                      \
-  const FT_CMap_ClassRec class_ =                                            \
-  {                                                                          \
-    size_, init_, done_, char_index_, char_next_, char_var_index_,           \
-    char_var_default_, variant_list_, charvariant_list_, variantchar_list_   \
+#define FT_DECLARE_CMAP_CLASS( class_ )              \
+  FT_CALLBACK_TABLE const  FT_CMap_ClassRec class_;
+
+#define FT_DEFINE_CMAP_CLASS(       \
+          class_,                   \
+          size_,                    \
+          init_,                    \
+          done_,                    \
+          char_index_,              \
+          char_next_,               \
+          char_var_index_,          \
+          char_var_default_,        \
+          variant_list_,            \
+          charvariant_list_,        \
+          variantchar_list_ )       \
+  FT_CALLBACK_TABLE_DEF             \
+  const FT_CMap_ClassRec  class_ =  \
+  {                                 \
+    size_,                          \
+    init_,                          \
+    done_,                          \
+    char_index_,                    \
+    char_next_,                     \
+    char_var_index_,                \
+    char_var_default_,              \
+    variant_list_,                  \
+    charvariant_list_,              \
+    variantchar_list_               \
   };
   };
+
 #else /* FT_CONFIG_OPTION_PIC */
 
 #else /* FT_CONFIG_OPTION_PIC */
 
-#define FT_DECLARE_CMAP_CLASS(class_) \
-    void FT_Init_Class_##class_( FT_Library library, FT_CMap_ClassRec*  clazz);
-
-#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_,       \
-        char_next_, char_var_index_, char_var_default_, variant_list_,       \
-        charvariant_list_, variantchar_list_)                                \
-  void                                                                       \
-  FT_Init_Class_##class_( FT_Library library,                                \
-                          FT_CMap_ClassRec*  clazz)                          \
-  {                                                                          \
-    FT_UNUSED(library);                                                      \
-    clazz->size = size_;                                                     \
-    clazz->init = init_;                                                     \
-    clazz->done = done_;                                                     \
-    clazz->char_index = char_index_;                                         \
-    clazz->char_next = char_next_;                                           \
-    clazz->char_var_index = char_var_index_;                                 \
-    clazz->char_var_default = char_var_default_;                             \
-    clazz->variant_list = variant_list_;                                     \
-    clazz->charvariant_list = charvariant_list_;                             \
-    clazz->variantchar_list = variantchar_list_;                             \
-  } 
+#define FT_DECLARE_CMAP_CLASS( class_ )                  \
+  void                                                   \
+  FT_Init_Class_ ## class_( FT_Library         library,  \
+                            FT_CMap_ClassRec*  clazz );
+
+#define FT_DEFINE_CMAP_CLASS(                            \
+          class_,                                        \
+          size_,                                         \
+          init_,                                         \
+          done_,                                         \
+          char_index_,                                   \
+          char_next_,                                    \
+          char_var_index_,                               \
+          char_var_default_,                             \
+          variant_list_,                                 \
+          charvariant_list_,                             \
+          variantchar_list_ )                            \
+  void                                                   \
+  FT_Init_Class_ ## class_( FT_Library         library,  \
+                            FT_CMap_ClassRec*  clazz )   \
+  {                                                      \
+    FT_UNUSED( library );                                \
+                                                         \
+    clazz->size             = size_;                     \
+    clazz->init             = init_;                     \
+    clazz->done             = done_;                     \
+    clazz->char_index       = char_index_;               \
+    clazz->char_next        = char_next_;                \
+    clazz->char_var_index   = char_var_index_;           \
+    clazz->char_var_default = char_var_default_;         \
+    clazz->variant_list     = variant_list_;             \
+    clazz->charvariant_list = charvariant_list_;         \
+    clazz->variantchar_list = variantchar_list_;         \
+  }
+
 #endif /* FT_CONFIG_OPTION_PIC */
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
+
   /* create a new charmap and add it to charmap->face */
   FT_BASE( FT_Error )
   FT_CMap_New( FT_CMap_Class  clazz,
   /* create a new charmap and add it to charmap->face */
   FT_BASE( FT_Error )
   FT_CMap_New( FT_CMap_Class  clazz,
@@ -270,13 +303,13 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Fields>                                                              */
   /*    max_points ::                                                      */
   /*                                                                       */
   /* <Fields>                                                              */
   /*    max_points ::                                                      */
-  /*      The maximal number of points used to store the vectorial outline */
+  /*      The maximum number of points used to store the vectorial outline */
   /*      of any glyph in this face.  If this value cannot be known in     */
   /*      advance, or if the face isn't scalable, this should be set to 0. */
   /*      Only relevant for scalable formats.                              */
   /*                                                                       */
   /*    max_contours ::                                                    */
   /*      of any glyph in this face.  If this value cannot be known in     */
   /*      advance, or if the face isn't scalable, this should be set to 0. */
   /*      Only relevant for scalable formats.                              */
   /*                                                                       */
   /*    max_contours ::                                                    */
-  /*      The maximal number of contours used to store the vectorial       */
+  /*      The maximum number of contours used to store the vectorial       */
   /*      outline of any glyph in this face.  If this value cannot be      */
   /*      known in advance, or if the face isn't scalable, this should be  */
   /*      set to 0.  Only relevant for scalable formats.                   */
   /*      outline of any glyph in this face.  If this value cannot be      */
   /*      known in advance, or if the face isn't scalable, this should be  */
   /*      set to 0.  Only relevant for scalable formats.                   */
@@ -319,10 +352,6 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  FT_Face_InternalRec_
   {
   /*                                                                       */
   typedef struct  FT_Face_InternalRec_
   {
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    FT_UShort           reserved1;
-    FT_Short            reserved2;
-#endif
     FT_Matrix           transform_matrix;
     FT_Vector           transform_delta;
     FT_Int              transform_flags;
     FT_Matrix           transform_matrix;
     FT_Vector           transform_delta;
     FT_Int              transform_flags;
@@ -334,7 +363,7 @@ FT_BEGIN_HEADER
 #endif
 
     FT_Bool             ignore_unpatented_hinter;
 #endif
 
     FT_Bool             ignore_unpatented_hinter;
-    FT_UInt             refcount;
+    FT_Int              refcount;
 
   } FT_Face_InternalRec;
 
 
   } FT_Face_InternalRec;
 
@@ -409,6 +438,7 @@ FT_BEGIN_HEADER
 #endif
 
 
 #endif
 
 
+  /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
@@ -436,19 +466,16 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    memory  :: A handle to the memory manager.                         */
   /*                                                                       */
   /*                                                                       */
   /*    memory  :: A handle to the memory manager.                         */
   /*                                                                       */
-  /*    generic :: A generic structure for user-level extensibility (?).   */
-  /*                                                                       */
   typedef struct  FT_ModuleRec_
   {
     FT_Module_Class*  clazz;
     FT_Library        library;
     FT_Memory         memory;
   typedef struct  FT_ModuleRec_
   {
     FT_Module_Class*  clazz;
     FT_Library        library;
     FT_Memory         memory;
-    FT_Generic        generic;
 
   } FT_ModuleRec;
 
 
 
   } FT_ModuleRec;
 
 
-  /* typecast an object to a FT_Module */
+  /* typecast an object to an FT_Module */
 #define FT_MODULE( x )          ((FT_Module)( x ))
 #define FT_MODULE_CLASS( x )    FT_MODULE( x )->clazz
 #define FT_MODULE_LIBRARY( x )  FT_MODULE( x )->library
 #define FT_MODULE( x )          ((FT_Module)( x ))
 #define FT_MODULE_CLASS( x )    FT_MODULE( x )->clazz
 #define FT_MODULE_LIBRARY( x )  FT_MODULE( x )->library
@@ -506,7 +533,7 @@ FT_BEGIN_HEADER
   ft_module_get_service( FT_Module    module,
                          const char*  service_id );
 
   ft_module_get_service( FT_Module    module,
                          const char*  service_id );
 
- /* */
 /* */
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
@@ -514,7 +541,7 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /****                                                                 ****/
   /****                                                                 ****/
   /*************************************************************************/
   /****                                                                 ****/
   /****                                                                 ****/
-  /****               FACE, SIZE & GLYPH SLOT OBJECTS                   ****/
+  /****   F A C E,   S I Z E   &   G L Y P H   S L O T   O B J E C T S  ****/
   /****                                                                 ****/
   /****                                                                 ****/
   /*************************************************************************/
   /****                                                                 ****/
   /****                                                                 ****/
   /*************************************************************************/
@@ -711,10 +738,6 @@ FT_BEGIN_HEADER
   /*     faces_list   :: The list of faces currently opened by this        */
   /*                     driver.                                           */
   /*                                                                       */
   /*     faces_list   :: The list of faces currently opened by this        */
   /*                     driver.                                           */
   /*                                                                       */
-  /*     extensions   :: A typeless pointer to the driver's extensions     */
-  /*                     registry, if they are supported through the       */
-  /*                     configuration macro FT_CONFIG_OPTION_EXTENSIONS.  */
-  /*                                                                       */
   /*     glyph_loader :: The glyph loader for all faces managed by this    */
   /*                     driver.  This object isn't defined for unscalable */
   /*                     formats.                                          */
   /*     glyph_loader :: The glyph loader for all faces managed by this    */
   /*                     driver.  This object isn't defined for unscalable */
   /*                     formats.                                          */
@@ -723,10 +746,7 @@ FT_BEGIN_HEADER
   {
     FT_ModuleRec     root;
     FT_Driver_Class  clazz;
   {
     FT_ModuleRec     root;
     FT_Driver_Class  clazz;
-
     FT_ListRec       faces_list;
     FT_ListRec       faces_list;
-    void*            extensions;
-
     FT_GlyphLoader   glyph_loader;
 
   } FT_DriverRec;
     FT_GlyphLoader   glyph_loader;
 
   } FT_DriverRec;
@@ -776,9 +796,6 @@ FT_BEGIN_HEADER
   /*    memory           :: The library's memory object.  Manages memory   */
   /*                        allocation.                                    */
   /*                                                                       */
   /*    memory           :: The library's memory object.  Manages memory   */
   /*                        allocation.                                    */
   /*                                                                       */
-  /*    generic          :: Client data variable.  Used to extend the      */
-  /*                        Library class by higher levels and clients.    */
-  /*                                                                       */
   /*    version_major    :: The major version number of the library.       */
   /*                                                                       */
   /*    version_minor    :: The minor version number of the library.       */
   /*    version_major    :: The major version number of the library.       */
   /*                                                                       */
   /*    version_minor    :: The minor version number of the library.       */
@@ -838,8 +855,6 @@ FT_BEGIN_HEADER
   {
     FT_Memory          memory;           /* library's memory manager */
 
   {
     FT_Memory          memory;           /* library's memory manager */
 
-    FT_Generic         generic;
-
     FT_Int             version_major;
     FT_Int             version_minor;
     FT_Int             version_patch;
     FT_Int             version_major;
     FT_Int             version_minor;
     FT_Int             version_patch;
@@ -868,7 +883,7 @@ FT_BEGIN_HEADER
     FT_PIC_Container   pic_container;
 #endif
 
     FT_PIC_Container   pic_container;
 #endif
 
-    FT_UInt            refcount;
+    FT_Int             refcount;
 
   } FT_LibraryRec;
 
 
   } FT_LibraryRec;
 
@@ -941,12 +956,13 @@ FT_BEGIN_HEADER
   FT_EXPORT_VAR( FT_Raster_Funcs )  ft_default_raster;
 #endif
 
   FT_EXPORT_VAR( FT_Raster_Funcs )  ft_default_raster;
 #endif
 
+
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
   /****                                                                 ****/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
   /****                                                                 ****/
-  /****              PIC-Support Macros for ftimage.h                   ****/
+  /****                      P I C   S U P P O R T                      ****/
   /****                                                                 ****/
   /****                                                                 ****/
   /*************************************************************************/
   /****                                                                 ****/
   /****                                                                 ****/
   /*************************************************************************/
@@ -954,6 +970,9 @@ FT_BEGIN_HEADER
   /*************************************************************************/
 
 
   /*************************************************************************/
 
 
+  /* PIC support macros for ftimage.h */
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
@@ -962,37 +981,56 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    Used to initialize an instance of FT_Outline_Funcs struct.         */
   /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
   /* <Description>                                                         */
   /*    Used to initialize an instance of FT_Outline_Funcs struct.         */
   /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
-  /*    called with a pre-allocated stracture to be filled.                */
+  /*    be called with a pre-allocated structure to be filled.             */
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*    allocated in the global scope (or the scope where the macro        */
   /*    is used).                                                          */
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*    allocated in the global scope (or the scope where the macro        */
   /*    is used).                                                          */
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_,       \
-                                cubic_to_, shift_, delta_)                   \
-  static const FT_Outline_Funcs class_ =                                     \
-  {                                                                          \
-    move_to_, line_to_, conic_to_, cubic_to_, shift_, delta_                 \
+#define FT_DEFINE_OUTLINE_FUNCS(           \
+          class_,                          \
+          move_to_,                        \
+          line_to_,                        \
+          conic_to_,                       \
+          cubic_to_,                       \
+          shift_,                          \
+          delta_ )                         \
+  static const  FT_Outline_Funcs class_ =  \
+  {                                        \
+    move_to_,                              \
+    line_to_,                              \
+    conic_to_,                             \
+    cubic_to_,                             \
+    shift_,                                \
+    delta_                                 \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_OUTLINE_FUNCS(                     \
+          class_,                                    \
+          move_to_,                                  \
+          line_to_,                                  \
+          conic_to_,                                 \
+          cubic_to_,                                 \
+          shift_,                                    \
+          delta_ )                                   \
+  static FT_Error                                    \
+  Init_Class_ ## class_( FT_Outline_Funcs*  clazz )  \
+  {                                                  \
+    clazz->move_to  = move_to_;                      \
+    clazz->line_to  = line_to_;                      \
+    clazz->conic_to = conic_to_;                     \
+    clazz->cubic_to = cubic_to_;                     \
+    clazz->shift    = shift_;                        \
+    clazz->delta    = delta_;                        \
+                                                     \
+    return FT_Err_Ok;                                \
+  }
 
 
-#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_,       \
-                                cubic_to_, shift_, delta_)                   \
-  static FT_Error                                                            \
-  Init_Class_##class_( FT_Outline_Funcs*  clazz )                            \
-  {                                                                          \
-    clazz->move_to = move_to_;                                               \
-    clazz->line_to = line_to_;                                               \
-    clazz->conic_to = conic_to_;                                             \
-    clazz->cubic_to = cubic_to_;                                             \
-    clazz->shift = shift_;                                                   \
-    clazz->delta = delta_;                                                   \
-    return FT_Err_Ok;                                                        \
-  } 
+#endif /* FT_CONFIG_OPTION_PIC */
 
 
-#endif /* FT_CONFIG_OPTION_PIC */ 
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
@@ -1002,51 +1040,56 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    Used to initialize an instance of FT_Raster_Funcs struct.          */
   /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
   /* <Description>                                                         */
   /*    Used to initialize an instance of FT_Raster_Funcs struct.          */
   /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
-  /*    called with a pre-allocated stracture to be filled.                */
+  /*    be called with a pre-allocated structure to be filled.             */
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*    allocated in the global scope (or the scope where the macro        */
   /*    is used).                                                          */
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*    allocated in the global scope (or the scope where the macro        */
   /*    is used).                                                          */
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_,           \
-                               raster_reset_, raster_set_mode_,              \
-                               raster_render_, raster_done_)                 \
-  const FT_Raster_Funcs class_ =                                      \
-  {                                                                          \
-    glyph_format_, raster_new_, raster_reset_,                               \
-    raster_set_mode_, raster_render_, raster_done_                           \
+#define FT_DEFINE_RASTER_FUNCS(    \
+          class_,                  \
+          glyph_format_,           \
+          raster_new_,             \
+          raster_reset_,           \
+          raster_set_mode_,        \
+          raster_render_,          \
+          raster_done_ )           \
+  const FT_Raster_Funcs  class_ =  \
+  {                                \
+    glyph_format_,                 \
+    raster_new_,                   \
+    raster_reset_,                 \
+    raster_set_mode_,              \
+    raster_render_,                \
+    raster_done_                   \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
 
 
-#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_,           \
-    raster_reset_, raster_set_mode_, raster_render_, raster_done_)           \
-  void                                                                       \
-  FT_Init_Class_##class_( FT_Raster_Funcs*  clazz )                          \
-  {                                                                          \
-    clazz->glyph_format = glyph_format_;                                     \
-    clazz->raster_new = raster_new_;                                         \
-    clazz->raster_reset = raster_reset_;                                     \
-    clazz->raster_set_mode = raster_set_mode_;                               \
-    clazz->raster_render = raster_render_;                                   \
-    clazz->raster_done = raster_done_;                                       \
-  } 
+#define FT_DEFINE_RASTER_FUNCS(                        \
+          class_,                                      \
+          glyph_format_,                               \
+          raster_new_,                                 \
+          raster_reset_,                               \
+          raster_set_mode_,                            \
+          raster_render_,                              \
+          raster_done_ )                               \
+  void                                                 \
+  FT_Init_Class_ ## class_( FT_Raster_Funcs*  clazz )  \
+  {                                                    \
+    clazz->glyph_format    = glyph_format_;            \
+    clazz->raster_new      = raster_new_;              \
+    clazz->raster_reset    = raster_reset_;            \
+    clazz->raster_set_mode = raster_set_mode_;         \
+    clazz->raster_render   = raster_render_;           \
+    clazz->raster_done     = raster_done_;             \
+  }
 
 
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#endif /* FT_CONFIG_OPTION_PIC */
 
 
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****                                                                 ****/
-  /****              PIC-Support Macros for ftrender.h                  ****/
-  /****                                                                 ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
 
 
+  /* PIC support macros for ftrender.h */
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
@@ -1057,39 +1100,63 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    Used to initialize an instance of FT_Glyph_Class struct.           */
   /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
   /* <Description>                                                         */
   /*    Used to initialize an instance of FT_Glyph_Class struct.           */
   /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
-  /*    called with a pre-allocated stracture to be filled.                */
+  /*    be called with a pre-allocated stcture to be filled.               */
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*    allocated in the global scope (or the scope where the macro        */
   /*    is used).                                                          */
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*    allocated in the global scope (or the scope where the macro        */
   /*    is used).                                                          */
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_,         \
-                        transform_, bbox_, prepare_)                         \
-  FT_CALLBACK_TABLE_DEF                                                      \
-  const FT_Glyph_Class class_ =                                              \
-  {                                                                          \
-    size_, format_, init_, done_, copy_, transform_, bbox_, prepare_         \
+#define FT_DEFINE_GLYPH(          \
+          class_,                 \
+          size_,                  \
+          format_,                \
+          init_,                  \
+          done_,                  \
+          copy_,                  \
+          transform_,             \
+          bbox_,                  \
+          prepare_ )              \
+  FT_CALLBACK_TABLE_DEF           \
+  const FT_Glyph_Class  class_ =  \
+  {                               \
+    size_,                        \
+    format_,                      \
+    init_,                        \
+    done_,                        \
+    copy_,                        \
+    transform_,                   \
+    bbox_,                        \
+    prepare_                      \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
 
 
-#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_,         \
-                        transform_, bbox_, prepare_)                         \
-  void                                                                       \
-  FT_Init_Class_##class_( FT_Glyph_Class*  clazz )                           \
-  {                                                                          \
-    clazz->glyph_size = size_;                                               \
-    clazz->glyph_format = format_;                                           \
-    clazz->glyph_init = init_;                                               \
-    clazz->glyph_done = done_;                                               \
-    clazz->glyph_copy = copy_;                                               \
-    clazz->glyph_transform = transform_;                                     \
-    clazz->glyph_bbox = bbox_;                                               \
-    clazz->glyph_prepare = prepare_;                                         \
-  } 
+#define FT_DEFINE_GLYPH(                              \
+          class_,                                     \
+          size_,                                      \
+          format_,                                    \
+          init_,                                      \
+          done_,                                      \
+          copy_,                                      \
+          transform_,                                 \
+          bbox_,                                      \
+          prepare_ )                                  \
+  void                                                \
+  FT_Init_Class_ ## class_( FT_Glyph_Class*  clazz )  \
+  {                                                   \
+    clazz->glyph_size      = size_;                   \
+    clazz->glyph_format    = format_;                 \
+    clazz->glyph_init      = init_;                   \
+    clazz->glyph_done      = done_;                   \
+    clazz->glyph_copy      = copy_;                   \
+    clazz->glyph_transform = transform_;              \
+    clazz->glyph_bbox      = bbox_;                   \
+    clazz->glyph_prepare   = prepare_;                \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
 
 
-#endif /* FT_CONFIG_OPTION_PIC */ 
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
@@ -1098,7 +1165,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    Used to create a forward declaration of a                          */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Used to create a forward declaration of a                          */
-  /*    FT_Renderer_Class stract instance.                                 */
+  /*    FT_Renderer_Class struct instance.                                 */
   /*                                                                       */
   /* <Macro>                                                               */
   /*    FT_DEFINE_RENDERER                                                 */
   /*                                                                       */
   /* <Macro>                                                               */
   /*    FT_DEFINE_RENDERER                                                 */
@@ -1106,20 +1173,23 @@ FT_BEGIN_HEADER
   /* <Description>                                                         */
   /*    Used to initialize an instance of FT_Renderer_Class struct.        */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Used to initialize an instance of FT_Renderer_Class struct.        */
   /*                                                                       */
-  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */
-  /*    to called with a pointer where the allocated stracture is returned.*/
-  /*    And when it is no longer needed a Destroy function needs           */
-  /*    to be called to release that allocation.                           */
-  /*    fcinit.c (ft_create_default_module_classes) already contains       */
+  /*    When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need  */
+  /*    to be called with a pointer where the allocated structure is       */
+  /*    returned.  And when it is no longer needed a `destroy' function    */
+  /*    needs to be called to release that allocation.                     */
+  /*    `fcinit.c' (ft_create_default_module_classes) already contains     */
   /*    a mechanism to call these functions for the default modules        */
   /*    a mechanism to call these functions for the default modules        */
-  /*    described in ftmodule.h                                            */
+  /*    described in `ftmodule.h'.                                         */
   /*                                                                       */
   /*                                                                       */
-  /*    Notice that the created Create and Destroy functions call          */
-  /*    pic_init and pic_free function to allow you to manually allocate   */
-  /*    and initialize any additional global data, like module specific    */
+  /*    Notice that the created `create' and `destroy' functions call      */
+  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */
+  /*    initialize any additional global data, like a module specific      */
   /*    interface, and put them in the global pic container defined in     */
   /*    interface, and put them in the global pic container defined in     */
-  /*    ftpic.h. if you don't need them just implement the functions as    */
-  /*    empty to resolve the link error.                                   */
+  /*    `ftpic.h'.  If you don't need them just implement the functions as */
+  /*    empty to resolve the link error.  Also the `pic_init' and          */
+  /*    `pic_free' functions should be declared in `pic.h', to be referred */
+  /*    by the renderer definition calling `FT_DEFINE_RENDERER' in the     */
+  /*    following.                                                         */
   /*                                                                       */
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*    allocated in the global scope (or the scope where the macro        */
   /*                                                                       */
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*    allocated in the global scope (or the scope where the macro        */
@@ -1127,101 +1197,130 @@ FT_BEGIN_HEADER
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DECLARE_RENDERER(class_)                                          \
-    FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
-
-#define FT_DEFINE_RENDERER(class_,                                           \
-                           flags_, size_, name_, version_, requires_,        \
-                           interface_, init_, done_, get_interface_,         \
-                           glyph_format_, render_glyph_, transform_glyph_,   \
-                           get_glyph_cbox_, set_mode_, raster_class_ )       \
-  FT_CALLBACK_TABLE_DEF                                                      \
-  const FT_Renderer_Class  class_ =                                          \
-  {                                                                          \
-    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,             \
-                          interface_,init_,done_,get_interface_)             \
-    glyph_format_,                                                           \
-                                                                             \
-    render_glyph_,                                                           \
-    transform_glyph_,                                                        \
-    get_glyph_cbox_,                                                         \
-    set_mode_,                                                               \
-                                                                             \
-    raster_class_                                                            \
+#define FT_DECLARE_RENDERER( class_ )               \
+  FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
+
+#define FT_DEFINE_RENDERER(                  \
+          class_,                            \
+          flags_,                            \
+          size_,                             \
+          name_,                             \
+          version_,                          \
+          requires_,                         \
+          interface_,                        \
+          init_,                             \
+          done_,                             \
+          get_interface_,                    \
+          glyph_format_,                     \
+          render_glyph_,                     \
+          transform_glyph_,                  \
+          get_glyph_cbox_,                   \
+          set_mode_,                         \
+          raster_class_ )                    \
+  FT_CALLBACK_TABLE_DEF                      \
+  const FT_Renderer_Class  class_ =          \
+  {                                          \
+    FT_DEFINE_ROOT_MODULE( flags_,           \
+                           size_,            \
+                           name_,            \
+                           version_,         \
+                           requires_,        \
+                           interface_,       \
+                           init_,            \
+                           done_,            \
+                           get_interface_ )  \
+    glyph_format_,                           \
+                                             \
+    render_glyph_,                           \
+    transform_glyph_,                        \
+    get_glyph_cbox_,                         \
+    set_mode_,                               \
+                                             \
+    raster_class_                            \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
-
-#define FT_DECLARE_RENDERER(class_)  FT_DECLARE_MODULE(class_)
-
-#define FT_DEFINE_RENDERER(class_, \
-                           flags_, size_, name_, version_, requires_,        \
-                           interface_, init_, done_, get_interface_,         \
-                           glyph_format_, render_glyph_, transform_glyph_,   \
-                           get_glyph_cbox_, set_mode_, raster_class_ )       \
-  void class_##_pic_free( FT_Library library );                              \
-  FT_Error class_##_pic_init( FT_Library library );                          \
-                                                                             \
-  void                                                                       \
-  FT_Destroy_Class_##class_( FT_Library        library,                      \
-                        FT_Module_Class*  clazz )                            \
-  {                                                                          \
-    FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz;                   \
-    FT_Memory         memory = library->memory;                              \
-    class_##_pic_free( library );                                            \
-    if ( rclazz )                                                            \
-      FT_FREE( rclazz );                                                     \
-  }                                                                          \
-                                                                             \
-  FT_Error                                                                   \
-  FT_Create_Class_##class_( FT_Library         library,                      \
-                            FT_Module_Class**  output_class )                \
-  {                                                                          \
-    FT_Renderer_Class*  clazz;                                               \
-    FT_Error            error;                                               \
-    FT_Memory           memory = library->memory;                            \
-                                                                             \
-    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )                                 \
-      return error;                                                          \
-                                                                             \
-    error = class_##_pic_init( library );                                    \
-    if(error)                                                                \
-    {                                                                        \
-      FT_FREE( clazz );                                                      \
-      return error;                                                          \
-    }                                                                        \
-                                                                             \
-    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,             \
-                          interface_,init_,done_,get_interface_)             \
-                                                                             \
-    clazz->glyph_format       = glyph_format_;                               \
-                                                                             \
-    clazz->render_glyph       = render_glyph_;                               \
-    clazz->transform_glyph    = transform_glyph_;                            \
-    clazz->get_glyph_cbox     = get_glyph_cbox_;                             \
-    clazz->set_mode           = set_mode_;                                   \
-                                                                             \
-    clazz->raster_class       = raster_class_;                               \
-                                                                             \
-    *output_class = (FT_Module_Class*)clazz;                                 \
-    return FT_Err_Ok;                                                        \
-  } 
-
-
-
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
 
 
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /****                                                                 ****/
-  /****                                                                 ****/
-  /****              PIC-Support Macros for ftmodapi.h                  ****/
-  /****                                                                 ****/
-  /****                                                                 ****/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
+#define FT_DECLARE_RENDERER( class_ )  FT_DECLARE_MODULE( class_ )
+
+#define FT_DEFINE_RENDERER(                                      \
+          class_,                                                \
+          flags_,                                                \
+          size_,                                                 \
+          name_,                                                 \
+          version_,                                              \
+          requires_,                                             \
+          interface_,                                            \
+          init_,                                                 \
+          done_,                                                 \
+          get_interface_,                                        \
+          glyph_format_,                                         \
+          render_glyph_,                                         \
+          transform_glyph_,                                      \
+          get_glyph_cbox_,                                       \
+          set_mode_,                                             \
+          raster_class_ )                                        \
+  void                                                           \
+  FT_Destroy_Class_ ## class_( FT_Library        library,        \
+                               FT_Module_Class*  clazz )         \
+  {                                                              \
+    FT_Renderer_Class*  rclazz = (FT_Renderer_Class*)clazz;      \
+    FT_Memory           memory = library->memory;                \
+                                                                 \
+                                                                 \
+    class_ ## _pic_free( library );                              \
+    if ( rclazz )                                                \
+      FT_FREE( rclazz );                                         \
+  }                                                              \
+                                                                 \
+                                                                 \
+  FT_Error                                                       \
+  FT_Create_Class_ ## class_( FT_Library         library,        \
+                              FT_Module_Class**  output_class )  \
+  {                                                              \
+    FT_Renderer_Class*  clazz = NULL;                            \
+    FT_Error            error;                                   \
+    FT_Memory           memory = library->memory;                \
+                                                                 \
+                                                                 \
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \
+      return error;                                              \
+                                                                 \
+    error = class_ ## _pic_init( library );                      \
+    if ( error )                                                 \
+    {                                                            \
+      FT_FREE( clazz );                                          \
+      return error;                                              \
+    }                                                            \
+                                                                 \
+    FT_DEFINE_ROOT_MODULE( flags_,                               \
+                           size_,                                \
+                           name_,                                \
+                           version_,                             \
+                           requires_,                            \
+                           interface_,                           \
+                           init_,                                \
+                           done_,                                \
+                           get_interface_ )                      \
+                                                                 \
+    clazz->glyph_format    = glyph_format_;                      \
+                                                                 \
+    clazz->render_glyph    = render_glyph_;                      \
+    clazz->transform_glyph = transform_glyph_;                   \
+    clazz->get_glyph_cbox  = get_glyph_cbox_;                    \
+    clazz->set_mode        = set_mode_;                          \
+                                                                 \
+    clazz->raster_class    = raster_class_;                      \
+                                                                 \
+    *output_class = (FT_Module_Class*)clazz;                     \
+                                                                 \
+    return FT_Err_Ok;                                            \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+
+  /* PIC support macros for ftmodapi.h **/
 
 
 #ifdef FT_CONFIG_OPTION_PIC
 
 
 #ifdef FT_CONFIG_OPTION_PIC
@@ -1262,6 +1361,7 @@ FT_BEGIN_HEADER
 
 #endif
 
 
 #endif
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
@@ -1269,28 +1369,31 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    Used to create a forward declaration of a                          */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Used to create a forward declaration of a                          */
-  /*    FT_Module_Class stract instance.                                   */
+  /*    FT_Module_Class struct instance.                                   */
   /*                                                                       */
   /* <Macro>                                                               */
   /*    FT_DEFINE_MODULE                                                   */
   /*                                                                       */
   /* <Description>                                                         */
   /*                                                                       */
   /* <Macro>                                                               */
   /*    FT_DEFINE_MODULE                                                   */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Used to initialize an instance of FT_Module_Class struct.          */
+  /*    Used to initialize an instance of an FT_Module_Class struct.       */
   /*                                                                       */
   /*                                                                       */
-  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */
-  /*    to called with a pointer where the allocated stracture is returned.*/
-  /*    And when it is no longer needed a Destroy function needs           */
-  /*    to be called to release that allocation.                           */
-  /*    fcinit.c (ft_create_default_module_classes) already contains       */
+  /*    When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to   */
+  /*    be called with a pointer where the allocated structure is          */
+  /*    returned.  And when it is no longer needed a `destroy' function    */
+  /*    needs to be called to release that allocation.                     */
+  /*    `fcinit.c' (ft_create_default_module_classes) already contains     */
   /*    a mechanism to call these functions for the default modules        */
   /*    a mechanism to call these functions for the default modules        */
-  /*    described in ftmodule.h                                            */
+  /*    described in `ftmodule.h'.                                         */
   /*                                                                       */
   /*                                                                       */
-  /*    Notice that the created Create and Destroy functions call          */
-  /*    pic_init and pic_free function to allow you to manually allocate   */
-  /*    and initialize any additional global data, like module specific    */
+  /*    Notice that the created `create' and `destroy' functions call      */
+  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */
+  /*    initialize any additional global data, like a module specific      */
   /*    interface, and put them in the global pic container defined in     */
   /*    interface, and put them in the global pic container defined in     */
-  /*    ftpic.h. if you don't need them just implement the functions as    */
-  /*    empty to resolve the link error.                                   */
+  /*    `ftpic.h'.  If you don't need them just implement the functions as */
+  /*    empty to resolve the link error.  Also the `pic_init' and          */
+  /*    `pic_free' functions should be declared in `pic.h', to be referred */
+  /*    by the module definition calling `FT_DEFINE_MODULE' in the         */
+  /*    following.                                                         */
   /*                                                                       */
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*    allocated in the global scope (or the scope where the macro        */
   /*                                                                       */
   /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   /*    allocated in the global scope (or the scope where the macro        */
@@ -1300,122 +1403,160 @@ FT_BEGIN_HEADER
   /*    FT_DEFINE_ROOT_MODULE                                              */
   /*                                                                       */
   /* <Description>                                                         */
   /*    FT_DEFINE_ROOT_MODULE                                              */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Used to initialize an instance of FT_Module_Class struct inside    */
-  /*    another stract that contains it or in a function that initializes  */
-  /*    that containing stract                                             */
+  /*    Used to initialize an instance of an FT_Module_Class struct inside */
+  /*    another struct that contains it or in a function that initializes  */
+  /*    that containing struct.                                            */
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DECLARE_MODULE(class_)                                            \
-  FT_CALLBACK_TABLE                                                          \
-  const FT_Module_Class  class_;                                             \
-
-#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_,     \
-                              interface_, init_, done_, get_interface_)      \
-  {                                                                          \
-    flags_,                                                                  \
-    size_,                                                                   \
-                                                                             \
-    name_,                                                                   \
-    version_,                                                                \
-    requires_,                                                               \
-                                                                             \
-    interface_,                                                              \
-                                                                             \
-    init_,                                                                   \
-    done_,                                                                   \
-    get_interface_,                                                          \
+#define FT_DECLARE_MODULE( class_ )  \
+  FT_CALLBACK_TABLE                  \
+  const FT_Module_Class  class_;
+
+#define FT_DEFINE_ROOT_MODULE(  \
+          flags_,               \
+          size_,                \
+          name_,                \
+          version_,             \
+          requires_,            \
+          interface_,           \
+          init_,                \
+          done_,                \
+          get_interface_ )      \
+  {                             \
+    flags_,                     \
+    size_,                      \
+                                \
+    name_,                      \
+    version_,                   \
+    requires_,                  \
+                                \
+    interface_,                 \
+                                \
+    init_,                      \
+    done_,                      \
+    get_interface_,             \
   },
 
   },
 
-#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_,  \
-                         interface_, init_, done_, get_interface_)           \
-  FT_CALLBACK_TABLE_DEF                                                      \
-  const FT_Module_Class class_ =                                             \
-  {                                                                          \
-    flags_,                                                                  \
-    size_,                                                                   \
-                                                                             \
-    name_,                                                                   \
-    version_,                                                                \
-    requires_,                                                               \
-                                                                             \
-    interface_,                                                              \
-                                                                             \
-    init_,                                                                   \
-    done_,                                                                   \
-    get_interface_,                                                          \
+#define FT_DEFINE_MODULE(         \
+          class_,                 \
+          flags_,                 \
+          size_,                  \
+          name_,                  \
+          version_,               \
+          requires_,              \
+          interface_,             \
+          init_,                  \
+          done_,                  \
+          get_interface_ )        \
+  FT_CALLBACK_TABLE_DEF           \
+  const FT_Module_Class class_ =  \
+  {                               \
+    flags_,                       \
+    size_,                        \
+                                  \
+    name_,                        \
+    version_,                     \
+    requires_,                    \
+                                  \
+    interface_,                   \
+                                  \
+    init_,                        \
+    done_,                        \
+    get_interface_,               \
   };
 
 
 #else /* FT_CONFIG_OPTION_PIC */
 
   };
 
 
 #else /* FT_CONFIG_OPTION_PIC */
 
-#define FT_DECLARE_MODULE(class_)                                            \
-  FT_Error FT_Create_Class_##class_( FT_Library library,                     \
-                                     FT_Module_Class** output_class );       \
-  void     FT_Destroy_Class_##class_( FT_Library library,                    \
-                                      FT_Module_Class*  clazz );
-
-#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_,     \
-                              interface_, init_, done_, get_interface_)      \
-    clazz->root.module_flags       = flags_;                                 \
-    clazz->root.module_size        = size_;                                  \
-    clazz->root.module_name        = name_;                                  \
-    clazz->root.module_version     = version_;                               \
-    clazz->root.module_requires    = requires_;                              \
-                                                                             \
-    clazz->root.module_interface   = interface_;                             \
-                                                                             \
-    clazz->root.module_init        = init_;                                  \
-    clazz->root.module_done        = done_;                                  \
-    clazz->root.get_interface      = get_interface_;               
-
-#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_,  \
-                         interface_, init_, done_, get_interface_)           \
-  void class_##_pic_free( FT_Library library );                              \
-  FT_Error class_##_pic_init( FT_Library library );                          \
-                                                                             \
-  void                                                                       \
-  FT_Destroy_Class_##class_( FT_Library library,                             \
-                             FT_Module_Class*  clazz )                       \
-  {                                                                          \
-    FT_Memory memory = library->memory;                                      \
-    class_##_pic_free( library );                                            \
-    if ( clazz )                                                             \
-      FT_FREE( clazz );                                                      \
-  }                                                                          \
-                                                                             \
-  FT_Error                                                                   \
-  FT_Create_Class_##class_( FT_Library library,                              \
-                            FT_Module_Class**  output_class )                \
-  {                                                                          \
-    FT_Memory memory = library->memory;                                      \
-    FT_Module_Class*  clazz;                                                 \
-    FT_Error          error;                                                 \
-                                                                             \
-    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )                                 \
-      return error;                                                          \
-    error = class_##_pic_init( library );                                    \
-    if(error)                                                                \
-    {                                                                        \
-      FT_FREE( clazz );                                                      \
-      return error;                                                          \
-    }                                                                        \
-                                                                             \
-    clazz->module_flags       = flags_;                                      \
-    clazz->module_size        = size_;                                       \
-    clazz->module_name        = name_;                                       \
-    clazz->module_version     = version_;                                    \
-    clazz->module_requires    = requires_;                                   \
-                                                                             \
-    clazz->module_interface   = interface_;                                  \
-                                                                             \
-    clazz->module_init        = init_;                                       \
-    clazz->module_done        = done_;                                       \
-    clazz->get_interface      = get_interface_;                              \
-                                                                             \
-    *output_class = clazz;                                                   \
-    return FT_Err_Ok;                                                        \
-  } 
+#define FT_DECLARE_MODULE( class_ )                               \
+  FT_Error                                                        \
+  FT_Create_Class_ ## class_( FT_Library         library,         \
+                              FT_Module_Class**  output_class );  \
+  void                                                            \
+  FT_Destroy_Class_ ## class_( FT_Library        library,         \
+                               FT_Module_Class*  clazz );
+
+#define FT_DEFINE_ROOT_MODULE(                      \
+          flags_,                                   \
+          size_,                                    \
+          name_,                                    \
+          version_,                                 \
+          requires_,                                \
+          interface_,                               \
+          init_,                                    \
+          done_,                                    \
+          get_interface_ )                          \
+    clazz->root.module_flags     = flags_;          \
+    clazz->root.module_size      = size_;           \
+    clazz->root.module_name      = name_;           \
+    clazz->root.module_version   = version_;        \
+    clazz->root.module_requires  = requires_;       \
+                                                    \
+    clazz->root.module_interface = interface_;      \
+                                                    \
+    clazz->root.module_init      = init_;           \
+    clazz->root.module_done      = done_;           \
+    clazz->root.get_interface    = get_interface_;
+
+#define FT_DEFINE_MODULE(                                        \
+          class_,                                                \
+          flags_,                                                \
+          size_,                                                 \
+          name_,                                                 \
+          version_,                                              \
+          requires_,                                             \
+          interface_,                                            \
+          init_,                                                 \
+          done_,                                                 \
+          get_interface_ )                                       \
+  void                                                           \
+  FT_Destroy_Class_ ## class_( FT_Library        library,        \
+                               FT_Module_Class*  clazz )         \
+  {                                                              \
+    FT_Memory memory = library->memory;                          \
+                                                                 \
+                                                                 \
+    class_ ## _pic_free( library );                              \
+    if ( clazz )                                                 \
+      FT_FREE( clazz );                                          \
+  }                                                              \
+                                                                 \
+                                                                 \
+  FT_Error                                                       \
+  FT_Create_Class_ ## class_( FT_Library         library,        \
+                              FT_Module_Class**  output_class )  \
+  {                                                              \
+    FT_Memory         memory = library->memory;                  \
+    FT_Module_Class*  clazz  = NULL;                             \
+    FT_Error          error;                                     \
+                                                                 \
+                                                                 \
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \
+      return error;                                              \
+    error = class_ ## _pic_init( library );                      \
+    if ( error )                                                 \
+    {                                                            \
+      FT_FREE( clazz );                                          \
+      return error;                                              \
+    }                                                            \
+                                                                 \
+    clazz->module_flags     = flags_;                            \
+    clazz->module_size      = size_;                             \
+    clazz->module_name      = name_;                             \
+    clazz->module_version   = version_;                          \
+    clazz->module_requires  = requires_;                         \
+                                                                 \
+    clazz->module_interface = interface_;                        \
+                                                                 \
+    clazz->module_init      = init_;                             \
+    clazz->module_done      = done_;                             \
+    clazz->get_interface    = get_interface_;                    \
+                                                                 \
+    *output_class = clazz;                                       \
+                                                                 \
+    return FT_Err_Ok;                                            \
+  }
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
index 1b31957..485ce7a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services (declaration).       */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services (declaration).       */
 /*                                                                         */
-/*  Copyright 2009 by                                                      */
+/*  Copyright 2009, 2012 by                                                */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #ifndef __FTPIC_H__
 #define __FTPIC_H__
 
 #ifndef __FTPIC_H__
 #define __FTPIC_H__
 
-  
+
 FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 
 FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 
-  typedef struct FT_PIC_Container_
+  typedef struct  FT_PIC_Container_
   {
     /* pic containers for base */
   {
     /* pic containers for base */
-    void* base;
+    void*  base;
+
     /* pic containers for modules */
     /* pic containers for modules */
-    void* autofit;   
-    void* cff;    
-    void* pshinter;    
-    void* psnames;    
-    void* raster;     
-    void* sfnt;     
-    void* smooth;     
-    void* truetype;     
+    void*  autofit;
+    void*  cff;
+    void*  pshinter;
+    void*  psnames;
+    void*  raster;
+    void*  sfnt;
+    void*  smooth;
+    void*  truetype;
+
   } FT_PIC_Container;
 
   } FT_PIC_Container;
 
-  /* Initialize the various function tables, structs, etc. stored in the container. */
+
+  /* Initialize the various function tables, structs, etc. */
+  /* stored in the container.                              */
   FT_BASE( FT_Error )
   FT_BASE( FT_Error )
-  ft_pic_container_init( FT_Library library );
+  ft_pic_container_init( FT_Library  library );
 
 
   /* Destroy the contents of the container. */
   FT_BASE( void )
 
 
   /* Destroy the contents of the container. */
   FT_BASE( void )
-  ft_pic_container_destroy( FT_Library library );
+  ft_pic_container_destroy( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
index aa573c8..6307f2d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Embedded resource forks accessor (specification).                    */
 /*                                                                         */
 /*                                                                         */
 /*    Embedded resource forks accessor (specification).                    */
 /*                                                                         */
-/*  Copyright 2004, 2006, 2007 by                                          */
+/*  Copyright 2004, 2006, 2007, 2012 by                                    */
 /*  Masatake YAMATO and Redhat K.K.                                        */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Masatake YAMATO and Redhat K.K.                                        */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -48,6 +48,68 @@ FT_BEGIN_HEADER
 
   } FT_RFork_Ref;
 
 
   } FT_RFork_Ref;
 
+#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
+  typedef FT_Error
+  (*ft_raccess_guess_func)( FT_Library  library,
+                            FT_Stream   stream,
+                            char       *base_file_name,
+                            char      **result_file_name,
+                            FT_Long    *result_offset );
+
+  typedef enum  FT_RFork_Rule_ {
+    FT_RFork_Rule_invalid = -2,
+    FT_RFork_Rule_uknown, /* -1 */
+    FT_RFork_Rule_apple_double,
+    FT_RFork_Rule_apple_single,
+    FT_RFork_Rule_darwin_ufs_export,
+    FT_RFork_Rule_darwin_newvfs,
+    FT_RFork_Rule_darwin_hfsplus,
+    FT_RFork_Rule_vfat,
+    FT_RFork_Rule_linux_cap,
+    FT_RFork_Rule_linux_double,
+    FT_RFork_Rule_linux_netatalk
+  } FT_RFork_Rule;
+
+  /* For fast translation between rule index and rule type,
+   * the macros FT_RFORK_xxx should be kept consistent with
+   * the raccess_guess_funcs table
+   */
+  typedef struct ft_raccess_guess_rec_ {
+    ft_raccess_guess_func  func;
+    FT_RFork_Rule          type;
+  } ft_raccess_guess_rec;
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+  /* this array is a storage in non-PIC mode, so ; is needed in END */
+#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \
+          const type name[] = {
+#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix )  \
+          { raccess_guess_ ## func_suffix,                           \
+            FT_RFork_Rule_ ## type_suffix },
+#define CONST_FT_RFORK_RULE_ARRAY_END  };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+  /* this array is a function in PIC mode, so no ; is needed in END */
+#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \
+          void                                         \
+          FT_Init_ ## name( type*  storage )           \
+          {                                            \
+            type*  local = storage;                    \
+                                                       \
+                                                       \
+            int  i = 0;
+#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix )  \
+          local[i].func = raccess_guess_ ## func_suffix;             \
+          local[i].type = FT_RFork_Rule_ ## type_suffix;             \
+          i++;
+#define CONST_FT_RFORK_RULE_ARRAY_END  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
+
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
index 569b9f7..cd5fbd0 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType services (specification only).                          */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType services (specification only).                          */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007 by                              */
+/*  Copyright 2003-2007, 2009, 2012, 2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
 
-#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */
-
-  /* we disable the warning `conditional expression is constant' here */
-  /* in order to compile cleanly with the maximum level of warnings   */
-#pragma warning( disable : 4127 )
-
-#endif /* _MSC_VER */
-
   /*
    * @macro:
    *   FT_FACE_FIND_SERVICE
   /*
    * @macro:
    *   FT_FACE_FIND_SERVICE
@@ -92,6 +84,7 @@ FT_BEGIN_HEADER
 
 #endif /* !C++ */
 
 
 #endif /* !C++ */
 
+
   /*
    * @macro:
    *   FT_FACE_FIND_GLOBAL_SERVICE
   /*
    * @macro:
    *   FT_FACE_FIND_GLOBAL_SERVICE
@@ -163,298 +156,445 @@ FT_BEGIN_HEADER
 
   typedef const FT_ServiceDescRec*  FT_ServiceDesc;
 
 
   typedef const FT_ServiceDescRec*  FT_ServiceDesc;
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
-  /*    FT_DEFINE_SERVICEDESCREC1 .. FT_DEFINE_SERVICEDESCREC6             */
+  /*    FT_DEFINE_SERVICEDESCREC1                                          */
+  /*    FT_DEFINE_SERVICEDESCREC2                                          */
+  /*    FT_DEFINE_SERVICEDESCREC3                                          */
+  /*    FT_DEFINE_SERVICEDESCREC4                                          */
+  /*    FT_DEFINE_SERVICEDESCREC5                                          */
+  /*    FT_DEFINE_SERVICEDESCREC6                                          */
+  /*    FT_DEFINE_SERVICEDESCREC7                                          */
   /*                                                                       */
   /* <Description>                                                         */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Used to initialize an array of FT_ServiceDescRec structs.          */
+  /*    Used to initialize an array of FT_ServiceDescRec structures.       */
   /*                                                                       */
   /*                                                                       */
-  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */
-  /*    to called with a pointer where the allocated array is returned.    */
-  /*    And when it is no longer needed a Destroy function needs           */
-  /*    to be called to release that allocation.                           */
+  /*    When FT_CONFIG_OPTION_PIC is defined a `create' function needs to  */
+  /*    be called with a pointer to return an allocated array.  As soon as */
+  /*    it is no longer needed, a `destroy' function needs to be called to */
+  /*    release that allocation.                                           */
   /*                                                                       */
   /*                                                                       */
-  /*    These functions should be manyally called from the pic_init and    */
-  /*    pic_free functions of your module (see FT_DEFINE_MODULE)           */
+  /*    These functions should be manually called from the `pic_init' and  */
+  /*    `pic_free' functions of your module (see FT_DEFINE_MODULE).        */
   /*                                                                       */
   /*    When FT_CONFIG_OPTION_PIC is not defined the array will be         */
   /*                                                                       */
   /*    When FT_CONFIG_OPTION_PIC is not defined the array will be         */
-  /*    allocated in the global scope (or the scope where the macro        */
-  /*    is used).                                                          */
+  /*    allocated in the global scope (or the scope where the macro is     */
+  /*    used).                                                             */
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
   /*                                                                       */
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICEDESCREC1(class_, serv_id_1, serv_data_1)            \
-  static const FT_ServiceDescRec class_[] =                                  \
-  {                                                                          \
-  {serv_id_1, serv_data_1},                                                  \
-  {NULL, NULL}                                                               \
+#define FT_DEFINE_SERVICEDESCREC1( class_,                                  \
+                                   serv_id_1, serv_data_1 )                 \
+  static const FT_ServiceDescRec  class_[] =                                \
+  {                                                                         \
+    { serv_id_1, serv_data_1 },                                             \
+    { NULL, NULL }                                                          \
   };
   };
-#define FT_DEFINE_SERVICEDESCREC2(class_, serv_id_1, serv_data_1,            \
-        serv_id_2, serv_data_2)                                              \
-  static const FT_ServiceDescRec class_[] =                                  \
-  {                                                                          \
-  {serv_id_1, serv_data_1},                                                  \
-  {serv_id_2, serv_data_2},                                                  \
-  {NULL, NULL}                                                               \
+
+#define FT_DEFINE_SERVICEDESCREC2( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2 )                 \
+  static const FT_ServiceDescRec  class_[] =                                \
+  {                                                                         \
+    { serv_id_1, serv_data_1 },                                             \
+    { serv_id_2, serv_data_2 },                                             \
+    { NULL, NULL }                                                          \
+  };
+
+#define FT_DEFINE_SERVICEDESCREC3( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2,                  \
+                                   serv_id_3, serv_data_3 )                 \
+  static const FT_ServiceDescRec  class_[] =                                \
+  {                                                                         \
+    { serv_id_1, serv_data_1 },                                             \
+    { serv_id_2, serv_data_2 },                                             \
+    { serv_id_3, serv_data_3 },                                             \
+    { NULL, NULL }                                                          \
   };
   };
-#define FT_DEFINE_SERVICEDESCREC3(class_, serv_id_1, serv_data_1,            \
-        serv_id_2, serv_data_2, serv_id_3, serv_data_3)                      \
-  static const FT_ServiceDescRec class_[] =                                  \
-  {                                                                          \
-  {serv_id_1, serv_data_1},                                                  \
-  {serv_id_2, serv_data_2},                                                  \
-  {serv_id_3, serv_data_3},                                                  \
-  {NULL, NULL}                                                               \
+
+#define FT_DEFINE_SERVICEDESCREC4( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2,                  \
+                                   serv_id_3, serv_data_3,                  \
+                                   serv_id_4, serv_data_4 )                 \
+  static const FT_ServiceDescRec  class_[] =                                \
+  {                                                                         \
+    { serv_id_1, serv_data_1 },                                             \
+    { serv_id_2, serv_data_2 },                                             \
+    { serv_id_3, serv_data_3 },                                             \
+    { serv_id_4, serv_data_4 },                                             \
+    { NULL, NULL }                                                          \
   };
   };
-#define FT_DEFINE_SERVICEDESCREC4(class_, serv_id_1, serv_data_1,            \
-        serv_id_2, serv_data_2, serv_id_3, serv_data_3,                      \
-        serv_id_4, serv_data_4)                                              \
-  static const FT_ServiceDescRec class_[] =                                  \
-  {                                                                          \
-  {serv_id_1, serv_data_1},                                                  \
-  {serv_id_2, serv_data_2},                                                  \
-  {serv_id_3, serv_data_3},                                                  \
-  {serv_id_4, serv_data_4},                                                  \
-  {NULL, NULL}                                                               \
+
+#define FT_DEFINE_SERVICEDESCREC5( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2,                  \
+                                   serv_id_3, serv_data_3,                  \
+                                   serv_id_4, serv_data_4,                  \
+                                   serv_id_5, serv_data_5 )                 \
+  static const FT_ServiceDescRec  class_[] =                                \
+  {                                                                         \
+    { serv_id_1, serv_data_1 },                                             \
+    { serv_id_2, serv_data_2 },                                             \
+    { serv_id_3, serv_data_3 },                                             \
+    { serv_id_4, serv_data_4 },                                             \
+    { serv_id_5, serv_data_5 },                                             \
+    { NULL, NULL }                                                          \
   };
   };
-#define FT_DEFINE_SERVICEDESCREC5(class_, serv_id_1, serv_data_1,            \
-        serv_id_2, serv_data_2, serv_id_3, serv_data_3,                      \
-        serv_id_4, serv_data_4, serv_id_5, serv_data_5)                      \
-  static const FT_ServiceDescRec class_[] =                                  \
-  {                                                                          \
-  {serv_id_1, serv_data_1},                                                  \
-  {serv_id_2, serv_data_2},                                                  \
-  {serv_id_3, serv_data_3},                                                  \
-  {serv_id_4, serv_data_4},                                                  \
-  {serv_id_5, serv_data_5},                                                  \
-  {NULL, NULL}                                                               \
+
+#define FT_DEFINE_SERVICEDESCREC6( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2,                  \
+                                   serv_id_3, serv_data_3,                  \
+                                   serv_id_4, serv_data_4,                  \
+                                   serv_id_5, serv_data_5,                  \
+                                   serv_id_6, serv_data_6 )                 \
+  static const FT_ServiceDescRec  class_[] =                                \
+  {                                                                         \
+    { serv_id_1, serv_data_1 },                                             \
+    { serv_id_2, serv_data_2 },                                             \
+    { serv_id_3, serv_data_3 },                                             \
+    { serv_id_4, serv_data_4 },                                             \
+    { serv_id_5, serv_data_5 },                                             \
+    { serv_id_6, serv_data_6 },                                             \
+    { NULL, NULL }                                                          \
   };
   };
-#define FT_DEFINE_SERVICEDESCREC6(class_, serv_id_1, serv_data_1,            \
-        serv_id_2, serv_data_2, serv_id_3, serv_data_3,                      \
-        serv_id_4, serv_data_4, serv_id_5, serv_data_5,                      \
-        serv_id_6, serv_data_6)                                              \
-  static const FT_ServiceDescRec class_[] =                                  \
-  {                                                                          \
-  {serv_id_1, serv_data_1},                                                  \
-  {serv_id_2, serv_data_2},                                                  \
-  {serv_id_3, serv_data_3},                                                  \
-  {serv_id_4, serv_data_4},                                                  \
-  {serv_id_5, serv_data_5},                                                  \
-  {serv_id_6, serv_data_6},                                                  \
-  {NULL, NULL}                                                               \
+
+#define FT_DEFINE_SERVICEDESCREC7( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2,                  \
+                                   serv_id_3, serv_data_3,                  \
+                                   serv_id_4, serv_data_4,                  \
+                                   serv_id_5, serv_data_5,                  \
+                                   serv_id_6, serv_data_6,                  \
+                                   serv_id_7, serv_data_7 )                 \
+  static const FT_ServiceDescRec  class_[] =                                \
+  {                                                                         \
+    { serv_id_1, serv_data_1 },                                             \
+    { serv_id_2, serv_data_2 },                                             \
+    { serv_id_3, serv_data_3 },                                             \
+    { serv_id_4, serv_data_4 },                                             \
+    { serv_id_5, serv_data_5 },                                             \
+    { serv_id_6, serv_data_6 },                                             \
+    { serv_id_7, serv_data_7 },                                             \
+    { NULL, NULL }                                                          \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
-
-#define FT_DEFINE_SERVICEDESCREC1(class_, serv_id_1, serv_data_1)            \
-  void                                                                       \
-  FT_Destroy_Class_##class_( FT_Library library,                             \
-                             FT_ServiceDescRec* clazz )                      \
-  {                                                                          \
-    FT_Memory memory = library->memory;                                      \
-    if ( clazz )                                                             \
-      FT_FREE( clazz );                                                      \
-  }                                                                          \
-                                                                             \
-  FT_Error                                                                   \
-  FT_Create_Class_##class_( FT_Library library,                              \
-                            FT_ServiceDescRec** output_class)                \
-  {                                                                          \
-    FT_ServiceDescRec*  clazz;                                               \
-    FT_Error          error;                                                 \
-    FT_Memory memory = library->memory;                                      \
-                                                                             \
-    if ( FT_ALLOC( clazz, sizeof(*clazz)*2 ) )                               \
-      return error;                                                          \
-    clazz[0].serv_id = serv_id_1;                                            \
-    clazz[0].serv_data = serv_data_1;                                        \
-    clazz[1].serv_id = NULL;                                                 \
-    clazz[1].serv_data = NULL;                                               \
-    *output_class = clazz;                                                   \
-    return FT_Err_Ok;                                                        \
-  } 
-
-#define FT_DEFINE_SERVICEDESCREC2(class_, serv_id_1, serv_data_1,            \
-        serv_id_2, serv_data_2)                                              \
-  void                                                                       \
-  FT_Destroy_Class_##class_( FT_Library library,                             \
-                             FT_ServiceDescRec* clazz )                      \
-  {                                                                          \
-    FT_Memory memory = library->memory;                                      \
-    if ( clazz )                                                             \
-      FT_FREE( clazz );                                                      \
-  }                                                                          \
-                                                                             \
-  FT_Error                                                                   \
-  FT_Create_Class_##class_( FT_Library library,                              \
-                            FT_ServiceDescRec** output_class)                \
-  {                                                                          \
-    FT_ServiceDescRec*  clazz;                                               \
-    FT_Error          error;                                                 \
-    FT_Memory memory = library->memory;                                      \
-                                                                             \
-    if ( FT_ALLOC( clazz, sizeof(*clazz)*3 ) )                               \
-      return error;                                                          \
-    clazz[0].serv_id = serv_id_1;                                            \
-    clazz[0].serv_data = serv_data_1;                                        \
-    clazz[1].serv_id = serv_id_2;                                            \
-    clazz[1].serv_data = serv_data_2;                                        \
-    clazz[2].serv_id = NULL;                                                 \
-    clazz[2].serv_data = NULL;                                               \
-    *output_class = clazz;                                                   \
-    return FT_Err_Ok;                                                        \
-  } 
-
-#define FT_DEFINE_SERVICEDESCREC3(class_, serv_id_1, serv_data_1,            \
-        serv_id_2, serv_data_2, serv_id_3, serv_data_3)                      \
-  void                                                                       \
-  FT_Destroy_Class_##class_( FT_Library library,                             \
-                             FT_ServiceDescRec* clazz )                      \
-  {                                                                          \
-    FT_Memory memory = library->memory;                                      \
-    if ( clazz )                                                             \
-      FT_FREE( clazz );                                                      \
-  }                                                                          \
-                                                                             \
-  FT_Error                                                                   \
-  FT_Create_Class_##class_( FT_Library library,                              \
-                            FT_ServiceDescRec** output_class)                \
-  {                                                                          \
-    FT_ServiceDescRec*  clazz;                                               \
-    FT_Error          error;                                                 \
-    FT_Memory memory = library->memory;                                      \
-                                                                             \
-    if ( FT_ALLOC( clazz, sizeof(*clazz)*4 ) )                               \
-      return error;                                                          \
-    clazz[0].serv_id = serv_id_1;                                            \
-    clazz[0].serv_data = serv_data_1;                                        \
-    clazz[1].serv_id = serv_id_2;                                            \
-    clazz[1].serv_data = serv_data_2;                                        \
-    clazz[2].serv_id = serv_id_3;                                            \
-    clazz[2].serv_data = serv_data_3;                                        \
-    clazz[3].serv_id = NULL;                                                 \
-    clazz[3].serv_data = NULL;                                               \
-    *output_class = clazz;                                                   \
-    return FT_Err_Ok;                                                        \
-  } 
-
-#define FT_DEFINE_SERVICEDESCREC4(class_, serv_id_1, serv_data_1,            \
-        serv_id_2, serv_data_2, serv_id_3, serv_data_3,                      \
-        serv_id_4, serv_data_4)                                              \
-  void                                                                       \
-  FT_Destroy_Class_##class_( FT_Library library,                             \
-                             FT_ServiceDescRec* clazz )                      \
-  {                                                                          \
-    FT_Memory memory = library->memory;                                      \
-    if ( clazz )                                                             \
-      FT_FREE( clazz );                                                      \
-  }                                                                          \
-                                                                             \
-  FT_Error                                                                   \
-  FT_Create_Class_##class_( FT_Library library,                              \
-                            FT_ServiceDescRec** output_class)                \
-  {                                                                          \
-    FT_ServiceDescRec*  clazz;                                               \
-    FT_Error          error;                                                 \
-    FT_Memory memory = library->memory;                                      \
-                                                                             \
-    if ( FT_ALLOC( clazz, sizeof(*clazz)*5 ) )                               \
-      return error;                                                          \
-    clazz[0].serv_id = serv_id_1;                                            \
-    clazz[0].serv_data = serv_data_1;                                        \
-    clazz[1].serv_id = serv_id_2;                                            \
-    clazz[1].serv_data = serv_data_2;                                        \
-    clazz[2].serv_id = serv_id_3;                                            \
-    clazz[2].serv_data = serv_data_3;                                        \
-    clazz[3].serv_id = serv_id_4;                                            \
-    clazz[3].serv_data = serv_data_4;                                        \
-    clazz[4].serv_id = NULL;                                                 \
-    clazz[4].serv_data = NULL;                                               \
-    *output_class = clazz;                                                   \
-    return FT_Err_Ok;                                                        \
-  } 
-
-#define FT_DEFINE_SERVICEDESCREC5(class_, serv_id_1, serv_data_1,            \
-        serv_id_2, serv_data_2, serv_id_3, serv_data_3, serv_id_4,           \
-        serv_data_4, serv_id_5, serv_data_5)                                 \
-  void                                                                       \
-  FT_Destroy_Class_##class_( FT_Library library,                             \
-                             FT_ServiceDescRec* clazz )                      \
-  {                                                                          \
-    FT_Memory memory = library->memory;                                      \
-    if ( clazz )                                                             \
-      FT_FREE( clazz );                                                      \
-  }                                                                          \
-                                                                             \
-  FT_Error                                                                   \
-  FT_Create_Class_##class_( FT_Library library,                              \
-                            FT_ServiceDescRec** output_class)                \
-  {                                                                          \
-    FT_ServiceDescRec*  clazz;                                               \
-    FT_Error          error;                                                 \
-    FT_Memory memory = library->memory;                                      \
-                                                                             \
-    if ( FT_ALLOC( clazz, sizeof(*clazz)*6 ) )                               \
-      return error;                                                          \
-    clazz[0].serv_id = serv_id_1;                                            \
-    clazz[0].serv_data = serv_data_1;                                        \
-    clazz[1].serv_id = serv_id_2;                                            \
-    clazz[1].serv_data = serv_data_2;                                        \
-    clazz[2].serv_id = serv_id_3;                                            \
-    clazz[2].serv_data = serv_data_3;                                        \
-    clazz[3].serv_id = serv_id_4;                                            \
-    clazz[3].serv_data = serv_data_4;                                        \
-    clazz[4].serv_id = serv_id_5;                                            \
-    clazz[4].serv_data = serv_data_5;                                        \
-    clazz[5].serv_id = NULL;                                                 \
-    clazz[5].serv_data = NULL;                                               \
-    *output_class = clazz;                                                   \
-    return FT_Err_Ok;                                                        \
-  } 
-
-#define FT_DEFINE_SERVICEDESCREC6(class_, serv_id_1, serv_data_1,            \
-        serv_id_2, serv_data_2, serv_id_3, serv_data_3,                      \
-        serv_id_4, serv_data_4, serv_id_5, serv_data_5,                      \
-        serv_id_6, serv_data_6)                                              \
-  void                                                                       \
-  FT_Destroy_Class_##class_( FT_Library library,                             \
-                             FT_ServiceDescRec* clazz )                      \
-  {                                                                          \
-    FT_Memory memory = library->memory;                                      \
-    if ( clazz )                                                             \
-      FT_FREE( clazz );                                                      \
-  }                                                                          \
-                                                                             \
-  FT_Error                                                                   \
-  FT_Create_Class_##class_( FT_Library library,                              \
-                            FT_ServiceDescRec** output_class)                \
-  {                                                                          \
-    FT_ServiceDescRec*  clazz;                                               \
-    FT_Error          error;                                                 \
-    FT_Memory memory = library->memory;                                      \
-                                                                             \
-    if ( FT_ALLOC( clazz, sizeof(*clazz)*7 ) )                               \
-      return error;                                                          \
-    clazz[0].serv_id = serv_id_1;                                            \
-    clazz[0].serv_data = serv_data_1;                                        \
-    clazz[1].serv_id = serv_id_2;                                            \
-    clazz[1].serv_data = serv_data_2;                                        \
-    clazz[2].serv_id = serv_id_3;                                            \
-    clazz[2].serv_data = serv_data_3;                                        \
-    clazz[3].serv_id = serv_id_4;                                            \
-    clazz[3].serv_data = serv_data_4;                                        \
-    clazz[4].serv_id = serv_id_5;                                            \
-    clazz[4].serv_data = serv_data_5;                                        \
-    clazz[5].serv_id = serv_id_6;                                            \
-    clazz[5].serv_data = serv_data_6;                                        \
-    clazz[6].serv_id = NULL;                                                 \
-    clazz[6].serv_data = NULL;                                               \
-    *output_class = clazz;                                                   \
-    return FT_Err_Ok;                                                        \
-  } 
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICEDESCREC1( class_,                                  \
+                                   serv_id_1, serv_data_1 )                 \
+  void                                                                      \
+  FT_Destroy_Class_ ## class_( FT_Library          library,                 \
+                               FT_ServiceDescRec*  clazz )                  \
+  {                                                                         \
+    FT_Memory  memory = library->memory;                                    \
+                                                                            \
+                                                                            \
+    if ( clazz )                                                            \
+      FT_FREE( clazz );                                                     \
+  }                                                                         \
+                                                                            \
+  FT_Error                                                                  \
+  FT_Create_Class_ ## class_( FT_Library           library,                 \
+                              FT_ServiceDescRec**  output_class )           \
+  {                                                                         \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
+    FT_Error            error;                                              \
+    FT_Memory           memory = library->memory;                           \
+                                                                            \
+                                                                            \
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) )                         \
+      return error;                                                         \
+                                                                            \
+    clazz[0].serv_id   = serv_id_1;                                         \
+    clazz[0].serv_data = serv_data_1;                                       \
+    clazz[1].serv_id   = NULL;                                              \
+    clazz[1].serv_data = NULL;                                              \
+                                                                            \
+    *output_class = clazz;                                                  \
+                                                                            \
+    return FT_Err_Ok;                                                       \
+  }
+
+#define FT_DEFINE_SERVICEDESCREC2( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2 )                 \
+  void                                                                      \
+  FT_Destroy_Class_ ## class_( FT_Library          library,                 \
+                               FT_ServiceDescRec*  clazz )                  \
+  {                                                                         \
+    FT_Memory  memory = library->memory;                                    \
+                                                                            \
+                                                                            \
+    if ( clazz )                                                            \
+      FT_FREE( clazz );                                                     \
+  }                                                                         \
+                                                                            \
+  FT_Error                                                                  \
+  FT_Create_Class_ ## class_( FT_Library           library,                 \
+                              FT_ServiceDescRec**  output_class )           \
+  {                                                                         \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
+    FT_Error            error;                                              \
+    FT_Memory           memory = library->memory;                           \
+                                                                            \
+                                                                            \
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) )                         \
+      return error;                                                         \
+                                                                            \
+    clazz[0].serv_id   = serv_id_1;                                         \
+    clazz[0].serv_data = serv_data_1;                                       \
+    clazz[1].serv_id   = serv_id_2;                                         \
+    clazz[1].serv_data = serv_data_2;                                       \
+    clazz[2].serv_id   = NULL;                                              \
+    clazz[2].serv_data = NULL;                                              \
+                                                                            \
+    *output_class = clazz;                                                  \
+                                                                            \
+    return FT_Err_Ok;                                                       \
+  }
+
+#define FT_DEFINE_SERVICEDESCREC3( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2,                  \
+                                   serv_id_3, serv_data_3 )                 \
+  void                                                                      \
+  FT_Destroy_Class_ ## class_( FT_Library          library,                 \
+                               FT_ServiceDescRec*  clazz )                  \
+  {                                                                         \
+    FT_Memory  memory = library->memory;                                    \
+                                                                            \
+                                                                            \
+    if ( clazz )                                                            \
+      FT_FREE( clazz );                                                     \
+  }                                                                         \
+                                                                            \
+  FT_Error                                                                  \
+  FT_Create_Class_ ## class_( FT_Library           library,                 \
+                              FT_ServiceDescRec**  output_class )           \
+  {                                                                         \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
+    FT_Error            error;                                              \
+    FT_Memory           memory = library->memory;                           \
+                                                                            \
+                                                                            \
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) )                         \
+      return error;                                                         \
+                                                                            \
+    clazz[0].serv_id   = serv_id_1;                                         \
+    clazz[0].serv_data = serv_data_1;                                       \
+    clazz[1].serv_id   = serv_id_2;                                         \
+    clazz[1].serv_data = serv_data_2;                                       \
+    clazz[2].serv_id   = serv_id_3;                                         \
+    clazz[2].serv_data = serv_data_3;                                       \
+    clazz[3].serv_id   = NULL;                                              \
+    clazz[3].serv_data = NULL;                                              \
+                                                                            \
+    *output_class = clazz;                                                  \
+                                                                            \
+    return FT_Err_Ok;                                                       \
+  }
+
+#define FT_DEFINE_SERVICEDESCREC4( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2,                  \
+                                   serv_id_3, serv_data_3,                  \
+                                   serv_id_4, serv_data_4 )                 \
+  void                                                                      \
+  FT_Destroy_Class_ ## class_( FT_Library          library,                 \
+                               FT_ServiceDescRec*  clazz )                  \
+  {                                                                         \
+    FT_Memory  memory = library->memory;                                    \
+                                                                            \
+                                                                            \
+    if ( clazz )                                                            \
+      FT_FREE( clazz );                                                     \
+  }                                                                         \
+                                                                            \
+  FT_Error                                                                  \
+  FT_Create_Class_ ## class_( FT_Library           library,                 \
+                              FT_ServiceDescRec**  output_class )           \
+  {                                                                         \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
+    FT_Error            error;                                              \
+    FT_Memory           memory = library->memory;                           \
+                                                                            \
+                                                                            \
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) )                         \
+      return error;                                                         \
+                                                                            \
+    clazz[0].serv_id   = serv_id_1;                                         \
+    clazz[0].serv_data = serv_data_1;                                       \
+    clazz[1].serv_id   = serv_id_2;                                         \
+    clazz[1].serv_data = serv_data_2;                                       \
+    clazz[2].serv_id   = serv_id_3;                                         \
+    clazz[2].serv_data = serv_data_3;                                       \
+    clazz[3].serv_id   = serv_id_4;                                         \
+    clazz[3].serv_data = serv_data_4;                                       \
+    clazz[4].serv_id   = NULL;                                              \
+    clazz[4].serv_data = NULL;                                              \
+                                                                            \
+    *output_class = clazz;                                                  \
+                                                                            \
+    return FT_Err_Ok;                                                       \
+  }
+
+#define FT_DEFINE_SERVICEDESCREC5( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2,                  \
+                                   serv_id_3, serv_data_3,                  \
+                                   serv_id_4, serv_data_4,                  \
+                                   serv_id_5, serv_data_5 )                 \
+  void                                                                      \
+  FT_Destroy_Class_ ## class_( FT_Library          library,                 \
+                               FT_ServiceDescRec*  clazz )                  \
+  {                                                                         \
+    FT_Memory  memory = library->memory;                                    \
+                                                                            \
+                                                                            \
+    if ( clazz )                                                            \
+      FT_FREE( clazz );                                                     \
+  }                                                                         \
+                                                                            \
+  FT_Error                                                                  \
+  FT_Create_Class_ ## class_( FT_Library           library,                 \
+                              FT_ServiceDescRec**  output_class )           \
+  {                                                                         \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
+    FT_Error            error;                                              \
+    FT_Memory           memory = library->memory;                           \
+                                                                            \
+                                                                            \
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) )                         \
+      return error;                                                         \
+                                                                            \
+    clazz[0].serv_id   = serv_id_1;                                         \
+    clazz[0].serv_data = serv_data_1;                                       \
+    clazz[1].serv_id   = serv_id_2;                                         \
+    clazz[1].serv_data = serv_data_2;                                       \
+    clazz[2].serv_id   = serv_id_3;                                         \
+    clazz[2].serv_data = serv_data_3;                                       \
+    clazz[3].serv_id   = serv_id_4;                                         \
+    clazz[3].serv_data = serv_data_4;                                       \
+    clazz[4].serv_id   = serv_id_5;                                         \
+    clazz[4].serv_data = serv_data_5;                                       \
+    clazz[5].serv_id   = NULL;                                              \
+    clazz[5].serv_data = NULL;                                              \
+                                                                            \
+    *output_class = clazz;                                                  \
+                                                                            \
+    return FT_Err_Ok;                                                       \
+  }
+
+#define FT_DEFINE_SERVICEDESCREC6( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2,                  \
+                                   serv_id_3, serv_data_3,                  \
+                                   serv_id_4, serv_data_4,                  \
+                                   serv_id_5, serv_data_5,                  \
+                                   serv_id_6, serv_data_6 )                 \
+  void                                                                      \
+  FT_Destroy_Class_ ## class_( FT_Library          library,                 \
+                               FT_ServiceDescRec*  clazz )                  \
+  {                                                                         \
+    FT_Memory  memory = library->memory;                                    \
+                                                                            \
+                                                                            \
+    if ( clazz )                                                            \
+      FT_FREE( clazz );                                                     \
+  }                                                                         \
+                                                                            \
+  FT_Error                                                                  \
+  FT_Create_Class_ ## class_( FT_Library           library,                 \
+                              FT_ServiceDescRec**  output_class)            \
+  {                                                                         \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
+    FT_Error            error;                                              \
+    FT_Memory           memory = library->memory;                           \
+                                                                            \
+                                                                            \
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) )                         \
+      return error;                                                         \
+                                                                            \
+    clazz[0].serv_id   = serv_id_1;                                         \
+    clazz[0].serv_data = serv_data_1;                                       \
+    clazz[1].serv_id   = serv_id_2;                                         \
+    clazz[1].serv_data = serv_data_2;                                       \
+    clazz[2].serv_id   = serv_id_3;                                         \
+    clazz[2].serv_data = serv_data_3;                                       \
+    clazz[3].serv_id   = serv_id_4;                                         \
+    clazz[3].serv_data = serv_data_4;                                       \
+    clazz[4].serv_id   = serv_id_5;                                         \
+    clazz[4].serv_data = serv_data_5;                                       \
+    clazz[5].serv_id   = serv_id_6;                                         \
+    clazz[5].serv_data = serv_data_6;                                       \
+    clazz[6].serv_id   = NULL;                                              \
+    clazz[6].serv_data = NULL;                                              \
+                                                                            \
+    *output_class = clazz;                                                  \
+                                                                            \
+    return FT_Err_Ok;                                                       \
+  }
+
+#define FT_DEFINE_SERVICEDESCREC7( class_,                                  \
+                                   serv_id_1, serv_data_1,                  \
+                                   serv_id_2, serv_data_2,                  \
+                                   serv_id_3, serv_data_3,                  \
+                                   serv_id_4, serv_data_4,                  \
+                                   serv_id_5, serv_data_5,                  \
+                                   serv_id_6, serv_data_6,                  \
+                                   serv_id_7, serv_data_7 )                 \
+  void                                                                      \
+  FT_Destroy_Class_ ## class_( FT_Library          library,                 \
+                               FT_ServiceDescRec*  clazz )                  \
+  {                                                                         \
+    FT_Memory  memory = library->memory;                                    \
+                                                                            \
+                                                                            \
+    if ( clazz )                                                            \
+      FT_FREE( clazz );                                                     \
+  }                                                                         \
+                                                                            \
+  FT_Error                                                                  \
+  FT_Create_Class_ ## class_( FT_Library           library,                 \
+                              FT_ServiceDescRec**  output_class)            \
+  {                                                                         \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
+    FT_Error            error;                                              \
+    FT_Memory           memory = library->memory;                           \
+                                                                            \
+                                                                            \
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) )                         \
+      return error;                                                         \
+                                                                            \
+    clazz[0].serv_id   = serv_id_1;                                         \
+    clazz[0].serv_data = serv_data_1;                                       \
+    clazz[1].serv_id   = serv_id_2;                                         \
+    clazz[1].serv_data = serv_data_2;                                       \
+    clazz[2].serv_id   = serv_id_3;                                         \
+    clazz[2].serv_data = serv_data_3;                                       \
+    clazz[3].serv_id   = serv_id_4;                                         \
+    clazz[3].serv_data = serv_data_4;                                       \
+    clazz[4].serv_id   = serv_id_5;                                         \
+    clazz[4].serv_data = serv_data_5;                                       \
+    clazz[5].serv_id   = serv_id_6;                                         \
+    clazz[5].serv_data = serv_data_6;                                       \
+    clazz[6].serv_id   = serv_id_7;                                         \
+    clazz[6].serv_data = serv_data_7;                                       \
+    clazz[7].serv_id   = NULL;                                              \
+    clazz[7].serv_data = NULL;                                              \
+                                                                            \
+    *output_class = clazz;                                                  \
+                                                                            \
+    return FT_Err_Ok;                                                       \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
 
   /*
    *  Parse a list of FT_ServiceDescRec descriptors and look for
 
   /*
    *  Parse a list of FT_ServiceDescRec descriptors and look for
@@ -505,7 +645,9 @@ FT_BEGIN_HEADER
   /*
    *  A magic number used within the services cache.
    */
   /*
    *  A magic number used within the services cache.
    */
-#define FT_SERVICE_UNAVAILABLE  ((FT_Pointer)-2)  /* magic number */
+
+  /* ensure that value `1' has the same width as a pointer */
+#define FT_SERVICE_UNAVAILABLE  ((FT_Pointer)~(FT_PtrDist)1)
 
 
   /*
 
 
   /*
@@ -603,6 +745,7 @@ FT_BEGIN_HEADER
 #define FT_SERVICE_POSTSCRIPT_CMAPS_H   <freetype/internal/services/svpscmap.h>
 #define FT_SERVICE_POSTSCRIPT_INFO_H    <freetype/internal/services/svpsinfo.h>
 #define FT_SERVICE_POSTSCRIPT_NAME_H    <freetype/internal/services/svpostnm.h>
 #define FT_SERVICE_POSTSCRIPT_CMAPS_H   <freetype/internal/services/svpscmap.h>
 #define FT_SERVICE_POSTSCRIPT_INFO_H    <freetype/internal/services/svpsinfo.h>
 #define FT_SERVICE_POSTSCRIPT_NAME_H    <freetype/internal/services/svpostnm.h>
+#define FT_SERVICE_PROPERTIES_H         <freetype/internal/services/svprop.h>
 #define FT_SERVICE_SFNT_H               <freetype/internal/services/svsfnt.h>
 #define FT_SERVICE_TRUETYPE_ENGINE_H    <freetype/internal/services/svtteng.h>
 #define FT_SERVICE_TT_CMAP_H            <freetype/internal/services/svttcmap.h>
 #define FT_SERVICE_SFNT_H               <freetype/internal/services/svsfnt.h>
 #define FT_SERVICE_TRUETYPE_ENGINE_H    <freetype/internal/services/svtteng.h>
 #define FT_SERVICE_TT_CMAP_H            <freetype/internal/services/svttcmap.h>
index a91eb72..2661858 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Stream handling (specification).                                     */
 /*                                                                         */
 /*                                                                         */
 /*    Stream handling (specification).                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2005, 2006 by                         */
+/*  Copyright 1996-2002, 2004-2006, 2011, 2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -154,67 +154,60 @@ FT_BEGIN_HEADER
   /*                                                                       */
 
 #define FT_BYTE_( p, i )  ( ((const FT_Byte*)(p))[(i)] )
   /*                                                                       */
 
 #define FT_BYTE_( p, i )  ( ((const FT_Byte*)(p))[(i)] )
-#define FT_INT8_( p, i )  ( ((const FT_Char*)(p))[(i)] )
 
 #define FT_INT16( x )   ( (FT_Int16)(x)  )
 #define FT_UINT16( x )  ( (FT_UInt16)(x) )
 #define FT_INT32( x )   ( (FT_Int32)(x)  )
 #define FT_UINT32( x )  ( (FT_UInt32)(x) )
 
 
 #define FT_INT16( x )   ( (FT_Int16)(x)  )
 #define FT_UINT16( x )  ( (FT_UInt16)(x) )
 #define FT_INT32( x )   ( (FT_Int32)(x)  )
 #define FT_UINT32( x )  ( (FT_UInt32)(x) )
 
-#define FT_BYTE_I16( p, i, s )  ( FT_INT16(  FT_BYTE_( p, i ) ) << (s) )
+
 #define FT_BYTE_U16( p, i, s )  ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )
 #define FT_BYTE_U16( p, i, s )  ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )
-#define FT_BYTE_I32( p, i, s )  ( FT_INT32(  FT_BYTE_( p, i ) ) << (s) )
 #define FT_BYTE_U32( p, i, s )  ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
 
 #define FT_BYTE_U32( p, i, s )  ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
 
-#define FT_INT8_I16( p, i, s )  ( FT_INT16(  FT_INT8_( p, i ) ) << (s) )
-#define FT_INT8_U16( p, i, s )  ( FT_UINT16( FT_INT8_( p, i ) ) << (s) )
-#define FT_INT8_I32( p, i, s )  ( FT_INT32(  FT_INT8_( p, i ) ) << (s) )
-#define FT_INT8_U32( p, i, s )  ( FT_UINT32( FT_INT8_( p, i ) ) << (s) )
-
 
 
-#define FT_PEEK_SHORT( p )  FT_INT16( FT_INT8_I16( p, 0, 8) | \
-                                      FT_BYTE_I16( p, 1, 0) )
+#define FT_PEEK_SHORT( p )  FT_INT16( FT_BYTE_U16( p, 0, 8) | \
+                                      FT_BYTE_U16( p, 1, 0) )
 
 #define FT_PEEK_USHORT( p )  FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
                                         FT_BYTE_U16( p, 1, 0 ) )
 
 
 #define FT_PEEK_USHORT( p )  FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
                                         FT_BYTE_U16( p, 1, 0 ) )
 
-#define FT_PEEK_LONG( p )  FT_INT32( FT_INT8_I32( p, 0, 24 ) | \
-                                     FT_BYTE_I32( p, 1, 16 ) | \
-                                     FT_BYTE_I32( p, 2,  8 ) | \
-                                     FT_BYTE_I32( p, 3,  0 ) )
+#define FT_PEEK_LONG( p )  FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
+                                     FT_BYTE_U32( p, 1, 16 ) | \
+                                     FT_BYTE_U32( p, 2,  8 ) | \
+                                     FT_BYTE_U32( p, 3,  0 ) )
 
 #define FT_PEEK_ULONG( p )  FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \
                                        FT_BYTE_U32( p, 1, 16 ) | \
                                        FT_BYTE_U32( p, 2,  8 ) | \
                                        FT_BYTE_U32( p, 3,  0 ) )
 
 
 #define FT_PEEK_ULONG( p )  FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \
                                        FT_BYTE_U32( p, 1, 16 ) | \
                                        FT_BYTE_U32( p, 2,  8 ) | \
                                        FT_BYTE_U32( p, 3,  0 ) )
 
-#define FT_PEEK_OFF3( p )  FT_INT32( FT_INT8_I32( p, 0, 16 ) | \
-                                     FT_BYTE_I32( p, 1,  8 ) | \
-                                     FT_BYTE_I32( p, 2,  0 ) )
+#define FT_PEEK_OFF3( p )  FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
+                                     FT_BYTE_U32( p, 1,  8 ) | \
+                                     FT_BYTE_U32( p, 2,  0 ) )
 
 #define FT_PEEK_UOFF3( p )  FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
                                        FT_BYTE_U32( p, 1,  8 ) | \
                                        FT_BYTE_U32( p, 2,  0 ) )
 
 
 #define FT_PEEK_UOFF3( p )  FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
                                        FT_BYTE_U32( p, 1,  8 ) | \
                                        FT_BYTE_U32( p, 2,  0 ) )
 
-#define FT_PEEK_SHORT_LE( p )  FT_INT16( FT_INT8_I16( p, 1, 8 ) | \
-                                         FT_BYTE_I16( p, 0, 0 ) )
+#define FT_PEEK_SHORT_LE( p )  FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \
+                                         FT_BYTE_U16( p, 0, 0 ) )
 
 #define FT_PEEK_USHORT_LE( p )  FT_UINT16( FT_BYTE_U16( p, 1, 8 ) |  \
                                            FT_BYTE_U16( p, 0, 0 ) )
 
 
 #define FT_PEEK_USHORT_LE( p )  FT_UINT16( FT_BYTE_U16( p, 1, 8 ) |  \
                                            FT_BYTE_U16( p, 0, 0 ) )
 
-#define FT_PEEK_LONG_LE( p )  FT_INT32( FT_INT8_I32( p, 3, 24 ) | \
-                                        FT_BYTE_I32( p, 2, 16 ) | \
-                                        FT_BYTE_I32( p, 1,  8 ) | \
-                                        FT_BYTE_I32( p, 0,  0 ) )
+#define FT_PEEK_LONG_LE( p )  FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \
+                                        FT_BYTE_U32( p, 2, 16 ) | \
+                                        FT_BYTE_U32( p, 1,  8 ) | \
+                                        FT_BYTE_U32( p, 0,  0 ) )
 
 #define FT_PEEK_ULONG_LE( p )  FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \
                                           FT_BYTE_U32( p, 2, 16 ) | \
                                           FT_BYTE_U32( p, 1,  8 ) | \
                                           FT_BYTE_U32( p, 0,  0 ) )
 
 
 #define FT_PEEK_ULONG_LE( p )  FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \
                                           FT_BYTE_U32( p, 2, 16 ) | \
                                           FT_BYTE_U32( p, 1,  8 ) | \
                                           FT_BYTE_U32( p, 0,  0 ) )
 
-#define FT_PEEK_OFF3_LE( p )  FT_INT32( FT_INT8_I32( p, 2, 16 ) | \
-                                        FT_BYTE_I32( p, 1,  8 ) | \
-                                        FT_BYTE_I32( p, 0,  0 ) )
+#define FT_PEEK_OFF3_LE( p )  FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
+                                        FT_BYTE_U32( p, 1,  8 ) | \
+                                        FT_BYTE_U32( p, 0,  0 ) )
 
 #define FT_PEEK_UOFF3_LE( p )  FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
                                           FT_BYTE_U32( p, 1,  8 ) | \
 
 #define FT_PEEK_UOFF3_LE( p )  FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
                                           FT_BYTE_U32( p, 1,  8 ) | \
@@ -292,18 +285,18 @@ FT_BEGIN_HEADER
 
 #define FT_GET_CHAR()       FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
 #define FT_GET_BYTE()       FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
 
 #define FT_GET_CHAR()       FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
 #define FT_GET_BYTE()       FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
-#define FT_GET_SHORT()      FT_GET_MACRO( FT_Stream_GetShort, FT_Short )
-#define FT_GET_USHORT()     FT_GET_MACRO( FT_Stream_GetShort, FT_UShort )
-#define FT_GET_OFF3()       FT_GET_MACRO( FT_Stream_GetOffset, FT_Long )
-#define FT_GET_UOFF3()      FT_GET_MACRO( FT_Stream_GetOffset, FT_ULong )
-#define FT_GET_LONG()       FT_GET_MACRO( FT_Stream_GetLong, FT_Long )
-#define FT_GET_ULONG()      FT_GET_MACRO( FT_Stream_GetLong, FT_ULong )
-#define FT_GET_TAG4()       FT_GET_MACRO( FT_Stream_GetLong, FT_ULong )
-
-#define FT_GET_SHORT_LE()   FT_GET_MACRO( FT_Stream_GetShortLE, FT_Short )
-#define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetShortLE, FT_UShort )
-#define FT_GET_LONG_LE()    FT_GET_MACRO( FT_Stream_GetLongLE, FT_Long )
-#define FT_GET_ULONG_LE()   FT_GET_MACRO( FT_Stream_GetLongLE, FT_ULong )
+#define FT_GET_SHORT()      FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
+#define FT_GET_USHORT()     FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
+#define FT_GET_OFF3()       FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )
+#define FT_GET_UOFF3()      FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
+#define FT_GET_LONG()       FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
+#define FT_GET_ULONG()      FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
+#define FT_GET_TAG4()       FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
+
+#define FT_GET_SHORT_LE()   FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
+#define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )
+#define FT_GET_LONG_LE()    FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )
+#define FT_GET_ULONG_LE()   FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
 #endif
 
 #define FT_READ_MACRO( func, type, var )        \
 #endif
 
 #define FT_READ_MACRO( func, type, var )        \
@@ -312,17 +305,17 @@ FT_BEGIN_HEADER
 
 #define FT_READ_BYTE( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
 #define FT_READ_CHAR( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
 
 #define FT_READ_BYTE( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
 #define FT_READ_CHAR( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
-#define FT_READ_SHORT( var )      FT_READ_MACRO( FT_Stream_ReadShort, FT_Short, var )
-#define FT_READ_USHORT( var )     FT_READ_MACRO( FT_Stream_ReadShort, FT_UShort, var )
-#define FT_READ_OFF3( var )       FT_READ_MACRO( FT_Stream_ReadOffset, FT_Long, var )
-#define FT_READ_UOFF3( var )      FT_READ_MACRO( FT_Stream_ReadOffset, FT_ULong, var )
-#define FT_READ_LONG( var )       FT_READ_MACRO( FT_Stream_ReadLong, FT_Long, var )
-#define FT_READ_ULONG( var )      FT_READ_MACRO( FT_Stream_ReadLong, FT_ULong, var )
+#define FT_READ_SHORT( var )      FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
+#define FT_READ_USHORT( var )     FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
+#define FT_READ_OFF3( var )       FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )
+#define FT_READ_UOFF3( var )      FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )
+#define FT_READ_LONG( var )       FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )
+#define FT_READ_ULONG( var )      FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
 
 
-#define FT_READ_SHORT_LE( var )   FT_READ_MACRO( FT_Stream_ReadShortLE, FT_Short, var )
-#define FT_READ_USHORT_LE( var )  FT_READ_MACRO( FT_Stream_ReadShortLE, FT_UShort, var )
-#define FT_READ_LONG_LE( var )    FT_READ_MACRO( FT_Stream_ReadLongLE, FT_Long, var )
-#define FT_READ_ULONG_LE( var )   FT_READ_MACRO( FT_Stream_ReadLongLE, FT_ULong, var )
+#define FT_READ_SHORT_LE( var )   FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )
+#define FT_READ_USHORT_LE( var )  FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )
+#define FT_READ_LONG_LE( var )    FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )
+#define FT_READ_ULONG_LE( var )   FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
 
 
 #ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
 
 
 #ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
@@ -431,25 +424,25 @@ FT_BEGIN_HEADER
   FT_BASE( FT_Char )
   FT_Stream_GetChar( FT_Stream  stream );
 
   FT_BASE( FT_Char )
   FT_Stream_GetChar( FT_Stream  stream );
 
-  /* read a 16-bit big-endian integer from an entered frame */
-  FT_BASE( FT_Short )
-  FT_Stream_GetShort( FT_Stream  stream );
+  /* read a 16-bit big-endian unsigned integer from an entered frame */
+  FT_BASE( FT_UShort )
+  FT_Stream_GetUShort( FT_Stream  stream );
 
 
-  /* read a 24-bit big-endian integer from an entered frame */
-  FT_BASE( FT_Long )
-  FT_Stream_GetOffset( FT_Stream  stream );
+  /* read a 24-bit big-endian unsigned integer from an entered frame */
+  FT_BASE( FT_ULong )
+  FT_Stream_GetUOffset( FT_Stream  stream );
 
 
-  /* read a 32-bit big-endian integer from an entered frame */
-  FT_BASE( FT_Long )
-  FT_Stream_GetLong( FT_Stream  stream );
+  /* read a 32-bit big-endian unsigned integer from an entered frame */
+  FT_BASE( FT_ULong )
+  FT_Stream_GetULong( FT_Stream  stream );
 
 
-  /* read a 16-bit little-endian integer from an entered frame */
-  FT_BASE( FT_Short )
-  FT_Stream_GetShortLE( FT_Stream  stream );
+  /* read a 16-bit little-endian unsigned integer from an entered frame */
+  FT_BASE( FT_UShort )
+  FT_Stream_GetUShortLE( FT_Stream  stream );
 
 
-  /* read a 32-bit little-endian integer from an entered frame */
-  FT_BASE( FT_Long )
-  FT_Stream_GetLongLE( FT_Stream  stream );
+  /* read a 32-bit little-endian unsigned integer from an entered frame */
+  FT_BASE( FT_ULong )
+  FT_Stream_GetULongLE( FT_Stream  stream );
 
 
   /* read a byte from a stream */
 
 
   /* read a byte from a stream */
@@ -457,30 +450,30 @@ FT_BEGIN_HEADER
   FT_Stream_ReadChar( FT_Stream  stream,
                       FT_Error*  error );
 
   FT_Stream_ReadChar( FT_Stream  stream,
                       FT_Error*  error );
 
-  /* read a 16-bit big-endian integer from a stream */
-  FT_BASE( FT_Short )
-  FT_Stream_ReadShort( FT_Stream  stream,
-                       FT_Error*  error );
-
-  /* read a 24-bit big-endian integer from a stream */
-  FT_BASE( FT_Long )
-  FT_Stream_ReadOffset( FT_Stream  stream,
+  /* read a 16-bit big-endian unsigned integer from a stream */
+  FT_BASE( FT_UShort )
+  FT_Stream_ReadUShort( FT_Stream  stream,
                         FT_Error*  error );
 
                         FT_Error*  error );
 
+  /* read a 24-bit big-endian unsigned integer from a stream */
+  FT_BASE( FT_ULong )
+  FT_Stream_ReadUOffset( FT_Stream  stream,
+                         FT_Error*  error );
+
   /* read a 32-bit big-endian integer from a stream */
   /* read a 32-bit big-endian integer from a stream */
-  FT_BASE( FT_Long )
-  FT_Stream_ReadLong( FT_Stream  stream,
-                      FT_Error*  error );
+  FT_BASE( FT_ULong )
+  FT_Stream_ReadULong( FT_Stream  stream,
+                       FT_Error*  error );
 
 
-  /* read a 16-bit little-endian integer from a stream */
-  FT_BASE( FT_Short )
-  FT_Stream_ReadShortLE( FT_Stream  stream,
-                         FT_Error*  error );
+  /* read a 16-bit little-endian unsigned integer from a stream */
+  FT_BASE( FT_UShort )
+  FT_Stream_ReadUShortLE( FT_Stream  stream,
+                          FT_Error*  error );
 
 
-  /* read a 32-bit little-endian integer from a stream */
-  FT_BASE( FT_Long )
-  FT_Stream_ReadLongLE( FT_Stream  stream,
-                        FT_Error*  error );
+  /* read a 32-bit little-endian unsigned integer from a stream */
+  FT_BASE( FT_ULong )
+  FT_Stream_ReadULongLE( FT_Stream  stream,
+                         FT_Error*  error );
 
   /* Read a structure from a stream.  The structure must be described */
   /* by an array of FT_Frame_Field records.                           */
 
   /* Read a structure from a stream.  The structure must be described */
   /* by an array of FT_Frame_Field records.                           */
@@ -493,37 +486,41 @@ FT_BEGIN_HEADER
 #define FT_STREAM_POS()           \
           FT_Stream_Pos( stream )
 
 #define FT_STREAM_POS()           \
           FT_Stream_Pos( stream )
 
-#define FT_STREAM_SEEK( position )                           \
-          FT_SET_ERROR( FT_Stream_Seek( stream, position ) )
+#define FT_STREAM_SEEK( position )                               \
+          FT_SET_ERROR( FT_Stream_Seek( stream,                  \
+                                        (FT_ULong)(position) ) )
 
 
-#define FT_STREAM_SKIP( distance )                           \
-          FT_SET_ERROR( FT_Stream_Skip( stream, distance ) )
+#define FT_STREAM_SKIP( distance )                              \
+          FT_SET_ERROR( FT_Stream_Skip( stream,                 \
+                                        (FT_Long)(distance) ) )
 
 
-#define FT_STREAM_READ( buffer, count )                   \
-          FT_SET_ERROR( FT_Stream_Read( stream,           \
-                                        (FT_Byte*)buffer, \
-                                        count ) )
+#define FT_STREAM_READ( buffer, count )                       \
+          FT_SET_ERROR( FT_Stream_Read( stream,               \
+                                        (FT_Byte*)(buffer),   \
+                                        (FT_ULong)(count) ) )
 
 
-#define FT_STREAM_READ_AT( position, buffer, count )         \
-          FT_SET_ERROR( FT_Stream_ReadAt( stream,            \
-                                           position,         \
-                                           (FT_Byte*)buffer, \
-                                           count ) )
+#define FT_STREAM_READ_AT( position, buffer, count )            \
+          FT_SET_ERROR( FT_Stream_ReadAt( stream,               \
+                                          (FT_ULong)(position), \
+                                          (FT_Byte*)buffer,     \
+                                          (FT_ULong)(count) ) )
 
 #define FT_STREAM_READ_FIELDS( fields, object )                          \
           FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
 
 
 
 #define FT_STREAM_READ_FIELDS( fields, object )                          \
           FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
 
 
-#define FT_FRAME_ENTER( size )                                       \
-          FT_SET_ERROR(                                              \
-            FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, size ) ) )
+#define FT_FRAME_ENTER( size )                                           \
+          FT_SET_ERROR(                                                  \
+            FT_DEBUG_INNER( FT_Stream_EnterFrame( stream,                \
+                                                  (FT_ULong)(size) ) ) )
 
 
-#define FT_FRAME_EXIT()                 \
+#define FT_FRAME_EXIT()                                   \
           FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
 
 #define FT_FRAME_EXTRACT( size, bytes )                                       \
           FT_SET_ERROR(                                                       \
           FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
 
 #define FT_FRAME_EXTRACT( size, bytes )                                       \
           FT_SET_ERROR(                                                       \
-            FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, size,             \
+            FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream,                   \
+                                                    (FT_ULong)(size),         \
                                                     (FT_Byte**)&(bytes) ) ) )
 
 #define FT_FRAME_RELEASE( bytes )                                         \
                                                     (FT_Byte**)&(bytes) ) ) )
 
 #define FT_FRAME_RELEASE( bytes )                                         \
index e9b383a..a9d98b6 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Tracing handling (specification only).                               */
 /*                                                                         */
 /*                                                                         */
 /*    Tracing handling (specification only).                               */
 /*                                                                         */
-/*  Copyright 2002, 2004, 2005, 2006, 2007 by                              */
+/*  Copyright 2002, 2004-2007, 2009, 2011-2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -38,6 +38,7 @@ FT_TRACE_DEF( smooth )    /* anti-aliasing raster    (ftgrays.c)  */
 FT_TRACE_DEF( mm )        /* MM interface            (ftmm.c)     */
 FT_TRACE_DEF( raccess )   /* resource fork accessor  (ftrfork.c)  */
 FT_TRACE_DEF( synth )     /* bold/slant synthesizer  (ftsynth.c)  */
 FT_TRACE_DEF( mm )        /* MM interface            (ftmm.c)     */
 FT_TRACE_DEF( raccess )   /* resource fork accessor  (ftrfork.c)  */
 FT_TRACE_DEF( synth )     /* bold/slant synthesizer  (ftsynth.c)  */
+FT_TRACE_DEF( bitmap )    /* bitmap checksum         (ftobjs.c)   */
 
   /* Cache sub-system */
 FT_TRACE_DEF( cache )     /* cache sub-system        (ftcache.c, etc.) */
 
   /* Cache sub-system */
 FT_TRACE_DEF( cache )     /* cache sub-system        (ftcache.c, etc.) */
@@ -73,6 +74,7 @@ FT_TRACE_DEF( t1parse )
   /* PostScript helper module `psaux' */
 FT_TRACE_DEF( t1decode )
 FT_TRACE_DEF( psobjs )
   /* PostScript helper module `psaux' */
 FT_TRACE_DEF( t1decode )
 FT_TRACE_DEF( psobjs )
+FT_TRACE_DEF( psconv )
 
   /* PostScript hinting module `pshinter' */
 FT_TRACE_DEF( pshrec )
 
   /* PostScript hinting module `pshinter' */
 FT_TRACE_DEF( pshrec )
@@ -86,6 +88,10 @@ FT_TRACE_DEF( cffload )
 FT_TRACE_DEF( cffobjs )
 FT_TRACE_DEF( cffparse )
 
 FT_TRACE_DEF( cffobjs )
 FT_TRACE_DEF( cffparse )
 
+FT_TRACE_DEF( cf2blues )
+FT_TRACE_DEF( cf2hints )
+FT_TRACE_DEF( cf2interp )
+
   /* Type 42 driver component */
 FT_TRACE_DEF( t42 )
 
   /* Type 42 driver component */
 FT_TRACE_DEF( t42 )
 
@@ -135,5 +141,12 @@ FT_TRACE_DEF( gxvtrak )
 FT_TRACE_DEF( gxvprop )
 FT_TRACE_DEF( gxvlcar )
 
 FT_TRACE_DEF( gxvprop )
 FT_TRACE_DEF( gxvlcar )
 
+  /* autofit components */
+FT_TRACE_DEF( afmodule )
+FT_TRACE_DEF( afhints )
+FT_TRACE_DEF( afcjk )
+FT_TRACE_DEF( aflatin )
+FT_TRACE_DEF( aflatin2 )
+FT_TRACE_DEF( afwarp )
 
 /* END */
 
 /* END */
index 00cd85e..12ad036 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType validation support (specification).                         */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType validation support (specification).                         */
 /*                                                                         */
-/*  Copyright 2004 by                                                      */
+/*  Copyright 2004, 2013 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -76,6 +76,14 @@ FT_BEGIN_HEADER
   } FT_ValidationLevel;
 
 
   } FT_ValidationLevel;
 
 
+#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */
+  /* We disable the warning `structure was padded due to   */
+  /* __declspec(align())' in order to compile cleanly with */
+  /* the maximum level of warnings.                        */
+#pragma warning( push )
+#pragma warning( disable : 4324 )
+#endif /* _MSC_VER */
+
   /* validator structure */
   typedef struct  FT_ValidatorRec_
   {
   /* validator structure */
   typedef struct  FT_ValidatorRec_
   {
@@ -88,8 +96,11 @@ FT_BEGIN_HEADER
 
   } FT_ValidatorRec;
 
 
   } FT_ValidatorRec;
 
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
 
 
-#define FT_VALIDATOR( x )  ((FT_Validator)( x ))
+#define FT_VALIDATOR( x )  ( (FT_Validator)( x ) )
 
 
   FT_BASE( void )
 
 
   FT_BASE( void )
index f500a65..262afcf 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Internal header files (specification only).                          */
 /*                                                                         */
 /*                                                                         */
 /*    Internal header files (specification only).                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */
+/*  Copyright 1996-2004, 2013 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #define FT_INTERNAL_AUTOHINT_H            <freetype/internal/autohint.h>
 
 
 #define FT_INTERNAL_AUTOHINT_H            <freetype/internal/autohint.h>
 
 
+#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */
+
+  /* We disable the warning `conditional expression is constant' here */
+  /* in order to compile cleanly with the maximum level of warnings.  */
+  /* In particular, the warning complains about stuff like `while(0)' */
+  /* which is very useful in macro definitions.  There is no benefit  */
+  /* in having it enabled.                                            */
+#pragma warning( disable : 4127 )
+
+#endif /* _MSC_VER */
+
+
 /* END */
 /* END */
diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/pcftypes.h b/reactos/lib/3rdparty/freetype/include/freetype/internal/pcftypes.h
deleted file mode 100644 (file)
index 382796f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*  pcftypes.h
-
-  FreeType font driver for pcf fonts
-
-  Copyright (C) 2000, 2001, 2002 by
-  Francesco Zappa Nardelli
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-
-#ifndef __PCFTYPES_H__
-#define __PCFTYPES_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-
-FT_BEGIN_HEADER
-
-
-  typedef struct  PCF_Public_FaceRec_
-  {
-    FT_FaceRec    root;
-    FT_StreamRec  gzip_stream;
-    FT_Stream     gzip_source;
-
-    char*         charset_encoding;
-    char*         charset_registry;
-
-  } PCF_Public_FaceRec, *PCF_Public_Face;
-
-
-FT_END_HEADER
-
-#endif  /* __PCFTYPES_H__ */
-
-
-/* END */
index a96e0df..e903114 100644 (file)
@@ -5,7 +5,7 @@
 /*    Auxiliary functions and data structures related to PostScript fonts  */
 /*    (specification).                                                     */
 /*                                                                         */
 /*    Auxiliary functions and data structures related to PostScript fonts  */
 /*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by             */
+/*  Copyright 1996-2004, 2006, 2008, 2009, 2012 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -101,6 +101,9 @@ FT_BEGIN_HEADER
   /*    capacity  :: The current size of the heap block.  Increments by    */
   /*                 1kByte chunks.                                        */
   /*                                                                       */
   /*    capacity  :: The current size of the heap block.  Increments by    */
   /*                 1kByte chunks.                                        */
   /*                                                                       */
+  /*    init      :: Set to 0xDEADBEEF if `elements' and `lengths' have    */
+  /*                 been allocated.                                       */
+  /*                                                                       */
   /*    max_elems :: The maximum number of elements in table.              */
   /*                                                                       */
   /*    num_elems :: The current number of elements in table.              */
   /*    max_elems :: The maximum number of elements in table.              */
   /*                                                                       */
   /*    num_elems :: The current number of elements in table.              */
@@ -183,6 +186,7 @@ FT_BEGIN_HEADER
     T1_FIELD_TYPE_STRING,
     T1_FIELD_TYPE_KEY,
     T1_FIELD_TYPE_BBOX,
     T1_FIELD_TYPE_STRING,
     T1_FIELD_TYPE_KEY,
     T1_FIELD_TYPE_BBOX,
+    T1_FIELD_TYPE_MM_BBOX,
     T1_FIELD_TYPE_INTEGER_ARRAY,
     T1_FIELD_TYPE_FIXED_ARRAY,
     T1_FIELD_TYPE_CALLBACK,
     T1_FIELD_TYPE_INTEGER_ARRAY,
     T1_FIELD_TYPE_FIXED_ARRAY,
     T1_FIELD_TYPE_CALLBACK,
@@ -225,7 +229,7 @@ FT_BEGIN_HEADER
     T1_Field_ParseFunc  reader;
     FT_UInt             offset;       /* offset of field in object      */
     FT_Byte             size;         /* size of field in bytes         */
     T1_Field_ParseFunc  reader;
     FT_UInt             offset;       /* offset of field in object      */
     FT_Byte             size;         /* size of field in bytes         */
-    FT_UInt             array_max;    /* maximal number of elements for */
+    FT_UInt             array_max;    /* maximum number of elements for */
                                       /* array                          */
     FT_UInt             count_offset; /* offset of element count for    */
                                       /* arrays; must not be zero if in */
                                       /* array                          */
     FT_UInt             count_offset; /* offset of element count for    */
                                       /* arrays; must not be zero if in */
@@ -531,7 +535,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    max_points   :: maximum points in builder outline                  */
   /*                                                                       */
   /*                                                                       */
   /*    max_points   :: maximum points in builder outline                  */
   /*                                                                       */
-  /*    max_contours :: Maximal number of contours in builder outline.     */
+  /*    max_contours :: Maximum number of contours in builder outline.     */
   /*                                                                       */
   /*    pos_x        :: The horizontal translation (if composite glyph).   */
   /*                                                                       */
   /*                                                                       */
   /*    pos_x        :: The horizontal translation (if composite glyph).   */
   /*                                                                       */
index 0c35765..3fb18dc 100644 (file)
@@ -6,7 +6,7 @@
 /*    recorders (specification only).  These are used to support native    */
 /*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */
 /*                                                                         */
 /*    recorders (specification only).  These are used to support native    */
 /*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2009 by                  */
+/*  Copyright 2001-2003, 2005-2007, 2009, 2012 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -679,30 +679,40 @@ FT_BEGIN_HEADER
 
   typedef PSHinter_Interface*  PSHinter_Service;
 
 
   typedef PSHinter_Interface*  PSHinter_Service;
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_,             \
-                                     get_t1_funcs_, get_t2_funcs_)           \
-  static const PSHinter_Interface class_ =                                   \
-  {                                                                          \
-    get_globals_funcs_, get_t1_funcs_, get_t2_funcs_                         \
+#define FT_DEFINE_PSHINTER_INTERFACE(        \
+          class_,                            \
+          get_globals_funcs_,                \
+          get_t1_funcs_,                     \
+          get_t2_funcs_ )                    \
+  static const PSHinter_Interface  class_ =  \
+  {                                          \
+    get_globals_funcs_,                      \
+    get_t1_funcs_,                           \
+    get_t2_funcs_                            \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
-
-#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_,             \
-                                     get_t1_funcs_, get_t2_funcs_)           \
-  void                                                                       \
-  FT_Init_Class_##class_( FT_Library library,                                \
-                          PSHinter_Interface*  clazz)                        \
-  {                                                                          \
-    FT_UNUSED(library);                                                      \
-    clazz->get_globals_funcs = get_globals_funcs_;                           \
-    clazz->get_t1_funcs = get_t1_funcs_;                                     \
-    clazz->get_t2_funcs = get_t2_funcs_;                                     \
-  } 
-
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_PSHINTER_INTERFACE(                      \
+          class_,                                          \
+          get_globals_funcs_,                              \
+          get_t1_funcs_,                                   \
+          get_t2_funcs_ )                                  \
+  void                                                     \
+  FT_Init_Class_ ## class_( FT_Library           library,  \
+                            PSHinter_Interface*  clazz )   \
+  {                                                        \
+    FT_UNUSED( library );                                  \
+                                                           \
+    clazz->get_globals_funcs = get_globals_funcs_;         \
+    clazz->get_t1_funcs      = get_t1_funcs_;              \
+    clazz->get_t2_funcs      = get_t2_funcs_;              \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
 
 FT_END_HEADER
 
 
 FT_END_HEADER
 
index 9264239..0974752 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType BDF services (specification).                           */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType BDF services (specification).                           */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2009, 2012 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -45,25 +45,30 @@ FT_BEGIN_HEADER
     FT_BDF_GetPropertyFunc   get_property;
   };
 
     FT_BDF_GetPropertyFunc   get_property;
   };
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \
-  static const FT_Service_BDFRec class_ =                                \
+#define FT_DEFINE_SERVICE_BDFRec( class_,                                \
+                                  get_charset_id_,                       \
+                                  get_property_ )                        \
+  static const FT_Service_BDFRec  class_ =                               \
   {                                                                      \
     get_charset_id_, get_property_                                       \
   };
 
   {                                                                      \
     get_charset_id_, get_property_                                       \
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
 
 
-#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \
+#define FT_DEFINE_SERVICE_BDFRec( class_,                                \
+                                  get_charset_id_,                       \
+                                  get_property_ )                        \
   void                                                                   \
   void                                                                   \
-  FT_Init_Class_##class_( FT_Service_BDFRec*  clazz )                    \
+  FT_Init_Class_ ## class_( FT_Service_BDFRec*  clazz )                  \
   {                                                                      \
     clazz->get_charset_id = get_charset_id_;                             \
   {                                                                      \
     clazz->get_charset_id = get_charset_id_;                             \
-    clazz->get_property = get_property_;                                 \
-  } 
+    clazz->get_property   = get_property_;                               \
+  }
 
 
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
 
   /* */
 
index 9b874b5..6be3f93 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType CID font services (specification).                      */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType CID font services (specification).                      */
 /*                                                                         */
-/*  Copyright 2007, 2009 by Derek Clegg, Michael Toftdal.                  */
+/*  Copyright 2007, 2009, 2012 by Derek Clegg, Michael Toftdal.            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
@@ -46,30 +46,36 @@ FT_BEGIN_HEADER
     FT_CID_GetCIDFromGlyphIndexFunc           get_cid_from_glyph_index;
   };
 
     FT_CID_GetCIDFromGlyphIndexFunc           get_cid_from_glyph_index;
   };
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_,                           \
-        get_is_cid_, get_cid_from_glyph_index_ )                             \
-  static const FT_Service_CIDRec class_ =                                    \
-  {                                                                          \
-    get_ros_, get_is_cid_, get_cid_from_glyph_index_                         \
+#define FT_DEFINE_SERVICE_CIDREC( class_,                                   \
+                                  get_ros_,                                 \
+                                  get_is_cid_,                              \
+                                  get_cid_from_glyph_index_ )               \
+  static const FT_Service_CIDRec class_ =                                   \
+  {                                                                         \
+    get_ros_, get_is_cid_, get_cid_from_glyph_index_                        \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
-
-#define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_,                           \
-        get_is_cid_, get_cid_from_glyph_index_ )                             \
-  void                                                                       \
-  FT_Init_Class_##class_( FT_Library library,                                \
-                          FT_Service_CIDRec* clazz)                          \
-  {                                                                          \
-    FT_UNUSED(library);                                                      \
-    clazz->get_ros = get_ros_;                                               \
-    clazz->get_is_cid = get_is_cid_;                                         \
-    clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_;             \
-  } 
-
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_CIDREC( class_,                                   \
+                                  get_ros_,                                 \
+                                  get_is_cid_,                              \
+                                  get_cid_from_glyph_index_ )               \
+  void                                                                      \
+  FT_Init_Class_ ## class_( FT_Library          library,                    \
+                            FT_Service_CIDRec*  clazz )                     \
+  {                                                                         \
+    FT_UNUSED( library );                                                   \
+                                                                            \
+    clazz->get_ros                  = get_ros_;                             \
+    clazz->get_is_cid               = get_is_cid_;                          \
+    clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_;            \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
 
   /* */
 
index d66a41d..1d12534 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType glyph dictionary services (specification).              */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType glyph dictionary services (specification).              */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2009, 2012 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -51,27 +51,33 @@ FT_BEGIN_HEADER
     FT_GlyphDict_NameIndexFunc  name_index;  /* optional */
   };
 
     FT_GlyphDict_NameIndexFunc  name_index;  /* optional */
   };
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \
-  static const FT_Service_GlyphDictRec class_ =                        \
+#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_,                        \
+                                        get_name_,                     \
+                                        name_index_)                   \
+  static const FT_Service_GlyphDictRec  class_ =                       \
   {                                                                    \
     get_name_, name_index_                                             \
   };
 
   {                                                                    \
     get_name_, name_index_                                             \
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
 
 
-#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \
+#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_,                        \
+                                        get_name_,                     \
+                                        name_index_)                   \
   void                                                                 \
   void                                                                 \
-  FT_Init_Class_##class_( FT_Library library,                          \
-                          FT_Service_GlyphDictRec* clazz)              \
+  FT_Init_Class_ ## class_( FT_Library                library,         \
+                            FT_Service_GlyphDictRec*  clazz )          \
   {                                                                    \
   {                                                                    \
-    FT_UNUSED(library);                                                \
-    clazz->get_name = get_name_;                                       \
+    FT_UNUSED( library );                                              \
+                                                                       \
+    clazz->get_name   = get_name_;                                     \
     clazz->name_index = name_index_;                                   \
     clazz->name_index = name_index_;                                   \
-  } 
+  }
 
 
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
 
   /* */
 
index 66e1da2..b08a663 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType Multiple Masters and GX var services (specification).   */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType Multiple Masters and GX var services (specification).   */
 /*                                                                         */
-/*  Copyright 2003, 2004 by                                                */
+/*  Copyright 2003, 2004, 2009, 2012 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -68,30 +68,39 @@ FT_BEGIN_HEADER
     FT_Set_Var_Design_Func  set_var_design;
   };
 
     FT_Set_Var_Design_Func  set_var_design;
   };
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_,   \
-        set_mm_blend_, get_mm_var_, set_var_design_)                         \
-  static const FT_Service_MultiMastersRec class_ =                           \
-  {                                                                          \
-    get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_     \
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,                          \
+                                           get_mm_,                         \
+                                           set_mm_design_,                  \
+                                           set_mm_blend_,                   \
+                                           get_mm_var_,                     \
+                                           set_var_design_ )                \
+  static const FT_Service_MultiMastersRec  class_ =                         \
+  {                                                                         \
+    get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_    \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
-
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_,   \
-        set_mm_blend_, get_mm_var_, set_var_design_)                         \
-  void                                                                       \
-  FT_Init_Class_##class_( FT_Service_MultiMastersRec*  clazz )               \
-  {                                                                          \
-    clazz->get_mm = get_mm_;                                                 \
-    clazz->set_mm_design = set_mm_design_;                                   \
-    clazz->set_mm_blend = set_mm_blend_;                                     \
-    clazz->get_mm_var = get_mm_var_;                                         \
-    clazz->set_var_design = set_var_design_;                                 \
-  } 
-
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,                          \
+                                           get_mm_,                         \
+                                           set_mm_design_,                  \
+                                           set_mm_blend_,                   \
+                                           get_mm_var_,                     \
+                                           set_var_design_ )                \
+  void                                                                      \
+  FT_Init_Class_ ## class_( FT_Service_MultiMastersRec*  clazz )            \
+  {                                                                         \
+    clazz->get_mm         = get_mm_;                                        \
+    clazz->set_mm_design  = set_mm_design_;                                 \
+    clazz->set_mm_blend   = set_mm_blend_;                                  \
+    clazz->get_mm_var     = get_mm_var_;                                    \
+    clazz->set_var_design = set_var_design_;                                \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
 
   /* */
 
index 106c54f..a76b4fe 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType PostScript name services (specification).               */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType PostScript name services (specification).               */
 /*                                                                         */
-/*  Copyright 2003, 2007 by                                                */
+/*  Copyright 2003, 2007, 2009, 2012 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -46,26 +46,28 @@ FT_BEGIN_HEADER
     FT_PsName_GetFunc  get_ps_font_name;
   };
 
     FT_PsName_GetFunc  get_ps_font_name;
   };
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \
-  static const FT_Service_PsFontNameRec class_ =                   \
-  {                                                                \
-    get_ps_font_name_                                              \
+#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
+  static const FT_Service_PsFontNameRec  class_ =                    \
+  {                                                                  \
+    get_ps_font_name_                                                \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
 
 
-#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \
-  void                                                             \
-  FT_Init_Class_##class_( FT_Library library,                      \
-                          FT_Service_PsFontNameRec* clazz)         \
-  {                                                                \
-    FT_UNUSED(library);                                            \
-    clazz->get_ps_font_name = get_ps_font_name_;                   \
-  } 
+#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
+  void                                                               \
+  FT_Init_Class_ ## class_( FT_Library                 library,      \
+                            FT_Service_PsFontNameRec*  clazz )       \
+  {                                                                  \
+    FT_UNUSED( library );                                            \
+                                                                     \
+    clazz->get_ps_font_name = get_ps_font_name_;                     \
+  }
 
 
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
 
   /* */
 
diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svprop.h b/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svprop.h
new file mode 100644 (file)
index 0000000..22da0bb
--- /dev/null
@@ -0,0 +1,81 @@
+/***************************************************************************/
+/*                                                                         */
+/*  svprop.h                                                               */
+/*                                                                         */
+/*    The FreeType property service (specification).                       */
+/*                                                                         */
+/*  Copyright 2012 by                                                      */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __SVPROP_H__
+#define __SVPROP_H__
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_PROPERTIES  "properties"
+
+
+  typedef FT_Error
+  (*FT_Properties_SetFunc)( FT_Module    module,
+                            const char*  property_name,
+                            const void*  value );
+
+  typedef FT_Error
+  (*FT_Properties_GetFunc)( FT_Module    module,
+                            const char*  property_name,
+                            void*        value );
+
+
+  FT_DEFINE_SERVICE( Properties )
+  {
+    FT_Properties_SetFunc  set_property;
+    FT_Properties_GetFunc  get_property;
+  };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_PROPERTIESREC( class_,          \
+                                         set_property_,   \
+                                         get_property_ )  \
+  static const FT_Service_PropertiesRec  class_ =         \
+  {                                                       \
+    set_property_,                                        \
+    get_property_                                         \
+  };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_PROPERTIESREC( class_,                \
+                                         set_property_,         \
+                                         get_property_ )        \
+  void                                                          \
+  FT_Init_Class_ ## class_( FT_Service_PropertiesRec*  clazz )  \
+  {                                                             \
+    clazz->set_property = set_property_;                        \
+    clazz->get_property = get_property_;                        \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+  /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVPROP_H__ */
+
+
+/* END */
index 961030c..030948e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType PostScript charmap service (specification).             */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType PostScript charmap service (specification).             */
 /*                                                                         */
-/*  Copyright 2003, 2006 by                                                */
+/*  Copyright 2003, 2006, 2009, 2012 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -120,37 +120,50 @@ FT_BEGIN_HEADER
 
 #ifndef FT_CONFIG_OPTION_PIC
 
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \
-        unicodes_char_index_, unicodes_char_next_, macintosh_name_,          \
-        adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_)     \
-  static const FT_Service_PsCMapsRec class_ =                                \
-  {                                                                          \
-    unicode_value_, unicodes_init_,                                          \
-    unicodes_char_index_, unicodes_char_next_, macintosh_name_,              \
-    adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_          \
+#define FT_DEFINE_SERVICE_PSCMAPSREC( class_,                               \
+                                      unicode_value_,                       \
+                                      unicodes_init_,                       \
+                                      unicodes_char_index_,                 \
+                                      unicodes_char_next_,                  \
+                                      macintosh_name_,                      \
+                                      adobe_std_strings_,                   \
+                                      adobe_std_encoding_,                  \
+                                      adobe_expert_encoding_ )              \
+  static const FT_Service_PsCMapsRec  class_ =                              \
+  {                                                                         \
+    unicode_value_, unicodes_init_,                                         \
+    unicodes_char_index_, unicodes_char_next_, macintosh_name_,             \
+    adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_         \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
-
-#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \
-        unicodes_char_index_, unicodes_char_next_, macintosh_name_,          \
-        adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_)     \
-  void                                                                       \
-  FT_Init_Class_##class_( FT_Library library,                                \
-                          FT_Service_PsCMapsRec* clazz)                      \
-  {                                                                          \
-    FT_UNUSED(library);                                                      \
-    clazz->unicode_value = unicode_value_;                                   \
-    clazz->unicodes_init = unicodes_init_;                                   \
-    clazz->unicodes_char_index = unicodes_char_index_;                       \
-    clazz->unicodes_char_next = unicodes_char_next_;                         \
-    clazz->macintosh_name = macintosh_name_;                                 \
-    clazz->adobe_std_strings = adobe_std_strings_;                           \
-    clazz->adobe_std_encoding = adobe_std_encoding_;                         \
-    clazz->adobe_expert_encoding = adobe_expert_encoding_;                   \
-  } 
-
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_PSCMAPSREC( class_,                               \
+                                      unicode_value_,                       \
+                                      unicodes_init_,                       \
+                                      unicodes_char_index_,                 \
+                                      unicodes_char_next_,                  \
+                                      macintosh_name_,                      \
+                                      adobe_std_strings_,                   \
+                                      adobe_std_encoding_,                  \
+                                      adobe_expert_encoding_ )              \
+  void                                                                      \
+  FT_Init_Class_ ## class_( FT_Library              library,                \
+                            FT_Service_PsCMapsRec*  clazz )                 \
+  {                                                                         \
+    FT_UNUSED( library );                                                   \
+                                                                            \
+    clazz->unicode_value         = unicode_value_;                          \
+    clazz->unicodes_init         = unicodes_init_;                          \
+    clazz->unicodes_char_index   = unicodes_char_index_;                    \
+    clazz->unicodes_char_next    = unicodes_char_next_;                     \
+    clazz->macintosh_name        = macintosh_name_;                         \
+    clazz->adobe_std_strings     = adobe_std_strings_;                      \
+    clazz->adobe_std_encoding    = adobe_std_encoding_;                     \
+    clazz->adobe_expert_encoding = adobe_expert_encoding_;                  \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
 
   /* */
 
index 91ba91e..4bfb506 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType PostScript info service (specification).                */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType PostScript info service (specification).                */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2009 by                                          */
+/*  Copyright 2003, 2004, 2009, 2011, 2012 by                              */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -38,12 +38,19 @@ FT_BEGIN_HEADER
                           PS_FontExtraRec*  afont_extra );
 
   typedef FT_Int
                           PS_FontExtraRec*  afont_extra );
 
   typedef FT_Int
-  (*PS_HasGlyphNamesFunc)( FT_Face   face );
+  (*PS_HasGlyphNamesFunc)( FT_Face  face );
 
   typedef FT_Error
   (*PS_GetFontPrivateFunc)( FT_Face         face,
                             PS_PrivateRec*  afont_private );
 
 
   typedef FT_Error
   (*PS_GetFontPrivateFunc)( FT_Face         face,
                             PS_PrivateRec*  afont_private );
 
+  typedef FT_Long
+  (*PS_GetFontValueFunc)( FT_Face       face,
+                          PS_Dict_Keys  key,
+                          FT_UInt       idx,
+                          void         *value,
+                          FT_Long       value_len );
+
 
   FT_DEFINE_SERVICE( PsInfo )
   {
 
   FT_DEFINE_SERVICE( PsInfo )
   {
@@ -51,34 +58,46 @@ FT_BEGIN_HEADER
     PS_GetFontExtraFunc    ps_get_font_extra;
     PS_HasGlyphNamesFunc   ps_has_glyph_names;
     PS_GetFontPrivateFunc  ps_get_font_private;
     PS_GetFontExtraFunc    ps_get_font_extra;
     PS_HasGlyphNamesFunc   ps_has_glyph_names;
     PS_GetFontPrivateFunc  ps_get_font_private;
+    PS_GetFontValueFunc    ps_get_font_value;
   };
 
   };
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_,      \
-        ps_get_font_extra_, has_glyph_names_, get_font_private_) \
-  static const FT_Service_PsInfoRec class_ =                     \
+#define FT_DEFINE_SERVICE_PSINFOREC( class_,                     \
+                                     get_font_info_,             \
+                                     ps_get_font_extra_,         \
+                                     has_glyph_names_,           \
+                                     get_font_private_,          \
+                                     get_font_value_ )           \
+  static const FT_Service_PsInfoRec  class_ =                    \
   {                                                              \
     get_font_info_, ps_get_font_extra_, has_glyph_names_,        \
   {                                                              \
     get_font_info_, ps_get_font_extra_, has_glyph_names_,        \
-    get_font_private_                                            \
+    get_font_private_, get_font_value_                           \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
 
 
-#define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_,      \
-        ps_get_font_extra_, has_glyph_names_, get_font_private_) \
+#define FT_DEFINE_SERVICE_PSINFOREC( class_,                     \
+                                     get_font_info_,             \
+                                     ps_get_font_extra_,         \
+                                     has_glyph_names_,           \
+                                     get_font_private_,          \
+                                     get_font_value_ )           \
   void                                                           \
   void                                                           \
-  FT_Init_Class_##class_( FT_Library library,                    \
-                          FT_Service_PsInfoRec*  clazz)          \
+  FT_Init_Class_ ## class_( FT_Library             library,      \
+                            FT_Service_PsInfoRec*  clazz )       \
   {                                                              \
   {                                                              \
-    FT_UNUSED(library);                                          \
-    clazz->ps_get_font_info = get_font_info_;                    \
-    clazz->ps_get_font_extra = ps_get_font_extra_;               \
-    clazz->ps_has_glyph_names = has_glyph_names_;                \
+    FT_UNUSED( library );                                        \
+                                                                 \
+    clazz->ps_get_font_info    = get_font_info_;                 \
+    clazz->ps_get_font_extra   = ps_get_font_extra_;             \
+    clazz->ps_has_glyph_names  = has_glyph_names_;               \
     clazz->ps_get_font_private = get_font_private_;              \
     clazz->ps_get_font_private = get_font_private_;              \
-  } 
+    clazz->ps_get_font_value   = get_font_value_;                \
+  }
 
 
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
 
   /* */
 
index 30bb162..d3835aa 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType SFNT table loading service (specification).             */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType SFNT table loading service (specification).             */
 /*                                                                         */
-/*  Copyright 2003, 2004 by                                                */
+/*  Copyright 2003, 2004, 2009, 2012 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -69,26 +69,27 @@ FT_BEGIN_HEADER
     FT_SFNT_TableInfoFunc  table_info;
   };
 
     FT_SFNT_TableInfoFunc  table_info;
   };
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_)  \
-  static const FT_Service_SFNT_TableRec class_ =                     \
-  {                                                                  \
-    load_, get_, info_                                               \
+#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ )  \
+  static const FT_Service_SFNT_TableRec  class_ =                      \
+  {                                                                    \
+    load_, get_, info_                                                 \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
 
 
-#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \
-  void                                                              \
-  FT_Init_Class_##class_( FT_Service_SFNT_TableRec*  clazz )        \
-  {                                                                 \
-    clazz->load_table = load_;                                      \
-    clazz->get_table = get_;                                        \
-    clazz->table_info = info_;                                      \
-  } 
+#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
+  void                                                                \
+  FT_Init_Class_ ## class_( FT_Service_SFNT_TableRec*  clazz )        \
+  {                                                                   \
+    clazz->load_table = load_;                                        \
+    clazz->get_table  = get_;                                         \
+    clazz->table_info = info_;                                        \
+  }
 
 
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
 
   /* */
 
index 8af0035..83994aa 100644 (file)
@@ -7,7 +7,7 @@
 /*  Copyright 2003 by                                                      */
 /*  Masatake YAMATO, Redhat K.K.                                           */
 /*                                                                         */
 /*  Copyright 2003 by                                                      */
 /*  Masatake YAMATO, Redhat K.K.                                           */
 /*                                                                         */
-/*  Copyright 2003, 2008 by                                                */
+/*  Copyright 2003, 2008, 2009, 2012 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -31,7 +31,7 @@
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
 
 
-#define FT_SERVICE_ID_TT_CMAP "tt-cmaps"
+#define FT_SERVICE_ID_TT_CMAP  "tt-cmaps"
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
@@ -58,8 +58,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  TT_CMapInfo_
   {
   /*                                                                       */
   typedef struct  TT_CMapInfo_
   {
-    FT_ULong language;
-    FT_Long  format;
+    FT_ULong  language;
+    FT_Long   format;
 
   } TT_CMapInfo;
 
 
   } TT_CMapInfo;
 
@@ -76,24 +76,25 @@ FT_BEGIN_HEADER
 
 #ifndef FT_CONFIG_OPTION_PIC
 
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_)  \
-  static const FT_Service_TTCMapsRec class_ =                 \
-  {                                                           \
-    get_cmap_info_                                            \
+#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \
+  static const FT_Service_TTCMapsRec  class_ =                  \
+  {                                                             \
+    get_cmap_info_                                              \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
 
 
-#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \
-  void                                                       \
-  FT_Init_Class_##class_( FT_Library library,                \
-                          FT_Service_TTCMapsRec*  clazz)     \
-  {                                                          \
-    FT_UNUSED(library);                                      \
-    clazz->get_cmap_info = get_cmap_info_;                   \
-  } 
+#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \
+  void                                                          \
+  FT_Init_Class_ ## class_( FT_Library              library,    \
+                            FT_Service_TTCMapsRec*  clazz )     \
+  {                                                             \
+    FT_UNUSED( library );                                       \
+                                                                \
+    clazz->get_cmap_info = get_cmap_info_;                      \
+  }
 
 
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
 
   /* */
 
index ab2dc9a..369eb84 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType TrueType glyph service.                                 */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType TrueType glyph service.                                 */
 /*                                                                         */
-/*  Copyright 2007 by David Turner.                                        */
+/*  Copyright 2007, 2009, 2012 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      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
@@ -24,7 +24,7 @@
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
 
 
-#define FT_SERVICE_ID_TT_GLYF "tt-glyf"
+#define FT_SERVICE_ID_TT_GLYF  "tt-glyf"
 
 
   typedef FT_ULong
 
 
   typedef FT_ULong
@@ -37,24 +37,25 @@ FT_BEGIN_HEADER
     TT_Glyf_GetLocationFunc  get_location;
   };
 
     TT_Glyf_GetLocationFunc  get_location;
   };
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ )   \
-  static const FT_Service_TTGlyfRec class_ =                  \
+#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ )  \
+  static const FT_Service_TTGlyfRec  class_ =                 \
   {                                                           \
     get_location_                                             \
   };
 
   {                                                           \
     get_location_                                             \
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
 
 
-#define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ )   \
+#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ )  \
   void                                                        \
   void                                                        \
-  FT_Init_Class_##class_( FT_Service_TTGlyfRec*  clazz )      \
+  FT_Init_Class_ ## class_( FT_Service_TTGlyfRec*  clazz )    \
   {                                                           \
     clazz->get_location = get_location_;                      \
   {                                                           \
     clazz->get_location = get_location_;                      \
-  } 
+  }
 
 
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
 
   /* */
 
index 6326deb..6b5e41f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    High-level `sfnt' driver interface (specification).                  */
 /*                                                                         */
 /*                                                                         */
 /*    High-level `sfnt' driver interface (specification).                  */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
+/*  Copyright 1996-2006, 2009, 2012-2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -125,77 +125,6 @@ FT_BEGIN_HEADER
   (*TT_Done_Face_Func)( TT_Face  face );
 
 
   (*TT_Done_Face_Func)( TT_Face  face );
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <FuncType>                                                            */
-  /*    TT_Load_SFNT_HeaderRec_Func                                        */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads the header of a SFNT font file.  Supports collections.       */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face       :: A handle to the target face object.                  */
-  /*                                                                       */
-  /*    stream     :: The input stream.                                    */
-  /*                                                                       */
-  /*    face_index :: The index of the TrueType font, if we are opening a  */
-  /*                  collection.                                          */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    sfnt       :: The SFNT header.                                     */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    The stream cursor must be at the font file's origin.               */
-  /*                                                                       */
-  /*    This function recognizes fonts embedded in a `TrueType             */
-  /*    collection'.                                                       */
-  /*                                                                       */
-  /*    This function checks that the header is valid by looking at the    */
-  /*    values of `search_range', `entry_selector', and `range_shift'.     */
-  /*                                                                       */
-  typedef FT_Error
-  (*TT_Load_SFNT_HeaderRec_Func)( TT_Face      face,
-                                  FT_Stream    stream,
-                                  FT_Long      face_index,
-                                  SFNT_Header  sfnt );
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <FuncType>                                                            */
-  /*    TT_Load_Directory_Func                                             */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads the table directory into a face object.                      */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face   :: A handle to the target face object.                      */
-  /*                                                                       */
-  /*    stream :: The input stream.                                        */
-  /*                                                                       */
-  /*    sfnt   :: The SFNT header.                                         */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    The stream cursor must be on the first byte after the 4-byte font  */
-  /*    format tag.  This is the case just after a call to                 */
-  /*    TT_Load_Format_Tag().                                              */
-  /*                                                                       */
-  typedef FT_Error
-  (*TT_Load_Directory_Func)( TT_Face      face,
-                             FT_Stream    stream,
-                             SFNT_Header  sfnt );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
   /*************************************************************************/
   /*                                                                       */
   /* <FuncType>                                                            */
   /*************************************************************************/
   /*                                                                       */
   /* <FuncType>                                                            */
@@ -363,88 +292,6 @@ FT_BEGIN_HEADER
                               TT_SBit_MetricsRec  *ametrics );
 
 
                               TT_SBit_MetricsRec  *ametrics );
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <FuncType>                                                            */
-  /*    TT_Set_SBit_Strike_OldFunc                                         */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Select an sbit strike for a given size request.                    */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face          :: The target face object.                           */
-  /*                                                                       */
-  /*    req           :: The size request.                                 */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    astrike_index :: The index of the sbit strike.                     */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.  Returns an error if no     */
-  /*    sbit strike exists for the selected ppem values.                   */
-  /*                                                                       */
-  typedef FT_Error
-  (*TT_Set_SBit_Strike_OldFunc)( TT_Face    face,
-                                 FT_UInt    x_ppem,
-                                 FT_UInt    y_ppem,
-                                 FT_ULong*  astrike_index );
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <FuncType>                                                            */
-  /*    TT_CharMap_Load_Func                                               */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads a given TrueType character map into memory.                  */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face   :: A handle to the parent face object.                      */
-  /*                                                                       */
-  /*    stream :: A handle to the current stream object.                   */
-  /*                                                                       */
-  /* <InOut>                                                               */
-  /*    cmap   :: A pointer to a cmap object.                              */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    The function assumes that the stream is already in use (i.e.,      */
-  /*    opened).  In case of error, all partially allocated tables are     */
-  /*    released.                                                          */
-  /*                                                                       */
-  typedef FT_Error
-  (*TT_CharMap_Load_Func)( TT_Face    face,
-                           void*      cmap,
-                           FT_Stream  input );
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <FuncType>                                                            */
-  /*    TT_CharMap_Free_Func                                               */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Destroys a character mapping table.                                */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face :: A handle to the parent face object.                        */
-  /*                                                                       */
-  /*    cmap :: A handle to a cmap object.                                 */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  typedef FT_Error
-  (*TT_CharMap_Free_Func)( TT_Face       face,
-                           void*         cmap );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
   /*************************************************************************/
   /*                                                                       */
   /* <FuncType>                                                            */
   /*************************************************************************/
   /*                                                                       */
   /* <FuncType>                                                            */
@@ -657,11 +504,6 @@ FT_BEGIN_HEADER
 
     TT_Load_Any_Func             load_any;
 
 
     TT_Load_Any_Func             load_any;
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    TT_Load_SFNT_HeaderRec_Func  load_sfnt_header;
-    TT_Load_Directory_Func       load_directory;
-#endif
-
     /* these functions are called by `load_face' but they can also  */
     /* be called from external modules, if there is a need to do so */
     TT_Load_Table_Func           load_head;
     /* these functions are called by `load_face' but they can also  */
     /* be called from external modules, if there is a need to do so */
     TT_Load_Table_Func           load_head;
@@ -674,12 +516,6 @@ FT_BEGIN_HEADER
     TT_Load_Table_Func           load_name;
     TT_Free_Table_Func           free_name;
 
     TT_Load_Table_Func           load_name;
     TT_Free_Table_Func           free_name;
 
-    /* optional tables */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    TT_Load_Table_Func           load_hdmx_stub;
-    TT_Free_Table_Func           free_hdmx_stub;
-#endif
-
     /* this field was called `load_kerning' up to version 2.1.10 */
     TT_Load_Table_Func           load_kern;
 
     /* this field was called `load_kerning' up to version 2.1.10 */
     TT_Load_Table_Func           load_kern;
 
@@ -690,43 +526,12 @@ FT_BEGIN_HEADER
     /* version 2.1.10                                                   */
     TT_Load_Table_Func           load_bhed;
 
     /* version 2.1.10                                                   */
     TT_Load_Table_Func           load_bhed;
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-    /* see `ttsbit.h' */
-    TT_Set_SBit_Strike_OldFunc   set_sbit_strike_stub;
-    TT_Load_Table_Func           load_sbits_stub;
-
-    /*
-     *  The following two fields appeared in version 2.1.8, and were placed
-     *  between `load_sbits' and `load_sbit_image'.  We support them as a
-     *  special exception since they are used by Xfont library within the
-     *  X.Org xserver, and because the probability that other rogue clients
-     *  use the other version 2.1.7 fields below is _extremely_ low.
-     *
-     *  Note that this forces us to disable an interesting memory-saving
-     *  optimization though...
-     */
-
-    TT_Find_SBit_Image_Func      find_sbit_image;
-    TT_Load_SBit_Metrics_Func    load_sbit_metrics;
-
-#endif
-
     TT_Load_SBit_Image_Func      load_sbit_image;
 
     TT_Load_SBit_Image_Func      load_sbit_image;
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    TT_Free_Table_Func           free_sbits_stub;
-#endif
-
     /* see `ttpost.h' */
     TT_Get_PS_Name_Func          get_psname;
     TT_Free_Table_Func           free_psnames;
 
     /* see `ttpost.h' */
     TT_Get_PS_Name_Func          get_psname;
     TT_Free_Table_Func           free_psnames;
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    TT_CharMap_Load_Func         load_charmap_stub;
-    TT_CharMap_Free_Func         free_charmap_stub;
-#endif
-
     /* starting here, the structure differs from version 2.1.7 */
 
     /* this field was introduced in version 2.1.8, named `get_psname' */
     /* starting here, the structure differs from version 2.1.7 */
 
     /* this field was introduced in version 2.1.8, named `get_psname' */
@@ -755,139 +560,144 @@ FT_BEGIN_HEADER
 
 #ifndef FT_CONFIG_OPTION_PIC
 
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a) \
-  a, 
-#else
-  #define FT_DEFINE_DRIVERS_OLD_INTERNAL(a)
-#endif
-#define FT_INTERNAL(a) \
-  a, 
-
-#define FT_DEFINE_SFNT_INTERFACE(class_,                                     \
-    goto_table_, init_face_, load_face_, done_face_, get_interface_,         \
-    load_any_, load_sfnt_header_, load_directory_, load_head_,               \
-    load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_,               \
-    load_name_, free_name_, load_hdmx_stub_, free_hdmx_stub_,                \
-    load_kern_, load_gasp_, load_pclt_, load_bhed_,                          \
-    set_sbit_strike_stub_, load_sbits_stub_, find_sbit_image_,               \
-    load_sbit_metrics_, load_sbit_image_, free_sbits_stub_,                  \
-    get_psname_, free_psnames_, load_charmap_stub_, free_charmap_stub_,      \
-    get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_,        \
-    set_sbit_strike_, load_strike_metrics_, get_metrics_ )                   \
-  static const SFNT_Interface class_ =                                       \
-  {                                                                          \
-    FT_INTERNAL(goto_table_) \
-    FT_INTERNAL(init_face_) \
-    FT_INTERNAL(load_face_) \
-    FT_INTERNAL(done_face_) \
-    FT_INTERNAL(get_interface_) \
-    FT_INTERNAL(load_any_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sfnt_header_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_directory_) \
-    FT_INTERNAL(load_head_) \
-    FT_INTERNAL(load_hhea_) \
-    FT_INTERNAL(load_cmap_) \
-    FT_INTERNAL(load_maxp_) \
-    FT_INTERNAL(load_os2_) \
-    FT_INTERNAL(load_post_) \
-    FT_INTERNAL(load_name_) \
-    FT_INTERNAL(free_name_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_hdmx_stub_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_hdmx_stub_) \
-    FT_INTERNAL(load_kern_) \
-    FT_INTERNAL(load_gasp_) \
-    FT_INTERNAL(load_pclt_) \
-    FT_INTERNAL(load_bhed_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(set_sbit_strike_stub_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbits_stub_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(find_sbit_image_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbit_metrics_) \
-    FT_INTERNAL(load_sbit_image_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_sbits_stub_) \
-    FT_INTERNAL(get_psname_) \
-    FT_INTERNAL(free_psnames_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_charmap_stub_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_charmap_stub_) \
-    FT_INTERNAL(get_kerning_) \
-    FT_INTERNAL(load_font_dir_) \
-    FT_INTERNAL(load_hmtx_) \
-    FT_INTERNAL(load_eblc_) \
-    FT_INTERNAL(free_eblc_) \
-    FT_INTERNAL(set_sbit_strike_) \
-    FT_INTERNAL(load_strike_metrics_) \
-    FT_INTERNAL(get_metrics_) \
+#define FT_DEFINE_SFNT_INTERFACE(        \
+          class_,                        \
+          goto_table_,                   \
+          init_face_,                    \
+          load_face_,                    \
+          done_face_,                    \
+          get_interface_,                \
+          load_any_,                     \
+          load_head_,                    \
+          load_hhea_,                    \
+          load_cmap_,                    \
+          load_maxp_,                    \
+          load_os2_,                     \
+          load_post_,                    \
+          load_name_,                    \
+          free_name_,                    \
+          load_kern_,                    \
+          load_gasp_,                    \
+          load_pclt_,                    \
+          load_bhed_,                    \
+          load_sbit_image_,              \
+          get_psname_,                   \
+          free_psnames_,                 \
+          get_kerning_,                  \
+          load_font_dir_,                \
+          load_hmtx_,                    \
+          load_eblc_,                    \
+          free_eblc_,                    \
+          set_sbit_strike_,              \
+          load_strike_metrics_,          \
+          get_metrics_ )                 \
+  static const SFNT_Interface  class_ =  \
+  {                                      \
+    goto_table_,                         \
+    init_face_,                          \
+    load_face_,                          \
+    done_face_,                          \
+    get_interface_,                      \
+    load_any_,                           \
+    load_head_,                          \
+    load_hhea_,                          \
+    load_cmap_,                          \
+    load_maxp_,                          \
+    load_os2_,                           \
+    load_post_,                          \
+    load_name_,                          \
+    free_name_,                          \
+    load_kern_,                          \
+    load_gasp_,                          \
+    load_pclt_,                          \
+    load_bhed_,                          \
+    load_sbit_image_,                    \
+    get_psname_,                         \
+    free_psnames_,                       \
+    get_kerning_,                        \
+    load_font_dir_,                      \
+    load_hmtx_,                          \
+    load_eblc_,                          \
+    free_eblc_,                          \
+    set_sbit_strike_,                    \
+    load_strike_metrics_,                \
+    get_metrics_,                        \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
-
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a, a_) \
-  clazz->a = a_;
-#else
-  #define FT_DEFINE_DRIVERS_OLD_INTERNAL(a, a_)
-#endif
-#define FT_INTERNAL(a, a_) \
-  clazz->a = a_;
-
-#define FT_DEFINE_SFNT_INTERFACE(class_,                                     \
-    goto_table_, init_face_, load_face_, done_face_, get_interface_,         \
-    load_any_, load_sfnt_header_, load_directory_, load_head_,               \
-    load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_,               \
-    load_name_, free_name_, load_hdmx_stub_, free_hdmx_stub_,                \
-    load_kern_, load_gasp_, load_pclt_, load_bhed_,                          \
-    set_sbit_strike_stub_, load_sbits_stub_, find_sbit_image_,               \
-    load_sbit_metrics_, load_sbit_image_, free_sbits_stub_,                  \
-    get_psname_, free_psnames_, load_charmap_stub_, free_charmap_stub_,      \
-    get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_,        \
-    set_sbit_strike_, load_strike_metrics_, get_metrics_ )                   \
-  void                                                                       \
-  FT_Init_Class_##class_( FT_Library library, SFNT_Interface*  clazz )       \
-  {                                                                          \
-    FT_UNUSED(library);                                                      \
-    FT_INTERNAL(goto_table,goto_table_) \
-    FT_INTERNAL(init_face,init_face_) \
-    FT_INTERNAL(load_face,load_face_) \
-    FT_INTERNAL(done_face,done_face_) \
-    FT_INTERNAL(get_interface,get_interface_) \
-    FT_INTERNAL(load_any,load_any_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sfnt_header,load_sfnt_header_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_directory,load_directory_) \
-    FT_INTERNAL(load_head,load_head_) \
-    FT_INTERNAL(load_hhea,load_hhea_) \
-    FT_INTERNAL(load_cmap,load_cmap_) \
-    FT_INTERNAL(load_maxp,load_maxp_) \
-    FT_INTERNAL(load_os2,load_os2_) \
-    FT_INTERNAL(load_post,load_post_) \
-    FT_INTERNAL(load_name,load_name_) \
-    FT_INTERNAL(free_name,free_name_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_hdmx_stub,load_hdmx_stub_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_hdmx_stub,free_hdmx_stub_) \
-    FT_INTERNAL(load_kern,load_kern_) \
-    FT_INTERNAL(load_gasp,load_gasp_) \
-    FT_INTERNAL(load_pclt,load_pclt_) \
-    FT_INTERNAL(load_bhed,load_bhed_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(set_sbit_strike_stub,set_sbit_strike_stub_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbits_stub,load_sbits_stub_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(find_sbit_image,find_sbit_image_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbit_metrics,load_sbit_metrics_) \
-    FT_INTERNAL(load_sbit_image,load_sbit_image_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_sbits_stub,free_sbits_stub_) \
-    FT_INTERNAL(get_psname,get_psname_) \
-    FT_INTERNAL(free_psnames,free_psnames_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_charmap_stub,load_charmap_stub_) \
-    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_charmap_stub,free_charmap_stub_) \
-    FT_INTERNAL(get_kerning,get_kerning_) \
-    FT_INTERNAL(load_font_dir,load_font_dir_) \
-    FT_INTERNAL(load_hmtx,load_hmtx_) \
-    FT_INTERNAL(load_eblc,load_eblc_) \
-    FT_INTERNAL(free_eblc,free_eblc_) \
-    FT_INTERNAL(set_sbit_strike,set_sbit_strike_) \
-    FT_INTERNAL(load_strike_metrics,load_strike_metrics_) \
-    FT_INTERNAL(get_metrics,get_metrics_) \
-  } 
-
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_INTERNAL( a, a_ )  \
+          clazz->a = a_;
+
+#define FT_DEFINE_SFNT_INTERFACE(                       \
+          class_,                                       \
+          goto_table_,                                  \
+          init_face_,                                   \
+          load_face_,                                   \
+          done_face_,                                   \
+          get_interface_,                               \
+          load_any_,                                    \
+          load_head_,                                   \
+          load_hhea_,                                   \
+          load_cmap_,                                   \
+          load_maxp_,                                   \
+          load_os2_,                                    \
+          load_post_,                                   \
+          load_name_,                                   \
+          free_name_,                                   \
+          load_kern_,                                   \
+          load_gasp_,                                   \
+          load_pclt_,                                   \
+          load_bhed_,                                   \
+          load_sbit_image_,                             \
+          get_psname_,                                  \
+          free_psnames_,                                \
+          get_kerning_,                                 \
+          load_font_dir_,                               \
+          load_hmtx_,                                   \
+          load_eblc_,                                   \
+          free_eblc_,                                   \
+          set_sbit_strike_,                             \
+          load_strike_metrics_,                         \
+          get_metrics_ )                                \
+  void                                                  \
+  FT_Init_Class_ ## class_( FT_Library       library,   \
+                            SFNT_Interface*  clazz )    \
+  {                                                     \
+    FT_UNUSED( library );                               \
+                                                        \
+    clazz->goto_table          = goto_table_;           \
+    clazz->init_face           = init_face_;            \
+    clazz->load_face           = load_face_;            \
+    clazz->done_face           = done_face_;            \
+    clazz->get_interface       = get_interface_;        \
+    clazz->load_any            = load_any_;             \
+    clazz->load_head           = load_head_;            \
+    clazz->load_hhea           = load_hhea_;            \
+    clazz->load_cmap           = load_cmap_;            \
+    clazz->load_maxp           = load_maxp_;            \
+    clazz->load_os2            = load_os2_;             \
+    clazz->load_post           = load_post_;            \
+    clazz->load_name           = load_name_;            \
+    clazz->free_name           = free_name_;            \
+    clazz->load_kern           = load_kern_;            \
+    clazz->load_gasp           = load_gasp_;            \
+    clazz->load_pclt           = load_pclt_;            \
+    clazz->load_bhed           = load_bhed_;            \
+    clazz->load_sbit_image     = load_sbit_image_;      \
+    clazz->get_psname          = get_psname_;           \
+    clazz->free_psnames        = free_psnames_;         \
+    clazz->get_kerning         = get_kerning_;          \
+    clazz->load_font_dir       = load_font_dir_;        \
+    clazz->load_hmtx           = load_hmtx_;            \
+    clazz->load_eblc           = load_eblc_;            \
+    clazz->free_eblc           = free_eblc_;            \
+    clazz->set_sbit_strike     = set_sbit_strike_;      \
+    clazz->load_strike_metrics = load_strike_metrics_;  \
+    clazz->get_metrics         = get_metrics_;          \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
 
 FT_END_HEADER
 
 
 FT_END_HEADER
 
index 5f73063..e20237c 100644 (file)
@@ -5,7 +5,7 @@
 /*    Basic Type1/Type2 type definitions and interface (specification      */
 /*    only).                                                               */
 /*                                                                         */
 /*    Basic Type1/Type2 type definitions and interface (specification      */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by             */
+/*  Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -78,17 +78,6 @@ FT_BEGIN_HEADER
   } T1_EncodingRec, *T1_Encoding;
 
 
   } T1_EncodingRec, *T1_Encoding;
 
 
-  typedef enum  T1_EncodingType_
-  {
-    T1_ENCODING_TYPE_NONE = 0,
-    T1_ENCODING_TYPE_ARRAY,
-    T1_ENCODING_TYPE_STANDARD,
-    T1_ENCODING_TYPE_ISOLATIN1,
-    T1_ENCODING_TYPE_EXPERT
-
-  } T1_EncodingType;
-
-
   /* used to hold extra data of PS_FontInfoRec that
    * cannot be stored in the publicly defined structure.
    *
   /* used to hold extra data of PS_FontInfoRec that
    * cannot be stored in the publicly defined structure.
    *
@@ -216,10 +205,6 @@ FT_BEGIN_HEADER
     FT_CharMapRec   charmaprecs[2];
     FT_CharMap      charmaps[2];
 
     FT_CharMapRec   charmaprecs[2];
     FT_CharMap      charmaps[2];
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    PS_Unicodes     unicode_map;
-#endif
-
     /* support for Multiple Masters fonts */
     PS_Blend        blend;
 
     /* support for Multiple Masters fonts */
     PS_Blend        blend;
 
index acbb863..1bbfe49 100644 (file)
@@ -5,7 +5,7 @@
 /*    Basic SFNT/TrueType type definitions and interface (specification    */
 /*    only).                                                               */
 /*                                                                         */
 /*    Basic SFNT/TrueType type definitions and interface (specification    */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008 by             */
+/*  Copyright 1996-2002, 2004-2008, 2012-2013 by                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -311,87 +311,6 @@ FT_BEGIN_HEADER
   } TT_GaspRec;
 
 
   } TT_GaspRec;
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    TT_HdmxEntryRec                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A small structure used to model the pre-computed widths of a given */
-  /*    size.  They are found in the `hdmx' table.                         */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    ppem      :: The pixels per EM value at which these metrics apply. */
-  /*                                                                       */
-  /*    max_width :: The maximum advance width for this metric.            */
-  /*                                                                       */
-  /*    widths    :: An array of widths.  Note: These are 8-bit bytes.     */
-  /*                                                                       */
-  typedef struct  TT_HdmxEntryRec_
-  {
-    FT_Byte   ppem;
-    FT_Byte   max_width;
-    FT_Byte*  widths;
-
-  } TT_HdmxEntryRec, *TT_HdmxEntry;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    TT_HdmxRec                                                         */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A structure used to model the `hdmx' table, which contains         */
-  /*    pre-computed widths for a set of given sizes/dimensions.           */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    version     :: The version number.                                 */
-  /*                                                                       */
-  /*    num_records :: The number of hdmx records.                         */
-  /*                                                                       */
-  /*    records     :: An array of hdmx records.                           */
-  /*                                                                       */
-  typedef struct  TT_HdmxRec_
-  {
-    FT_UShort     version;
-    FT_Short      num_records;
-    TT_HdmxEntry  records;
-
-  } TT_HdmxRec, *TT_Hdmx;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    TT_Kern0_PairRec                                                   */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A structure used to model a kerning pair for the kerning table     */
-  /*    format 0.  The engine now loads this table if it finds one in the  */
-  /*    font file.                                                         */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    left  :: The index of the left glyph in pair.                      */
-  /*                                                                       */
-  /*    right :: The index of the right glyph in pair.                     */
-  /*                                                                       */
-  /*    value :: The kerning distance.  A positive value spaces the        */
-  /*             glyphs, a negative one makes them closer.                 */
-  /*                                                                       */
-  typedef struct  TT_Kern0_PairRec_
-  {
-    FT_UShort  left;   /* index of left  glyph in pair */
-    FT_UShort  right;  /* index of right glyph in pair */
-    FT_FWord   value;  /* kerning value                */
-
-  } TT_Kern0_PairRec, *TT_Kern0_Pair;
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
@@ -1269,9 +1188,6 @@ FT_BEGIN_HEADER
     TT_HoriHeader         horizontal;   /* TrueType horizontal header     */
 
     TT_MaxProfile         max_profile;
     TT_HoriHeader         horizontal;   /* TrueType horizontal header     */
 
     TT_MaxProfile         max_profile;
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    FT_ULong              max_components;  /* stubbed to 0 */
-#endif
 
     FT_Bool               vertical_info;
     TT_VertHeader         vertical;     /* TT Vertical header, if present */
 
     FT_Bool               vertical_info;
     TT_VertHeader         vertical;     /* TT Vertical header, if present */
@@ -1308,11 +1224,6 @@ FT_BEGIN_HEADER
     /*                                                                     */
     /***********************************************************************/
 
     /*                                                                     */
     /***********************************************************************/
 
-    /* horizontal device metrics */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    TT_HdmxRec            hdmx;
-#endif
-
     /* grid-fitting and scaling table */
     TT_GaspRec            gasp;                 /* the `gasp' table */
 
     /* grid-fitting and scaling table */
     TT_GaspRec            gasp;                 /* the `gasp' table */
 
@@ -1320,11 +1231,6 @@ FT_BEGIN_HEADER
     TT_PCLT               pclt;
 
     /* embedded bitmaps support */
     TT_PCLT               pclt;
 
     /* embedded bitmaps support */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    FT_ULong              num_sbit_strikes;
-    TT_SBit_Strike        sbit_strikes;
-#endif
-
     FT_ULong              num_sbit_scales;
     TT_SBit_Scale         sbit_scales;
 
     FT_ULong              num_sbit_scales;
     TT_SBit_Scale         sbit_scales;
 
@@ -1338,12 +1244,6 @@ FT_BEGIN_HEADER
     /*                                                                     */
     /***********************************************************************/
 
     /*                                                                     */
     /***********************************************************************/
 
-    /* the glyph locations */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    FT_UShort             num_locations_stub;
-    FT_Long*              glyph_locations_stub;
-#endif
-
     /* the font program, if any */
     FT_ULong              font_program_size;
     FT_Byte*              font_program;
     /* the font program, if any */
     FT_ULong              font_program_size;
     FT_Byte*              font_program;
@@ -1356,13 +1256,6 @@ FT_BEGIN_HEADER
     FT_ULong              cvt_size;
     FT_Short*             cvt;
 
     FT_ULong              cvt_size;
     FT_Short*             cvt;
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    /* the format 0 kerning table, if any */
-    FT_Int                num_kern_pairs;
-    FT_Int                kern_table_index;
-    TT_Kern0_Pair         kern_pairs;
-#endif
-
     /* A pointer to the bytecode interpreter to use.  This is also */
     /* used to hook the debugger for the `ttdebug' utility.        */
     TT_Interpreter        interpreter;
     /* A pointer to the bytecode interpreter to use.  This is also */
     /* used to hook the debugger for the `ttdebug' utility.        */
     TT_Interpreter        interpreter;
@@ -1383,11 +1276,8 @@ FT_BEGIN_HEADER
 
     const char*           postscript_name;
 
 
     const char*           postscript_name;
 
-    /* since version 2.1.8, but was originally placed after */
-    /* `glyph_locations_stub'                               */
     FT_ULong              glyf_len;
 
     FT_ULong              glyf_len;
 
-    /* since version 2.1.8, but was originally placed before `extra' */
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
     FT_Bool               doblend;
     GX_Blend              blend;
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
     FT_Bool               doblend;
     GX_Blend              blend;
@@ -1401,7 +1291,7 @@ FT_BEGIN_HEADER
     FT_Byte*              vert_metrics;
     FT_ULong              vert_metrics_size;
 
     FT_Byte*              vert_metrics;
     FT_ULong              vert_metrics_size;
 
-    FT_ULong              num_locations; /* in broken TTF, gid > 0xFFFF */ 
+    FT_ULong              num_locations; /* in broken TTF, gid > 0xFFFF */
     FT_Byte*              glyph_locations;
 
     FT_Byte*              hdmx_table;
     FT_Byte*              glyph_locations;
 
     FT_Byte*              hdmx_table;
@@ -1428,6 +1318,13 @@ FT_BEGIN_HEADER
     FT_ULong              horz_metrics_offset;
     FT_ULong              vert_metrics_offset;
 
     FT_ULong              horz_metrics_offset;
     FT_ULong              vert_metrics_offset;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    /* since 2.4.12 */
+    FT_ULong              sph_found_func_flags; /* special functions found */
+                                                /* for this face           */
+    FT_Bool               sph_compatibility_mode;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
   } TT_FaceRec;
 
 
   } TT_FaceRec;
 
 
@@ -1443,7 +1340,7 @@ FT_BEGIN_HEADER
   /*  <Fields>                                                             */
   /*     memory       :: A handle to the memory manager.                   */
   /*                                                                       */
   /*  <Fields>                                                             */
   /*     memory       :: A handle to the memory manager.                   */
   /*                                                                       */
-  /*     max_points   :: The maximal size in points of the zone.           */
+  /*     max_points   :: The maximum size in points of the zone.           */
   /*                                                                       */
   /*     max_contours :: Max size in links contours of the zone.           */
   /*                                                                       */
   /*                                                                       */
   /*     max_contours :: Max size in links contours of the zone.           */
   /*                                                                       */
index 5e2a393..a14255e 100644 (file)
@@ -5,7 +5,7 @@
 /*    Basic Type 1/Type 2 tables definitions and interface (specification  */
 /*    only).                                                               */
 /*                                                                         */
 /*    Basic Type 1/Type 2 tables definitions and interface (specification  */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by             */
+/*  Copyright 1996-2004, 2006, 2008, 2009, 2011 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -493,8 +493,166 @@ FT_BEGIN_HEADER
   FT_Get_PS_Font_Private( FT_Face     face,
                           PS_Private  afont_private );
 
   FT_Get_PS_Font_Private( FT_Face     face,
                           PS_Private  afont_private );
 
-  /* */
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Enum>                                                                */
+  /*    T1_EncodingType                                                    */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    An enumeration describing the `Encoding' entry in a Type 1         */
+  /*    dictionary.                                                        */
+  /*                                                                       */
+  typedef enum  T1_EncodingType_
+  {
+    T1_ENCODING_TYPE_NONE = 0,
+    T1_ENCODING_TYPE_ARRAY,
+    T1_ENCODING_TYPE_STANDARD,
+    T1_ENCODING_TYPE_ISOLATIN1,
+    T1_ENCODING_TYPE_EXPERT
+
+  } T1_EncodingType;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Enum>                                                                */
+  /*    PS_Dict_Keys                                                       */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    An enumeration used in calls to @FT_Get_PS_Font_Value to identify  */
+  /*    the Type~1 dictionary entry to retrieve.                           */
+  /*                                                                       */
+  typedef enum  PS_Dict_Keys_
+  {
+    /* conventionally in the font dictionary */
+    PS_DICT_FONT_TYPE,              /* FT_Byte         */
+    PS_DICT_FONT_MATRIX,            /* FT_Fixed        */
+    PS_DICT_FONT_BBOX,              /* FT_Fixed        */
+    PS_DICT_PAINT_TYPE,             /* FT_Byte         */
+    PS_DICT_FONT_NAME,              /* FT_String*      */
+    PS_DICT_UNIQUE_ID,              /* FT_Int          */
+    PS_DICT_NUM_CHAR_STRINGS,       /* FT_Int          */
+    PS_DICT_CHAR_STRING_KEY,        /* FT_String*      */
+    PS_DICT_CHAR_STRING,            /* FT_String*      */
+    PS_DICT_ENCODING_TYPE,          /* T1_EncodingType */
+    PS_DICT_ENCODING_ENTRY,         /* FT_String*      */
+
+    /* conventionally in the font Private dictionary */
+    PS_DICT_NUM_SUBRS,              /* FT_Int     */
+    PS_DICT_SUBR,                   /* FT_String* */
+    PS_DICT_STD_HW,                 /* FT_UShort  */
+    PS_DICT_STD_VW,                 /* FT_UShort  */
+    PS_DICT_NUM_BLUE_VALUES,        /* FT_Byte    */
+    PS_DICT_BLUE_VALUE,             /* FT_Short   */
+    PS_DICT_BLUE_FUZZ,              /* FT_Int     */
+    PS_DICT_NUM_OTHER_BLUES,        /* FT_Byte    */
+    PS_DICT_OTHER_BLUE,             /* FT_Short   */
+    PS_DICT_NUM_FAMILY_BLUES,       /* FT_Byte    */
+    PS_DICT_FAMILY_BLUE,            /* FT_Short   */
+    PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte    */
+    PS_DICT_FAMILY_OTHER_BLUE,      /* FT_Short   */
+    PS_DICT_BLUE_SCALE,             /* FT_Fixed   */
+    PS_DICT_BLUE_SHIFT,             /* FT_Int     */
+    PS_DICT_NUM_STEM_SNAP_H,        /* FT_Byte    */
+    PS_DICT_STEM_SNAP_H,            /* FT_Short   */
+    PS_DICT_NUM_STEM_SNAP_V,        /* FT_Byte    */
+    PS_DICT_STEM_SNAP_V,            /* FT_Short   */
+    PS_DICT_FORCE_BOLD,             /* FT_Bool    */
+    PS_DICT_RND_STEM_UP,            /* FT_Bool    */
+    PS_DICT_MIN_FEATURE,            /* FT_Short   */
+    PS_DICT_LEN_IV,                 /* FT_Int     */
+    PS_DICT_PASSWORD,               /* FT_Long    */
+    PS_DICT_LANGUAGE_GROUP,         /* FT_Long    */
+
+    /* conventionally in the font FontInfo dictionary */
+    PS_DICT_VERSION,                /* FT_String* */
+    PS_DICT_NOTICE,                 /* FT_String* */
+    PS_DICT_FULL_NAME,              /* FT_String* */
+    PS_DICT_FAMILY_NAME,            /* FT_String* */
+    PS_DICT_WEIGHT,                 /* FT_String* */
+    PS_DICT_IS_FIXED_PITCH,         /* FT_Bool    */
+    PS_DICT_UNDERLINE_POSITION,     /* FT_Short   */
+    PS_DICT_UNDERLINE_THICKNESS,    /* FT_UShort  */
+    PS_DICT_FS_TYPE,                /* FT_UShort  */
+    PS_DICT_ITALIC_ANGLE,           /* FT_Long    */
+
+    PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
+
+  } PS_Dict_Keys;
+
+
+  /************************************************************************
+   *
+   * @function:
+   *    FT_Get_PS_Font_Value
+   *
+   * @description:
+   *    Retrieve the value for the supplied key from a PostScript font.
+   *
+   * @input:
+   *    face ::
+   *       PostScript face handle.
+   *
+   *    key ::
+   *       An enumeration value representing the dictionary key to retrieve.
+   *
+   *    idx ::
+   *       For array values, this specifies the index to be returned.
+   *
+   *    value ::
+   *       A pointer to memory into which to write the value.
+   *
+   *    valen_len ::
+   *       The size, in bytes, of the memory supplied for the value.
+   *
+   * @output:
+   *    value ::
+   *       The value matching the above key, if it exists.
+   *
+   * @return:
+   *    The amount of memory (in bytes) required to hold the requested
+   *    value (if it exists, -1 otherwise).
+   *
+   * @note:
+   *    The values returned are not pointers into the internal structures of
+   *    the face, but are `fresh' copies, so that the memory containing them
+   *    belongs to the calling application.  This also enforces the
+   *    `read-only' nature of these values, i.e., this function cannot be
+   *    used to manipulate the face.
+   *
+   *    `value' is a void pointer because the values returned can be of
+   *    various types.
+   *
+   *    If either `value' is NULL or `value_len' is too small, just the
+   *    required memory size for the requested entry is returned.
+   *
+   *    The `idx' parameter is used, not only to retrieve elements of, for
+   *    example, the FontMatrix or FontBBox, but also to retrieve name keys
+   *    from the CharStrings dictionary, and the charstrings themselves.  It
+   *    is ignored for atomic values.
+   *
+   *    PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000.  To
+   *    get the value as in the font stream, you need to divide by
+   *    65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).
+   *
+   *    IMPORTANT: Only key/value pairs read by the FreeType interpreter can
+   *    be retrieved.  So, for example, PostScript procedures such as NP,
+   *    ND, and RD are not available.  Arbitrary keys are, obviously, not be
+   *    available either.
+   *
+   *    If the font's format is not PostScript-based, this function returns
+   *    the `FT_Err_Invalid_Argument' error code.
+   *
+   */
+  FT_EXPORT( FT_Long )
+  FT_Get_PS_Font_Value( FT_Face       face,
+                        PS_Dict_Keys  key,
+                        FT_UInt       idx,
+                        void         *value,
+                        FT_Long       value_len );
+
+  /* */
 
 FT_END_HEADER
 
 
 FT_END_HEADER
 
index 66aef04..173f88c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType name ID definitions (specification only).                   */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType name ID definitions (specification only).                   */
 /*                                                                         */
-/*  Copyright 1996-2002, 2003, 2004, 2006, 2007, 2008 by                   */
+/*  Copyright 1996-2004, 2006-2008, 2012 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -316,11 +316,12 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* Possible values of the language identifier field in the name records  */
   /* of the TTF `name' table if the `platform' identifier code is          */
   /*                                                                       */
   /* Possible values of the language identifier field in the name records  */
   /* of the TTF `name' table if the `platform' identifier code is          */
-  /* TT_PLATFORM_MACINTOSH.                                                */
+  /* TT_PLATFORM_MACINTOSH.  These values are also used as return values   */
+  /* for function @FT_Get_CMap_Language_ID.                                */
   /*                                                                       */
   /* The canonical source for the Apple assigned Language ID's is at       */
   /*                                                                       */
   /*                                                                       */
   /* The canonical source for the Apple assigned Language ID's is at       */
   /*                                                                       */
-  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6name.html                 */
+  /*   https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html      */
   /*                                                                       */
 #define TT_MAC_LANGID_ENGLISH                       0
 #define TT_MAC_LANGID_FRENCH                        1
   /*                                                                       */
 #define TT_MAC_LANGID_ENGLISH                       0
 #define TT_MAC_LANGID_FRENCH                        1
@@ -461,21 +462,10 @@ FT_BEGIN_HEADER
   /* of the TTF `name' table if the `platform' identifier code is          */
   /* TT_PLATFORM_MICROSOFT.                                                */
   /*                                                                       */
   /* of the TTF `name' table if the `platform' identifier code is          */
   /* TT_PLATFORM_MICROSOFT.                                                */
   /*                                                                       */
-  /* The canonical source for the MS assigned LCID's (seems to) be at      */
+  /* The canonical source for the MS assigned LCIDs is                     */
   /*                                                                       */
   /*   http://www.microsoft.com/globaldev/reference/lcid-all.mspx          */
   /*                                                                       */
   /*                                                                       */
   /*   http://www.microsoft.com/globaldev/reference/lcid-all.mspx          */
   /*                                                                       */
-  /* It used to be at various places, among them                           */
-  /*                                                                       */
-  /*   http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt              */
-  /*   http://www.microsoft.com/globaldev/reference/loclanghome.asp        */
-  /*   http://support.microsoft.com/support/kb/articles/Q224/8/04.ASP      */
-  /*   http://msdn.microsoft.com/library/en-us/passport25/                 */
-  /*           NET_Passport_VBScript_Documentation/Single_Sign_In/         */
-  /*           Advanced_Single_Sign_In/Localization_and_LCIDs.asp          */
-  /*                                                                       */
-  /* Hopefully, it seems now that the Globaldev site prevails...           */
-  /*                                   (updated by Antoine, 2004-02-17)    */
 
 #define TT_MS_LANGID_ARABIC_GENERAL                    0x0001
 #define TT_MS_LANGID_ARABIC_SAUDI_ARABIA               0x0401
 
 #define TT_MS_LANGID_ARABIC_GENERAL                    0x0001
 #define TT_MS_LANGID_ARABIC_SAUDI_ARABIA               0x0401
index 4610e50..fe07117 100644 (file)
@@ -5,7 +5,7 @@
 /*    Basic SFNT/TrueType tables definitions and interface                 */
 /*    (specification only).                                                */
 /*                                                                         */
 /*    Basic SFNT/TrueType tables definitions and interface                 */
 /*    (specification only).                                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010 by       */
+/*  Copyright 1996-2005, 2008-2012 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -600,6 +600,16 @@ FT_BEGIN_HEADER
   /*    by the sfnt, truetype, and opentype drivers.  See @FT_Sfnt_Tag for */
   /*    a list.                                                            */
   /*                                                                       */
   /*    by the sfnt, truetype, and opentype drivers.  See @FT_Sfnt_Tag for */
   /*    a list.                                                            */
   /*                                                                       */
+  /*    Here an example how to access the `vhea' table:                    */
+  /*                                                                       */
+  /*    {                                                                  */
+  /*      TT_VertHeader*  vert_header;                                     */
+  /*                                                                       */
+  /*                                                                       */
+  /*      vert_header =                                                    */
+  /*        (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea );       */
+  /*    }                                                                  */
+  /*                                                                       */
   FT_EXPORT( void* )
   FT_Get_Sfnt_Table( FT_Face      face,
                      FT_Sfnt_Tag  tag );
   FT_EXPORT( void* )
   FT_Get_Sfnt_Table( FT_Face      face,
                      FT_Sfnt_Tag  tag );
@@ -687,18 +697,23 @@ FT_BEGIN_HEADER
   *     The index of an SFNT table.  The function returns
   *     FT_Err_Table_Missing for an invalid value.
   *
   *     The index of an SFNT table.  The function returns
   *     FT_Err_Table_Missing for an invalid value.
   *
-  * @output:
+  * @inout:
   *   tag ::
   *   tag ::
-  *     The name tag of the SFNT table.
+  *     The name tag of the SFNT table.  If the value is NULL, `table_index'
+  *     is ignored, and `length' returns the number of SFNT tables in the
+  *     font.
   *
   *
+  * @output:
   *   length ::
   *   length ::
-  *     The length of the SFNT table.
+  *     The length of the SFNT table (or the number of SFNT tables, depending
+  *     on `tag').
   *
   * @return:
   *   FreeType error code.  0~means success.
   *
   * @note:
   *
   * @return:
   *   FreeType error code.  0~means success.
   *
   * @note:
-  *   SFNT tables with length zero are treated as missing.
+  *   While parsing fonts, FreeType handles SFNT tables with length zero as
+  *   missing.
   *
   */
   FT_EXPORT( FT_Error )
   *
   */
   FT_EXPORT( FT_Error )
@@ -725,6 +740,9 @@ FT_BEGIN_HEADER
   /*    The language ID of `charmap'.  If `charmap' doesn't belong to a    */
   /*    TrueType/sfnt face, just return~0 as the default value.            */
   /*                                                                       */
   /*    The language ID of `charmap'.  If `charmap' doesn't belong to a    */
   /*    TrueType/sfnt face, just return~0 as the default value.            */
   /*                                                                       */
+  /*    For a format~14 cmap (to access Unicode IVS), the return value is  */
+  /*    0xFFFFFFFF.                                                        */
+  /*                                                                       */
   FT_EXPORT( FT_ULong )
   FT_Get_CMap_Language_ID( FT_CharMap  charmap );
 
   FT_EXPORT( FT_ULong )
   FT_Get_CMap_Language_ID( FT_CharMap  charmap );
 
index 307ce4b..be8c524 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Tags for TrueType and OpenType tables (specification only).          */
 /*                                                                         */
 /*                                                                         */
 /*    Tags for TrueType and OpenType tables (specification only).          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2004, 2005, 2007, 2008 by                         */
+/*  Copyright 1996-2001, 2004, 2005, 2007, 2008, 2013 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -40,6 +40,8 @@ FT_BEGIN_HEADER
 #define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
 #define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
 #define TTAG_bsln  FT_MAKE_TAG( 'b', 's', 'l', 'n' )
 #define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
 #define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
 #define TTAG_bsln  FT_MAKE_TAG( 'b', 's', 'l', 'n' )
+#define TTAG_CBDT  FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
+#define TTAG_CBLC  FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
 #define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
 #define TTAG_CID   FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
 #define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
 #define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
 #define TTAG_CID   FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
 #define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
index 4047d7f..a85378e 100644 (file)
@@ -1,6 +1,6 @@
 # modules.cfg
 #
 # modules.cfg
 #
-# Copyright 2005, 2006, 2007, 2009 by
+# Copyright 2005-2007, 2009-2011 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -54,7 +54,7 @@ FONT_MODULES += pfr
 
 # PostScript Type 42 font driver.
 #
 
 # PostScript Type 42 font driver.
 #
-# This driver needs the `truetype' module.
+# This driver needs the `truetype' and `psaux' modules.
 FONT_MODULES += type42
 
 # Windows FONT/FNT font driver.  See optional extension ftwinfnt.c below
 FONT_MODULES += type42
 
 # Windows FONT/FNT font driver.  See optional extension ftwinfnt.c below
@@ -122,6 +122,11 @@ AUX_MODULES += gzip
 # See include/freetype/ftlzw.h for the API.
 AUX_MODULES += lzw
 
 # See include/freetype/ftlzw.h for the API.
 AUX_MODULES += lzw
 
+# Support for streams compressed with bzip2 (files with suffix .bz2).
+#
+# See include/freetype/ftbzip2.h for the API.
+AUX_MODULES += bzip2
+
 # OpenType table validation.  Needs ftotval.c below.
 #
 # AUX_MODULES += otvalid
 # OpenType table validation.  Needs ftotval.c below.
 #
 # AUX_MODULES += otvalid
diff --git a/reactos/lib/3rdparty/freetype/objs/README b/reactos/lib/3rdparty/freetype/objs/README
deleted file mode 100644 (file)
index befb63e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-This directory contains all the object files created when building the
-library.
diff --git a/reactos/lib/3rdparty/freetype/src/Jamfile b/reactos/lib/3rdparty/freetype/src/Jamfile
deleted file mode 100644 (file)
index 76ee0f4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# FreeType 2 src Jamfile
-#
-# Copyright 2001, 2002 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) ;
-
-# The file <freetype/internal/internal.h> is used to define macros that are
-# later used in #include statements.  It needs to be parsed in order to
-# record these definitions.
-#
-HDRMACRO  [ FT2_SubDir $(FT2_INCLUDE_DIR) internal internal.h ] ;
-
-for xx in $(FT2_COMPONENTS)
-{
-  SubInclude FT2_TOP $(FT2_SRC_DIR) $(xx) ;
-}
-
-# end of src Jamfile
diff --git a/reactos/lib/3rdparty/freetype/src/autofit/Jamfile b/reactos/lib/3rdparty/freetype/src/autofit/Jamfile
deleted file mode 100644 (file)
index 2714765..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# FreeType 2 src/autofit Jamfile
-#
-# Copyright 2003, 2004, 2005, 2006, 2007, 2009 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir FT2_TOP src autofit ;
-
-{
-  local  _sources ;
-
-  # define FT2_AUTOFIT2 to enable experimental latin hinter replacement
-  if $(FT2_AUTOFIT2)
-  {
-    DEFINES += FT_OPTION_AUTOFIT2 ;
-  }
-  if $(FT2_MULTI)
-  {
-    _sources = afangles afglobal afhints aflatin afcjk afindic afloader afmodule afdummy afwarp afpic ;
-
-    if $(FT2_AUTOFIT2)
-    {
-      _sources += aflatin2 ;
-    }
-  }
-  else
-  {
-    _sources = autofit ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/autofit Jamfile
index e2360d1..b44a5ba 100644 (file)
@@ -5,7 +5,7 @@
 /*    Routines used to compute vector angles with limited accuracy         */
 /*    and very high speed.  It also contains sorting routines (body).      */
 /*                                                                         */
 /*    Routines used to compute vector angles with limited accuracy         */
 /*    and very high speed.  It also contains sorting routines (body).      */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006 by                                    */
+/*  Copyright 2003-2006, 2011-2012 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -77,7 +77,7 @@
       return 1 - 2 * ( delta < 0 );
   }
 
       return 1 - 2 * ( delta < 0 );
   }
 
-#endif
+#endif /* 0 */
 
 
   /*
 
 
   /*
     {
       for ( j = i; j > 0; j-- )
       {
     {
       for ( j = i; j > 0; j-- )
       {
-        if ( table[j] > table[j - 1] )
+        if ( table[j] >= table[j - 1] )
           break;
 
         swap         = table[j];
           break;
 
         swap         = table[j];
 
 
   FT_LOCAL_DEF( void )
 
 
   FT_LOCAL_DEF( void )
-  af_sort_widths( FT_UInt   count,
-                  AF_Width  table )
+  af_sort_and_quantize_widths( FT_UInt*  count,
+                               AF_Width  table,
+                               FT_Pos    threshold )
   {
     FT_UInt      i, j;
   {
     FT_UInt      i, j;
+    FT_UInt      cur_idx;
+    FT_Pos       cur_val;
+    FT_Pos       sum;
     AF_WidthRec  swap;
 
 
     AF_WidthRec  swap;
 
 
-    for ( i = 1; i < count; i++ )
+    if ( *count == 1 )
+      return;
+
+    /* sort */
+    for ( i = 1; i < *count; i++ )
     {
       for ( j = i; j > 0; j-- )
       {
     {
       for ( j = i; j > 0; j-- )
       {
-        if ( table[j].org > table[j - 1].org )
+        if ( table[j].org >= table[j - 1].org )
           break;
 
         swap         = table[j];
           break;
 
         swap         = table[j];
         table[j - 1] = swap;
       }
     }
         table[j - 1] = swap;
       }
     }
+
+    cur_idx = 0;
+    cur_val = table[cur_idx].org;
+
+    /* compute and use mean values for clusters not larger than  */
+    /* `threshold'; this is very primitive and might not yield   */
+    /* the best result, but normally, using reference character  */
+    /* `o', `*count' is 2, so the code below is fully sufficient */
+    for ( i = 1; i < *count; i++ )
+    {
+      if ( table[i].org - cur_val > threshold ||
+           i == *count - 1                    )
+      {
+        sum = 0;
+
+        /* fix loop for end of array */
+        if ( table[i].org - cur_val <= threshold &&
+             i == *count - 1                     )
+          i++;
+
+        for ( j = cur_idx; j < i; j++ )
+        {
+          sum         += table[j].org;
+          table[j].org = 0;
+        }
+        table[cur_idx].org = sum / j;
+
+        if ( i < *count - 1 )
+        {
+          cur_idx = i + 1;
+          cur_val = table[cur_idx].org;
+        }
+      }
+    }
+
+    cur_idx = 1;
+
+    /* compress array to remove zero values */
+    for ( i = 1; i < *count; i++ )
+    {
+      if ( table[i].org )
+        table[cur_idx++] = table[i];
+    }
+
+    *count = cur_idx;
   }
 
 
   }
 
 
index f3b1067..f69a528 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines for CJK script (body).                  */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter hinting routines for CJK script (body).                  */
 /*                                                                         */
-/*  Copyright 2006, 2007, 2008, 2009, 2010 by                              */
+/*  Copyright 2006-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
    *
    */
 
    *
    */
 
+#include <ft2build.h>
+#include FT_ADVANCES_H
+#include FT_INTERNAL_DEBUG_H
+
 #include "aftypes.h"
 #include "aflatin.h"
 
 
 #ifdef AF_CONFIG_OPTION_CJK
 
 #include "aftypes.h"
 #include "aflatin.h"
 
 
 #ifdef AF_CONFIG_OPTION_CJK
 
+#undef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+
 #include "afcjk.h"
 #include "aferrors.h"
 
 
 #include "afcjk.h"
 #include "aferrors.h"
 
 
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
 #include "afwarp.h"
 #endif
 
 
 #include "afwarp.h"
 #endif
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_afcjk
+
+
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
 
+
+  /* Basically the Latin version with AF_CJKMetrics */
+  /* to replace AF_LatinMetrics.                    */
+
+  FT_LOCAL_DEF( void )
+  af_cjk_metrics_init_widths( AF_CJKMetrics  metrics,
+                              FT_Face        face )
+  {
+    /* scan the array of segments in each direction */
+    AF_GlyphHintsRec  hints[1];
+
+
+    af_glyph_hints_init( hints, face->memory );
+
+    metrics->axis[AF_DIMENSION_HORZ].width_count = 0;
+    metrics->axis[AF_DIMENSION_VERT].width_count = 0;
+
+    {
+      FT_Error          error;
+      FT_UInt           glyph_index;
+      int               dim;
+      AF_CJKMetricsRec  dummy[1];
+      AF_Scaler         scaler = &dummy->root.scaler;
+
+
+      glyph_index = FT_Get_Char_Index( face,
+                                       metrics->root.clazz->standard_char );
+      if ( glyph_index == 0 )
+        goto Exit;
+
+      error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
+      if ( error || face->glyph->outline.n_points <= 0 )
+        goto Exit;
+
+      FT_ZERO( dummy );
+
+      dummy->units_per_em = metrics->units_per_em;
+
+      scaler->x_scale = 0x10000L;
+      scaler->y_scale = 0x10000L;
+      scaler->x_delta = 0;
+      scaler->y_delta = 0;
+
+      scaler->face        = face;
+      scaler->render_mode = FT_RENDER_MODE_NORMAL;
+      scaler->flags       = 0;
+
+      af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
+
+      error = af_glyph_hints_reload( hints, &face->glyph->outline );
+      if ( error )
+        goto Exit;
+
+      for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
+      {
+        AF_CJKAxis    axis    = &metrics->axis[dim];
+        AF_AxisHints  axhints = &hints->axis[dim];
+        AF_Segment    seg, limit, link;
+        FT_UInt       num_widths = 0;
+
+
+        error = af_latin_hints_compute_segments( hints, (AF_Dimension)dim );
+        if ( error )
+          goto Exit;
+
+        af_latin_hints_link_segments( hints, (AF_Dimension)dim );
+
+        seg   = axhints->segments;
+        limit = seg + axhints->num_segments;
+
+        for ( ; seg < limit; seg++ )
+        {
+          link = seg->link;
+
+          /* we only consider stem segments there! */
+          if ( link && link->link == seg && link > seg )
+          {
+            FT_Pos  dist;
+
+
+            dist = seg->pos - link->pos;
+            if ( dist < 0 )
+              dist = -dist;
+
+            if ( num_widths < AF_CJK_MAX_WIDTHS )
+              axis->widths[num_widths++].org = dist;
+          }
+        }
+
+        /* this also replaces multiple almost identical stem widths */
+        /* with a single one (the value 100 is heuristic) */
+        af_sort_and_quantize_widths( &num_widths, axis->widths,
+                                     dummy->units_per_em / 100 );
+        axis->width_count = num_widths;
+      }
+
+    Exit:
+      for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
+      {
+        AF_CJKAxis  axis = &metrics->axis[dim];
+        FT_Pos      stdw;
+
+
+        stdw = ( axis->width_count > 0 ) ? axis->widths[0].org
+                                         : AF_LATIN_CONSTANT( metrics, 50 );
+
+        /* let's try 20% of the smallest width */
+        axis->edge_distance_threshold = stdw / 5;
+        axis->standard_width          = stdw;
+        axis->extra_light             = 0;
+      }
+    }
+
+    af_glyph_hints_done( hints );
+  }
+
+
+#define AF_CJK_MAX_TEST_CHARACTERS  32
+
+
+  /* Each blue zone has two types of fill and unfill, this is, */
+  /* filling the entire glyph square or not.                   */
+
+  enum
+  {
+    AF_CJK_BLUE_TYPE_FILL,
+    AF_CJK_BLUE_TYPE_UNFILL,
+    AF_CJK_BLUE_TYPE_MAX
+  };
+
+
+  /* Put some common and representative Han Ideographs characters here. */
+  static const FT_ULong af_cjk_hani_blue_chars[AF_CJK_BLUE_MAX]
+                                              [AF_CJK_BLUE_TYPE_MAX]
+                                              [AF_CJK_MAX_TEST_CHARACTERS] =
+  {
+    {
+      {
+        0x4ED6, 0x4EEC, 0x4F60, 0x4F86, 0x5011, 0x5230, 0x548C, 0x5730,
+        0x5BF9, 0x5C0D, 0x5C31, 0x5E2D, 0x6211, 0x65F6, 0x6642, 0x6703,
+        0x6765, 0x70BA, 0x80FD, 0x8230, 0x8AAA, 0x8BF4, 0x8FD9, 0x9019,
+        0x9F4A /* top fill */
+      },
+      {
+        0x519B, 0x540C, 0x5DF2, 0x613F, 0x65E2, 0x661F, 0x662F, 0x666F,
+        0x6C11, 0x7167, 0x73B0, 0x73FE, 0x7406, 0x7528, 0x7F6E, 0x8981,
+        0x8ECD, 0x90A3, 0x914D, 0x91CC, 0x958B, 0x96F7, 0x9732, 0x9762,
+        0x987E /* top unfill */
+      }
+    },
+    {
+      {
+        0x4E2A, 0x4E3A, 0x4EBA, 0x4ED6, 0x4EE5, 0x4EEC, 0x4F60, 0x4F86,
+        0x500B, 0x5011, 0x5230, 0x548C, 0x5927, 0x5BF9, 0x5C0D, 0x5C31,
+        0x6211, 0x65F6, 0x6642, 0x6709, 0x6765, 0x70BA, 0x8981, 0x8AAA,
+        0x8BF4 /* bottom fill */
+      },
+      {
+        0x4E3B, 0x4E9B, 0x56E0, 0x5B83, 0x60F3, 0x610F, 0x7406, 0x751F,
+        0x7576, 0x770B, 0x7740, 0x7F6E, 0x8005, 0x81EA, 0x8457, 0x88E1,
+        0x8FC7, 0x8FD8, 0x8FDB, 0x9032, 0x904E, 0x9053, 0x9084, 0x91CC,
+        0x9762 /* bottom unfill */
+      }
+    },
+#ifndef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+      { {0x0000}, {0x0000} },
+      { {0x0000}, {0x0000} }
+#else
+    {
+      {
+        0x4E9B, 0x4EEC, 0x4F60, 0x4F86, 0x5011, 0x5230, 0x548C, 0x5730,
+        0x5979, 0x5C06, 0x5C07, 0x5C31, 0x5E74, 0x5F97, 0x60C5, 0x6700,
+        0x6837, 0x6A23, 0x7406, 0x80FD, 0x8AAA, 0x8BF4, 0x8FD9, 0x9019,
+        0x901A /* left fill */
+      },
+      {
+        0x5373, 0x5417, 0x5427, 0x542C, 0x5462, 0x54C1, 0x54CD, 0x55CE,
+        0x5E08, 0x5E2B, 0x6536, 0x65AD, 0x65B7, 0x660E, 0x773C, 0x9593,
+        0x95F4, 0x9645, 0x9648, 0x9650, 0x9664, 0x9673, 0x968F, 0x969B,
+        0x96A8 /* left unfill */
+      }
+    },
+    {
+      {
+        0x4E8B, 0x524D, 0x5B78, 0x5C06, 0x5C07, 0x60C5, 0x60F3, 0x6216,
+        0x653F, 0x65AF, 0x65B0, 0x6837, 0x6A23, 0x6C11, 0x6C92, 0x6CA1,
+        0x7136, 0x7279, 0x73B0, 0x73FE, 0x7403, 0x7B2C, 0x7D93, 0x8C01,
+        0x8D77 /* right fill */
+      },
+      {
+        0x4F8B, 0x5225, 0x522B, 0x5236, 0x52A8, 0x52D5, 0x5417, 0x55CE,
+        0x589E, 0x6307, 0x660E, 0x671D, 0x671F, 0x6784, 0x7269, 0x786E,
+        0x79CD, 0x8ABF, 0x8C03, 0x8CBB, 0x8D39, 0x90A3, 0x90FD, 0x9593,
+        0x95F4 /* right unfill */
+      }
+    }
+#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
+  };
+
+
+  /* Calculate blue zones for all the CJK_BLUE_XXX's. */
+
+  static void
+  af_cjk_metrics_init_blues( AF_CJKMetrics   metrics,
+                             FT_Face         face,
+                             const FT_ULong  blue_chars
+                                               [AF_CJK_BLUE_MAX]
+                                               [AF_CJK_BLUE_TYPE_MAX]
+                                               [AF_CJK_MAX_TEST_CHARACTERS] )
+  {
+    FT_Pos        fills[AF_CJK_MAX_TEST_CHARACTERS];
+    FT_Pos        flats[AF_CJK_MAX_TEST_CHARACTERS];
+
+    FT_Int        num_fills;
+    FT_Int        num_flats;
+
+    FT_Int        bb;
+    AF_CJKBlue    blue;
+    FT_Error      error;
+    AF_CJKAxis    axis;
+    FT_GlyphSlot  glyph = face->glyph;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+    FT_String*  cjk_blue_name[AF_CJK_BLUE_MAX] = {
+      (FT_String*)"top",
+      (FT_String*)"bottom",
+      (FT_String*)"left",
+      (FT_String*)"right"
+    };
+    FT_String*  cjk_blue_type_name[AF_CJK_BLUE_TYPE_MAX] = {
+      (FT_String*)"filled",
+      (FT_String*)"unfilled"
+    };
+#endif
+
+
+    /* We compute the blues simply by loading each character from the */
+    /* `blue_chars[blues]' string, then computing its extreme points  */
+    /* (depending blue zone type etc.).                               */
+
+    FT_TRACE5(( "cjk blue zones computation\n" ));
+    FT_TRACE5(( "------------------------------------------------\n" ));
+
+    for ( bb = 0; bb < AF_CJK_BLUE_MAX; bb++ )
+    {
+      FT_Int   fill_type;
+      FT_Pos*  blue_ref;
+      FT_Pos*  blue_shoot;
+
+
+      num_fills = 0;
+      num_flats = 0;
+
+      for ( fill_type = 0; fill_type < AF_CJK_BLUE_TYPE_MAX; fill_type++ )
+      {
+        const FT_ULong*  p     = blue_chars[bb][fill_type];
+        const FT_ULong*  limit = p + AF_CJK_MAX_TEST_CHARACTERS;
+        FT_Bool          fill  = FT_BOOL(
+                                   fill_type == AF_CJK_BLUE_TYPE_FILL );
+
+
+        FT_TRACE5(( "cjk blue %s/%s\n", cjk_blue_name[bb],
+                                        cjk_blue_type_name[fill_type] ));
+
+
+        for ( ; p < limit && *p; p++ )
+        {
+          FT_UInt     glyph_index;
+          FT_Pos      best_pos; /* same as points.y */
+          FT_Int      best_point;
+          FT_Vector*  points;
+
+
+          FT_TRACE5(( "  U+%lX...", *p ));
+
+          /* load the character in the face -- skip unknown or empty ones */
+          glyph_index = FT_Get_Char_Index( face, *p );
+          if ( glyph_index == 0 )
+          {
+            FT_TRACE5(( "unavailable\n" ));
+            continue;
+          }
+
+          error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
+          if ( error || glyph->outline.n_points <= 0 )
+          {
+            FT_TRACE5(( "no outline\n" ));
+            continue;
+          }
+
+          /* now compute min or max point indices and coordinates */
+          points     = glyph->outline.points;
+          best_point = -1;
+          best_pos   = 0;  /* make compiler happy */
+
+          {
+            FT_Int  nn;
+            FT_Int  first = 0;
+            FT_Int  last  = -1;
+
+
+            for ( nn = 0;
+                  nn < glyph->outline.n_contours;
+                  first = last + 1, nn++ )
+            {
+              FT_Int  pp;
+
+
+              last = glyph->outline.contours[nn];
+
+              /* Avoid single-point contours since they are never       */
+              /* rasterized.  In some fonts, they correspond to mark    */
+              /* attachment points which are way outside of the glyph's */
+              /* real outline.                                          */
+              if ( last <= first )
+                continue;
+
+              switch ( bb )
+              {
+              case AF_CJK_BLUE_TOP:
+                for ( pp = first; pp <= last; pp++ )
+                  if ( best_point < 0 || points[pp].y > best_pos )
+                  {
+                    best_point = pp;
+                    best_pos   = points[pp].y;
+                  }
+                break;
+
+              case AF_CJK_BLUE_BOTTOM:
+                for ( pp = first; pp <= last; pp++ )
+                  if ( best_point < 0 || points[pp].y < best_pos )
+                  {
+                    best_point = pp;
+                    best_pos   = points[pp].y;
+                  }
+                break;
+
+              case AF_CJK_BLUE_LEFT:
+                for ( pp = first; pp <= last; pp++ )
+                  if ( best_point < 0 || points[pp].x < best_pos )
+                  {
+                    best_point = pp;
+                    best_pos   = points[pp].x;
+                  }
+                break;
+
+              case AF_CJK_BLUE_RIGHT:
+                for ( pp = first; pp <= last; pp++ )
+                  if ( best_point < 0 || points[pp].x > best_pos )
+                  {
+                    best_point = pp;
+                    best_pos   = points[pp].x;
+                  }
+                break;
+
+              default:
+                ;
+              }
+            }
+            FT_TRACE5(( "best_pos=%5ld\n", best_pos ));
+          }
+
+          if ( fill )
+            fills[num_fills++] = best_pos;
+          else
+            flats[num_flats++] = best_pos;
+        }
+      }
+
+      if ( num_flats == 0 && num_fills == 0 )
+      {
+        /*
+         *  we couldn't find a single glyph to compute this blue zone,
+         *  we will simply ignore it then
+         */
+        FT_TRACE5(( "empty\n" ));
+        continue;
+      }
+
+      /* we have computed the contents of the `fill' and `flats' tables, */
+      /* now determine the reference position of the blue --             */
+      /* we simply take the median value after a simple sort             */
+      af_sort_pos( num_flats, flats );
+      af_sort_pos( num_fills, fills );
+
+      if ( AF_CJK_BLUE_TOP == bb || AF_CJK_BLUE_BOTTOM == bb )
+        axis = &metrics->axis[AF_DIMENSION_VERT];
+      else
+        axis = &metrics->axis[AF_DIMENSION_HORZ];
+
+      blue       = & axis->blues[axis->blue_count];
+      blue_ref   = & blue->ref.org;
+      blue_shoot = & blue->shoot.org;
+
+      axis->blue_count++;
+      if ( num_flats == 0 )
+      {
+        *blue_ref   = fills[num_fills / 2];
+        *blue_shoot = fills[num_fills / 2];
+      }
+      else if ( num_fills == 0 )
+      {
+        *blue_ref   = flats[num_flats / 2];
+        *blue_shoot = flats[num_flats / 2];
+      }
+      else
+      {
+        *blue_ref   = fills[num_fills / 2];
+        *blue_shoot = flats[num_flats / 2];
+      }
+
+      /* make sure blue_ref >= blue_shoot for top/right or */
+      /* vice versa for bottom/left                        */
+      if ( *blue_shoot != *blue_ref )
+      {
+        FT_Pos   ref       = *blue_ref;
+        FT_Pos   shoot     = *blue_shoot;
+        FT_Bool  under_ref = FT_BOOL( shoot < ref );
+
+
+        if ( ( AF_CJK_BLUE_TOP == bb   ||
+               AF_CJK_BLUE_RIGHT == bb ) ^ under_ref )
+          *blue_shoot = *blue_ref = ( shoot + ref ) / 2;
+      }
+
+      blue->flags = 0;
+      if ( AF_CJK_BLUE_TOP == bb )
+        blue->flags |= AF_CJK_BLUE_IS_TOP;
+      else if ( AF_CJK_BLUE_RIGHT == bb )
+        blue->flags |= AF_CJK_BLUE_IS_RIGHT;
+
+      FT_TRACE5(( "-- cjk %s bluezone ref = %ld shoot = %ld\n",
+                  cjk_blue_name[bb], *blue_ref, *blue_shoot ));
+    }
+
+    return;
+  }
+
+
+  /* Basically the Latin version with type AF_CJKMetrics for metrics. */
+  FT_LOCAL_DEF( void )
+  af_cjk_metrics_check_digits( AF_CJKMetrics  metrics,
+                               FT_Face        face )
+  {
+    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;
+
+
+      glyph_index = FT_Get_Char_Index( face, i );
+      if ( glyph_index == 0 )
+        continue;
+
+      if ( FT_Get_Advance( face, glyph_index,
+                           FT_LOAD_NO_SCALE         |
+                           FT_LOAD_NO_HINTING       |
+                           FT_LOAD_IGNORE_TRANSFORM,
+                           &advance ) )
+        continue;
+
+      if ( started )
+      {
+        if ( advance != old_advance )
+        {
+          same_width = 0;
+          break;
+        }
+      }
+      else
+      {
+        old_advance = advance;
+        started     = 1;
+      }
+    }
+
+    metrics->root.digits_have_same_width = same_width;
+  }
+
+
   FT_LOCAL_DEF( FT_Error )
   FT_LOCAL_DEF( FT_Error )
-  af_cjk_metrics_init( AF_LatinMetrics  metrics,
-                       FT_Face          face )
+  af_cjk_metrics_init( AF_CJKMetrics  metrics,
+                       FT_Face        face )
   {
     FT_CharMap  oldmap = face->charmap;
 
 
     metrics->units_per_em = face->units_per_EM;
 
   {
     FT_CharMap  oldmap = face->charmap;
 
 
     metrics->units_per_em = face->units_per_EM;
 
-    /* TODO are there blues? */
-
     if ( FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )
       face->charmap = NULL;
     else
     {
     if ( FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )
       face->charmap = NULL;
     else
     {
-      /* latin's version would suffice */
-      af_latin_metrics_init_widths( metrics, face, 0x7530 );
-      af_latin_metrics_check_digits( metrics, face );
+      af_cjk_metrics_init_widths( metrics, face );
+      af_cjk_metrics_init_blues( metrics, face, af_cjk_hani_blue_chars );
+      af_cjk_metrics_check_digits( metrics, face );
     }
 
     FT_Set_Charmap( face, oldmap );
 
     }
 
     FT_Set_Charmap( face, oldmap );
 
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   static void
   }
 
 
   static void
-  af_cjk_metrics_scale_dim( AF_LatinMetrics  metrics,
-                            AF_Scaler        scaler,
-                            AF_Dimension     dim )
+  af_cjk_metrics_scale_dim( AF_CJKMetrics  metrics,
+                            AF_Scaler      scaler,
+                            AF_Dimension   dim )
   {
   {
-    AF_LatinAxis  axis;
+    FT_Fixed    scale;
+    FT_Pos      delta;
+    AF_CJKAxis  axis;
+    FT_UInt     nn;
 
 
     axis = &metrics->axis[dim];
 
     if ( dim == AF_DIMENSION_HORZ )
     {
 
 
     axis = &metrics->axis[dim];
 
     if ( dim == AF_DIMENSION_HORZ )
     {
-      axis->scale = scaler->x_scale;
-      axis->delta = scaler->x_delta;
+      scale = scaler->x_scale;
+      delta = scaler->x_delta;
     }
     else
     {
     }
     else
     {
-      axis->scale = scaler->y_scale;
-      axis->delta = scaler->y_delta;
+      scale = scaler->y_scale;
+      delta = scaler->y_delta;
+    }
+
+    if ( axis->org_scale == scale && axis->org_delta == delta )
+      return;
+
+    axis->org_scale = scale;
+    axis->org_delta = delta;
+
+    axis->scale = scale;
+    axis->delta = delta;
+
+    /* scale the blue zones */
+    for ( nn = 0; nn < axis->blue_count; nn++ )
+    {
+      AF_CJKBlue  blue = &axis->blues[nn];
+      FT_Pos      dist;
+
+
+      blue->ref.cur   = FT_MulFix( blue->ref.org, scale ) + delta;
+      blue->ref.fit   = blue->ref.cur;
+      blue->shoot.cur = FT_MulFix( blue->shoot.org, scale ) + delta;
+      blue->shoot.fit = blue->shoot.cur;
+      blue->flags    &= ~AF_CJK_BLUE_ACTIVE;
+
+      /* a blue zone is only active if it is less than 3/4 pixels tall */
+      dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale );
+      if ( dist <= 48 && dist >= -48 )
+      {
+        FT_Pos  delta1, delta2;
+
+
+        blue->ref.fit  = FT_PIX_ROUND( blue->ref.cur );
+
+        /* shoot is under shoot for cjk */
+        delta1 = FT_DivFix( blue->ref.fit, scale ) - blue->shoot.org;
+        delta2 = delta1;
+        if ( delta1 < 0 )
+          delta2 = -delta2;
+
+        delta2 = FT_MulFix( delta2, scale );
+
+        FT_TRACE5(( "delta: %d", delta1 ));
+        if ( delta2 < 32 )
+          delta2 = 0;
+#if 0
+        else if ( delta2 < 64 )
+          delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 );
+#endif
+        else
+          delta2 = FT_PIX_ROUND( delta2 );
+        FT_TRACE5(( "/%d\n", delta2 ));
+
+        if ( delta1 < 0 )
+          delta2 = -delta2;
+
+        blue->shoot.fit = blue->ref.fit - delta2;
+
+        FT_TRACE5(( ">> active cjk blue zone %c%d[%ld/%ld]: "
+                     "ref: cur=%.2f fit=%.2f shoot: cur=%.2f fit=%.2f\n",
+                       ( dim == AF_DIMENSION_HORZ ) ? 'H' : 'V',
+                       nn, blue->ref.org, blue->shoot.org,
+                       blue->ref.cur / 64.0, blue->ref.fit / 64.0,
+                       blue->shoot.cur / 64.0, blue->shoot.fit / 64.0 ));
+
+        blue->flags |= AF_CJK_BLUE_ACTIVE;
+      }
     }
   }
 
 
   FT_LOCAL_DEF( void )
     }
   }
 
 
   FT_LOCAL_DEF( void )
-  af_cjk_metrics_scale( AF_LatinMetrics  metrics,
-                        AF_Scaler        scaler )
+  af_cjk_metrics_scale( AF_CJKMetrics  metrics,
+                        AF_Scaler      scaler )
   {
     metrics->root.scaler = *scaler;
 
   {
     metrics->root.scaler = *scaler;
 
     {
       AF_Point  pt   = seg->first;
       AF_Point  last = seg->last;
     {
       AF_Point  pt   = seg->first;
       AF_Point  last = seg->last;
-      AF_Flags  f0   = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
+      AF_Flags  f0   = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
       AF_Flags  f1;
 
 
       AF_Flags  f1;
 
 
       for ( ; pt != last; f0 = f1 )
       {
         pt = pt->next;
       for ( ; pt != last; f0 = f1 )
       {
         pt = pt->next;
-        f1 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
+        f1 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
 
         if ( !f0 && !f1 )
           break;
 
         if ( !f0 && !f1 )
           break;
       }
     }
 
       }
     }
 
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
                               AF_Dimension   dim )
   {
     AF_AxisHints  axis   = &hints->axis[dim];
                               AF_Dimension   dim )
   {
     AF_AxisHints  axis   = &hints->axis[dim];
-    FT_Error      error  = AF_Err_Ok;
+    FT_Error      error  = FT_Err_Ok;
     FT_Memory     memory = hints->memory;
     FT_Memory     memory = hints->memory;
-    AF_LatinAxis  laxis  = &((AF_LatinMetrics)hints->metrics)->axis[dim];
+    AF_CJKAxis    laxis  = &((AF_CJKMetrics)hints->metrics)->axis[dim];
 
     AF_Segment    segments      = axis->segments;
     AF_Segment    segment_limit = segments + axis->num_segments;
 
     AF_Segment    segments      = axis->segments;
     AF_Segment    segment_limit = segments + axis->num_segments;
           /* can make a single edge.                                 */
           if ( link )
           {
           /* can make a single edge.                                 */
           if ( link )
           {
-            AF_Segment  seg1 = edge->first;
-            AF_Segment  link1;
+            AF_Segment  seg1  = edge->first;
             FT_Pos      dist2 = 0;
 
 
             do
             {
             FT_Pos      dist2 = 0;
 
 
             do
             {
-              link1 = seg1->link;
+              AF_Segment  link1 = seg1->link;
+
+
               if ( link1 )
               {
                 dist2 = AF_SEGMENT_DIST( link, link1 );
               if ( link1 )
               {
                 dist2 = AF_SEGMENT_DIST( link, link1 );
   }
 
 
   }
 
 
+  FT_LOCAL_DEF( void )
+  af_cjk_hints_compute_blue_edges( AF_GlyphHints  hints,
+                                   AF_CJKMetrics  metrics,
+                                   AF_Dimension   dim )
+  {
+    AF_AxisHints  axis       = &hints->axis[dim];
+    AF_Edge       edge       = axis->edges;
+    AF_Edge       edge_limit = edge + axis->num_edges;
+    AF_CJKAxis    cjk        = &metrics->axis[dim];
+    FT_Fixed      scale      = cjk->scale;
+    FT_Pos        best_dist0;  /* initial threshold */
+
+
+    /* compute the initial threshold as a fraction of the EM size */
+    best_dist0 = FT_MulFix( metrics->units_per_em / 40, scale );
+
+    if ( best_dist0 > 64 / 2 ) /* maximum 1/2 pixel */
+      best_dist0 = 64 / 2;
+
+    /* compute which blue zones are active, i.e. have their scaled */
+    /* size < 3/4 pixels                                           */
+
+    /* If the distant between an edge and a blue zone is shorter than */
+    /* best_dist0, set the blue zone for the edge.  Then search for   */
+    /* the blue zone with the smallest best_dist to the edge.         */
+
+    for ( ; edge < edge_limit; edge++ )
+    {
+      FT_UInt   bb;
+      AF_Width  best_blue = NULL;
+      FT_Pos    best_dist = best_dist0;
+
+
+      for ( bb = 0; bb < cjk->blue_count; bb++ )
+      {
+        AF_CJKBlue  blue = cjk->blues + bb;
+        FT_Bool     is_top_right_blue, is_major_dir;
+
+
+        /* skip inactive blue zones (i.e., those that are too small) */
+        if ( !( blue->flags & AF_CJK_BLUE_ACTIVE ) )
+          continue;
+
+        /* if it is a top zone, check for right edges -- if it is a bottom */
+        /* zone, check for left edges                                      */
+        /*                                                                 */
+        /* of course, that's for TrueType                                  */
+        is_top_right_blue  =
+          FT_BOOL( ( ( blue->flags & AF_CJK_BLUE_IS_TOP )   != 0 ) ||
+                   ( ( blue->flags & AF_CJK_BLUE_IS_RIGHT ) != 0 ) );
+        is_major_dir = FT_BOOL( edge->dir == axis->major_dir );
+
+        /* if it is a top zone, the edge must be against the major    */
+        /* direction; if it is a bottom zone, it must be in the major */
+        /* direction                                                  */
+        if ( is_top_right_blue ^ is_major_dir )
+        {
+          FT_Pos    dist;
+          AF_Width  compare;
+
+
+          /* Compare the edge to the closest blue zone type */
+          if ( FT_ABS( edge->fpos - blue->ref.org ) >
+               FT_ABS( edge->fpos - blue->shoot.org ) )
+            compare = &blue->shoot;
+          else
+            compare = &blue->ref;
+
+          dist = edge->fpos - compare->org;
+          if ( dist < 0 )
+            dist = -dist;
+
+          dist = FT_MulFix( dist, scale );
+          if ( dist < best_dist )
+          {
+            best_dist = dist;
+            best_blue = compare;
+          }
+        }
+      }
+
+      if ( best_blue )
+        edge->blue_edge = best_blue;
+    }
+  }
+
+
   FT_LOCAL_DEF( FT_Error )
   FT_LOCAL_DEF( FT_Error )
-  af_cjk_hints_init( AF_GlyphHints    hints,
-                     AF_LatinMetrics  metrics )
+  af_cjk_hints_init( AF_GlyphHints  hints,
+                     AF_CJKMetrics  metrics )
   {
     FT_Render_Mode  mode;
     FT_UInt32       scaler_flags, other_flags;
   {
     FT_Render_Mode  mode;
     FT_UInt32       scaler_flags, other_flags;
     /* compute flags depending on render mode, etc. */
     mode = metrics->root.scaler.render_mode;
 
     /* compute flags depending on render mode, etc. */
     mode = metrics->root.scaler.render_mode;
 
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
     if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )
       metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;
 #endif
     if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )
       metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;
 #endif
                              AF_Edge_Flags  base_flags,
                              AF_Edge_Flags  stem_flags )
   {
                              AF_Edge_Flags  base_flags,
                              AF_Edge_Flags  stem_flags )
   {
-    AF_LatinMetrics  metrics  = (AF_LatinMetrics) hints->metrics;
-    AF_LatinAxis     axis     = & metrics->axis[dim];
-    FT_Pos           dist     = width;
-    FT_Int           sign     = 0;
-    FT_Int           vertical = ( dim == AF_DIMENSION_VERT );
+    AF_CJKMetrics  metrics  = (AF_CJKMetrics) hints->metrics;
+    AF_CJKAxis     axis     = & metrics->axis[dim];
+    FT_Pos         dist     = width;
+    FT_Int         sign     = 0;
+    FT_Bool        vertical = FT_BOOL( dim == AF_DIMENSION_VERT );
 
     FT_UNUSED( base_flags );
     FT_UNUSED( stem_flags );
 
     FT_UNUSED( base_flags );
     FT_UNUSED( stem_flags );
         goto Exit;
     }
 
         goto Exit;
     }
 
-    offset = cur_len % 64;
+    offset = cur_len & 63;
 
     if ( offset < 32 )
     {
 
     if ( offset < 32 )
     {
     AF_Edge       anchor   = 0;
     FT_Pos        delta    = 0;
     FT_Int        skipped  = 0;
     AF_Edge       anchor   = 0;
     FT_Pos        delta    = 0;
     FT_Int        skipped  = 0;
+    FT_Bool       has_last_stem = FALSE;
+    FT_Pos        last_stem_pos = 0;
+
 
 
+    /* we begin by aligning all stems relative to the blue zone */
+    FT_TRACE5(( "==== cjk hinting %s edges =====\n",
+          dim == AF_DIMENSION_HORZ ? "vertical" : "horizontal" ));
+
+    if ( AF_HINTS_DO_BLUES( hints ) )
+    {
+      for ( edge = edges; edge < edge_limit; edge++ )
+      {
+        AF_Width  blue;
+        AF_Edge   edge1, edge2;
+
+
+        if ( edge->flags & AF_EDGE_DONE )
+          continue;
+
+        blue  = edge->blue_edge;
+        edge1 = NULL;
+        edge2 = edge->link;
+
+        if ( blue )
+        {
+          edge1 = edge;
+        }
+        else if ( edge2 && edge2->blue_edge )
+        {
+          blue  = edge2->blue_edge;
+          edge1 = edge2;
+          edge2 = edge;
+        }
+
+        if ( !edge1 )
+          continue;
+
+        FT_TRACE5(( "CJKBLUE: edge %d @%d (opos=%.2f) snapped to (%.2f), "
+                 "was (%.2f)\n",
+                 edge1-edges, edge1->fpos, edge1->opos / 64.0, blue->fit / 64.0,
+                 edge1->pos / 64.0 ));
+
+        edge1->pos    = blue->fit;
+        edge1->flags |= AF_EDGE_DONE;
+
+        if ( edge2 && !edge2->blue_edge )
+        {
+          af_cjk_align_linked_edge( hints, dim, edge1, edge2 );
+          edge2->flags |= AF_EDGE_DONE;
+        }
+
+        if ( !anchor )
+          anchor = edge;
+      }
+    }
 
     /* now we align all stem edges. */
     for ( edge = edges; edge < edge_limit; edge++ )
 
     /* now we align all stem edges. */
     for ( edge = edges; edge < edge_limit; edge++ )
         continue;
       }
 
         continue;
       }
 
+      /* Some CJK characters have so many stems that
+       * the hinter is likely to merge two adjacent ones.
+       * To solve this problem, if either edge of a stem
+       * is too close to the previous one, we avoid
+       * aligning the two edges, but rather interpolate
+       * their locations at the end of this function in
+       * order to preserve the space between the stems.
+       */
+      if ( has_last_stem                       &&
+           ( edge->pos  < last_stem_pos + 64 ||
+             edge2->pos < last_stem_pos + 64 ) )
+      {
+        skipped++;
+        continue;
+      }
+
       /* now align the stem */
       /* now align the stem */
+      /* this should not happen, but it's better to be safe */
+      if ( edge2->blue_edge )
+      {
+        FT_TRACE5(( "ASSERTION FAILED for edge %d\n", edge2-edges ));
+
+        af_cjk_align_linked_edge( hints, dim, edge2, edge );
+        edge->flags |= AF_EDGE_DONE;
+        continue;
+      }
 
       if ( edge2 < edge )
       {
         af_cjk_align_linked_edge( hints, dim, edge2, edge );
         edge->flags |= AF_EDGE_DONE;
 
       if ( edge2 < edge )
       {
         af_cjk_align_linked_edge( hints, dim, edge2, edge );
         edge->flags |= AF_EDGE_DONE;
+        /* We rarely reaches here it seems;
+         * usually the two edges belonging
+         * to one stem are marked as DONE together
+         */
+        has_last_stem = TRUE;
+        last_stem_pos = edge->pos;
         continue;
       }
 
         continue;
       }
 
       anchor = edge;
       edge->flags  |= AF_EDGE_DONE;
       edge2->flags |= AF_EDGE_DONE;
       anchor = edge;
       edge->flags  |= AF_EDGE_DONE;
       edge2->flags |= AF_EDGE_DONE;
+      has_last_stem = TRUE;
+      last_stem_pos = edge2->pos;
     }
 
     /* make sure that lowercase m's maintain their symmetry */
     }
 
     /* make sure that lowercase m's maintain their symmetry */
 
 
   FT_LOCAL_DEF( FT_Error )
 
 
   FT_LOCAL_DEF( FT_Error )
-  af_cjk_hints_apply( AF_GlyphHints    hints,
-                      FT_Outline*      outline,
-                      AF_LatinMetrics  metrics )
+  af_cjk_hints_apply( AF_GlyphHints  hints,
+                      FT_Outline*    outline,
+                      AF_CJKMetrics  metrics )
   {
     FT_Error  error;
     int       dim;
   {
     FT_Error  error;
     int       dim;
       error = af_cjk_hints_detect_features( hints, AF_DIMENSION_HORZ );
       if ( error )
         goto Exit;
       error = af_cjk_hints_detect_features( hints, AF_DIMENSION_HORZ );
       if ( error )
         goto Exit;
+
+      af_cjk_hints_compute_blue_edges( hints, metrics, AF_DIMENSION_HORZ );
     }
 
     if ( AF_HINTS_DO_VERTICAL( hints ) )
     }
 
     if ( AF_HINTS_DO_VERTICAL( hints ) )
       error = af_cjk_hints_detect_features( hints, AF_DIMENSION_VERT );
       if ( error )
         goto Exit;
       error = af_cjk_hints_detect_features( hints, AF_DIMENSION_VERT );
       if ( error )
         goto Exit;
+
+      af_cjk_hints_compute_blue_edges( hints, metrics, AF_DIMENSION_VERT );
     }
 
     /* grid-fit the outline */
     }
 
     /* grid-fit the outline */
            ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL( hints ) )   )
       {
 
            ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL( hints ) )   )
       {
 
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
         if ( dim == AF_DIMENSION_HORZ                                  &&
              metrics->root.scaler.render_mode == FT_RENDER_MODE_NORMAL )
         {
         if ( dim == AF_DIMENSION_HORZ                                  &&
              metrics->root.scaler.render_mode == FT_RENDER_MODE_NORMAL )
         {
           FT_Pos        delta;
 
 
           FT_Pos        delta;
 
 
-          af_warper_compute( &warper, hints, dim, &scale, &delta );
-          af_glyph_hints_scale_dim( hints, dim, scale, delta );
+          af_warper_compute( &warper, hints, (AF_Dimension)dim,
+                             &scale, &delta );
+          af_glyph_hints_scale_dim( hints, (AF_Dimension)dim,
+                                    scale, delta );
           continue;
         }
           continue;
         }
-#endif /* AF_USE_WARPER */
+#endif /* AF_CONFIG_OPTION_USE_WARPER */
 
         af_cjk_hint_edges( hints, (AF_Dimension)dim );
         af_cjk_align_edge_points( hints, (AF_Dimension)dim );
 
         af_cjk_hint_edges( hints, (AF_Dimension)dim );
         af_cjk_align_edge_points( hints, (AF_Dimension)dim );
   /*************************************************************************/
 
 
   /*************************************************************************/
 
 
+  /* this corresponds to Unicode 6.0 */
+
   static const AF_Script_UniRangeRec  af_cjk_uniranges[] =
   {
   static const AF_Script_UniRangeRec  af_cjk_uniranges[] =
   {
-#if 0
-    AF_UNIRANGE_REC(  0x0100UL,  0xFFFFUL ),  /* why this? */
-#endif
+    AF_UNIRANGE_REC(  0x1100UL,  0x11FFUL ),  /* Hangul Jamo                             */
     AF_UNIRANGE_REC(  0x2E80UL,  0x2EFFUL ),  /* CJK Radicals Supplement                 */
     AF_UNIRANGE_REC(  0x2F00UL,  0x2FDFUL ),  /* Kangxi Radicals                         */
     AF_UNIRANGE_REC(  0x2E80UL,  0x2EFFUL ),  /* CJK Radicals Supplement                 */
     AF_UNIRANGE_REC(  0x2F00UL,  0x2FDFUL ),  /* Kangxi Radicals                         */
+    AF_UNIRANGE_REC(  0x2FF0UL,  0x2FFFUL ),  /* Ideographic Description Characters      */
     AF_UNIRANGE_REC(  0x3000UL,  0x303FUL ),  /* CJK Symbols and Punctuation             */
     AF_UNIRANGE_REC(  0x3040UL,  0x309FUL ),  /* Hiragana                                */
     AF_UNIRANGE_REC(  0x30A0UL,  0x30FFUL ),  /* Katakana                                */
     AF_UNIRANGE_REC(  0x3100UL,  0x312FUL ),  /* Bopomofo                                */
     AF_UNIRANGE_REC(  0x3130UL,  0x318FUL ),  /* Hangul Compatibility Jamo               */
     AF_UNIRANGE_REC(  0x3000UL,  0x303FUL ),  /* CJK Symbols and Punctuation             */
     AF_UNIRANGE_REC(  0x3040UL,  0x309FUL ),  /* Hiragana                                */
     AF_UNIRANGE_REC(  0x30A0UL,  0x30FFUL ),  /* Katakana                                */
     AF_UNIRANGE_REC(  0x3100UL,  0x312FUL ),  /* Bopomofo                                */
     AF_UNIRANGE_REC(  0x3130UL,  0x318FUL ),  /* Hangul Compatibility Jamo               */
+    AF_UNIRANGE_REC(  0x3190UL,  0x319FUL ),  /* Kanbun                                  */
     AF_UNIRANGE_REC(  0x31A0UL,  0x31BFUL ),  /* Bopomofo Extended                       */
     AF_UNIRANGE_REC(  0x31C0UL,  0x31EFUL ),  /* CJK Strokes                             */
     AF_UNIRANGE_REC(  0x31F0UL,  0x31FFUL ),  /* Katakana Phonetic Extensions            */
     AF_UNIRANGE_REC(  0x31A0UL,  0x31BFUL ),  /* Bopomofo Extended                       */
     AF_UNIRANGE_REC(  0x31C0UL,  0x31EFUL ),  /* CJK Strokes                             */
     AF_UNIRANGE_REC(  0x31F0UL,  0x31FFUL ),  /* Katakana Phonetic Extensions            */
     AF_UNIRANGE_REC(  0x3400UL,  0x4DBFUL ),  /* CJK Unified Ideographs Extension A      */
     AF_UNIRANGE_REC(  0x4DC0UL,  0x4DFFUL ),  /* Yijing Hexagram Symbols                 */
     AF_UNIRANGE_REC(  0x4E00UL,  0x9FFFUL ),  /* CJK Unified Ideographs                  */
     AF_UNIRANGE_REC(  0x3400UL,  0x4DBFUL ),  /* CJK Unified Ideographs Extension A      */
     AF_UNIRANGE_REC(  0x4DC0UL,  0x4DFFUL ),  /* Yijing Hexagram Symbols                 */
     AF_UNIRANGE_REC(  0x4E00UL,  0x9FFFUL ),  /* CJK Unified Ideographs                  */
+    AF_UNIRANGE_REC(  0xA960UL,  0xA97FUL ),  /* Hangul Jamo Extended-A                  */
+    AF_UNIRANGE_REC(  0xAC00UL,  0xD7AFUL ),  /* Hangul Syllables                        */
+    AF_UNIRANGE_REC(  0xD7B0UL,  0xD7FFUL ),  /* Hangul Jamo Extended-B                  */
     AF_UNIRANGE_REC(  0xF900UL,  0xFAFFUL ),  /* CJK Compatibility Ideographs            */
     AF_UNIRANGE_REC(  0xF900UL,  0xFAFFUL ),  /* CJK Compatibility Ideographs            */
+    AF_UNIRANGE_REC(  0xFE10UL,  0xFE1FUL ),  /* Vertical forms                          */
     AF_UNIRANGE_REC(  0xFE30UL,  0xFE4FUL ),  /* CJK Compatibility Forms                 */
     AF_UNIRANGE_REC(  0xFF00UL,  0xFFEFUL ),  /* Halfwidth and Fullwidth Forms           */
     AF_UNIRANGE_REC(  0xFE30UL,  0xFE4FUL ),  /* CJK Compatibility Forms                 */
     AF_UNIRANGE_REC(  0xFF00UL,  0xFFEFUL ),  /* Halfwidth and Fullwidth Forms           */
+    AF_UNIRANGE_REC( 0x1B000UL, 0x1B0FFUL ),  /* Kana Supplement                         */
+    AF_UNIRANGE_REC( 0x1D300UL, 0x1D35FUL ),  /* Tai Xuan Hing Symbols                   */
+    AF_UNIRANGE_REC( 0x1F200UL, 0x1F2FFUL ),  /* Enclosed Ideographic Supplement         */
     AF_UNIRANGE_REC( 0x20000UL, 0x2A6DFUL ),  /* CJK Unified Ideographs Extension B      */
     AF_UNIRANGE_REC( 0x20000UL, 0x2A6DFUL ),  /* CJK Unified Ideographs Extension B      */
+    AF_UNIRANGE_REC( 0x2A700UL, 0x2B73FUL ),  /* CJK Unified Ideographs Extension C      */
+    AF_UNIRANGE_REC( 0x2B740UL, 0x2B81FUL ),  /* CJK Unified Ideographs Extension D      */
     AF_UNIRANGE_REC( 0x2F800UL, 0x2FA1FUL ),  /* CJK Compatibility Ideographs Supplement */
     AF_UNIRANGE_REC(       0UL,       0UL )
   };
 
 
     AF_UNIRANGE_REC( 0x2F800UL, 0x2FA1FUL ),  /* CJK Compatibility Ideographs Supplement */
     AF_UNIRANGE_REC(       0UL,       0UL )
   };
 
 
-  AF_DEFINE_SCRIPT_CLASS(af_cjk_script_class,
+  AF_DEFINE_SCRIPT_CLASS( af_cjk_script_class,
     AF_SCRIPT_CJK,
     af_cjk_uniranges,
     AF_SCRIPT_CJK,
     af_cjk_uniranges,
+    0x7530, /* 田 */
 
 
-    sizeof( AF_LatinMetricsRec ),
+    sizeof ( AF_CJKMetricsRec ),
 
     (AF_Script_InitMetricsFunc) af_cjk_metrics_init,
     (AF_Script_ScaleMetricsFunc)af_cjk_metrics_scale,
 
     (AF_Script_InitMetricsFunc) af_cjk_metrics_init,
     (AF_Script_ScaleMetricsFunc)af_cjk_metrics_scale,
   };
 
 
   };
 
 
-  AF_DEFINE_SCRIPT_CLASS(af_cjk_script_class,
+  AF_DEFINE_SCRIPT_CLASS( af_cjk_script_class,
     AF_SCRIPT_CJK,
     af_cjk_uniranges,
     AF_SCRIPT_CJK,
     af_cjk_uniranges,
+    0,
 
 
-    sizeof( AF_LatinMetricsRec ),
+    sizeof ( AF_CJKMetricsRec ),
 
     (AF_Script_InitMetricsFunc) NULL,
     (AF_Script_ScaleMetricsFunc)NULL,
 
     (AF_Script_InitMetricsFunc) NULL,
     (AF_Script_ScaleMetricsFunc)NULL,
index 0b20d4a..ab816f2 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines for CJK script (specification).         */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter hinting routines for CJK script (specification).         */
 /*                                                                         */
-/*  Copyright 2006, 2007 by                                                */
+/*  Copyright 2006, 2007, 2011, 2012 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -20,6 +20,7 @@
 #define __AFCJK_H__
 
 #include "afhints.h"
 #define __AFCJK_H__
 
 #include "afhints.h"
+#include "aflatin.h"
 
 
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
@@ -27,25 +28,109 @@ FT_BEGIN_HEADER
 
   /* the CJK-specific script class */
 
 
   /* the CJK-specific script class */
 
-  AF_DECLARE_SCRIPT_CLASS(af_cjk_script_class)
+  AF_DECLARE_SCRIPT_CLASS( af_cjk_script_class )
 
 
+  /* CJK (global) metrics management */
 
 
+  /*
+   *  CJK glyphs tend to fill the square.  So we have both vertical and
+   *  horizontal blue zones.  But some glyphs have flat bounding strokes that
+   *  leave some space between neighbour glyphs.
+   */
+  enum
+  {
+    AF_CJK_BLUE_TOP,
+    AF_CJK_BLUE_BOTTOM,
+    AF_CJK_BLUE_LEFT,
+    AF_CJK_BLUE_RIGHT,
+
+    AF_CJK_BLUE_MAX
+  };
+
+
+#define AF_CJK_MAX_WIDTHS  16
+#define AF_CJK_MAX_BLUES   AF_CJK_BLUE_MAX
+
+
+  enum
+  {
+    AF_CJK_BLUE_ACTIVE     = 1 << 0,
+    AF_CJK_BLUE_IS_TOP     = 1 << 1,
+    AF_CJK_BLUE_IS_RIGHT   = 1 << 2,
+    AF_CJK_BLUE_ADJUSTMENT = 1 << 3,  /* used for scale adjustment */
+                                      /* optimization              */
+    AF_CJK_BLUE_FLAG_MAX
+  };
+
+
+  typedef struct  AF_CJKBlueRec_
+  {
+    AF_WidthRec  ref;
+    AF_WidthRec  shoot; /* undershoot */
+    FT_UInt      flags;
+
+  } AF_CJKBlueRec, *AF_CJKBlue;
+
+
+  typedef struct  AF_CJKAxisRec_
+  {
+    FT_Fixed       scale;
+    FT_Pos         delta;
+
+    FT_UInt        width_count;
+    AF_WidthRec    widths[AF_CJK_MAX_WIDTHS];
+    FT_Pos         edge_distance_threshold;
+    FT_Pos         standard_width;
+    FT_Bool        extra_light;
+
+    /* used for horizontal metrics too for CJK */
+    FT_Bool        control_overshoot;
+    FT_UInt        blue_count;
+    AF_CJKBlueRec  blues[AF_CJK_BLUE_MAX];
+
+    FT_Fixed       org_scale;
+    FT_Pos         org_delta;
+
+  } AF_CJKAxisRec, *AF_CJKAxis;
+
+
+  typedef struct  AF_CJKMetricsRec_
+  {
+    AF_ScriptMetricsRec  root;
+    FT_UInt              units_per_em;
+    AF_CJKAxisRec        axis[AF_DIMENSION_MAX];
+
+  } AF_CJKMetricsRec, *AF_CJKMetrics;
+
+
+#ifdef AF_CONFIG_OPTION_CJK
   FT_LOCAL( FT_Error )
   FT_LOCAL( FT_Error )
-  af_cjk_metrics_init( AF_LatinMetrics  metrics,
-                       FT_Face          face );
+  af_cjk_metrics_init( AF_CJKMetrics  metrics,
+                       FT_Face        face );
 
   FT_LOCAL( void )
 
   FT_LOCAL( void )
-  af_cjk_metrics_scale( AF_LatinMetrics  metrics,
-                        AF_Scaler        scaler );
+  af_cjk_metrics_scale( AF_CJKMetrics  metrics,
+                        AF_Scaler      scaler );
 
   FT_LOCAL( FT_Error )
 
   FT_LOCAL( FT_Error )
-  af_cjk_hints_init( AF_GlyphHints    hints,
-                     AF_LatinMetrics  metrics );
+  af_cjk_hints_init( AF_GlyphHints  hints,
+                     AF_CJKMetrics  metrics );
 
   FT_LOCAL( FT_Error )
 
   FT_LOCAL( FT_Error )
-  af_cjk_hints_apply( AF_GlyphHints    hints,
-                      FT_Outline*      outline,
-                      AF_LatinMetrics  metrics );
+  af_cjk_hints_apply( AF_GlyphHints  hints,
+                      FT_Outline*    outline,
+                      AF_CJKMetrics  metrics );
+
+  /* shared; called from afindic.c */
+  FT_LOCAL( void )
+  af_cjk_metrics_check_digits( AF_CJKMetrics  metrics,
+                               FT_Face        face );
+
+  FT_LOCAL( void )
+  af_cjk_metrics_init_widths( AF_CJKMetrics  metrics,
+                              FT_Face        face );
+#endif /* AF_CONFIG_OPTION_CJK */
+
 
 /* */
 
 
 /* */
 
index 42b2fcb..2294455 100644 (file)
@@ -5,7 +5,7 @@
 /*    Auto-fitter dummy routines to be used if no hinting should be        */
 /*    performed (body).                                                    */
 /*                                                                         */
 /*    Auto-fitter dummy routines to be used if no hinting should be        */
 /*    performed (body).                                                    */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005 by                                          */
+/*  Copyright 2003-2005, 2011, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -19,6 +19,7 @@
 
 #include "afdummy.h"
 #include "afhints.h"
 
 #include "afdummy.h"
 #include "afhints.h"
+#include "aferrors.h"
 
 
   static FT_Error
 
 
   static FT_Error
@@ -27,7 +28,7 @@
   {
     af_glyph_hints_rescale( hints,
                             metrics );
   {
     af_glyph_hints_rescale( hints,
                             metrics );
-    return 0;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     FT_UNUSED( hints );
     FT_UNUSED( outline );
 
     FT_UNUSED( hints );
     FT_UNUSED( outline );
 
-    return 0;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-  AF_DEFINE_SCRIPT_CLASS(af_dummy_script_class,
-    AF_SCRIPT_NONE,
+  AF_DEFINE_SCRIPT_CLASS( af_dummy_script_class,
+    AF_SCRIPT_DUMMY,
     NULL,
     NULL,
+    0,
 
 
-    sizeof( AF_ScriptMetricsRec ),
+    sizeof ( AF_ScriptMetricsRec ),
 
     (AF_Script_InitMetricsFunc) NULL,
     (AF_Script_ScaleMetricsFunc)NULL,
 
     (AF_Script_InitMetricsFunc) NULL,
     (AF_Script_ScaleMetricsFunc)NULL,
index b69ef43..95d8f8c 100644 (file)
@@ -5,7 +5,7 @@
 /*    Auto-fitter dummy routines to be used if no hinting should be        */
 /*    performed (specification).                                           */
 /*                                                                         */
 /*    Auto-fitter dummy routines to be used if no hinting should be        */
 /*    performed (specification).                                           */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005 by                                          */
+/*  Copyright 2003-2005, 2011 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,7 +29,7 @@ FT_BEGIN_HEADER
   *  be performed.  This is the default for non-latin glyphs!
   */
 
   *  be performed.  This is the default for non-latin glyphs!
   */
 
-  AF_DECLARE_SCRIPT_CLASS(af_dummy_script_class)
+  AF_DECLARE_SCRIPT_CLASS( af_dummy_script_class )
 
 /* */
 
 
 /* */
 
index c2ed5fe..50e1a22 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Autofitter error codes (specification only).                         */
 /*                                                                         */
 /*                                                                         */
 /*    Autofitter error codes (specification only).                         */
 /*                                                                         */
-/*  Copyright 2005 by                                                      */
+/*  Copyright 2005, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,6 +30,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  AF_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Autofit
 
 #define FT_ERR_PREFIX  AF_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Autofit
 
index 178c884..3e41465 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter routines to compute global hinting values (body).        */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter routines to compute global hinting values (body).        */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by            */
+/*  Copyright 2003-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -31,8 +31,8 @@
 
 #ifndef FT_CONFIG_OPTION_PIC
 
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-/* when updating this table, don't forget to update 
-  AF_SCRIPT_CLASSES_COUNT and autofit_module_class_pic_init */
+  /* when updating this table, don't forget to update          */
+  /* AF_SCRIPT_CLASSES_COUNT and autofit_module_class_pic_init */
 
   /* populate this list when you add new scripts */
   static AF_ScriptClass const  af_script_classes[] =
 
   /* populate this list when you add new scripts */
   static AF_ScriptClass const  af_script_classes[] =
 #endif
     &af_latin_script_class,
     &af_cjk_script_class,
 #endif
     &af_latin_script_class,
     &af_cjk_script_class,
-    &af_indic_script_class, 
+    &af_indic_script_class,
     NULL  /* do not remove */
   };
 
     NULL  /* do not remove */
   };
 
-#endif /* FT_CONFIG_OPTION_PIC */
-
-  /* index of default script in `af_script_classes' */
-#define AF_SCRIPT_LIST_DEFAULT  2
-  /* a bit mask indicating an uncovered glyph       */
-#define AF_SCRIPT_LIST_NONE     0x7F
-  /* if this flag is set, we have an ASCII digit    */
-#define AF_DIGIT                0x80
-
-
-  /*
-   *  Note that glyph_scripts[] is used to map each glyph into
-   *  an index into the `af_script_classes' array.
-   *
-   */
-  typedef struct  AF_FaceGlobalsRec_
-  {
-    FT_Face           face;
-    FT_Long           glyph_count;    /* same as face->num_glyphs */
-    FT_Byte*          glyph_scripts;
-
-    AF_ScriptMetrics  metrics[AF_SCRIPT_MAX];
-
-  } AF_FaceGlobalsRec;
+#endif /* !FT_CONFIG_OPTION_PIC */
 
 
   /* Compute the script index of each glyph within a given face. */
 
 
   /* Compute the script index of each glyph within a given face. */
   static FT_Error
   af_face_globals_compute_script_coverage( AF_FaceGlobals  globals )
   {
   static FT_Error
   af_face_globals_compute_script_coverage( AF_FaceGlobals  globals )
   {
-    FT_Error    error       = AF_Err_Ok;
+    FT_Error    error;
     FT_Face     face        = globals->face;
     FT_CharMap  old_charmap = face->charmap;
     FT_Byte*    gscripts    = globals->glyph_scripts;
     FT_Face     face        = globals->face;
     FT_CharMap  old_charmap = face->charmap;
     FT_Byte*    gscripts    = globals->glyph_scripts;
-    FT_UInt     ss, i;
+    FT_UInt     ss;
+    FT_UInt     i;
 
 
 
 
-    /* the value 255 means `uncovered glyph' */
+    /* the value AF_SCRIPT_NONE means `uncovered glyph' */
     FT_MEM_SET( globals->glyph_scripts,
     FT_MEM_SET( globals->glyph_scripts,
-                AF_SCRIPT_LIST_NONE,
+                AF_SCRIPT_NONE,
                 globals->glyph_count );
 
     error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
     if ( error )
     {
      /*
                 globals->glyph_count );
 
     error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
     if ( error )
     {
      /*
-      *  Ignore this error; we simply use the default script.
+      *  Ignore this error; we simply use the fallback script.
       *  XXX: Shouldn't we rather disable hinting?
       */
       *  XXX: Shouldn't we rather disable hinting?
       */
-      error = AF_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
       goto Exit;
     }
 
         continue;
 
       /*
         continue;
 
       /*
-       *  Scan all unicode points in the range and set the corresponding
+       *  Scan all Unicode points in the range and set the corresponding
        *  glyph script index.
        */
       for ( range = clazz->script_uni_ranges; range->first != 0; range++ )
        *  glyph script index.
        */
       for ( range = clazz->script_uni_ranges; range->first != 0; range++ )
 
         if ( gindex != 0                             &&
              gindex < (FT_ULong)globals->glyph_count &&
 
         if ( gindex != 0                             &&
              gindex < (FT_ULong)globals->glyph_count &&
-             gscripts[gindex] == AF_SCRIPT_LIST_NONE )
-        {
+             gscripts[gindex] == AF_SCRIPT_NONE )
           gscripts[gindex] = (FT_Byte)ss;
           gscripts[gindex] = (FT_Byte)ss;
-        }
 
         for (;;)
         {
 
         for (;;)
         {
             break;
 
           if ( gindex < (FT_ULong)globals->glyph_count &&
             break;
 
           if ( gindex < (FT_ULong)globals->glyph_count &&
-               gscripts[gindex] == AF_SCRIPT_LIST_NONE )
-          {
+               gscripts[gindex] == AF_SCRIPT_NONE )
             gscripts[gindex] = (FT_Byte)ss;
             gscripts[gindex] = (FT_Byte)ss;
-          }
         }
       }
     }
         }
       }
     }
 
   Exit:
     /*
 
   Exit:
     /*
-     *  By default, all uncovered glyphs are set to the latin script.
+     *  By default, all uncovered glyphs are set to the fallback script.
      *  XXX: Shouldn't we disable hinting or do something similar?
      */
      *  XXX: Shouldn't we disable hinting or do something similar?
      */
+    if ( globals->module->fallback_script != AF_SCRIPT_NONE )
     {
       FT_Long  nn;
 
 
       for ( nn = 0; nn < globals->glyph_count; nn++ )
       {
     {
       FT_Long  nn;
 
 
       for ( nn = 0; nn < globals->glyph_count; nn++ )
       {
-        if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_LIST_NONE )
+        if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_NONE )
         {
         {
-          gscripts[nn] &= ~AF_SCRIPT_LIST_NONE;
-          gscripts[nn] |= AF_SCRIPT_LIST_DEFAULT;
+          gscripts[nn] &= ~AF_SCRIPT_NONE;
+          gscripts[nn] |= globals->module->fallback_script;
         }
       }
     }
         }
       }
     }
 
   FT_LOCAL_DEF( FT_Error )
   af_face_globals_new( FT_Face          face,
 
   FT_LOCAL_DEF( FT_Error )
   af_face_globals_new( FT_Face          face,
-                       AF_FaceGlobals  *aglobals )
+                       AF_FaceGlobals  *aglobals,
+                       AF_Module        module )
   {
     FT_Error        error;
     FT_Memory       memory;
   {
     FT_Error        error;
     FT_Memory       memory;
 
     memory = face->memory;
 
 
     memory = face->memory;
 
-    if ( !FT_ALLOC( globals, sizeof ( *globals ) +
-                             face->num_glyphs * sizeof ( FT_Byte ) ) )
-    {
-      globals->face          = face;
-      globals->glyph_count   = face->num_glyphs;
-      globals->glyph_scripts = (FT_Byte*)( globals + 1 );
+    if ( FT_ALLOC( globals, sizeof ( *globals ) +
+                            face->num_glyphs * sizeof ( FT_Byte ) ) )
+      goto Exit;
 
 
-      error = af_face_globals_compute_script_coverage( globals );
-      if ( error )
-      {
-        af_face_globals_free( globals );
-        globals = NULL;
-      }
+    globals->face          = face;
+    globals->glyph_count   = face->num_glyphs;
+    globals->glyph_scripts = (FT_Byte*)( globals + 1 );
+    globals->module        = module;
+
+    error = af_face_globals_compute_script_coverage( globals );
+    if ( error )
+    {
+      af_face_globals_free( globals );
+      globals = NULL;
     }
 
     }
 
+    globals->increase_x_height = AF_PROP_INCREASE_X_HEIGHT_MAX;
+
+  Exit:
     *aglobals = globals;
     return error;
   }
     *aglobals = globals;
     return error;
   }
     FT_UInt           script     = options & 15;
     const FT_Offset   script_max = sizeof ( AF_SCRIPT_CLASSES_GET ) /
                                      sizeof ( AF_SCRIPT_CLASSES_GET[0] );
     FT_UInt           script     = options & 15;
     const FT_Offset   script_max = sizeof ( AF_SCRIPT_CLASSES_GET ) /
                                      sizeof ( AF_SCRIPT_CLASSES_GET[0] );
-    FT_Error          error      = AF_Err_Ok;
+    FT_Error          error      = FT_Err_Ok;
 
 
     if ( gindex >= (FT_ULong)globals->glyph_count )
     {
 
 
     if ( gindex >= (FT_ULong)globals->glyph_count )
     {
-      error = AF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     gidx = script;
     if ( gidx == 0 || gidx + 1 >= script_max )
       goto Exit;
     }
 
     gidx = script;
     if ( gidx == 0 || gidx + 1 >= script_max )
-      gidx = globals->glyph_scripts[gindex] & AF_SCRIPT_LIST_NONE;
+      gidx = globals->glyph_scripts[gindex] & AF_SCRIPT_NONE;
 
     clazz = AF_SCRIPT_CLASSES_GET[gidx];
     if ( script == 0 )
 
     clazz = AF_SCRIPT_CLASSES_GET[gidx];
     if ( script == 0 )
     metrics = globals->metrics[clazz->script];
     if ( metrics == NULL )
     {
     metrics = globals->metrics[clazz->script];
     if ( metrics == NULL )
     {
-      /* create the global metrics object when needed */
+      /* create the global metrics object if necessary */
       FT_Memory  memory = globals->face->memory;
 
 
       if ( FT_ALLOC( metrics, clazz->script_metrics_size ) )
         goto Exit;
 
       FT_Memory  memory = globals->face->memory;
 
 
       if ( FT_ALLOC( metrics, clazz->script_metrics_size ) )
         goto Exit;
 
-      metrics->clazz = clazz;
+      metrics->clazz   = clazz;
+      metrics->globals = globals;
 
       if ( clazz->script_metrics_init )
       {
 
       if ( clazz->script_metrics_init )
       {
index 2a68e19..2e24900 100644 (file)
@@ -5,7 +5,7 @@
 /*    Auto-fitter routines to compute global hinting values                */
 /*    (specification).                                                     */
 /*                                                                         */
 /*    Auto-fitter routines to compute global hinting values                */
 /*    (specification).                                                     */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2007, 2009 by                              */
+/*  Copyright 2003-2005, 2007, 2009, 2011-2012 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
-#ifndef __AF_GLOBAL_H__
-#define __AF_GLOBAL_H__
+#ifndef __AFGLOBAL_H__
+#define __AFGLOBAL_H__
 
 
 #include "aftypes.h"
 
 
 #include "aftypes.h"
+#include "afmodule.h"
 
 
 FT_BEGIN_HEADER
 
 
 
 
 FT_BEGIN_HEADER
 
 
+  /*
+   *  Default values and flags for both autofitter globals (found in
+   *  AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
+   */
+
+  /* index of fallback script in `af_script_classes' */
+#define AF_SCRIPT_FALLBACK  2
+  /* a bit mask indicating an uncovered glyph        */
+#define AF_SCRIPT_NONE      0x7F
+  /* if this flag is set, we have an ASCII digit     */
+#define AF_DIGIT            0x80
+
+  /* `increase-x-height' property */
+#define AF_PROP_INCREASE_X_HEIGHT_MIN  6
+#define AF_PROP_INCREASE_X_HEIGHT_MAX  0
+
+
   /************************************************************************/
   /************************************************************************/
   /*****                                                              *****/
   /************************************************************************/
   /************************************************************************/
   /*****                                                              *****/
@@ -36,16 +54,36 @@ FT_BEGIN_HEADER
   /************************************************************************/
 
 
   /************************************************************************/
 
 
+  /*
+   *  Note that glyph_scripts[] is used to map each glyph into
+   *  an index into the `af_script_classes' array.
+   *
+   */
+  typedef struct  AF_FaceGlobalsRec_
+  {
+    FT_Face           face;
+    FT_Long           glyph_count;    /* same as face->num_glyphs */
+    FT_Byte*          glyph_scripts;
+
+    /* per-face auto-hinter properties */
+    FT_UInt           increase_x_height;
+
+    AF_ScriptMetrics  metrics[AF_SCRIPT_MAX];
+
+    AF_Module         module;         /* to access global properties */
+
+  } AF_FaceGlobalsRec;
+
+
   /*
    *  model the global hints data for a given face, decomposed into
    *  script-specific items
    */
   /*
    *  model the global hints data for a given face, decomposed into
    *  script-specific items
    */
-  typedef struct AF_FaceGlobalsRec_*   AF_FaceGlobals;
-
 
   FT_LOCAL( FT_Error )
   af_face_globals_new( FT_Face          face,
 
   FT_LOCAL( FT_Error )
   af_face_globals_new( FT_Face          face,
-                       AF_FaceGlobals  *aglobals );
+                       AF_FaceGlobals  *aglobals,
+                       AF_Module        module );
 
   FT_LOCAL( FT_Error )
   af_face_globals_get_metrics( AF_FaceGlobals     globals,
 
   FT_LOCAL( FT_Error )
   af_face_globals_get_metrics( AF_FaceGlobals     globals,
@@ -65,7 +103,7 @@ FT_BEGIN_HEADER
 
 FT_END_HEADER
 
 
 FT_END_HEADER
 
-#endif /* __AF_GLOBALS_H__ */
+#endif /* __AFGLOBAL_H__ */
 
 
 /* END */
 
 
 /* END */
index c349709..e8defaa 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines (body).                                 */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter hinting routines (body).                                 */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2009, 2010 by                  */
+/*  Copyright 2003-2007, 2009-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include "afhints.h"
 #include "aferrors.h"
 #include FT_INTERNAL_CALC_H
 #include "afhints.h"
 #include "aferrors.h"
 #include FT_INTERNAL_CALC_H
+#include FT_INTERNAL_DEBUG_H
 
 
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_afhints
+
+
+  /* Get new segment for given axis. */
+
   FT_LOCAL_DEF( FT_Error )
   af_axis_hints_new_segment( AF_AxisHints  axis,
                              FT_Memory     memory,
                              AF_Segment   *asegment )
   {
   FT_LOCAL_DEF( FT_Error )
   af_axis_hints_new_segment( AF_AxisHints  axis,
                              FT_Memory     memory,
                              AF_Segment   *asegment )
   {
-    FT_Error    error   = AF_Err_Ok;
+    FT_Error    error   = FT_Err_Ok;
     AF_Segment  segment = NULL;
 
 
     AF_Segment  segment = NULL;
 
 
@@ -39,7 +52,7 @@
 
       if ( old_max >= big_max )
       {
 
       if ( old_max >= big_max )
       {
-        error = AF_Err_Out_Of_Memory;
+        error = FT_THROW( Out_Of_Memory );
         goto Exit;
       }
 
         goto Exit;
       }
 
   }
 
 
   }
 
 
+  /* Get new edge for given axis, direction, and position. */
+
   FT_LOCAL( FT_Error )
   af_axis_hints_new_edge( AF_AxisHints  axis,
                           FT_Int        fpos,
                           AF_Direction  dir,
                           FT_Memory     memory,
   FT_LOCAL( FT_Error )
   af_axis_hints_new_edge( AF_AxisHints  axis,
                           FT_Int        fpos,
                           AF_Direction  dir,
                           FT_Memory     memory,
-                          AF_Edge      *aedge )
+                          AF_Edge      *anedge )
   {
   {
-    FT_Error  error = AF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     AF_Edge   edge  = NULL;
     AF_Edge   edges;
 
     AF_Edge   edge  = NULL;
     AF_Edge   edges;
 
@@ -82,7 +97,7 @@
 
       if ( old_max >= big_max )
       {
 
       if ( old_max >= big_max )
       {
-        error = AF_Err_Out_Of_Memory;
+        error = FT_THROW( Out_Of_Memory );
         goto Exit;
       }
 
         goto Exit;
       }
 
     edge->dir  = (FT_Char)dir;
 
   Exit:
     edge->dir  = (FT_Char)dir;
 
   Exit:
-    *aedge = edge;
+    *anedge = edge;
     return error;
   }
 
 
     return error;
   }
 
 
-#ifdef AF_DEBUG
+#ifdef FT_DEBUG_AUTOFIT
 
 #include FT_CONFIG_STANDARD_LIBRARY_H
 
 
 #include FT_CONFIG_STANDARD_LIBRARY_H
 
 #define AF_INDEX_NUM( ptr, base )  ( (ptr) ? ( (ptr) - (base) ) : -1 )
 
 
 #define AF_INDEX_NUM( ptr, base )  ( (ptr) ? ( (ptr) - (base) ) : -1 )
 
 
+#ifdef __cplusplus
+  extern "C" {
+#endif
   void
   af_glyph_hints_dump_points( AF_GlyphHints  hints )
   {
   void
   af_glyph_hints_dump_points( AF_GlyphHints  hints )
   {
     AF_Point  point;
 
 
     AF_Point  point;
 
 
-    printf( "Table of points:\n" );
-    printf(   "  [ index |  xorg |  yorg |  xscale |  yscale "
-              "|  xfit  |  yfit  |  flags ]\n" );
+    FT_TRACE7(( "Table of points:\n"
+                "  [ index |  xorg |  yorg | xscale | yscale"
+                " |  xfit |  yfit |  flags ]\n" ));
 
     for ( point = points; point < limit; point++ )
 
     for ( point = points; point < limit; point++ )
-    {
-      printf( "  [ %5d | %5d | %5d | %-5.2f | %-5.2f "
-              "| %-5.2f | %-5.2f | %c%c%c%c%c%c ]\n",
-              point - points,
-              point->fx,
-              point->fy,
-              point->ox/64.0,
-              point->oy/64.0,
-              point->x/64.0,
-              point->y/64.0,
-              ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? 'w' : ' ',
-              ( point->flags & AF_FLAG_INFLECTION )         ? 'i' : ' ',
-              ( point->flags & AF_FLAG_EXTREMA_X )          ? '<' : ' ',
-              ( point->flags & AF_FLAG_EXTREMA_Y )          ? 'v' : ' ',
-              ( point->flags & AF_FLAG_ROUND_X )            ? '(' : ' ',
-              ( point->flags & AF_FLAG_ROUND_Y )            ? 'u' : ' ');
-    }
-    printf( "\n" );
+      FT_TRACE7(( "  [ %5d | %5d | %5d | %6.2f | %6.2f"
+                  " | %5.2f | %5.2f | %c%c%c%c%c%c ]\n",
+                  point - points,
+                  point->fx,
+                  point->fy,
+                  point->ox / 64.0,
+                  point->oy / 64.0,
+                  point->x / 64.0,
+                  point->y / 64.0,
+                  ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? 'w' : ' ',
+                  ( point->flags & AF_FLAG_INFLECTION )         ? 'i' : ' ',
+                  ( point->flags & AF_FLAG_EXTREMA_X )          ? '<' : ' ',
+                  ( point->flags & AF_FLAG_EXTREMA_Y )          ? 'v' : ' ',
+                  ( point->flags & AF_FLAG_ROUND_X )            ? '(' : ' ',
+                  ( point->flags & AF_FLAG_ROUND_Y )            ? 'u' : ' '));
+    FT_TRACE7(( "\n" ));
   }
   }
+#ifdef __cplusplus
+  }
+#endif
 
 
   static const char*
 
 
   static const char*
     if ( pos == 0 )
       return "normal";
 
     if ( pos == 0 )
       return "normal";
 
-    temp[pos] = 0;
+    temp[pos] = '\0';
 
     return temp;
   }
 
 
 
     return temp;
   }
 
 
-  /* A function to dump the array of linked segments. */
+  /* Dump the array of linked segments. */
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
   void
   af_glyph_hints_dump_segments( AF_GlyphHints  hints )
   {
   void
   af_glyph_hints_dump_segments( AF_GlyphHints  hints )
   {
     for ( dimension = 1; dimension >= 0; dimension-- )
     {
       AF_AxisHints  axis     = &hints->axis[dimension];
     for ( dimension = 1; dimension >= 0; dimension-- )
     {
       AF_AxisHints  axis     = &hints->axis[dimension];
+      AF_Point      points   = hints->points;
+      AF_Edge       edges    = axis->edges;
       AF_Segment    segments = axis->segments;
       AF_Segment    limit    = segments + axis->num_segments;
       AF_Segment    seg;
 
 
       AF_Segment    segments = axis->segments;
       AF_Segment    limit    = segments + axis->num_segments;
       AF_Segment    seg;
 
 
-      printf ( "Table of %s segments:\n",
-               dimension == AF_DIMENSION_HORZ ? "vertical" : "horizontal" );
-      printf ( "  [ index |  pos  |  dir  | link | serif |"
-               " height  | extra | flags    ]\n" );
+      FT_TRACE7(( "Table of %s segments:\n",
+                  dimension == AF_DIMENSION_HORZ ? "vertical"
+                                                 : "horizontal" ));
+      if ( axis->num_segments )
+        FT_TRACE7(( "  [ index |  pos  |  dir  | from"
+                    " |  to  | link | serif | edge"
+                    " | height | extra |    flags    ]\n" ));
+      else
+        FT_TRACE7(( "  (none)\n" ));
 
       for ( seg = segments; seg < limit; seg++ )
 
       for ( seg = segments; seg < limit; seg++ )
-      {
-        printf ( "  [ %5d | %5.2g | %5s | %4d | %5d | %5d | %5d | %s ]\n",
-                 seg - segments,
-                 dimension == AF_DIMENSION_HORZ ? (int)seg->first->ox / 64.0
-                                                : (int)seg->first->oy / 64.0,
-                 af_dir_str( (AF_Direction)seg->dir ),
-                 AF_INDEX_NUM( seg->link, segments ),
-                 AF_INDEX_NUM( seg->serif, segments ),
-                 seg->height,
-                 seg->height - ( seg->max_coord - seg->min_coord ),
-                 af_edge_flags_to_string( seg->flags ) );
-      }
-      printf( "\n" );
+        FT_TRACE7(( "  [ %5d | %5.2g | %5s | %4d"
+                    " | %4d | %4d | %5d | %4d"
+                    " | %6d | %5d | %11s ]\n",
+                    seg - segments,
+                    dimension == AF_DIMENSION_HORZ
+                                 ? (int)seg->first->ox / 64.0
+                                 : (int)seg->first->oy / 64.0,
+                    af_dir_str( (AF_Direction)seg->dir ),
+                    AF_INDEX_NUM( seg->first, points ),
+                    AF_INDEX_NUM( seg->last, points ),
+                    AF_INDEX_NUM( seg->link, segments ),
+                    AF_INDEX_NUM( seg->serif, segments ),
+                    AF_INDEX_NUM( seg->edge, edges ),
+                    seg->height,
+                    seg->height - ( seg->max_coord - seg->min_coord ),
+                    af_edge_flags_to_string( (AF_Edge_Flags)seg->flags ) ));
+      FT_TRACE7(( "\n" ));
     }
   }
     }
   }
+#ifdef __cplusplus
+  }
+#endif
+
+
+  /* Fetch number of segments. */
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+  FT_Error
+  af_glyph_hints_get_num_segments( AF_GlyphHints  hints,
+                                   FT_Int         dimension,
+                                   FT_Int*        num_segments )
+  {
+    AF_Dimension  dim;
+    AF_AxisHints  axis;
+
 
 
+    dim = ( dimension == 0 ) ? AF_DIMENSION_HORZ : AF_DIMENSION_VERT;
 
 
+    axis          = &hints->axis[dim];
+    *num_segments = axis->num_segments;
+
+    return FT_Err_Ok;
+  }
+#ifdef __cplusplus
+  }
+#endif
+
+
+  /* Fetch offset of segments into user supplied offset array. */
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+  FT_Error
+  af_glyph_hints_get_segment_offset( AF_GlyphHints  hints,
+                                     FT_Int         dimension,
+                                     FT_Int         idx,
+                                     FT_Pos*        offset )
+  {
+    AF_Dimension  dim;
+    AF_AxisHints  axis;
+    AF_Segment    seg;
+
+
+    if ( !offset )
+      return FT_THROW( Invalid_Argument );
+
+    dim = ( dimension == 0 ) ? AF_DIMENSION_HORZ : AF_DIMENSION_VERT;
+
+    axis = &hints->axis[dim];
+
+    if ( idx < 0 || idx >= axis->num_segments )
+      return FT_THROW( Invalid_Argument );
+
+    seg     = &axis->segments[idx];
+    *offset = ( dim == AF_DIMENSION_HORZ ) ? seg->first->ox
+                                           : seg->first->oy;
+
+    return FT_Err_Ok;
+  }
+#ifdef __cplusplus
+  }
+#endif
+
+
+  /* Dump the array of linked edges. */
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
   void
   af_glyph_hints_dump_edges( AF_GlyphHints  hints )
   {
   void
   af_glyph_hints_dump_edges( AF_GlyphHints  hints )
   {
 
       /*
        *  note: AF_DIMENSION_HORZ corresponds to _vertical_ edges
 
       /*
        *  note: AF_DIMENSION_HORZ corresponds to _vertical_ edges
-       *        since they have constant a X coordinate.
+       *        since they have a constant X coordinate.
        */
        */
-      printf ( "Table of %s edges:\n",
-               dimension == AF_DIMENSION_HORZ ? "vertical" : "horizontal" );
-      printf ( "  [ index |  pos  |  dir  | link |"
-               " serif | blue | opos  |  pos  | flags   ]\n" );
+      FT_TRACE7(( "Table of %s edges:\n",
+                  dimension == AF_DIMENSION_HORZ ? "vertical"
+                                                 : "horizontal" ));
+      if ( axis->num_edges )
+        FT_TRACE7(( "  [ index |  pos  |  dir  | link"
+                    " | serif | blue | opos  |  pos  |    flags    ]\n" ));
+      else
+        FT_TRACE7(( "  (none)\n" ));
 
       for ( edge = edges; edge < limit; edge++ )
 
       for ( edge = edges; edge < limit; edge++ )
-      {
-        printf ( "  [ %5d | %5.2g | %5s | %4d |"
-                 " %5d |   %c  | %5.2f | %5.2f | %s ]\n",
-                 edge - edges,
-                 (int)edge->opos / 64.0,
-                 af_dir_str( (AF_Direction)edge->dir ),
-                 AF_INDEX_NUM( edge->link, edges ),
-                 AF_INDEX_NUM( edge->serif, edges ),
-                 edge->blue_edge ? 'y' : 'n',
-                 edge->opos / 64.0,
-                 edge->pos / 64.0,
-                 af_edge_flags_to_string( edge->flags ) );
-      }
-      printf( "\n" );
+        FT_TRACE7(( "  [ %5d | %5.2g | %5s | %4d"
+                    " | %5d |   %c  | %5.2f | %5.2f | %11s ]\n",
+                    edge - edges,
+                    (int)edge->opos / 64.0,
+                    af_dir_str( (AF_Direction)edge->dir ),
+                    AF_INDEX_NUM( edge->link, edges ),
+                    AF_INDEX_NUM( edge->serif, edges ),
+                    edge->blue_edge ? 'y' : 'n',
+                    edge->opos / 64.0,
+                    edge->pos / 64.0,
+                    af_edge_flags_to_string( (AF_Edge_Flags)edge->flags ) ));
+      FT_TRACE7(( "\n" ));
     }
   }
     }
   }
+#ifdef __cplusplus
+  }
+#endif
 
 
-#else /* !AF_DEBUG */
+#else /* !FT_DEBUG_AUTOFIT */
 
   /* these empty stubs are only used to link the `ftgrid' test program */
 
   /* these empty stubs are only used to link the `ftgrid' test program */
-  /* when debugging is disabled                                        */
+  /* if debugging is disabled                                          */
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
 
   void
   af_glyph_hints_dump_points( AF_GlyphHints  hints )
 
   void
   af_glyph_hints_dump_points( AF_GlyphHints  hints )
   }
 
 
   }
 
 
+  FT_Error
+  af_glyph_hints_get_num_segments( AF_GlyphHints  hints,
+                                   FT_Int         dimension,
+                                   FT_Int*        num_segments )
+  {
+    FT_UNUSED( hints );
+    FT_UNUSED( dimension );
+    FT_UNUSED( num_segments );
+
+    return 0;
+  }
+
+
+  FT_Error
+  af_glyph_hints_get_segment_offset( AF_GlyphHints  hints,
+                                     FT_Int         dimension,
+                                     FT_Int         idx,
+                                     FT_Pos*        offset )
+  {
+    FT_UNUSED( hints );
+    FT_UNUSED( dimension );
+    FT_UNUSED( idx );
+    FT_UNUSED( offset );
+
+    return 0;
+  }
+
+
   void
   af_glyph_hints_dump_edges( AF_GlyphHints  hints )
   {
     FT_UNUSED( hints );
   }
 
   void
   af_glyph_hints_dump_edges( AF_GlyphHints  hints )
   {
     FT_UNUSED( hints );
   }
 
-#endif /* !AF_DEBUG */
+#ifdef __cplusplus
+  }
+#endif
+
+#endif /* !FT_DEBUG_AUTOFIT */
 
 
 
 
-  /* compute the direction value of a given vector */
+  /* Compute the direction value of a given vector. */
+
   FT_LOCAL_DEF( AF_Direction )
   af_direction_compute( FT_Pos  dx,
                         FT_Pos  dy )
   FT_LOCAL_DEF( AF_Direction )
   af_direction_compute( FT_Pos  dx,
                         FT_Pos  dy )
       }
     }
 
       }
     }
 
+    /* return no direction if arm lengths differ too much            */
+    /* (value 14 is heuristic, corresponding to approx. 4.1 degrees) */
     ss *= 14;
     if ( FT_ABS( ll ) <= FT_ABS( ss ) )
       dir = AF_DIR_NONE;
     ss *= 14;
     if ( FT_ABS( ll ) <= FT_ABS( ss ) )
       dir = AF_DIR_NONE;
   FT_LOCAL_DEF( void )
   af_glyph_hints_done( AF_GlyphHints  hints )
   {
   FT_LOCAL_DEF( void )
   af_glyph_hints_done( AF_GlyphHints  hints )
   {
-    if ( hints && hints->memory )
-    {
-      FT_Memory  memory = hints->memory;
-      int        dim;
+    FT_Memory  memory = hints->memory;
+    int        dim;
 
 
 
 
-      /*
-       *  note that we don't need to free the segment and edge
-       *  buffers, since they are really within the hints->points array
-       */
-      for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
-      {
-        AF_AxisHints  axis = &hints->axis[dim];
+    if ( !( hints && hints->memory ) )
+      return;
 
 
+    /*
+     *  note that we don't need to free the segment and edge
+     *  buffers since they are really within the hints->points array
+     */
+    for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
+    {
+      AF_AxisHints  axis = &hints->axis[dim];
 
 
-        axis->num_segments = 0;
-        axis->max_segments = 0;
-        FT_FREE( axis->segments );
 
 
-        axis->num_edges    = 0;
-        axis->max_edges    = 0;
-        FT_FREE( axis->edges );
-      }
+      axis->num_segments = 0;
+      axis->max_segments = 0;
+      FT_FREE( axis->segments );
+
+      axis->num_edges = 0;
+      axis->max_edges = 0;
+      FT_FREE( axis->edges );
+    }
 
 
-      FT_FREE( hints->contours );
-      hints->max_contours = 0;
-      hints->num_contours = 0;
+    FT_FREE( hints->contours );
+    hints->max_contours = 0;
+    hints->num_contours = 0;
 
 
-      FT_FREE( hints->points );
-      hints->num_points = 0;
-      hints->max_points = 0;
+    FT_FREE( hints->points );
+    hints->num_points = 0;
+    hints->max_points = 0;
 
 
-      hints->memory = NULL;
-    }
+    hints->memory = NULL;
   }
 
 
   }
 
 
+  /* Reset metrics. */
+
   FT_LOCAL_DEF( void )
   af_glyph_hints_rescale( AF_GlyphHints     hints,
                           AF_ScriptMetrics  metrics )
   FT_LOCAL_DEF( void )
   af_glyph_hints_rescale( AF_GlyphHints     hints,
                           AF_ScriptMetrics  metrics )
   }
 
 
   }
 
 
+  /* Recompute all AF_Point in AF_GlyphHints from the definitions */
+  /* in a source outline.                                         */
+
   FT_LOCAL_DEF( FT_Error )
   af_glyph_hints_reload( AF_GlyphHints  hints,
                          FT_Outline*    outline )
   {
   FT_LOCAL_DEF( FT_Error )
   af_glyph_hints_reload( AF_GlyphHints  hints,
                          FT_Outline*    outline )
   {
-    FT_Error   error   = AF_Err_Ok;
+    FT_Error   error   = FT_Err_Ok;
     AF_Point   points;
     FT_UInt    old_max, new_max;
     FT_Fixed   x_scale = hints->x_scale;
     AF_Point   points;
     FT_UInt    old_max, new_max;
     FT_Fixed   x_scale = hints->x_scale;
     hints->axis[1].num_segments = 0;
     hints->axis[1].num_edges    = 0;
 
     hints->axis[1].num_segments = 0;
     hints->axis[1].num_edges    = 0;
 
-    /* first of all, reallocate the contours array when necessary */
+    /* first of all, reallocate the contours array if necessary */
     new_max = (FT_UInt)outline->n_contours;
     old_max = hints->max_contours;
     if ( new_max > old_max )
     {
     new_max = (FT_UInt)outline->n_contours;
     old_max = hints->max_contours;
     if ( new_max > old_max )
     {
-      new_max = ( new_max + 3 ) & ~3;
+      new_max = ( new_max + 3 ) & ~3; /* round up to a multiple of 4 */
 
       if ( FT_RENEW_ARRAY( hints->contours, old_max, new_max ) )
         goto Exit;
 
       if ( FT_RENEW_ARRAY( hints->contours, old_max, new_max ) )
         goto Exit;
     old_max = hints->max_points;
     if ( new_max > old_max )
     {
     old_max = hints->max_points;
     if ( new_max > old_max )
     {
-      new_max = ( new_max + 2 + 7 ) & ~7;
+      new_max = ( new_max + 2 + 7 ) & ~7; /* round up to a multiple of 8 */
 
       if ( FT_RENEW_ARRAY( hints->points, old_max, new_max ) )
         goto Exit;
 
       if ( FT_RENEW_ARRAY( hints->points, old_max, new_max ) )
         goto Exit;
             point->flags = AF_FLAG_CUBIC;
             break;
           default:
             point->flags = AF_FLAG_CUBIC;
             break;
           default:
-            point->flags = 0;
+            point->flags = AF_FLAG_NONE;
           }
 
           point->prev = prev;
           }
 
           point->prev = prev;
         }
       }
 
         }
       }
 
-      /* set-up the contours array */
+      /* set up the contours array */
       {
         AF_Point*  contour       = hints->contours;
         AF_Point*  contour_limit = contour + hints->num_contours;
       {
         AF_Point*  contour       = hints->contours;
         AF_Point*  contour_limit = contour + hints->num_contours;
           in_dir         = af_direction_compute( out_x, out_y );
           point->out_dir = (FT_Char)in_dir;
 
           in_dir         = af_direction_compute( out_x, out_y );
           point->out_dir = (FT_Char)in_dir;
 
-          if ( point->flags & ( AF_FLAG_CONIC | AF_FLAG_CUBIC ) )
+          /* check for weak points */
+
+          if ( point->flags & AF_FLAG_CONTROL )
           {
           Is_Weak_Point:
             point->flags |= AF_FLAG_WEAK_INTERPOLATION;
           {
           Is_Weak_Point:
             point->flags |= AF_FLAG_WEAK_INTERPOLATION;
   }
 
 
   }
 
 
+  /* Store the hinted outline in an FT_Outline structure. */
+
   FT_LOCAL_DEF( void )
   af_glyph_hints_save( AF_GlyphHints  hints,
                        FT_Outline*    outline )
   FT_LOCAL_DEF( void )
   af_glyph_hints_save( AF_GlyphHints  hints,
                        FT_Outline*    outline )
    ****************************************************************/
 
 
    ****************************************************************/
 
 
+  /* Align all points of an edge to the same coordinate value, */
+  /* either horizontally or vertically.                        */
+
   FT_LOCAL_DEF( void )
   af_glyph_hints_align_edge_points( AF_GlyphHints  hints,
                                     AF_Dimension   dim )
   FT_LOCAL_DEF( void )
   af_glyph_hints_align_edge_points( AF_GlyphHints  hints,
                                     AF_Dimension   dim )
             break;
 
           point = point->next;
             break;
 
           point = point->next;
-
         }
       }
     }
         }
       }
     }
    ****************************************************************/
 
 
    ****************************************************************/
 
 
-  /* hint the strong points -- this is equivalent to the TrueType `IP' */
-  /* hinting instruction                                               */
+  /* Hint the strong points -- this is equivalent to the TrueType `IP' */
+  /* hinting instruction.                                              */
 
   FT_LOCAL_DEF( void )
   af_glyph_hints_align_strong_points( AF_GlyphHints  hints,
 
   FT_LOCAL_DEF( void )
   af_glyph_hints_align_strong_points( AF_GlyphHints  hints,
           max = edge_limit - edges;
 
 #if 1
           max = edge_limit - edges;
 
 #if 1
-          /* for small edge counts, a linear search is better */
+          /* for a small number of edges, a linear search is better */
           if ( max <= 8 )
           {
             FT_PtrDist  nn;
 
           if ( max <= 8 )
           {
             FT_PtrDist  nn;
 
+
             for ( nn = 0; nn < max; nn++ )
               if ( edges[nn].fpos >= u )
                 break;
             for ( nn = 0; nn < max; nn++ )
               if ( edges[nn].fpos >= u )
                 break;
             }
           }
 
             }
           }
 
+          /* point is not on an edge */
           {
             AF_Edge  before = edges + min - 1;
             AF_Edge  after  = edges + min + 0;
           {
             AF_Edge  before = edges + min - 1;
             AF_Edge  after  = edges + min + 0;
    ****************************************************************/
 
 
    ****************************************************************/
 
 
+  /* Shift the original coordinates of all points between `p1' and */
+  /* `p2' to get hinted coordinates, using the same difference as  */
+  /* given by `ref'.                                               */
+
   static void
   af_iup_shift( AF_Point  p1,
                 AF_Point  p2,
   static void
   af_iup_shift( AF_Point  p1,
                 AF_Point  p2,
     AF_Point  p;
     FT_Pos    delta = ref->u - ref->v;
 
     AF_Point  p;
     FT_Pos    delta = ref->u - ref->v;
 
+
     if ( delta == 0 )
       return;
 
     if ( delta == 0 )
       return;
 
   }
 
 
   }
 
 
+  /* Interpolate the original coordinates of all points between `p1' and  */
+  /* `p2' to get hinted coordinates, using `ref1' and `ref2' as the       */
+  /* reference points.  The `u' and `v' members are the current and       */
+  /* original coordinate values, respectively.                            */
+  /*                                                                      */
+  /* Details can be found in the TrueType bytecode specification.         */
+
   static void
   af_iup_interp( AF_Point  p1,
                  AF_Point  p2,
   static void
   af_iup_interp( AF_Point  p1,
                  AF_Point  p2,
   }
 
 
   }
 
 
+  /* Hint the weak points -- this is equivalent to the TrueType `IUP' */
+  /* hinting instruction.                                             */
+
   FT_LOCAL_DEF( void )
   af_glyph_hints_align_weak_points( AF_GlyphHints  hints,
                                     AF_Dimension   dim )
   FT_LOCAL_DEF( void )
   af_glyph_hints_align_weak_points( AF_GlyphHints  hints,
                                     AF_Dimension   dim )
 
       for (;;)
       {
 
       for (;;)
       {
-        FT_ASSERT( point <= end_point &&
+        FT_ASSERT( point <= end_point                 &&
                    ( point->flags & touch_flag ) != 0 );
 
                    ( point->flags & touch_flag ) != 0 );
 
-        /* skip any touched neighbhours */
-        while ( point < end_point && ( point[1].flags & touch_flag ) != 0 )
+        /* skip any touched neighbours */
+        while ( point < end_point                    &&
+                ( point[1].flags & touch_flag ) != 0 )
           point++;
 
         last_touched = point;
 
         /* find the next touched point, if any */
           point++;
 
         last_touched = point;
 
         /* find the next touched point, if any */
-        point ++;
+        point++;
         for (;;)
         {
           if ( point > end_point )
         for (;;)
         {
           if ( point > end_point )
     EndContour:
       /* special case: only one point was touched */
       if ( last_touched == first_touched )
     EndContour:
       /* special case: only one point was touched */
       if ( last_touched == first_touched )
-      {
         af_iup_shift( first_point, end_point, first_touched );
         af_iup_shift( first_point, end_point, first_touched );
-      }
+
       else /* interpolate the last part */
       {
         if ( last_touched < end_point )
       else /* interpolate the last part */
       {
         if ( last_touched < end_point )
   }
 
 
   }
 
 
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+
+  /* Apply (small) warp scale and warp delta for given dimension. */
 
   FT_LOCAL_DEF( void )
   af_glyph_hints_scale_dim( AF_GlyphHints  hints,
 
   FT_LOCAL_DEF( void )
   af_glyph_hints_scale_dim( AF_GlyphHints  hints,
     }
   }
 
     }
   }
 
-#endif /* AF_USE_WARPER */
+#endif /* AF_CONFIG_OPTION_USE_WARPER */
 
 /* END */
 
 /* END */
index 10e673b..776b3c8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines (specification).                        */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter hinting routines (specification).                        */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2010 by                  */
+/*  Copyright 2003-2008, 2010-2012 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
 
- /*
-  *  The definition of outline glyph hints.  These are shared by all
-  *  script analysis routines (until now).
-  */
 /*
+   *  The definition of outline glyph hints.  These are shared by all
+   *  script analysis routines (until now).
+   */
 
   typedef enum  AF_Dimension_
   {
 
   typedef enum  AF_Dimension_
   {
@@ -55,6 +55,151 @@ FT_BEGIN_HEADER
   } AF_Direction;
 
 
   } AF_Direction;
 
 
+  /*
+   *  The following explanations are mostly taken from the article
+   *
+   *    Real-Time Grid Fitting of Typographic Outlines
+   *
+   *  by David Turner and Werner Lemberg
+   *
+   *   http://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf
+   *
+   *
+   *  Segments
+   *
+   *    `af_{cjk,latin,...}_hints_compute_segments' are the functions to
+   *    find segments in an outline.  A segment is a series of consecutive
+   *    points that are approximately aligned along a coordinate axis.  The
+   *    analysis to do so is specific to a script.
+   *
+   *    A segment must have at least two points, except in the case of
+   *    `fake' segments that are generated to hint metrics appropriately,
+   *    and which consist of a single point.
+   *
+   *
+   *  Edges
+   *
+   *    As soon as segments are defined, the auto-hinter groups them into
+   *    edges.  An edge corresponds to a single position on the main
+   *    dimension that collects one or more segments (allowing for a small
+   *    threshold).
+   *
+   *    The auto-hinter first tries to grid fit edges, then to align
+   *    segments on the edges unless it detects that they form a serif.
+   *
+   *    `af_{cjk,latin,...}_hints_compute_edges' are the functions to find
+   *    edges; they are specific to a script.
+   *
+   *
+   *                      A          H
+   *                       |        |
+   *                       |        |
+   *                       |        |
+   *                       |        |
+   *         C             |        |             F
+   *          +------<-----+        +-----<------+
+   *          |             B      G             |
+   *          |                                  |
+   *          |                                  |
+   *          +--------------->------------------+
+   *         D                                    E
+   *
+   *
+   *  Stems
+   *
+   *    Segments need to be `linked' to other ones in order to detect stems.
+   *    A stem is made of two segments that face each other in opposite
+   *    directions and that are sufficiently close to each other.  Using
+   *    vocabulary from the TrueType specification, stem segments form a
+   *    `black distance'.
+   *
+   *    In the above ASCII drawing, the horizontal segments are BC, DE, and
+   *    FG; the vertical segments are AB, CD, EF, and GH.
+   *
+   *    Each segment has at most one `best' candidate to form a black
+   *    distance, or no candidate at all.  Notice that two distinct segments
+   *    can have the same candidate, which frequently means a serif.
+   *
+   *    A stem is recognized by the following condition:
+   *
+   *      best segment_1 = segment_2 && best segment_2 = segment_1
+   *
+   *    The best candidate is stored in field `link' in structure
+   *    `AF_Segment'.
+   *
+   *    Stems are detected by `af_{cjk,latin,...}_hint_edges'.
+   *
+   *    In the above ASCII drawing, the best candidate for both AB and CD is
+   *    GH, while the best candidate for GH is AB.  Similarly, the best
+   *    candidate for EF and GH is AB, while the best candidate for AB is
+   *    GH.
+   *
+   *
+   *  Serifs
+   *
+   *    On the opposite, a serif has
+   *
+   *      best segment_1 = segment_2 && best segment_2 != segment_1
+   *
+   *    where segment_1 corresponds to the serif segment (CD and EF in the
+   *    above ASCII drawing).
+   *
+   *    The best candidate is stored in field `serif' in structure
+   *    `AF_Segment' (and `link' is set to NULL).
+   *
+   *    Serifs are detected by `af_{cjk,latin,...}_hint_edges'.
+   *
+   *
+   *  Touched points
+   *
+   *    A point is called `touched' if it has been processed somehow by the
+   *    auto-hinter.  It basically means that it shouldn't be moved again
+   *    (or moved only under certain constraints to preserve the already
+   *    applied processing).
+   *
+   *
+   *  Flat and round segments
+   *
+   *    Segments are `round' or `flat', depending on the series of points
+   *    that define them.  A segment is round if the next and previous point
+   *    of an extremum (which can be either a single point or sequence of
+   *    points) are both conic or cubic control points.  Otherwise, a
+   *    segment with an extremum is flat.
+   *
+   *
+   *  Strong Points
+   *
+   *    Experience has shown that points which are not part of an edge need
+   *    to be interpolated linearly between their two closest edges, even if
+   *    these are not part of the contour of those particular points.
+   *    Typical candidates for this are
+   *
+   *    - angle points (i.e., points where the `in' and `out' direction
+   *      differ greatly)
+   *
+   *    - inflection points (i.e., where the `in' and `out' angles are the
+   *      same, but the curvature changes sign)
+   *
+   *    `af_glyph_hints_align_strong_points' is the function which takes
+   *    care of such situations; it is equivalent to the TrueType `IP'
+   *    hinting instruction.
+   *
+   *
+   *  Weak Points
+   *
+   *    Other points in the outline must be interpolated using the
+   *    coordinates of their previous and next unfitted contour neighbours.
+   *    These are called `weak points' and are touched by the function
+   *    `af_glyph_hints_align_weak_points', equivalent to the TrueType `IUP'
+   *    hinting instruction.  Typical candidates are control points and
+   *    points on the contour without a major direction.
+   *
+   *    The major effect is to reduce possible distortion caused by
+   *    alignment of edges and strong points, thus weak points are processed
+   *    after strong points.
+   */
+
+
   /* point hint flags */
   typedef enum  AF_Flags_
   {
   /* point hint flags */
   typedef enum  AF_Flags_
   {
@@ -109,7 +254,7 @@ FT_BEGIN_HEADER
     FT_Char    out_dir;  /* direction of outwards vector */
 
     FT_Pos     ox, oy;   /* original, scaled position                   */
     FT_Char    out_dir;  /* direction of outwards vector */
 
     FT_Pos     ox, oy;   /* original, scaled position                   */
-    FT_Short   fx, fy;   /* original, unscaled position (font units)    */
+    FT_Short   fx, fy;   /* original, unscaled position (in font units) */
     FT_Pos     x, y;     /* current position                            */
     FT_Pos     u, v;     /* current (x,y) or (y,x) depending on context */
 
     FT_Pos     x, y;     /* current position                            */
     FT_Pos     u, v;     /* current (x,y) or (y,x) depending on context */
 
@@ -137,50 +282,48 @@ FT_BEGIN_HEADER
     FT_Pos      score;       /* used during stem matching  */
     FT_Pos      len;         /* used during stem matching  */
 
     FT_Pos      score;       /* used during stem matching  */
     FT_Pos      len;         /* used during stem matching  */
 
-    AF_Point    first;       /* first point in edge segment             */
-    AF_Point    last;        /* last point in edge segment              */
-    AF_Point*   contour;     /* ptr to first point of segment's contour */
+    AF_Point    first;       /* first point in edge segment */
+    AF_Point    last;        /* last point in edge segment  */
 
   } AF_SegmentRec;
 
 
   typedef struct  AF_EdgeRec_
   {
 
   } AF_SegmentRec;
 
 
   typedef struct  AF_EdgeRec_
   {
-    FT_Short    fpos;       /* original, unscaled position (font units) */
-    FT_Pos      opos;       /* original, scaled position                */
-    FT_Pos      pos;        /* current position                         */
+    FT_Short    fpos;       /* original, unscaled position (in font units) */
+    FT_Pos      opos;       /* original, scaled position                   */
+    FT_Pos      pos;        /* current position                            */
 
     FT_Byte     flags;      /* edge flags                                   */
     FT_Char     dir;        /* edge direction                               */
     FT_Fixed    scale;      /* used to speed up interpolation between edges */
 
     FT_Byte     flags;      /* edge flags                                   */
     FT_Char     dir;        /* edge direction                               */
     FT_Fixed    scale;      /* used to speed up interpolation between edges */
-    AF_Width    blue_edge;  /* non-NULL if this is a blue edge              */
-
-    AF_Edge     link;
-    AF_Edge     serif;
-    FT_Short    num_linked;
 
 
-    FT_Int      score;
+    AF_Width    blue_edge;  /* non-NULL if this is a blue edge */
+    AF_Edge     link;       /* link edge                       */
+    AF_Edge     serif;      /* primary edge for serifs         */
+    FT_Short    num_linked; /* number of linked edges          */
+    FT_Int      score;      /* used during stem matching       */
 
 
-    AF_Segment  first;
-    AF_Segment  last;
+    AF_Segment  first;      /* first segment in edge */
+    AF_Segment  last;       /* last segment in edge  */
 
   } AF_EdgeRec;
 
 
   typedef struct  AF_AxisHintsRec_
   {
 
   } AF_EdgeRec;
 
 
   typedef struct  AF_AxisHintsRec_
   {
-    FT_Int        num_segments;
-    FT_Int        max_segments;
-    AF_Segment    segments;
+    FT_Int        num_segments; /* number of used segments      */
+    FT_Int        max_segments; /* number of allocated segments */
+    AF_Segment    segments;     /* segments array               */
 #ifdef AF_SORT_SEGMENTS
     FT_Int        mid_segments;
 #endif
 
 #ifdef AF_SORT_SEGMENTS
     FT_Int        mid_segments;
 #endif
 
-    FT_Int        num_edges;
-    FT_Int        max_edges;
-    AF_Edge       edges;
+    FT_Int        num_edges;    /* number of used edges      */
+    FT_Int        max_edges;    /* number of allocated edges */
+    AF_Edge       edges;        /* edges array               */
 
 
-    AF_Direction  major_dir;
+    AF_Direction  major_dir;    /* either vertical or horizontal */
 
   } AF_AxisHintsRec, *AF_AxisHints;
 
 
   } AF_AxisHintsRec, *AF_AxisHints;
 
@@ -195,15 +338,13 @@ FT_BEGIN_HEADER
     FT_Fixed          y_scale;
     FT_Pos            y_delta;
 
     FT_Fixed          y_scale;
     FT_Pos            y_delta;
 
-    FT_Pos            edge_distance_threshold;
+    FT_Int            max_points;    /* number of allocated points */
+    FT_Int            num_points;    /* number of used points      */
+    AF_Point          points;        /* points array               */
 
 
-    FT_Int            max_points;
-    FT_Int            num_points;
-    AF_Point          points;
-
-    FT_Int            max_contours;
-    FT_Int            num_contours;
-    AF_Point*         contours;
+    FT_Int            max_contours;  /* number of allocated contours */
+    FT_Int            num_contours;  /* number of used contours      */
+    AF_Point*         contours;      /* contours array               */
 
     AF_AxisHintsRec   axis[AF_DIMENSION_MAX];
 
 
     AF_AxisHintsRec   axis[AF_DIMENSION_MAX];
 
@@ -214,7 +355,7 @@ FT_BEGIN_HEADER
 
     FT_Pos            xmin_delta;    /* used for warping */
     FT_Pos            xmax_delta;
 
     FT_Pos            xmin_delta;    /* used for warping */
     FT_Pos            xmax_delta;
-    
+
   } AF_GlyphHintsRec;
 
 
   } AF_GlyphHintsRec;
 
 
@@ -222,7 +363,7 @@ FT_BEGIN_HEADER
 #define AF_HINTS_TEST_OTHER( h, f )   ( (h)->other_flags  & (f) )
 
 
 #define AF_HINTS_TEST_OTHER( h, f )   ( (h)->other_flags  & (f) )
 
 
-#ifdef AF_DEBUG
+#ifdef FT_DEBUG_AUTOFIT
 
 #define AF_HINTS_DO_HORIZONTAL( h )                                     \
           ( !_af_debug_disable_horz_hints                            && \
 
 #define AF_HINTS_DO_HORIZONTAL( h )                                     \
           ( !_af_debug_disable_horz_hints                            && \
@@ -237,7 +378,7 @@ FT_BEGIN_HEADER
 
 #define AF_HINTS_DO_BLUES( h )  ( !_af_debug_disable_blue_hints )
 
 
 #define AF_HINTS_DO_BLUES( h )  ( !_af_debug_disable_blue_hints )
 
-#else /* !AF_DEBUG */
+#else /* !FT_DEBUG_AUTOFIT */
 
 #define AF_HINTS_DO_HORIZONTAL( h )                                \
           !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL )
 
 #define AF_HINTS_DO_HORIZONTAL( h )                                \
           !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL )
@@ -250,7 +391,7 @@ FT_BEGIN_HEADER
 
 #define AF_HINTS_DO_BLUES( h )  1
 
 
 #define AF_HINTS_DO_BLUES( h )  1
 
-#endif /* !AF_DEBUG */
+#endif /* !FT_DEBUG_AUTOFIT */
 
 
   FT_LOCAL( AF_Direction )
 
 
   FT_LOCAL( AF_Direction )
@@ -274,12 +415,6 @@ FT_BEGIN_HEADER
   af_glyph_hints_init( AF_GlyphHints  hints,
                        FT_Memory      memory );
 
   af_glyph_hints_init( AF_GlyphHints  hints,
                        FT_Memory      memory );
 
-
-
-  /*
-   *  recompute all AF_Point in a AF_GlyphHints from the definitions
-   *  in a source outline
-   */
   FT_LOCAL( void )
   af_glyph_hints_rescale( AF_GlyphHints     hints,
                           AF_ScriptMetrics  metrics );
   FT_LOCAL( void )
   af_glyph_hints_rescale( AF_GlyphHints     hints,
                           AF_ScriptMetrics  metrics );
@@ -304,7 +439,7 @@ FT_BEGIN_HEADER
   af_glyph_hints_align_weak_points( AF_GlyphHints  hints,
                                     AF_Dimension   dim );
 
   af_glyph_hints_align_weak_points( AF_GlyphHints  hints,
                                     AF_Dimension   dim );
 
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
   FT_LOCAL( void )
   af_glyph_hints_scale_dim( AF_GlyphHints  hints,
                             AF_Dimension   dim,
   FT_LOCAL( void )
   af_glyph_hints_scale_dim( AF_GlyphHints  hints,
                             AF_Dimension   dim,
index 1d9e9ea..8c24972 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines for Indic scripts (body).               */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter hinting routines for Indic scripts (body).               */
 /*                                                                         */
-/*  Copyright 2007 by                                                      */
+/*  Copyright 2007, 2011-2013 by                                           */
 /*  Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.    */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.    */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include "afcjk.h"
 
 
 #include "afcjk.h"
 
 
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
 #include "afwarp.h"
 #endif
 
 
   static FT_Error
 #include "afwarp.h"
 #endif
 
 
   static FT_Error
-  af_indic_metrics_init( AF_LatinMetrics  metrics,
-                         FT_Face          face )
+  af_indic_metrics_init( AF_CJKMetrics  metrics,
+                         FT_Face        face )
   {
   {
-    /* use CJK routines */
-    return af_cjk_metrics_init( metrics, face );
+    /* skip blue zone init in CJK routines */
+    FT_CharMap  oldmap = face->charmap;
+
+
+    metrics->units_per_em = face->units_per_EM;
+
+    if ( FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )
+      face->charmap = NULL;
+    else
+    {
+      af_cjk_metrics_init_widths( metrics, face );
+#if 0
+      /* either need indic specific blue_chars[] or just skip blue zones */
+      af_cjk_metrics_init_blues( metrics, face, af_cjk_blue_chars );
+#endif
+      af_cjk_metrics_check_digits( metrics, face );
+    }
+
+    FT_Set_Charmap( face, oldmap );
+
+    return FT_Err_Ok;
   }
 
 
   static void
   }
 
 
   static void
-  af_indic_metrics_scale( AF_LatinMetrics  metrics,
-                          AF_Scaler        scaler )
+  af_indic_metrics_scale( AF_CJKMetrics  metrics,
+                          AF_Scaler      scaler )
   {
     /* use CJK routines */
     af_cjk_metrics_scale( metrics, scaler );
   {
     /* use CJK routines */
     af_cjk_metrics_scale( metrics, scaler );
@@ -51,8 +70,8 @@
 
 
   static FT_Error
 
 
   static FT_Error
-  af_indic_hints_init( AF_GlyphHints    hints,
-                       AF_LatinMetrics  metrics )
+  af_indic_hints_init( AF_GlyphHints  hints,
+                       AF_CJKMetrics  metrics )
   {
     /* use CJK routines */
     return af_cjk_hints_init( hints, metrics );
   {
     /* use CJK routines */
     return af_cjk_hints_init( hints, metrics );
@@ -60,9 +79,9 @@
 
 
   static FT_Error
 
 
   static FT_Error
-  af_indic_hints_apply( AF_GlyphHints    hints,
-                        FT_Outline*      outline,
-                        AF_LatinMetrics  metrics)
+  af_indic_hints_apply( AF_GlyphHints  hints,
+                        FT_Outline*    outline,
+                        AF_CJKMetrics  metrics )
   {
     /* use CJK routines */
     return af_cjk_hints_apply( hints, outline, metrics );
   {
     /* use CJK routines */
     return af_cjk_hints_apply( hints, outline, metrics );
     AF_UNIRANGE_REC( 0x0100UL, 0xFFFFUL ),  /* why this? */
 #endif
     AF_UNIRANGE_REC( 0x0900UL, 0x0DFFUL),    /* Indic Range */
     AF_UNIRANGE_REC( 0x0100UL, 0xFFFFUL ),  /* why this? */
 #endif
     AF_UNIRANGE_REC( 0x0900UL, 0x0DFFUL),    /* Indic Range */
+    AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL),    /* Tibetan */
+    AF_UNIRANGE_REC( 0x1900UL, 0x194FUL),    /* Limbu */
+    AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL),    /* Sundanese */
+    AF_UNIRANGE_REC( 0x1C80UL, 0x1CDFUL),    /* Meetei Mayak */
+    AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL),    /* Syloti Nagri */
+    AF_UNIRANGE_REC( 0x11800UL, 0x118DFUL),  /* Sharada */
     AF_UNIRANGE_REC(      0UL,      0UL)
   };
 
 
     AF_UNIRANGE_REC(      0UL,      0UL)
   };
 
 
-  AF_DEFINE_SCRIPT_CLASS(af_indic_script_class,
+  AF_DEFINE_SCRIPT_CLASS( af_indic_script_class,
     AF_SCRIPT_INDIC,
     af_indic_uniranges,
     AF_SCRIPT_INDIC,
     af_indic_uniranges,
+    'o', /* XXX */
 
 
-    sizeof( AF_LatinMetricsRec ),
+    sizeof ( AF_CJKMetricsRec ),
 
     (AF_Script_InitMetricsFunc) af_indic_metrics_init,
     (AF_Script_ScaleMetricsFunc)af_indic_metrics_scale,
 
     (AF_Script_InitMetricsFunc) af_indic_metrics_init,
     (AF_Script_ScaleMetricsFunc)af_indic_metrics_scale,
   };
 
 
   };
 
 
-  AF_DEFINE_SCRIPT_CLASS(af_indic_script_class,
+  AF_DEFINE_SCRIPT_CLASS( af_indic_script_class,
     AF_SCRIPT_INDIC,
     af_indic_uniranges,
     AF_SCRIPT_INDIC,
     af_indic_uniranges,
+    0,
 
 
-    sizeof( AF_LatinMetricsRec ),
+    sizeof ( AF_CJKMetricsRec ),
 
     (AF_Script_InitMetricsFunc) NULL,
     (AF_Script_ScaleMetricsFunc)NULL,
 
     (AF_Script_InitMetricsFunc) NULL,
     (AF_Script_ScaleMetricsFunc)NULL,
index 662a982..c252cf2 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines for Indic scripts (specification).      */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter hinting routines for Indic scripts (specification).      */
 /*                                                                         */
-/*  Copyright 2007 by                                                      */
+/*  Copyright 2007, 2012 by                                                */
 /*  Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.    */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.    */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -27,7 +27,7 @@ FT_BEGIN_HEADER
 
   /* the Indic-specific script class */
 
 
   /* the Indic-specific script class */
 
-  AF_DECLARE_SCRIPT_CLASS(af_indic_script_class)
+  AF_DECLARE_SCRIPT_CLASS( af_indic_script_class )
 
 
 /* */
 
 
 /* */
index 63491e3..ef0157a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines for latin script (body).                */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter hinting routines for latin script (body).                */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by            */
+/*  Copyright 2003-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #include <ft2build.h>
 #include FT_ADVANCES_H
 
 #include <ft2build.h>
 #include FT_ADVANCES_H
+#include FT_INTERNAL_DEBUG_H
 
 
+#include "afglobal.h"
 #include "aflatin.h"
 #include "aferrors.h"
 
 
 #include "aflatin.h"
 #include "aferrors.h"
 
 
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
 #include "afwarp.h"
 #endif
 
 
 #include "afwarp.h"
 #endif
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_aflatin
+
+
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
 
+
+  /* Find segments and links, compute all stem widths, and initialize */
+  /* standard width and height for the glyph with given charcode.     */
+
   FT_LOCAL_DEF( void )
   af_latin_metrics_init_widths( AF_LatinMetrics  metrics,
   FT_LOCAL_DEF( void )
   af_latin_metrics_init_widths( AF_LatinMetrics  metrics,
-                                FT_Face          face,
-                                FT_ULong         charcode )
+                                FT_Face          face )
   {
     /* scan the array of segments in each direction */
     AF_GlyphHintsRec  hints[1];
 
 
   {
     /* scan the array of segments in each direction */
     AF_GlyphHintsRec  hints[1];
 
 
+    FT_TRACE5(( "standard widths computation\n"
+                "===========================\n\n" ));
+
     af_glyph_hints_init( hints, face->memory );
 
     metrics->axis[AF_DIMENSION_HORZ].width_count = 0;
     metrics->axis[AF_DIMENSION_VERT].width_count = 0;
 
     {
     af_glyph_hints_init( hints, face->memory );
 
     metrics->axis[AF_DIMENSION_HORZ].width_count = 0;
     metrics->axis[AF_DIMENSION_VERT].width_count = 0;
 
     {
-      FT_Error             error;
-      FT_UInt              glyph_index;
-      int                  dim;
-      AF_LatinMetricsRec   dummy[1];
-      AF_Scaler            scaler = &dummy->root.scaler;
+      FT_Error            error;
+      FT_UInt             glyph_index;
+      int                 dim;
+      AF_LatinMetricsRec  dummy[1];
+      AF_Scaler           scaler = &dummy->root.scaler;
 
 
 
 
-      glyph_index = FT_Get_Char_Index( face, charcode );
+      glyph_index = FT_Get_Char_Index( face,
+                                       metrics->root.clazz->standard_char );
       if ( glyph_index == 0 )
         goto Exit;
 
       if ( glyph_index == 0 )
         goto Exit;
 
+      FT_TRACE5(( "standard character: 0x%X (glyph index %d)\n",
+                  metrics->root.clazz->standard_char, glyph_index ));
+
       error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
       if ( error || face->glyph->outline.n_points <= 0 )
         goto Exit;
       error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
       if ( error || face->glyph->outline.n_points <= 0 )
         goto Exit;
       FT_ZERO( dummy );
 
       dummy->units_per_em = metrics->units_per_em;
       FT_ZERO( dummy );
 
       dummy->units_per_em = metrics->units_per_em;
-      scaler->x_scale     = scaler->y_scale = 0x10000L;
-      scaler->x_delta     = scaler->y_delta = 0;
+
+      scaler->x_scale = 0x10000L;
+      scaler->y_scale = 0x10000L;
+      scaler->x_delta = 0;
+      scaler->y_delta = 0;
+
       scaler->face        = face;
       scaler->render_mode = FT_RENDER_MODE_NORMAL;
       scaler->flags       = 0;
       scaler->face        = face;
       scaler->render_mode = FT_RENDER_MODE_NORMAL;
       scaler->flags       = 0;
               dist = -dist;
 
             if ( num_widths < AF_LATIN_MAX_WIDTHS )
               dist = -dist;
 
             if ( num_widths < AF_LATIN_MAX_WIDTHS )
-              axis->widths[ num_widths++ ].org = dist;
+              axis->widths[num_widths++].org = dist;
           }
         }
 
           }
         }
 
-        af_sort_widths( num_widths, axis->widths );
+        /* this also replaces multiple almost identical stem widths */
+        /* with a single one (the value 100 is heuristic) */
+        af_sort_and_quantize_widths( &num_widths, axis->widths,
+                                     dummy->units_per_em / 100 );
         axis->width_count = num_widths;
       }
 
         axis->width_count = num_widths;
       }
 
         axis->edge_distance_threshold = stdw / 5;
         axis->standard_width          = stdw;
         axis->extra_light             = 0;
         axis->edge_distance_threshold = stdw / 5;
         axis->standard_width          = stdw;
         axis->extra_light             = 0;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+        {
+          FT_UInt  i;
+
+
+          FT_TRACE5(( "%s widths:\n",
+                      dim == AF_DIMENSION_VERT ? "horizontal"
+                                               : "vertical" ));
+
+          FT_TRACE5(( "  %d (standard)", axis->standard_width ));
+          for ( i = 1; i < axis->width_count; i++ )
+            FT_TRACE5(( " %d", axis->widths[i].org ));
+
+          FT_TRACE5(( "\n" ));
+        }
+#endif
       }
     }
 
       }
     }
 
+    FT_TRACE5(( "\n" ));
+
     af_glyph_hints_done( hints );
   }
 
     af_glyph_hints_done( hints );
   }
 
   };
 
 
   };
 
 
+  /* Find all blue zones.  Flat segments give the reference points, */
+  /* round segments the overshoot positions.                        */
+
   static void
   af_latin_metrics_init_blues( AF_LatinMetrics  metrics,
                                FT_Face          face )
   static void
   af_latin_metrics_init_blues( AF_LatinMetrics  metrics,
                                FT_Face          face )
     AF_LatinBlue  blue;
     FT_Error      error;
     AF_LatinAxis  axis  = &metrics->axis[AF_DIMENSION_VERT];
     AF_LatinBlue  blue;
     FT_Error      error;
     AF_LatinAxis  axis  = &metrics->axis[AF_DIMENSION_VERT];
-    FT_GlyphSlot  glyph = face->glyph;
+    FT_Outline    outline;
 
 
     /* we compute the blues simply by loading each character from the    */
 
 
     /* we compute the blues simply by loading each character from the    */
-    /* 'af_latin_blue_chars[blues]' string, then compute its top-most or */
+    /* `af_latin_blue_chars[blues]' string, then finding its top-most or */
     /* bottom-most points (depending on `AF_IS_TOP_BLUE')                */
 
     /* bottom-most points (depending on `AF_IS_TOP_BLUE')                */
 
-    AF_LOG(( "blue zones computation\n" ));
-    AF_LOG(( "------------------------------------------------\n" ));
+    FT_TRACE5(( "blue zones computation\n"
+                "======================\n\n" ));
 
     for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )
     {
 
     for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )
     {
       FT_Pos*      blue_shoot;
 
 
       FT_Pos*      blue_shoot;
 
 
-      AF_LOG(( "blue %3d: ", bb ));
+      FT_TRACE5(( "blue zone %d:\n", bb ));
 
       num_flats  = 0;
       num_rounds = 0;
 
       num_flats  = 0;
       num_rounds = 0;
       for ( ; p < limit && *p; p++ )
       {
         FT_UInt     glyph_index;
       for ( ; p < limit && *p; p++ )
       {
         FT_UInt     glyph_index;
-        FT_Pos      best_y; /* same as points.y */
-        FT_Int      best_point, best_first, best_last;
+        FT_Pos      best_y;                            /* same as points.y */
+        FT_Int      best_point, best_contour_first, best_contour_last;
         FT_Vector*  points;
         FT_Bool     round = 0;
 
 
         FT_Vector*  points;
         FT_Bool     round = 0;
 
 
-        AF_LOG(( "'%c'", *p ));
-
         /* load the character in the face -- skip unknown or empty ones */
         glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p );
         if ( glyph_index == 0 )
           continue;
 
         /* load the character in the face -- skip unknown or empty ones */
         glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p );
         if ( glyph_index == 0 )
           continue;
 
-        error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
-        if ( error || glyph->outline.n_points <= 0 )
+        error   = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
+        outline = face->glyph->outline;
+        if ( error || outline.n_points <= 0 )
           continue;
 
         /* now compute min or max point indices and coordinates */
           continue;
 
         /* now compute min or max point indices and coordinates */
-        points      = glyph->outline.points;
-        best_point  = -1;
-        best_y      = 0;  /* make compiler happy */
-        best_first  = 0;  /* ditto */
-        best_last   = 0;  /* ditto */
+        points             = outline.points;
+        best_point         = -1;
+        best_y             = 0;  /* make compiler happy */
+        best_contour_first = 0;  /* ditto */
+        best_contour_last  = 0;  /* ditto */
 
         {
           FT_Int  nn;
 
         {
           FT_Int  nn;
           FT_Int  last  = -1;
 
 
           FT_Int  last  = -1;
 
 
-          for ( nn = 0; nn < glyph->outline.n_contours; first = last+1, nn++ )
+          for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ )
           {
             FT_Int  old_best_point = best_point;
             FT_Int  pp;
 
 
           {
             FT_Int  old_best_point = best_point;
             FT_Int  pp;
 
 
-            last = glyph->outline.contours[nn];
+            last = outline.contours[nn];
 
             /* Avoid single-point contours since they are never rasterized. */
             /* In some fonts, they correspond to mark attachment points     */
             /* which are way outside of the glyph's real outline.           */
             if ( last <= first )
 
             /* Avoid single-point contours since they are never rasterized. */
             /* In some fonts, they correspond to mark attachment points     */
             /* which are way outside of the glyph's real outline.           */
             if ( last <= first )
-                continue;
+              continue;
 
             if ( AF_LATIN_IS_TOP_BLUE( bb ) )
             {
 
             if ( AF_LATIN_IS_TOP_BLUE( bb ) )
             {
 
             if ( best_point != old_best_point )
             {
 
             if ( best_point != old_best_point )
             {
-              best_first = first;
-              best_last  = last;
+              best_contour_first = first;
+              best_contour_last  = last;
             }
           }
             }
           }
-          AF_LOG(( "%5d", best_y ));
+          FT_TRACE5(( "  %c  %ld", *p, best_y ));
         }
 
         /* now check whether the point belongs to a straight or round   */
         }
 
         /* now check whether the point belongs to a straight or round   */
         /* lies, then inspect its previous and next points              */
         if ( best_point >= 0 )
         {
         /* lies, then inspect its previous and next points              */
         if ( best_point >= 0 )
         {
+          FT_Pos  best_x = points[best_point].x;
           FT_Int  prev, next;
           FT_Int  prev, next;
+          FT_Int  best_on_point_first, best_on_point_last;
           FT_Pos  dist;
 
 
           FT_Pos  dist;
 
 
-          /* now look for the previous and next points that are not on the */
-          /* same Y coordinate.  Threshold the `closeness'...              */
+          if ( FT_CURVE_TAG( outline.tags[best_point] ) == FT_CURVE_TAG_ON )
+          {
+            best_on_point_first = best_point;
+            best_on_point_last  = best_point;
+          }
+          else
+          {
+            best_on_point_first = -1;
+            best_on_point_last  = -1;
+          }
+
+          /* look for the previous and next points that are not on the */
+          /* same Y coordinate, then threshold the `closeness'...      */
           prev = best_point;
           next = prev;
 
           do
           {
           prev = best_point;
           next = prev;
 
           do
           {
-            if ( prev > best_first )
+            if ( prev > best_contour_first )
               prev--;
             else
               prev--;
             else
-              prev = best_last;
+              prev = best_contour_last;
 
 
-            dist = points[prev].y - best_y;
-            if ( dist < -5 || dist > 5 )
-              break;
+            dist = FT_ABS( points[prev].y - best_y );
+            /* accept a small distance or a small angle (both values are */
+            /* heuristic; value 20 corresponds to approx. 2.9 degrees)   */
+            if ( dist > 5 )
+              if ( FT_ABS( points[prev].x - best_x ) <= 20 * dist )
+                break;
+
+            if ( FT_CURVE_TAG( outline.tags[prev] ) == FT_CURVE_TAG_ON )
+            {
+              best_on_point_first = prev;
+              if ( best_on_point_last < 0 )
+                best_on_point_last = prev;
+            }
 
           } while ( prev != best_point );
 
           do
           {
 
           } while ( prev != best_point );
 
           do
           {
-            if ( next < best_last )
+            if ( next < best_contour_last )
               next++;
             else
               next++;
             else
-              next = best_first;
+              next = best_contour_first;
 
 
-            dist = points[next].y - best_y;
-            if ( dist < -5 || dist > 5 )
-              break;
+            dist = FT_ABS( points[next].y - best_y );
+            if ( dist > 5 )
+              if ( FT_ABS( points[next].x - best_x ) <= 20 * dist )
+                break;
+
+            if ( FT_CURVE_TAG( outline.tags[next] ) == FT_CURVE_TAG_ON )
+            {
+              best_on_point_last = next;
+              if ( best_on_point_first < 0 )
+                best_on_point_first = next;
+            }
 
           } while ( next != best_point );
 
 
           } while ( next != best_point );
 
-          /* now, set the `round' flag depending on the segment's kind */
-          round = FT_BOOL(
-            FT_CURVE_TAG( glyph->outline.tags[prev] ) != FT_CURVE_TAG_ON ||
-            FT_CURVE_TAG( glyph->outline.tags[next] ) != FT_CURVE_TAG_ON );
+          /* now set the `round' flag depending on the segment's kind */
+          /* (value 8 is heuristic)                                   */
+          if ( best_on_point_first >= 0                               &&
+               best_on_point_last >= 0                                &&
+               (FT_UInt)( FT_ABS( points[best_on_point_last].x -
+                                  points[best_on_point_first].x ) ) >
+                 metrics->units_per_em / 8                            )
+            round = 0;
+          else
+            round = FT_BOOL(
+              FT_CURVE_TAG( outline.tags[prev] ) != FT_CURVE_TAG_ON ||
+              FT_CURVE_TAG( outline.tags[next] ) != FT_CURVE_TAG_ON );
 
 
-          AF_LOG(( "%c ", round ? 'r' : 'f' ));
+          FT_TRACE5(( " (%s)\n", round ? "round" : "flat" ));
         }
 
         if ( round )
         }
 
         if ( round )
           flats[num_flats++]   = best_y;
       }
 
           flats[num_flats++]   = best_y;
       }
 
-      AF_LOG(( "\n" ));
-
       if ( num_flats == 0 && num_rounds == 0 )
       {
         /*
          *  we couldn't find a single glyph to compute this blue zone,
          *  we will simply ignore it then
          */
       if ( num_flats == 0 && num_rounds == 0 )
       {
         /*
          *  we couldn't find a single glyph to compute this blue zone,
          *  we will simply ignore it then
          */
-        AF_LOG(( "empty\n" ));
+        FT_TRACE5(( "  empty\n" ));
         continue;
       }
 
         continue;
       }
 
       af_sort_pos( num_rounds, rounds );
       af_sort_pos( num_flats,  flats );
 
       af_sort_pos( num_rounds, rounds );
       af_sort_pos( num_flats,  flats );
 
-      blue       = & axis->blues[axis->blue_count];
-      blue_ref   = & blue->ref.org;
-      blue_shoot = & blue->shoot.org;
+      blue       = &axis->blues[axis->blue_count];
+      blue_ref   = &blue->ref.org;
+      blue_shoot = &blue->shoot.org;
 
       axis->blue_count++;
 
 
       axis->blue_count++;
 
 
 
         if ( AF_LATIN_IS_TOP_BLUE( bb ) ^ over_ref )
 
 
         if ( AF_LATIN_IS_TOP_BLUE( bb ) ^ over_ref )
-          *blue_shoot = *blue_ref = ( shoot + ref ) / 2;
+        {
+          *blue_ref   =
+          *blue_shoot = ( shoot + ref ) / 2;
+
+          FT_TRACE5(( "  [overshoot smaller than reference,"
+                      " taking mean value]\n" ));
+        }
       }
 
       blue->flags = 0;
       }
 
       blue->flags = 0;
       if ( bb == AF_LATIN_BLUE_SMALL_TOP )
         blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;
 
       if ( bb == AF_LATIN_BLUE_SMALL_TOP )
         blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;
 
-      AF_LOG(( "-- ref = %ld, shoot = %ld\n", *blue_ref, *blue_shoot ));
+      FT_TRACE5(( "    -> reference = %ld\n"
+                  "       overshoot = %ld\n",
+                  *blue_ref, *blue_shoot ));
     }
 
     }
 
+    FT_TRACE5(( "\n" ));
+
     return;
   }
 
 
     return;
   }
 
 
+  /* Check whether all ASCII digits have the same advance width. */
+
   FT_LOCAL_DEF( void )
   af_latin_metrics_check_digits( AF_LatinMetrics  metrics,
                                  FT_Face          face )
   FT_LOCAL_DEF( void )
   af_latin_metrics_check_digits( AF_LatinMetrics  metrics,
                                  FT_Face          face )
     FT_Fixed  advance, old_advance = 0;
 
 
     FT_Fixed  advance, old_advance = 0;
 
 
-    /* check whether all ASCII digits have the same advance width; */
-    /* digit `0' is 0x30 in all supported charmaps                 */
+    /* digit `0' is 0x30 in all supported charmaps */
     for ( i = 0x30; i <= 0x39; i++ )
     {
       FT_UInt  glyph_index;
     for ( i = 0x30; i <= 0x39; i++ )
     {
       FT_UInt  glyph_index;
   }
 
 
   }
 
 
+  /* Initialize global metrics. */
+
   FT_LOCAL_DEF( FT_Error )
   af_latin_metrics_init( AF_LatinMetrics  metrics,
                          FT_Face          face )
   {
   FT_LOCAL_DEF( FT_Error )
   af_latin_metrics_init( AF_LatinMetrics  metrics,
                          FT_Face          face )
   {
-    FT_Error    error = AF_Err_Ok;
     FT_CharMap  oldmap = face->charmap;
     FT_CharMap  oldmap = face->charmap;
-    FT_UInt     ee;
-
-    static const FT_Encoding  latin_encodings[] =
-    {
-      FT_ENCODING_UNICODE,
-      FT_ENCODING_APPLE_ROMAN,
-      FT_ENCODING_ADOBE_STANDARD,
-      FT_ENCODING_ADOBE_LATIN_1,
-      FT_ENCODING_NONE  /* end of list */
-    };
 
 
     metrics->units_per_em = face->units_per_EM;
 
 
 
     metrics->units_per_em = face->units_per_EM;
 
-    /* do we have a latin charmap in there? */
-    for ( ee = 0; latin_encodings[ee] != FT_ENCODING_NONE; ee++ )
+    if ( !FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )
     {
     {
-      error = FT_Select_Charmap( face, latin_encodings[ee] );
-      if ( !error )
-        break;
-    }
-
-    if ( !error )
-    {
-      /* For now, compute the standard width and height from the `o'. */
-      af_latin_metrics_init_widths( metrics, face, 'o' );
+      af_latin_metrics_init_widths( metrics, face );
       af_latin_metrics_init_blues( metrics, face );
       af_latin_metrics_check_digits( metrics, face );
     }
 
     FT_Set_Charmap( face, oldmap );
       af_latin_metrics_init_blues( metrics, face );
       af_latin_metrics_check_digits( metrics, face );
     }
 
     FT_Set_Charmap( face, oldmap );
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
+  /* Adjust scaling value, then scale and shift widths   */
+  /* and blue zones (if applicable) for given dimension. */
+
   static void
   af_latin_metrics_scale_dim( AF_LatinMetrics  metrics,
                               AF_Scaler        scaler,
   static void
   af_latin_metrics_scale_dim( AF_LatinMetrics  metrics,
                               AF_Scaler        scaler,
 
       if ( blue )
       {
 
       if ( blue )
       {
-        FT_Pos  scaled = FT_MulFix( blue->shoot.org, scaler->y_scale );
-        FT_Pos  fitted = ( scaled + 40 ) & ~63;
+        FT_Pos   scaled;
+        FT_Pos   threshold;
+        FT_Pos   fitted;
+        FT_UInt  limit;
+        FT_UInt  ppem;
+
 
 
+        scaled    = FT_MulFix( blue->shoot.org, scaler->y_scale );
+        ppem      = metrics->root.scaler.face->size->metrics.x_ppem;
+        limit     = metrics->root.globals->increase_x_height;
+        threshold = 40;
+
+        /* if the `increase-x-height' property is active, */
+        /* we round up much more often                    */
+        if ( limit                                 &&
+             ppem <= limit                         &&
+             ppem >= AF_PROP_INCREASE_X_HEIGHT_MIN )
+          threshold = 52;
+
+        fitted = ( scaled + threshold ) & ~63;
 
         if ( scaled != fitted )
         {
 
         if ( scaled != fitted )
         {
           else
 #endif
           if ( dim == AF_DIMENSION_VERT )
           else
 #endif
           if ( dim == AF_DIMENSION_VERT )
-          {
             scale = FT_MulDiv( scale, fitted, scaled );
             scale = FT_MulDiv( scale, fitted, scaled );
-          }
         }
       }
     }
         }
       }
     }
       metrics->root.scaler.y_delta = delta;
     }
 
       metrics->root.scaler.y_delta = delta;
     }
 
-    /* scale the standard widths */
+    /* scale the widths */
     for ( nn = 0; nn < axis->width_count; nn++ )
     {
       AF_Width  width = axis->widths + nn;
     for ( nn = 0; nn < axis->width_count; nn++ )
     {
       AF_Width  width = axis->widths + nn;
     }
 
     /* an extra-light axis corresponds to a standard width that is */
     }
 
     /* an extra-light axis corresponds to a standard width that is */
-    /* smaller than 0.75 pixels                                    */
+    /* smaller than 5/8 pixels                                     */
     axis->extra_light =
       (FT_Bool)( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );
 
     axis->extra_light =
       (FT_Bool)( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );
 
         dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale );
         if ( dist <= 48 && dist >= -48 )
         {
         dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale );
         if ( dist <= 48 && dist >= -48 )
         {
-          FT_Pos  delta1, delta2;
+#if 0
+          FT_Pos  delta1;
+#endif
+          FT_Pos  delta2;
+
+
+          /* use discrete values for blue zone widths */
 
 
+#if 0
 
 
+          /* generic, original code */
           delta1 = blue->shoot.org - blue->ref.org;
           delta2 = delta1;
           if ( delta1 < 0 )
           delta1 = blue->shoot.org - blue->ref.org;
           delta2 = delta1;
           if ( delta1 < 0 )
           blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );
           blue->shoot.fit = blue->ref.fit + delta2;
 
           blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );
           blue->shoot.fit = blue->ref.fit + delta2;
 
+#else
+
+          /* simplified version due to abs(dist) <= 48 */
+          delta2 = dist;
+          if ( dist < 0 )
+            delta2 = -delta2;
+
+          if ( delta2 < 32 )
+            delta2 = 0;
+          else if ( delta2 < 48 )
+            delta2 = 32;
+          else
+            delta2 = 64;
+
+          if ( dist < 0 )
+            delta2 = -delta2;
+
+          blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );
+          blue->shoot.fit = blue->ref.fit - delta2;
+
+#endif
+
           blue->flags |= AF_LATIN_BLUE_ACTIVE;
         }
       }
           blue->flags |= AF_LATIN_BLUE_ACTIVE;
         }
       }
   }
 
 
   }
 
 
+  /* Scale global values in both directions. */
+
   FT_LOCAL_DEF( void )
   af_latin_metrics_scale( AF_LatinMetrics  metrics,
                           AF_Scaler        scaler )
   {
     metrics->root.scaler.render_mode = scaler->render_mode;
     metrics->root.scaler.face        = scaler->face;
   FT_LOCAL_DEF( void )
   af_latin_metrics_scale( AF_LatinMetrics  metrics,
                           AF_Scaler        scaler )
   {
     metrics->root.scaler.render_mode = scaler->render_mode;
     metrics->root.scaler.face        = scaler->face;
+    metrics->root.scaler.flags       = scaler->flags;
 
     af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
     af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );
 
     af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
     af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
 
+
+  /* Walk over all contours and compute its segments. */
+
   FT_LOCAL_DEF( FT_Error )
   af_latin_hints_compute_segments( AF_GlyphHints  hints,
                                    AF_Dimension   dim )
   {
   FT_LOCAL_DEF( FT_Error )
   af_latin_hints_compute_segments( AF_GlyphHints  hints,
                                    AF_Dimension   dim )
   {
-    AF_AxisHints  axis          = &hints->axis[dim];
-    FT_Memory     memory        = hints->memory;
-    FT_Error      error         = AF_Err_Ok;
-    AF_Segment    segment       = NULL;
-    AF_SegmentRec seg0;
-    AF_Point*     contour       = hints->contours;
-    AF_Point*     contour_limit = contour + hints->num_contours;
-    AF_Direction  major_dir, segment_dir;
+    AF_AxisHints   axis          = &hints->axis[dim];
+    FT_Memory      memory        = hints->memory;
+    FT_Error       error         = FT_Err_Ok;
+    AF_Segment     segment       = NULL;
+    AF_SegmentRec  seg0;
+    AF_Point*      contour       = hints->contours;
+    AF_Point*      contour_limit = contour + hints->num_contours;
+    AF_Direction   major_dir, segment_dir;
 
 
     FT_ZERO( &seg0 );
 
 
     FT_ZERO( &seg0 );
             /* a segment is round if either its first or last point */
             /* is a control point                                   */
             if ( ( segment->first->flags | point->flags ) &
             /* a segment is round if either its first or last point */
             /* is a control point                                   */
             if ( ( segment->first->flags | point->flags ) &
-                   AF_FLAG_CONTROL                        )
+                 AF_FLAG_CONTROL                          )
               segment->flags |= AF_EDGE_ROUND;
 
             /* compute segment size */
               segment->flags |= AF_EDGE_ROUND;
 
             /* compute segment size */
 
             on_edge = 0;
             segment = NULL;
 
             on_edge = 0;
             segment = NULL;
-            /* fallthrough */
+            /* fall through */
           }
         }
 
           }
         }
 
           min_pos = max_pos = point->u;
           segment->first    = point;
           segment->last     = point;
           min_pos = max_pos = point->u;
           segment->first    = point;
           segment->last     = point;
-          segment->contour  = contour;
           on_edge           = 1;
         }
 
           on_edge           = 1;
         }
 
     } /* contours */
 
 
     } /* contours */
 
 
-    /* now slightly increase the height of segments when this makes */
-    /* sense -- this is used to better detect and ignore serifs     */
+    /* now slightly increase the height of segments if this makes */
+    /* sense -- this is used to better detect and ignore serifs   */
     {
       AF_Segment  segments     = axis->segments;
       AF_Segment  segments_end = segments + axis->num_segments;
     {
       AF_Segment  segments     = axis->segments;
       AF_Segment  segments_end = segments + axis->num_segments;
   }
 
 
   }
 
 
+  /* Link segments to form stems and serifs. */
+
   FT_LOCAL_DEF( void )
   af_latin_hints_link_segments( AF_GlyphHints  hints,
                                 AF_Dimension   dim )
   FT_LOCAL_DEF( void )
   af_latin_hints_link_segments( AF_GlyphHints  hints,
                                 AF_Dimension   dim )
       if ( seg1->dir != axis->major_dir || seg1->first == seg1->last )
         continue;
 
       if ( seg1->dir != axis->major_dir || seg1->first == seg1->last )
         continue;
 
+      /* search for stems having opposite directions, */
+      /* with seg1 to the `left' of seg2              */
       for ( seg2 = segments; seg2 < segment_limit; seg2++ )
       for ( seg2 = segments; seg2 < segment_limit; seg2++ )
-        if ( seg1->dir + seg2->dir == 0 && seg2->pos > seg1->pos )
-        {
-          FT_Pos  pos1 = seg1->pos;
-          FT_Pos  pos2 = seg2->pos;
-          FT_Pos  dist = pos2 - pos1;
+      {
+        FT_Pos  pos1 = seg1->pos;
+        FT_Pos  pos2 = seg2->pos;
 
 
 
 
-          if ( dist < 0 )
-            dist = -dist;
+        if ( seg1->dir + seg2->dir == 0 && pos2 > pos1 )
+        {
+          /* compute distance between the two segments */
+          FT_Pos  dist = pos2 - pos1;
+          FT_Pos  min  = seg1->min_coord;
+          FT_Pos  max  = seg1->max_coord;
+          FT_Pos  len, score;
 
 
-          {
-            FT_Pos  min = seg1->min_coord;
-            FT_Pos  max = seg1->max_coord;
-            FT_Pos  len, score;
 
 
+          if ( min < seg2->min_coord )
+            min = seg2->min_coord;
 
 
-            if ( min < seg2->min_coord )
-              min = seg2->min_coord;
+          if ( max > seg2->max_coord )
+            max = seg2->max_coord;
 
 
-            if ( max > seg2->max_coord )
-              max = seg2->max_coord;
+          /* compute maximum coordinate difference of the two segments */
+          len = max - min;
+          if ( len >= len_threshold )
+          {
+            /* small coordinate differences cause a higher score, and     */
+            /* segments with a greater distance cause a higher score also */
+            score = dist + len_score / len;
 
 
-            len = max - min;
-            if ( len >= len_threshold )
+            /* and we search for the smallest score */
+            /* of the sum of the two values         */
+            if ( score < seg1->score )
             {
             {
-              score = dist + len_score / len;
-
-              if ( score < seg1->score )
-              {
-                seg1->score = score;
-                seg1->link  = seg2;
-              }
+              seg1->score = score;
+              seg1->link  = seg2;
+            }
 
 
-              if ( score < seg2->score )
-              {
-                seg2->score = score;
-                seg2->link  = seg1;
-              }
+            if ( score < seg2->score )
+            {
+              seg2->score = score;
+              seg2->link  = seg1;
             }
           }
         }
             }
           }
         }
+      }
     }
 
     }
 
-    /* now, compute the `serif' segments */
+    /* now compute the `serif' segments, cf. explanations in `afhints.h' */
     for ( seg1 = segments; seg1 < segment_limit; seg1++ )
     {
       seg2 = seg1->link;
     for ( seg1 = segments; seg1 < segment_limit; seg1++ )
     {
       seg2 = seg1->link;
   }
 
 
   }
 
 
+  /* Link segments to edges, using feature analysis for selection. */
+
   FT_LOCAL_DEF( FT_Error )
   af_latin_hints_compute_edges( AF_GlyphHints  hints,
                                 AF_Dimension   dim )
   {
     AF_AxisHints  axis   = &hints->axis[dim];
   FT_LOCAL_DEF( FT_Error )
   af_latin_hints_compute_edges( AF_GlyphHints  hints,
                                 AF_Dimension   dim )
   {
     AF_AxisHints  axis   = &hints->axis[dim];
-    FT_Error      error  = AF_Err_Ok;
+    FT_Error      error  = FT_Err_Ok;
     FT_Memory     memory = hints->memory;
     AF_LatinAxis  laxis  = &((AF_LatinMetrics)hints->metrics)->axis[dim];
 
     FT_Memory     memory = hints->memory;
     AF_LatinAxis  laxis  = &((AF_LatinMetrics)hints->metrics)->axis[dim];
 
     AF_Segment    segment_limit = segments + axis->num_segments;
     AF_Segment    seg;
 
     AF_Segment    segment_limit = segments + axis->num_segments;
     AF_Segment    seg;
 
+#if 0
     AF_Direction  up_dir;
     AF_Direction  up_dir;
+#endif
     FT_Fixed      scale;
     FT_Pos        edge_distance_threshold;
     FT_Pos        segment_length_threshold;
     FT_Fixed      scale;
     FT_Pos        edge_distance_threshold;
     FT_Pos        segment_length_threshold;
     scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale
                                          : hints->y_scale;
 
     scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale
                                          : hints->y_scale;
 
+#if 0
     up_dir = ( dim == AF_DIMENSION_HORZ ) ? AF_DIR_UP
                                           : AF_DIR_RIGHT;
     up_dir = ( dim == AF_DIMENSION_HORZ ) ? AF_DIR_UP
                                           : AF_DIR_RIGHT;
+#endif
 
     /*
 
     /*
-     *  We ignore all segments that are less than 1 pixels in length,
+     *  We ignore all segments that are less than 1 pixel in length
      *  to avoid many problems with serif fonts.  We compute the
      *  corresponding threshold in font units.
      */
      *  to avoid many problems with serif fonts.  We compute the
      *  corresponding threshold in font units.
      */
 
     /*********************************************************************/
     /*                                                                   */
 
     /*********************************************************************/
     /*                                                                   */
-    /* We will begin by generating a sorted table of edges for the       */
-    /* current direction.  To do so, we simply scan each segment and try */
-    /* to find an edge in our table that corresponds to its position.    */
+    /* We begin by generating a sorted table of edges for the current    */
+    /* direction.  To do so, we simply scan each segment and try to find */
+    /* an edge in our table that corresponds to its position.            */
     /*                                                                   */
     /* If no edge is found, we create and insert a new edge in the       */
     /* sorted table.  Otherwise, we simply add the segment to the edge's */
     /*                                                                   */
     /* If no edge is found, we create and insert a new edge in the       */
     /* sorted table.  Otherwise, we simply add the segment to the edge's */
-    /* list which will be processed in the second step to compute the    */
+    /* list which gets processed in the second step to compute the       */
     /* edge's properties.                                                */
     /*                                                                   */
     /* edge's properties.                                                */
     /*                                                                   */
-    /* Note that the edges table is sorted along the segment/edge        */
+    /* Note that the table of edges is sorted along the segment/edge     */
     /* position.                                                         */
     /*                                                                   */
     /*********************************************************************/
 
     /* position.                                                         */
     /*                                                                   */
     /*********************************************************************/
 
+    /* assure that edge distance threshold is at most 0.25px */
     edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
                                          scale );
     if ( edge_distance_threshold > 64 / 4 )
     edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
                                          scale );
     if ( edge_distance_threshold > 64 / 4 )
 
     for ( seg = segments; seg < segment_limit; seg++ )
     {
 
     for ( seg = segments; seg < segment_limit; seg++ )
     {
-      AF_Edge  found = 0;
+      AF_Edge  found = NULL;
       FT_Int   ee;
 
 
       FT_Int   ee;
 
 
 
         edge->first    = seg;
         edge->last     = seg;
 
         edge->first    = seg;
         edge->last     = seg;
-        edge->fpos     = seg->pos;
         edge->dir      = seg->dir;
         edge->dir      = seg->dir;
-        edge->opos     = edge->pos = FT_MulFix( seg->pos, scale );
+        edge->fpos     = seg->pos;
+        edge->opos     = FT_MulFix( seg->pos, scale );
+        edge->pos      = edge->opos;
         seg->edge_next = seg;
       }
       else
         seg->edge_next = seg;
       }
       else
     }
 
 
     }
 
 
-    /*********************************************************************/
-    /*                                                                   */
-    /* Good, we will now compute each edge's properties according to     */
-    /* segments found on its position.  Basically, these are:            */
-    /*                                                                   */
-    /*  - edge's main direction                                          */
-    /*  - stem edge, serif edge or both (which defaults to stem then)    */
-    /*  - rounded edge, straight or both (which defaults to straight)    */
-    /*  - link for edge                                                  */
-    /*                                                                   */
-    /*********************************************************************/
+    /******************************************************************/
+    /*                                                                */
+    /* Good, we now compute each edge's properties according to the   */
+    /* segments found on its position.  Basically, these are          */
+    /*                                                                */
+    /*  - the edge's main direction                                   */
+    /*  - stem edge, serif edge or both (which defaults to stem then) */
+    /*  - rounded edge, straight or both (which defaults to straight) */
+    /*  - link for edge                                               */
+    /*                                                                */
+    /******************************************************************/
 
     /* first of all, set the `edge' field in each segment -- this is */
     /* required in order to compute edge links                       */
 
     /* first of all, set the `edge' field in each segment -- this is */
     /* required in order to compute edge links                       */
           } while ( seg != edge->first );
       }
 
           } while ( seg != edge->first );
       }
 
-      /* now, compute each edge properties */
+      /* now compute each edge properties */
       for ( edge = edges; edge < edge_limit; edge++ )
       {
         FT_Int  is_round    = 0;  /* does it contain round segments?    */
         FT_Int  is_straight = 0;  /* does it contain straight segments? */
       for ( edge = edges; edge < edge_limit; edge++ )
       {
         FT_Int  is_round    = 0;  /* does it contain round segments?    */
         FT_Int  is_straight = 0;  /* does it contain straight segments? */
+#if 0
         FT_Pos  ups         = 0;  /* number of upwards segments         */
         FT_Pos  downs       = 0;  /* number of downwards segments       */
         FT_Pos  ups         = 0;  /* number of upwards segments         */
         FT_Pos  downs       = 0;  /* number of downwards segments       */
+#endif
 
 
         seg = edge->first;
 
 
         seg = edge->first;
           else
             is_straight++;
 
           else
             is_straight++;
 
+#if 0
           /* check for segment direction */
           if ( seg->dir == up_dir )
           /* check for segment direction */
           if ( seg->dir == up_dir )
-            ups   += seg->max_coord-seg->min_coord;
+            ups   += seg->max_coord - seg->min_coord;
           else
           else
-            downs += seg->max_coord-seg->min_coord;
+            downs += seg->max_coord - seg->min_coord;
+#endif
 
           /* check for links -- if seg->serif is set, then seg->link must */
           /* be ignored                                                   */
 
           /* check for links -- if seg->serif is set, then seg->link must */
           /* be ignored                                                   */
           edge->dir = 0;  /* both up and down! */
 #endif
 
           edge->dir = 0;  /* both up and down! */
 #endif
 
-        /* gets rid of serifs if link is set                */
+        /* get rid of serifs if link is set                 */
         /* XXX: This gets rid of many unpleasant artefacts! */
         /*      Example: the `c' in cour.pfa at size 13     */
 
         /* XXX: This gets rid of many unpleasant artefacts! */
         /*      Example: the `c' in cour.pfa at size 13     */
 
   }
 
 
   }
 
 
+  /* Detect segments and edges for given dimension. */
+
   FT_LOCAL_DEF( FT_Error )
   af_latin_hints_detect_features( AF_GlyphHints  hints,
                                   AF_Dimension   dim )
   FT_LOCAL_DEF( FT_Error )
   af_latin_hints_detect_features( AF_GlyphHints  hints,
                                   AF_Dimension   dim )
 
       error = af_latin_hints_compute_edges( hints, dim );
     }
 
       error = af_latin_hints_compute_edges( hints, dim );
     }
+
     return error;
   }
 
 
     return error;
   }
 
 
+  /* Compute all edges which lie within blue zones. */
+
   FT_LOCAL_DEF( void )
   af_latin_hints_compute_blue_edges( AF_GlyphHints    hints,
                                      AF_LatinMetrics  metrics )
   {
   FT_LOCAL_DEF( void )
   af_latin_hints_compute_blue_edges( AF_GlyphHints    hints,
                                      AF_LatinMetrics  metrics )
   {
-    AF_AxisHints  axis       = &hints->axis[ AF_DIMENSION_VERT ];
+    AF_AxisHints  axis       = &hints->axis[AF_DIMENSION_VERT];
     AF_Edge       edge       = axis->edges;
     AF_Edge       edge_limit = edge + axis->num_edges;
     AF_Edge       edge       = axis->edges;
     AF_Edge       edge_limit = edge + axis->num_edges;
-    AF_LatinAxis  latin      = &metrics->axis[ AF_DIMENSION_VERT ];
+    AF_LatinAxis  latin      = &metrics->axis[AF_DIMENSION_VERT];
     FT_Fixed      scale      = latin->scale;
 
 
     FT_Fixed      scale      = latin->scale;
 
 
     /* for each horizontal edge search the blue zone which is closest */
     for ( ; edge < edge_limit; edge++ )
     {
     /* for each horizontal edge search the blue zone which is closest */
     for ( ; edge < edge_limit; edge++ )
     {
-      FT_Int    bb;
+      FT_UInt   bb;
       AF_Width  best_blue = NULL;
       FT_Pos    best_dist;  /* initial threshold */
 
 
       /* compute the initial threshold as a fraction of the EM size */
       AF_Width  best_blue = NULL;
       FT_Pos    best_dist;  /* initial threshold */
 
 
       /* compute the initial threshold as a fraction of the EM size */
+      /* (the value 40 is heuristic)                                */
       best_dist = FT_MulFix( metrics->units_per_em / 40, scale );
 
       best_dist = FT_MulFix( metrics->units_per_em / 40, scale );
 
+      /* assure a minimum distance of 0.5px */
       if ( best_dist > 64 / 2 )
         best_dist = 64 / 2;
 
       if ( best_dist > 64 / 2 )
         best_dist = 64 / 2;
 
-      for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )
+      for ( bb = 0; bb < latin->blue_count; bb++ )
       {
         AF_LatinBlue  blue = latin->blues + bb;
         FT_Bool       is_top_blue, is_major_dir;
 
 
       {
         AF_LatinBlue  blue = latin->blues + bb;
         FT_Bool       is_top_blue, is_major_dir;
 
 
-        /* skip inactive blue zones (i.e., those that are too small) */
+        /* skip inactive blue zones (i.e., those that are too large) */
         if ( !( blue->flags & AF_LATIN_BLUE_ACTIVE ) )
           continue;
 
         if ( !( blue->flags & AF_LATIN_BLUE_ACTIVE ) )
           continue;
 
           if ( dist < best_dist )
           {
             best_dist = dist;
           if ( dist < best_dist )
           {
             best_dist = dist;
-            best_blue = & blue->ref;
+            best_blue = &blue->ref;
           }
 
           }
 
-          /* now, compare it to the overshoot position if the edge is     */
-          /* rounded, and if the edge is over the reference position of a */
-          /* top zone, or under the reference position of a bottom zone   */
+          /* now compare it to the overshoot position and check whether */
+          /* the edge is rounded, and whether the edge is over the      */
+          /* reference position of a top zone, or under the reference   */
+          /* position of a bottom zone                                  */
           if ( edge->flags & AF_EDGE_ROUND && dist != 0 )
           {
             FT_Bool  is_under_ref = FT_BOOL( edge->fpos < blue->ref.org );
           if ( edge->flags & AF_EDGE_ROUND && dist != 0 )
           {
             FT_Bool  is_under_ref = FT_BOOL( edge->fpos < blue->ref.org );
 
             if ( is_top_blue ^ is_under_ref )
             {
 
             if ( is_top_blue ^ is_under_ref )
             {
-              blue = latin->blues + bb;
               dist = edge->fpos - blue->shoot.org;
               if ( dist < 0 )
                 dist = -dist;
               dist = edge->fpos - blue->shoot.org;
               if ( dist < 0 )
                 dist = -dist;
               if ( dist < best_dist )
               {
                 best_dist = dist;
               if ( dist < best_dist )
               {
                 best_dist = dist;
-                best_blue = & blue->shoot;
+                best_blue = &blue->shoot;
               }
             }
           }
               }
             }
           }
   }
 
 
   }
 
 
+  /* Initalize hinting engine. */
+
   static FT_Error
   af_latin_hints_init( AF_GlyphHints    hints,
                        AF_LatinMetrics  metrics )
   static FT_Error
   af_latin_hints_init( AF_GlyphHints    hints,
                        AF_LatinMetrics  metrics )
 
     /*
      *  correct x_scale and y_scale if needed, since they may have
 
     /*
      *  correct x_scale and y_scale if needed, since they may have
-     *  been modified `af_latin_metrics_scale_dim' above
+     *  been modified by `af_latin_metrics_scale_dim' above
      */
     hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
     hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
      */
     hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
     hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
     /* compute flags depending on render mode, etc. */
     mode = metrics->root.scaler.render_mode;
 
     /* compute flags depending on render mode, etc. */
     mode = metrics->root.scaler.render_mode;
 
-#if 0 /* #ifdef AF_USE_WARPER */
+#if 0 /* #ifdef AF_CONFIG_OPTION_USE_WARPER */
     if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )
     if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )
-    {
       metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;
       metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;
-    }
 #endif
 
     scaler_flags = hints->scaler_flags;
 #endif
 
     scaler_flags = hints->scaler_flags;
      *  In `light' hinting mode we disable horizontal hinting completely.
      *  We also do it if the face is italic.
      */
      *  In `light' hinting mode we disable horizontal hinting completely.
      *  We also do it if the face is italic.
      */
-    if ( mode == FT_RENDER_MODE_LIGHT                    ||
-         (face->style_flags & FT_STYLE_FLAG_ITALIC) != 0 )
+    if ( mode == FT_RENDER_MODE_LIGHT                      ||
+         ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
       scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
 
     hints->scaler_flags = scaler_flags;
     hints->other_flags  = other_flags;
 
       scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
 
     hints->scaler_flags = scaler_flags;
     hints->other_flags  = other_flags;
 
-    return 0;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
 
-  /* snap a given width in scaled coordinates to one of the */
-  /* current standard widths                                */
+  /* Snap a given width in scaled coordinates to one of the */
+  /* current standard widths.                               */
 
   static FT_Pos
   af_latin_snap_width( AF_Width  widths,
 
   static FT_Pos
   af_latin_snap_width( AF_Width  widths,
   }
 
 
   }
 
 
-  /* compute the snapped width of a given stem */
+  /* Compute the snapped width of a given stem, ignoring very thin ones. */
+  /* There is a lot of voodoo in this function; changing the hard-coded  */
+  /* parameters influence the whole hinting process.                     */
 
   static FT_Pos
   af_latin_compute_stem_width( AF_GlyphHints  hints,
 
   static FT_Pos
   af_latin_compute_stem_width( AF_GlyphHints  hints,
 
 
     if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||
 
 
     if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||
-          axis->extra_light                      )
+         axis->extra_light                       )
       return width;
 
     if ( dist < 0 )
       return width;
 
     if ( dist < 0 )
       /* smooth hinting process: very lightly quantize the stem width */
 
       /* leave the widths of serifs alone */
       /* smooth hinting process: very lightly quantize the stem width */
 
       /* leave the widths of serifs alone */
-
-      if ( ( stem_flags & AF_EDGE_SERIF ) && vertical && ( dist < 3 * 64 ) )
+      if ( ( stem_flags & AF_EDGE_SERIF ) &&
+           vertical                       &&
+           ( dist < 3 * 64 )              )
         goto Done_Width;
 
         goto Done_Width;
 
-      else if ( ( base_flags & AF_EDGE_ROUND ) )
+      else if ( base_flags & AF_EDGE_ROUND )
       {
         if ( dist < 80 )
           dist = 64;
       {
         if ( dist < 80 )
           dist = 64;
     else
     {
       /* strong hinting process: snap the stem width to integer pixels */
     else
     {
       /* strong hinting process: snap the stem width to integer pixels */
+
       FT_Pos  org_dist = dist;
 
 
       FT_Pos  org_dist = dist;
 
 
             if ( delta < 0 )
               delta = -delta;
 
             if ( delta < 0 )
               delta = -delta;
 
-            if (delta >= 16)
+            if ( delta >= 16 )
             {
               dist = org_dist;
               if ( dist < 48 )
             {
               dist = org_dist;
               if ( dist < 48 )
   }
 
 
   }
 
 
-  /* align one stem edge relative to the previous stem edge */
+  /* Align one stem edge relative to the previous stem edge. */
 
   static void
   af_latin_align_linked_edge( AF_GlyphHints  hints,
 
   static void
   af_latin_align_linked_edge( AF_GlyphHints  hints,
 
     stem_edge->pos = base_edge->pos + fitted_width;
 
 
     stem_edge->pos = base_edge->pos + fitted_width;
 
-    AF_LOG(( "LINK: edge %d (opos=%.2f) linked to (%.2f), "
-             "dist was %.2f, now %.2f\n",
-             stem_edge-hints->axis[dim].edges, stem_edge->opos / 64.0,
-             stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
+    FT_TRACE5(( "  LINK: edge %d (opos=%.2f) linked to %.2f,"
+                " dist was %.2f, now %.2f\n",
+                stem_edge-hints->axis[dim].edges, stem_edge->opos / 64.0,
+                stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
   }
 
 
   }
 
 
+  /* Shift the coordinates of the `serif' edge by the same amount */
+  /* as the corresponding `base' edge has been moved already.     */
+
   static void
   af_latin_align_serif_edge( AF_GlyphHints  hints,
                              AF_Edge        base,
   static void
   af_latin_align_serif_edge( AF_GlyphHints  hints,
                              AF_Edge        base,
   {
     FT_UNUSED( hints );
 
   {
     FT_UNUSED( hints );
 
-    serif->pos = base->pos + (serif->opos - base->opos);
+    serif->pos = base->pos + ( serif->opos - base->opos );
   }
 
 
   }
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
 
 
+  /* The main grid-fitting routine. */
+
   FT_LOCAL_DEF( void )
   af_latin_hint_edges( AF_GlyphHints  hints,
                        AF_Dimension   dim )
   FT_LOCAL_DEF( void )
   af_latin_hint_edges( AF_GlyphHints  hints,
                        AF_Dimension   dim )
     AF_Edge       edge_limit = edges + axis->num_edges;
     FT_PtrDist    n_edges;
     AF_Edge       edge;
     AF_Edge       edge_limit = edges + axis->num_edges;
     FT_PtrDist    n_edges;
     AF_Edge       edge;
-    AF_Edge       anchor     = 0;
+    AF_Edge       anchor     = NULL;
     FT_Int        has_serifs = 0;
 
     FT_Int        has_serifs = 0;
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+    FT_UInt       num_actions = 0;
+#endif
+
+
+    FT_TRACE5(( "%s edge hinting\n",
+                dim == AF_DIMENSION_VERT ? "horizontal" : "vertical" ));
 
     /* we begin by aligning all stems relative to the blue zone */
     /* if needed -- that's only for horizontal edges            */
 
     /* we begin by aligning all stems relative to the blue zone */
     /* if needed -- that's only for horizontal edges            */
       for ( edge = edges; edge < edge_limit; edge++ )
       {
         AF_Width  blue;
       for ( edge = edges; edge < edge_limit; edge++ )
       {
         AF_Width  blue;
-        AF_Edge   edge1, edge2;
+        AF_Edge   edge1, edge2; /* these edges form the stem to check */
 
 
         if ( edge->flags & AF_EDGE_DONE )
 
 
         if ( edge->flags & AF_EDGE_DONE )
         edge2 = edge->link;
 
         if ( blue )
         edge2 = edge->link;
 
         if ( blue )
-        {
           edge1 = edge;
           edge1 = edge;
-        }
+
+        /* flip edges if the other stem is aligned to a blue zone */
         else if ( edge2 && edge2->blue_edge )
         {
           blue  = edge2->blue_edge;
         else if ( edge2 && edge2->blue_edge )
         {
           blue  = edge2->blue_edge;
         if ( !edge1 )
           continue;
 
         if ( !edge1 )
           continue;
 
-        AF_LOG(( "BLUE: edge %d (opos=%.2f) snapped to (%.2f), "
-                 "was (%.2f)\n",
-                 edge1-edges, edge1->opos / 64.0, blue->fit / 64.0,
-                 edge1->pos / 64.0 ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+        if ( !anchor )
+          FT_TRACE5(( "  BLUE_ANCHOR: edge %d (opos=%.2f) snapped to %.2f,"
+                      " was %.2f (anchor=edge %d)\n",
+                      edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0,
+                      edge1->pos / 64.0, edge - edges ));
+        else
+          FT_TRACE5(( "  BLUE: edge %d (opos=%.2f) snapped to %.2f,"
+                      " was %.2f\n",
+                      edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0,
+                      edge1->pos / 64.0 ));
+
+        num_actions++;
+#endif
 
         edge1->pos    = blue->fit;
         edge1->flags |= AF_EDGE_DONE;
 
         edge1->pos    = blue->fit;
         edge1->flags |= AF_EDGE_DONE;
         {
           af_latin_align_linked_edge( hints, dim, edge1, edge2 );
           edge2->flags |= AF_EDGE_DONE;
         {
           af_latin_align_linked_edge( hints, dim, edge1, edge2 );
           edge2->flags |= AF_EDGE_DONE;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+          num_actions++;
+#endif
         }
 
         if ( !anchor )
         }
 
         if ( !anchor )
       }
     }
 
       }
     }
 
-    /* now we will align all stem edges, trying to maintain the */
-    /* relative order of stems in the glyph                     */
+    /* now we align all other stem edges, trying to maintain the */
+    /* relative order of stems in the glyph                      */
     for ( edge = edges; edge < edge_limit; edge++ )
     {
       AF_Edge  edge2;
     for ( edge = edges; edge < edge_limit; edge++ )
     {
       AF_Edge  edge2;
       /* this should not happen, but it's better to be safe */
       if ( edge2->blue_edge )
       {
       /* this should not happen, but it's better to be safe */
       if ( edge2->blue_edge )
       {
-        AF_LOG(( "ASSERTION FAILED for edge %d\n", edge2-edges ));
+        FT_TRACE5(( "  ASSERTION FAILED for edge %d\n", edge2-edges ));
 
         af_latin_align_linked_edge( hints, dim, edge2, edge );
         edge->flags |= AF_EDGE_DONE;
 
         af_latin_align_linked_edge( hints, dim, edge2, edge );
         edge->flags |= AF_EDGE_DONE;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+        num_actions++;
+#endif
         continue;
       }
 
       if ( !anchor )
       {
         continue;
       }
 
       if ( !anchor )
       {
+        /* if we reach this if clause, no stem has been aligned yet */
+
         FT_Pos  org_len, org_center, cur_len;
         FT_Pos  cur_pos1, error1, error2, u_off, d_off;
 
         FT_Pos  org_len, org_center, cur_len;
         FT_Pos  cur_pos1, error1, error2, u_off, d_off;
 
                     hints, dim, org_len,
                     (AF_Edge_Flags)edge->flags,
                     (AF_Edge_Flags)edge2->flags );
                     hints, dim, org_len,
                     (AF_Edge_Flags)edge->flags,
                     (AF_Edge_Flags)edge2->flags );
+
+        /* some voodoo to specially round edges for small stem widths; */
+        /* the idea is to align the center of a stem, then shifting    */
+        /* the stem edges to suitable positions                        */
         if ( cur_len <= 64 )
         if ( cur_len <= 64 )
-          u_off = d_off = 32;
+        {
+          /* width <= 1px */
+          u_off = 32;
+          d_off = 32;
+        }
         else
         {
         else
         {
+          /* 1px < width < 1.5px */
           u_off = 38;
           d_off = 26;
         }
           u_off = 38;
           d_off = 26;
         }
         if ( cur_len < 96 )
         {
           org_center = edge->opos + ( org_len >> 1 );
         if ( cur_len < 96 )
         {
           org_center = edge->opos + ( org_len >> 1 );
-
           cur_pos1   = FT_PIX_ROUND( org_center );
 
           error1 = org_center - ( cur_pos1 - u_off );
           cur_pos1   = FT_PIX_ROUND( org_center );
 
           error1 = org_center - ( cur_pos1 - u_off );
         else
           edge->pos = FT_PIX_ROUND( edge->opos );
 
         else
           edge->pos = FT_PIX_ROUND( edge->opos );
 
-        AF_LOG(( "ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f) "
-                 "snapped to (%.2f) (%.2f)\n",
-                 edge-edges, edge->opos / 64.0,
-                 edge2-edges, edge2->opos / 64.0,
-                 edge->pos / 64.0, edge2->pos / 64.0 ));
-        anchor = edge;
-
+        anchor       = edge;
         edge->flags |= AF_EDGE_DONE;
 
         edge->flags |= AF_EDGE_DONE;
 
+        FT_TRACE5(( "  ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f)"
+                    " snapped to %.2f and %.2f\n",
+                    edge - edges, edge->opos / 64.0,
+                    edge2 - edges, edge2->opos / 64.0,
+                    edge->pos / 64.0, edge2->pos / 64.0 ));
+
         af_latin_align_linked_edge( hints, dim, edge, edge2 );
         af_latin_align_linked_edge( hints, dim, edge, edge2 );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+        num_actions += 2;
+#endif
       }
       else
       {
       }
       else
       {
         org_center = org_pos + ( org_len >> 1 );
 
         cur_len = af_latin_compute_stem_width(
         org_center = org_pos + ( org_len >> 1 );
 
         cur_len = af_latin_compute_stem_width(
-                   hints, dim, org_len,
-                   (AF_Edge_Flags)edge->flags,
-                   (AF_Edge_Flags)edge2->flags );
+                    hints, dim, org_len,
+                    (AF_Edge_Flags)edge->flags,
+                    (AF_Edge_Flags)edge2->flags );
 
         if ( edge2->flags & AF_EDGE_DONE )
 
         if ( edge2->flags & AF_EDGE_DONE )
+        {
+          FT_TRACE5(( "  ADJUST: edge %d (pos=%.2f) moved to %.2f\n",
+                      edge - edges, edge->pos / 64.0,
+                      ( edge2->pos - cur_len ) / 64.0 ));
+
           edge->pos = edge2->pos - cur_len;
           edge->pos = edge2->pos - cur_len;
+        }
 
         else if ( cur_len < 96 )
         {
 
         else if ( cur_len < 96 )
         {
 
           cur_pos1 = FT_PIX_ROUND( org_center );
 
 
           cur_pos1 = FT_PIX_ROUND( org_center );
 
-          if (cur_len <= 64 )
-            u_off = d_off = 32;
+          if ( cur_len <= 64 )
+          {
+            u_off = 32;
+            d_off = 32;
+          }
           else
           {
             u_off = 38;
           else
           {
             u_off = 38;
           edge->pos  = cur_pos1 - cur_len / 2;
           edge2->pos = cur_pos1 + cur_len / 2;
 
           edge->pos  = cur_pos1 - cur_len / 2;
           edge2->pos = cur_pos1 + cur_len / 2;
 
-          AF_LOG(( "STEM: %d (opos=%.2f) to %d (opos=%.2f) "
-                   "snapped to (%.2f) and (%.2f)\n",
-                   edge-edges, edge->opos / 64.0,
-                   edge2-edges, edge2->opos / 64.0,
-                   edge->pos / 64.0, edge2->pos / 64.0 ));
+          FT_TRACE5(( "  STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)"
+                      " snapped to %.2f and %.2f\n",
+                      edge - edges, edge->opos / 64.0,
+                      edge2 - edges, edge2->opos / 64.0,
+                      edge->pos / 64.0, edge2->pos / 64.0 ));
         }
         }
+
         else
         {
           org_pos    = anchor->pos + ( edge->opos - anchor->opos );
         else
         {
           org_pos    = anchor->pos + ( edge->opos - anchor->opos );
                          (AF_Edge_Flags)edge->flags,
                          (AF_Edge_Flags)edge2->flags );
 
                          (AF_Edge_Flags)edge->flags,
                          (AF_Edge_Flags)edge2->flags );
 
-          cur_pos1   = FT_PIX_ROUND( org_pos );
-          delta1     = cur_pos1 + ( cur_len >> 1 ) - org_center;
+          cur_pos1 = FT_PIX_ROUND( org_pos );
+          delta1   = cur_pos1 + ( cur_len >> 1 ) - org_center;
           if ( delta1 < 0 )
             delta1 = -delta1;
 
           if ( delta1 < 0 )
             delta1 = -delta1;
 
-          cur_pos2   = FT_PIX_ROUND( org_pos + org_len ) - cur_len;
-          delta2     = cur_pos2 + ( cur_len >> 1 ) - org_center;
+          cur_pos2 = FT_PIX_ROUND( org_pos + org_len ) - cur_len;
+          delta2   = cur_pos2 + ( cur_len >> 1 ) - org_center;
           if ( delta2 < 0 )
             delta2 = -delta2;
 
           edge->pos  = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
           edge2->pos = edge->pos + cur_len;
 
           if ( delta2 < 0 )
             delta2 = -delta2;
 
           edge->pos  = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
           edge2->pos = edge->pos + cur_len;
 
-          AF_LOG(( "STEM: %d (opos=%.2f) to %d (opos=%.2f) "
-                   "snapped to (%.2f) and (%.2f)\n",
-                   edge-edges, edge->opos / 64.0,
-                   edge2-edges, edge2->opos / 64.0,
-                   edge->pos / 64.0, edge2->pos / 64.0 ));
+          FT_TRACE5(( "  STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)"
+                      " snapped to %.2f and %.2f\n",
+                      edge - edges, edge->opos / 64.0,
+                      edge2 - edges, edge2->opos / 64.0,
+                      edge->pos / 64.0, edge2->pos / 64.0 ));
         }
 
         }
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+        num_actions++;
+#endif
+
         edge->flags  |= AF_EDGE_DONE;
         edge2->flags |= AF_EDGE_DONE;
 
         if ( edge > edges && edge->pos < edge[-1].pos )
         {
         edge->flags  |= AF_EDGE_DONE;
         edge2->flags |= AF_EDGE_DONE;
 
         if ( edge > edges && edge->pos < edge[-1].pos )
         {
-          AF_LOG(( "BOUND: %d (pos=%.2f) to (%.2f)\n",
-                   edge-edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+          FT_TRACE5(( "  BOUND: edge %d (pos=%.2f) moved to %.2f\n",
+                      edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));
+
+          num_actions++;
+#endif
+
           edge->pos = edge[-1].pos;
         }
       }
           edge->pos = edge[-1].pos;
         }
       }
         if ( delta < 64 + 16 )
         {
           af_latin_align_serif_edge( hints, edge->serif, edge );
         if ( delta < 64 + 16 )
         {
           af_latin_align_serif_edge( hints, edge->serif, edge );
-          AF_LOG(( "SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f) "
-                   "aligned to (%.2f)\n",
-                   edge-edges, edge->opos / 64.0,
-                   edge->serif - edges, edge->serif->opos / 64.0,
-                   edge->pos / 64.0 ));
+          FT_TRACE5(( "  SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f)"
+                      " aligned to %.2f\n",
+                      edge - edges, edge->opos / 64.0,
+                      edge->serif - edges, edge->serif->opos / 64.0,
+                      edge->pos / 64.0 ));
         }
         else if ( !anchor )
         {
         }
         else if ( !anchor )
         {
-          AF_LOG(( "SERIF_ANCHOR: edge %d (opos=%.2f) snapped to (%.2f)\n",
-                   edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
           edge->pos = FT_PIX_ROUND( edge->opos );
           anchor    = edge;
           edge->pos = FT_PIX_ROUND( edge->opos );
           anchor    = edge;
+          FT_TRACE5(( "  SERIF_ANCHOR: edge %d (opos=%.2f)"
+                      " snapped to %.2f\n",
+                      edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
         }
         else
         {
         }
         else
         {
                           FT_MulDiv( edge->opos - before->opos,
                                      after->pos - before->pos,
                                      after->opos - before->opos );
                           FT_MulDiv( edge->opos - before->opos,
                                      after->pos - before->pos,
                                      after->opos - before->opos );
-            AF_LOG(( "SERIF_LINK1: edge %d (opos=%.2f) snapped to (%.2f) "
-                     "from %d (opos=%.2f)\n",
-                     edge-edges, edge->opos / 64.0,
-                     edge->pos / 64.0, before - edges,
-                     before->opos / 64.0 ));
+
+            FT_TRACE5(( "  SERIF_LINK1: edge %d (opos=%.2f) snapped to %.2f"
+                        " from %d (opos=%.2f)\n",
+                        edge - edges, edge->opos / 64.0,
+                        edge->pos / 64.0,
+                        before - edges, before->opos / 64.0 ));
           }
           else
           {
             edge->pos = anchor->pos +
                         ( ( edge->opos - anchor->opos + 16 ) & ~31 );
           }
           else
           {
             edge->pos = anchor->pos +
                         ( ( edge->opos - anchor->opos + 16 ) & ~31 );
-            AF_LOG(( "SERIF_LINK2: edge %d (opos=%.2f) snapped to (%.2f)\n",
-                     edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
+            FT_TRACE5(( "  SERIF_LINK2: edge %d (opos=%.2f)"
+                        " snapped to %.2f\n",
+                        edge - edges, edge->opos / 64.0, edge->pos / 64.0 ));
           }
         }
 
           }
         }
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+        num_actions++;
+#endif
         edge->flags |= AF_EDGE_DONE;
 
         if ( edge > edges && edge->pos < edge[-1].pos )
         edge->flags |= AF_EDGE_DONE;
 
         if ( edge > edges && edge->pos < edge[-1].pos )
+        {
+#ifdef FT_DEBUG_LEVEL_TRACE
+          FT_TRACE5(( "  BOUND: edge %d (pos=%.2f) moved to %.2f\n",
+                      edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));
+
+          num_actions++;
+#endif
           edge->pos = edge[-1].pos;
           edge->pos = edge[-1].pos;
+        }
 
         if ( edge + 1 < edge_limit        &&
              edge[1].flags & AF_EDGE_DONE &&
              edge->pos > edge[1].pos      )
 
         if ( edge + 1 < edge_limit        &&
              edge[1].flags & AF_EDGE_DONE &&
              edge->pos > edge[1].pos      )
+        {
+#ifdef FT_DEBUG_LEVEL_TRACE
+          FT_TRACE5(( "  BOUND: edge %d (pos=%.2f) moved to %.2f\n",
+                      edge - edges, edge->pos / 64.0, edge[1].pos / 64.0 ));
+
+          num_actions++;
+#endif
+
           edge->pos = edge[1].pos;
           edge->pos = edge[1].pos;
+        }
       }
     }
       }
     }
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+    if ( !num_actions )
+      FT_TRACE5(( "  (none)\n" ));
+    FT_TRACE5(( "\n" ));
+#endif
   }
 
 
   }
 
 
+  /* Apply the complete hinting algorithm to a latin glyph. */
+
   static FT_Error
   af_latin_hints_apply( AF_GlyphHints    hints,
                         FT_Outline*      outline,
   static FT_Error
   af_latin_hints_apply( AF_GlyphHints    hints,
                         FT_Outline*      outline,
       goto Exit;
 
     /* analyze glyph outline */
       goto Exit;
 
     /* analyze glyph outline */
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
     if ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ||
     if ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ||
-         AF_HINTS_DO_HORIZONTAL( hints ) )
+         AF_HINTS_DO_HORIZONTAL( hints )                          )
 #else
     if ( AF_HINTS_DO_HORIZONTAL( hints ) )
 #endif
 #else
     if ( AF_HINTS_DO_HORIZONTAL( hints ) )
 #endif
     /* grid-fit the outline */
     for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
     {
     /* grid-fit the outline */
     for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
     {
-#ifdef AF_USE_WARPER
-      if ( ( dim == AF_DIMENSION_HORZ &&
-             metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ) )
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+      if ( dim == AF_DIMENSION_HORZ                                 &&
+           metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT )
       {
         AF_WarperRec  warper;
         FT_Fixed      scale;
         FT_Pos        delta;
 
 
       {
         AF_WarperRec  warper;
         FT_Fixed      scale;
         FT_Pos        delta;
 
 
-        af_warper_compute( &warper, hints, dim, &scale, &delta );
-        af_glyph_hints_scale_dim( hints, dim, scale, delta );
+        af_warper_compute( &warper, hints, (AF_Dimension)dim,
+                           &scale, &delta );
+        af_glyph_hints_scale_dim( hints, (AF_Dimension)dim,
+                                  scale, delta );
         continue;
       }
 #endif
         continue;
       }
 #endif
     AF_UNIRANGE_REC(  0x2460UL,  0x24FFUL ),  /* Enclosed Alphanumerics */
     AF_UNIRANGE_REC(  0x2C60UL,  0x2C7FUL ),  /* Latin Extended-C */
     AF_UNIRANGE_REC(  0x2DE0UL,  0x2DFFUL ),  /* Cyrillic Extended-A */
     AF_UNIRANGE_REC(  0x2460UL,  0x24FFUL ),  /* Enclosed Alphanumerics */
     AF_UNIRANGE_REC(  0x2C60UL,  0x2C7FUL ),  /* Latin Extended-C */
     AF_UNIRANGE_REC(  0x2DE0UL,  0x2DFFUL ),  /* Cyrillic Extended-A */
+    AF_UNIRANGE_REC(  0x2E00UL,  0x2E7FUL ),  /* Supplemental Punctuation */
     AF_UNIRANGE_REC(  0xA640UL,  0xA69FUL ),  /* Cyrillic Extended-B */
     AF_UNIRANGE_REC(  0xA720UL,  0xA7FFUL ),  /* Latin Extended-D */
     AF_UNIRANGE_REC(  0xFB00UL,  0xFB06UL ),  /* Alphab. Present. Forms (Latin Ligs) */
     AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ),  /* Mathematical Alphanumeric Symbols */
     AF_UNIRANGE_REC(  0xA640UL,  0xA69FUL ),  /* Cyrillic Extended-B */
     AF_UNIRANGE_REC(  0xA720UL,  0xA7FFUL ),  /* Latin Extended-D */
     AF_UNIRANGE_REC(  0xFB00UL,  0xFB06UL ),  /* Alphab. Present. Forms (Latin Ligs) */
     AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ),  /* Mathematical Alphanumeric Symbols */
+    AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ),  /* Enclosed Alphanumeric Supplement */
     AF_UNIRANGE_REC(       0UL,       0UL )
   };
 
 
     AF_UNIRANGE_REC(       0UL,       0UL )
   };
 
 
-  AF_DEFINE_SCRIPT_CLASS(af_latin_script_class,  
+  AF_DEFINE_SCRIPT_CLASS( af_latin_script_class,
     AF_SCRIPT_LATIN,
     af_latin_uniranges,
     AF_SCRIPT_LATIN,
     af_latin_uniranges,
+    'o',
 
 
-    sizeof( AF_LatinMetricsRec ),
+    sizeof ( AF_LatinMetricsRec ),
 
     (AF_Script_InitMetricsFunc) af_latin_metrics_init,
     (AF_Script_ScaleMetricsFunc)af_latin_metrics_scale,
 
     (AF_Script_InitMetricsFunc) af_latin_metrics_init,
     (AF_Script_ScaleMetricsFunc)af_latin_metrics_scale,
index 660b10c..d9170b3 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines for latin script (specification).       */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter hinting routines for latin script (specification).       */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2009 by                        */
+/*  Copyright 2003-2007, 2009, 2011-2012 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -27,11 +27,11 @@ FT_BEGIN_HEADER
 
   /* the latin-specific script class */
 
 
   /* the latin-specific script class */
 
-  AF_DECLARE_SCRIPT_CLASS(af_latin_script_class)
+  AF_DECLARE_SCRIPT_CLASS( af_latin_script_class )
 
 
 
 
-/* constants are given with units_per_em == 2048 in mind */
-#define AF_LATIN_CONSTANT( metrics, c ) \
+  /* constants are given with units_per_em == 2048 in mind */
+#define AF_LATIN_CONSTANT( metrics, c )                                      \
   ( ( (c) * (FT_Long)( (AF_LatinMetrics)(metrics) )->units_per_em ) / 2048 )
 
 
   ( ( (c) * (FT_Long)( (AF_LatinMetrics)(metrics) )->units_per_em ) / 2048 )
 
 
@@ -76,10 +76,10 @@ FT_BEGIN_HEADER
 
   enum
   {
 
   enum
   {
-    AF_LATIN_BLUE_ACTIVE     = 1 << 0,
-    AF_LATIN_BLUE_TOP        = 1 << 1,
-    AF_LATIN_BLUE_ADJUSTMENT = 1 << 2,  /* used for scale adjustment */
-                                        /* optimization              */
+    AF_LATIN_BLUE_ACTIVE     = 1 << 0,  /* set if zone height is <= 3/4px */
+    AF_LATIN_BLUE_TOP        = 1 << 1,  /* result of AF_LATIN_IS_TOP_BLUE */
+    AF_LATIN_BLUE_ADJUSTMENT = 1 << 2,  /* used for scale adjustment      */
+                                        /* optimization                   */
     AF_LATIN_BLUE_FLAG_MAX
   };
 
     AF_LATIN_BLUE_FLAG_MAX
   };
 
@@ -98,14 +98,13 @@ FT_BEGIN_HEADER
     FT_Fixed         scale;
     FT_Pos           delta;
 
     FT_Fixed         scale;
     FT_Pos           delta;
 
-    FT_UInt          width_count;
-    AF_WidthRec      widths[AF_LATIN_MAX_WIDTHS];
-    FT_Pos           edge_distance_threshold;
-    FT_Pos           standard_width;
-    FT_Bool          extra_light;
+    FT_UInt          width_count;                 /* number of used widths */
+    AF_WidthRec      widths[AF_LATIN_MAX_WIDTHS]; /* widths array          */
+    FT_Pos           edge_distance_threshold;   /* used for creating edges */
+    FT_Pos           standard_width;         /* the default stem thickness */
+    FT_Bool          extra_light;         /* is standard width very light? */
 
     /* ignored for horizontal metrics */
 
     /* ignored for horizontal metrics */
-    FT_Bool          control_overshoot;
     FT_UInt          blue_count;
     AF_LatinBlueRec  blues[AF_LATIN_BLUE_MAX];
 
     FT_UInt          blue_count;
     AF_LatinBlueRec  blues[AF_LATIN_BLUE_MAX];
 
@@ -134,8 +133,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   af_latin_metrics_init_widths( AF_LatinMetrics  metrics,
 
   FT_LOCAL( void )
   af_latin_metrics_init_widths( AF_LatinMetrics  metrics,
-                                FT_Face          face,
-                                FT_ULong         charcode );
+                                FT_Face          face );
 
   FT_LOCAL( void )
   af_latin_metrics_check_digits( AF_LatinMetrics  metrics,
 
   FT_LOCAL( void )
   af_latin_metrics_check_digits( AF_LatinMetrics  metrics,
@@ -175,25 +173,17 @@ FT_BEGIN_HEADER
 
 
   /*
 
 
   /*
-   *  This shouldn't normally be exported.  However, other scripts might
-   *  like to use this function as-is.
+   *  The next functions shouldn't normally be exported.  However, other
+   *  scripts might like to use these functions as-is.
    */
   FT_LOCAL( FT_Error )
   af_latin_hints_compute_segments( AF_GlyphHints  hints,
                                    AF_Dimension   dim );
 
    */
   FT_LOCAL( FT_Error )
   af_latin_hints_compute_segments( AF_GlyphHints  hints,
                                    AF_Dimension   dim );
 
-  /*
-   *  This shouldn't normally be exported.  However, other scripts might
-   *  want to use this function as-is.
-   */
   FT_LOCAL( void )
   af_latin_hints_link_segments( AF_GlyphHints  hints,
                                 AF_Dimension   dim );
 
   FT_LOCAL( void )
   af_latin_hints_link_segments( AF_GlyphHints  hints,
                                 AF_Dimension   dim );
 
-  /*
-   *  This shouldn't normally be exported.  However, other scripts might
-   *  want to use this function as-is.
-   */
   FT_LOCAL( FT_Error )
   af_latin_hints_compute_edges( AF_GlyphHints  hints,
                                 AF_Dimension   dim );
   FT_LOCAL( FT_Error )
   af_latin_hints_compute_edges( AF_GlyphHints  hints,
                                 AF_Dimension   dim );
index 6546475..b1e9658 100644 (file)
@@ -1,10 +1,10 @@
 /***************************************************************************/
 /*                                                                         */
 /***************************************************************************/
 /*                                                                         */
-/*  aflatin.c                                                              */
+/*  aflatin2.c                                                             */
 /*                                                                         */
 /*    Auto-fitter hinting routines for latin script (body).                */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter hinting routines for latin script (body).                */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by            */
+/*  Copyright 2003-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #include FT_ADVANCES_H
 
 
 #include FT_ADVANCES_H
 
+#include "afglobal.h"
 #include "aflatin.h"
 #include "aflatin2.h"
 #include "aferrors.h"
 
 
 #include "aflatin.h"
 #include "aflatin2.h"
 #include "aferrors.h"
 
 
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
 #include "afwarp.h"
 #endif
 
 #include "afwarp.h"
 #endif
 
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_aflatin2
+
+
   FT_LOCAL_DEF( FT_Error )
   af_latin2_hints_compute_segments( AF_GlyphHints  hints,
   FT_LOCAL_DEF( FT_Error )
   af_latin2_hints_compute_segments( AF_GlyphHints  hints,
-                                   AF_Dimension   dim );
+                                    AF_Dimension   dim );
 
   FT_LOCAL_DEF( void )
   af_latin2_hints_link_segments( AF_GlyphHints  hints,
 
   FT_LOCAL_DEF( void )
   af_latin2_hints_link_segments( AF_GlyphHints  hints,
@@ -45,8 +57,7 @@
 
   FT_LOCAL_DEF( void )
   af_latin2_metrics_init_widths( AF_LatinMetrics  metrics,
 
   FT_LOCAL_DEF( void )
   af_latin2_metrics_init_widths( AF_LatinMetrics  metrics,
-                                FT_Face          face,
-                                FT_ULong         charcode )
+                                 FT_Face          face )
   {
     /* scan the array of segments in each direction */
     AF_GlyphHintsRec  hints[1];
   {
     /* scan the array of segments in each direction */
     AF_GlyphHintsRec  hints[1];
@@ -65,7 +76,8 @@
       AF_Scaler            scaler = &dummy->root.scaler;
 
 
       AF_Scaler            scaler = &dummy->root.scaler;
 
 
-      glyph_index = FT_Get_Char_Index( face, charcode );
+      glyph_index = FT_Get_Char_Index( face,
+                                       metrics->root.clazz->standard_char );
       if ( glyph_index == 0 )
         goto Exit;
 
       if ( glyph_index == 0 )
         goto Exit;
 
               dist = -dist;
 
             if ( num_widths < AF_LATIN_MAX_WIDTHS )
               dist = -dist;
 
             if ( num_widths < AF_LATIN_MAX_WIDTHS )
-              axis->widths[ num_widths++ ].org = dist;
+              axis->widths[num_widths++].org = dist;
           }
         }
 
           }
         }
 
 #define AF_LATIN_MAX_TEST_CHARACTERS  12
 
 
 #define AF_LATIN_MAX_TEST_CHARACTERS  12
 
 
-  static const char af_latin2_blue_chars[AF_LATIN_MAX_BLUES][AF_LATIN_MAX_TEST_CHARACTERS+1] =
+  static const char af_latin2_blue_chars[AF_LATIN_MAX_BLUES]
+                                        [AF_LATIN_MAX_TEST_CHARACTERS+1] =
   {
     "THEZOCQS",
     "HEZLOCUS",
   {
     "THEZOCQS",
     "HEZLOCUS",
 
   static void
   af_latin2_metrics_init_blues( AF_LatinMetrics  metrics,
 
   static void
   af_latin2_metrics_init_blues( AF_LatinMetrics  metrics,
-                               FT_Face          face )
+                                FT_Face          face )
   {
     FT_Pos        flats [AF_LATIN_MAX_TEST_CHARACTERS];
     FT_Pos        rounds[AF_LATIN_MAX_TEST_CHARACTERS];
   {
     FT_Pos        flats [AF_LATIN_MAX_TEST_CHARACTERS];
     FT_Pos        rounds[AF_LATIN_MAX_TEST_CHARACTERS];
     FT_GlyphSlot  glyph = face->glyph;
 
 
     FT_GlyphSlot  glyph = face->glyph;
 
 
-    /* we compute the blues simply by loading each character from the    */
+    /* we compute the blues simply by loading each character from the     */
     /* 'af_latin2_blue_chars[blues]' string, then compute its top-most or */
     /* 'af_latin2_blue_chars[blues]' string, then compute its top-most or */
-    /* bottom-most points (depending on `AF_IS_TOP_BLUE')                */
+    /* bottom-most points (depending on `AF_IS_TOP_BLUE')                 */
 
 
-    AF_LOG(( "blue zones computation\n" ));
-    AF_LOG(( "------------------------------------------------\n" ));
+    FT_TRACE5(( "blue zones computation\n"
+                "======================\n\n" ));
 
     for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )
     {
 
     for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )
     {
       FT_Pos*      blue_shoot;
 
 
       FT_Pos*      blue_shoot;
 
 
-      AF_LOG(( "blue %3d: ", bb ));
+      FT_TRACE5(( "blue zone %d:\n", bb ));
 
       num_flats  = 0;
       num_rounds = 0;
 
       num_flats  = 0;
       num_rounds = 0;
         FT_Bool     round;
 
 
         FT_Bool     round;
 
 
-        AF_LOG(( "'%c'", *p ));
-
         /* load the character in the face -- skip unknown or empty ones */
         glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p );
         if ( glyph_index == 0 )
         /* load the character in the face -- skip unknown or empty ones */
         glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p );
         if ( glyph_index == 0 )
               best_last  = last;
             }
           }
               best_last  = last;
             }
           }
-          AF_LOG(( "%5d", best_y ));
+          FT_TRACE5(( "  %c  %d", *p, best_y ));
         }
 
         /* now check whether the point belongs to a straight or round   */
         /* segment; we first need to find in which contour the extremum */
         /* lies, then inspect its previous and next points              */
         {
         }
 
         /* now check whether the point belongs to a straight or round   */
         /* segment; we first need to find in which contour the extremum */
         /* lies, then inspect its previous and next points              */
         {
+          FT_Pos  best_x = points[best_point].x;
           FT_Int  start, end, prev, next;
           FT_Pos  dist;
 
           FT_Int  start, end, prev, next;
           FT_Pos  dist;
 
 
           do
           {
 
           do
           {
-            prev = start-1;
+            prev = start - 1;
             if ( prev < best_first )
               prev = best_last;
 
             if ( prev < best_first )
               prev = best_last;
 
-            dist = points[prev].y - best_y;
-            if ( dist < -5 || dist > 5 )
-              break;
+            dist = FT_ABS( points[prev].y - best_y );
+            /* accept a small distance or a small angle (both values are */
+            /* heuristic; value 20 corresponds to approx. 2.9 degrees)   */
+            if ( dist > 5 )
+              if ( FT_ABS( points[prev].x - best_x ) <= 20 * dist )
+                break;
 
             start = prev;
 
 
             start = prev;
 
 
           do
           {
 
           do
           {
-            next = end+1;
+            next = end + 1;
             if ( next > best_last )
               next = best_first;
 
             if ( next > best_last )
               next = best_first;
 
-            dist = points[next].y - best_y;
-            if ( dist < -5 || dist > 5 )
-              break;
+            dist = FT_ABS( points[next].y - best_y );
+            if ( dist > 5 )
+              if ( FT_ABS( points[next].x - best_x ) <= 20 * dist )
+                break;
 
             end = next;
 
 
             end = next;
 
             FT_CURVE_TAG( glyph->outline.tags[start] ) != FT_CURVE_TAG_ON ||
             FT_CURVE_TAG( glyph->outline.tags[ end ] ) != FT_CURVE_TAG_ON );
 
             FT_CURVE_TAG( glyph->outline.tags[start] ) != FT_CURVE_TAG_ON ||
             FT_CURVE_TAG( glyph->outline.tags[ end ] ) != FT_CURVE_TAG_ON );
 
-          AF_LOG(( "%c ", round ? 'r' : 'f' ));
+          FT_TRACE5(( " (%s)\n", round ? "round" : "flat" ));
         }
 
         if ( round )
         }
 
         if ( round )
           flats[num_flats++]   = best_y;
       }
 
           flats[num_flats++]   = best_y;
       }
 
-      AF_LOG(( "\n" ));
-
       if ( num_flats == 0 && num_rounds == 0 )
       {
         /*
          *  we couldn't find a single glyph to compute this blue zone,
          *  we will simply ignore it then
          */
       if ( num_flats == 0 && num_rounds == 0 )
       {
         /*
          *  we couldn't find a single glyph to compute this blue zone,
          *  we will simply ignore it then
          */
-        AF_LOG(( "empty\n" ));
+        FT_TRACE5(( "  empty\n" ));
         continue;
       }
 
         continue;
       }
 
 
 
         if ( AF_LATIN_IS_TOP_BLUE( bb ) ^ over_ref )
 
 
         if ( AF_LATIN_IS_TOP_BLUE( bb ) ^ over_ref )
-          *blue_shoot = *blue_ref = ( shoot + ref ) / 2;
+        {
+          *blue_ref   =
+          *blue_shoot = ( shoot + ref ) / 2;
+
+          FT_TRACE5(( "  [overshoot smaller than reference,"
+                      " taking mean value]\n" ));
+        }
       }
 
       blue->flags = 0;
       }
 
       blue->flags = 0;
       if ( bb == AF_LATIN_BLUE_SMALL_TOP )
         blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;
 
       if ( bb == AF_LATIN_BLUE_SMALL_TOP )
         blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;
 
-      AF_LOG(( "-- ref = %ld, shoot = %ld\n", *blue_ref, *blue_shoot ));
+      FT_TRACE5(( "    -> reference = %ld\n"
+                  "       overshoot = %ld\n",
+                  *blue_ref, *blue_shoot ));
     }
 
     return;
     }
 
     return;
 
   FT_LOCAL_DEF( FT_Error )
   af_latin2_metrics_init( AF_LatinMetrics  metrics,
 
   FT_LOCAL_DEF( FT_Error )
   af_latin2_metrics_init( AF_LatinMetrics  metrics,
-                         FT_Face          face )
+                          FT_Face          face )
   {
   {
-    FT_Error    error = AF_Err_Ok;
+    FT_Error    error  = FT_Err_Ok;
     FT_CharMap  oldmap = face->charmap;
     FT_UInt     ee;
 
     FT_CharMap  oldmap = face->charmap;
     FT_UInt     ee;
 
 
     if ( !error )
     {
 
     if ( !error )
     {
-      /* For now, compute the standard width and height from the `o'. */
-      af_latin2_metrics_init_widths( metrics, face, 'o' );
+      af_latin2_metrics_init_widths( metrics, face );
       af_latin2_metrics_init_blues( metrics, face );
       af_latin2_metrics_check_digits( metrics, face );
     }
 
     FT_Set_Charmap( face, oldmap );
       af_latin2_metrics_init_blues( metrics, face );
       af_latin2_metrics_check_digits( metrics, face );
     }
 
     FT_Set_Charmap( face, oldmap );
-    return AF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   static void
   af_latin2_metrics_scale_dim( AF_LatinMetrics  metrics,
   }
 
 
   static void
   af_latin2_metrics_scale_dim( AF_LatinMetrics  metrics,
-                              AF_Scaler        scaler,
-                              AF_Dimension     dim )
+                               AF_Scaler        scaler,
+                               AF_Dimension     dim )
   {
     FT_Fixed      scale;
     FT_Pos        delta;
   {
     FT_Fixed      scale;
     FT_Pos        delta;
 
       if ( blue )
       {
 
       if ( blue )
       {
-        FT_Pos  scaled = FT_MulFix( blue->shoot.org, scaler->y_scale );
-        FT_Pos  fitted = ( scaled + 40 ) & ~63;
+        FT_Pos   scaled;
+        FT_Pos   threshold;
+        FT_Pos   fitted;
+        FT_UInt  limit;
+        FT_UInt  ppem;
+
+
+        scaled    = FT_MulFix( blue->shoot.org, scaler->y_scale );
+        ppem      = metrics->root.scaler.face->size->metrics.x_ppem;
+        limit     = metrics->root.globals->increase_x_height;
+        threshold = 40;
+
+        /* if the `increase-x-height' property is active, */
+        /* we round up much more often                    */
+        if ( limit                                 &&
+             ppem <= limit                         &&
+             ppem >= AF_PROP_INCREASE_X_HEIGHT_MIN )
+          threshold = 52;
+
+        fitted = ( scaled + threshold ) & ~63;
 
 #if 1
         if ( scaled != fitted )
         {
           scale = FT_MulDiv( scale, fitted, scaled );
 
 #if 1
         if ( scaled != fitted )
         {
           scale = FT_MulDiv( scale, fitted, scaled );
-          AF_LOG(( "== scaled x-top = %.2g  fitted = %.2g, scaling = %.4g\n", scaled/64.0, fitted/64.0, (fitted*1.0)/scaled ));
+          FT_TRACE5(( "== scaled x-top = %.2g"
+                      "  fitted = %.2g, scaling = %.4g\n",
+                      scaled / 64.0, fitted / 64.0,
+                      ( fitted * 1.0 ) / scaled ));
         }
 #endif
       }
         }
 #endif
       }
     }
 
     /* an extra-light axis corresponds to a standard width that is */
     }
 
     /* an extra-light axis corresponds to a standard width that is */
-    /* smaller than 0.75 pixels                                    */
+    /* smaller than 5/8 pixels                                     */
     axis->extra_light =
       (FT_Bool)( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );
 
     axis->extra_light =
       (FT_Bool)( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );
 
           blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );
           blue->shoot.fit = blue->ref.fit + delta2;
 
           blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );
           blue->shoot.fit = blue->ref.fit + delta2;
 
-          AF_LOG(( ">> activating blue zone %d:  ref.cur=%.2g ref.fit=%.2g shoot.cur=%.2g shoot.fit=%.2g\n",
-                   nn, blue->ref.cur/64.0, blue->ref.fit/64.0,
-                   blue->shoot.cur/64.0, blue->shoot.fit/64.0 ));
+          FT_TRACE5(( ">> activating blue zone %d:"
+                      "  ref.cur=%.2g ref.fit=%.2g"
+                      "  shoot.cur=%.2g shoot.fit=%.2g\n",
+                      nn, blue->ref.cur / 64.0, blue->ref.fit / 64.0,
+                      blue->shoot.cur / 64.0, blue->shoot.fit / 64.0 ));
 
           blue->flags |= AF_LATIN_BLUE_ACTIVE;
         }
 
           blue->flags |= AF_LATIN_BLUE_ACTIVE;
         }
 
   FT_LOCAL_DEF( void )
   af_latin2_metrics_scale( AF_LatinMetrics  metrics,
 
   FT_LOCAL_DEF( void )
   af_latin2_metrics_scale( AF_LatinMetrics  metrics,
-                          AF_Scaler        scaler )
+                           AF_Scaler        scaler )
   {
     metrics->root.scaler.render_mode = scaler->render_mode;
     metrics->root.scaler.face        = scaler->face;
   {
     metrics->root.scaler.render_mode = scaler->render_mode;
     metrics->root.scaler.face        = scaler->face;
+    metrics->root.scaler.flags       = scaler->flags;
 
     af_latin2_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
     af_latin2_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );
 
     af_latin2_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
     af_latin2_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );
 
   FT_LOCAL_DEF( FT_Error )
   af_latin2_hints_compute_segments( AF_GlyphHints  hints,
 
   FT_LOCAL_DEF( FT_Error )
   af_latin2_hints_compute_segments( AF_GlyphHints  hints,
-                                   AF_Dimension   dim )
+                                    AF_Dimension   dim )
   {
     AF_AxisHints  axis          = &hints->axis[dim];
     FT_Memory     memory        = hints->memory;
   {
     AF_AxisHints  axis          = &hints->axis[dim];
     FT_Memory     memory        = hints->memory;
-    FT_Error      error         = AF_Err_Ok;
+    FT_Error      error         = FT_Err_Ok;
     AF_Segment    segment       = NULL;
     AF_SegmentRec seg0;
     AF_Point*     contour       = hints->contours;
     AF_Segment    segment       = NULL;
     AF_SegmentRec seg0;
     AF_Point*     contour       = hints->contours;
         segment->dir       = first->out_dir;
         segment->first     = first;
         segment->last      = point;
         segment->dir       = first->out_dir;
         segment->first     = first;
         segment->last      = point;
-        segment->contour   = contour;
-        segment->pos       = (FT_Short)(( min_u + max_u ) >> 1);
+        segment->pos       = (FT_Short)( ( min_u + max_u ) >> 1 );
         segment->min_coord = (FT_Short) min_v;
         segment->max_coord = (FT_Short) max_v;
         segment->min_coord = (FT_Short) min_v;
         segment->max_coord = (FT_Short) max_v;
-        segment->height    = (FT_Short)(max_v - min_v);
+        segment->height    = (FT_Short)( max_v - min_v );
 
         /* a segment is round if it doesn't have successive */
         /* on-curve points.                                 */
         {
           AF_Point  pt   = first;
           AF_Point  last = point;
 
         /* a segment is round if it doesn't have successive */
         /* on-curve points.                                 */
         {
           AF_Point  pt   = first;
           AF_Point  last = point;
-          AF_Flags  f0   = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
+          AF_Flags  f0   = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
           AF_Flags  f1;
 
 
           AF_Flags  f1;
 
 
           for ( ; pt != last; f0 = f1 )
           {
             pt = pt->next;
           for ( ; pt != last; f0 = f1 )
           {
             pt = pt->next;
-            f1 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
+            f1 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
 
             if ( !f0 && !f1 )
               break;
 
             if ( !f0 && !f1 )
               break;
           break;
 
         /* jump to the start of the next segment, if any */
           break;
 
         /* jump to the start of the next segment, if any */
-        while ( FT_ABS(point->out_dir) != major_dir )
+        while ( FT_ABS( point->out_dir ) != major_dir )
         {
           point = point->next;
 
         {
           point = point->next;
 
       FT_UInt     count    = axis->num_segments;
       FT_UInt     ii, jj;
 
       FT_UInt     count    = axis->num_segments;
       FT_UInt     ii, jj;
 
-      for (ii = 0; ii < count; ii++)
+      for ( ii = 0; ii < count; ii++ )
       {
         if ( segments[ii].dir > 0 )
         {
       {
         if ( segments[ii].dir > 0 )
         {
-          for (jj = ii+1; jj < count; jj++)
+          for ( jj = ii + 1; jj < count; jj++ )
           {
             if ( segments[jj].dir < 0 )
             {
               AF_SegmentRec  tmp;
 
           {
             if ( segments[jj].dir < 0 )
             {
               AF_SegmentRec  tmp;
 
+
               tmp          = segments[ii];
               segments[ii] = segments[jj];
               segments[jj] = tmp;
               tmp          = segments[ii];
               segments[ii] = segments[jj];
               segments[jj] = tmp;
 
   FT_LOCAL_DEF( void )
   af_latin2_hints_link_segments( AF_GlyphHints  hints,
 
   FT_LOCAL_DEF( void )
   af_latin2_hints_link_segments( AF_GlyphHints  hints,
-                                AF_Dimension   dim )
+                                 AF_Dimension   dim )
   {
     AF_AxisHints  axis          = &hints->axis[dim];
     AF_Segment    segments      = axis->segments;
   {
     AF_AxisHints  axis          = &hints->axis[dim];
     AF_Segment    segments      = axis->segments;
 
   FT_LOCAL_DEF( FT_Error )
   af_latin2_hints_compute_edges( AF_GlyphHints  hints,
 
   FT_LOCAL_DEF( FT_Error )
   af_latin2_hints_compute_edges( AF_GlyphHints  hints,
-                                AF_Dimension   dim )
+                                 AF_Dimension   dim )
   {
     AF_AxisHints  axis   = &hints->axis[dim];
   {
     AF_AxisHints  axis   = &hints->axis[dim];
-    FT_Error      error  = AF_Err_Ok;
+    FT_Error      error  = FT_Err_Ok;
     FT_Memory     memory = hints->memory;
     AF_LatinAxis  laxis  = &((AF_LatinMetrics)hints->metrics)->axis[dim];
 
     FT_Memory     memory = hints->memory;
     AF_LatinAxis  laxis  = &((AF_LatinMetrics)hints->metrics)->axis[dim];
 
     if ( dim == AF_DIMENSION_HORZ )
     {
       if ( laxis->width_count > 0 )
     if ( dim == AF_DIMENSION_HORZ )
     {
       if ( laxis->width_count > 0 )
-        segment_length_threshold = (laxis->standard_width * 10 ) >> 4;
+        segment_length_threshold = ( laxis->standard_width * 10 ) >> 4;
       else
         segment_length_threshold = FT_DivFix( 64, hints->y_scale );
     }
       else
         segment_length_threshold = FT_DivFix( 64, hints->y_scale );
     }
       {
         FT_Pos  dist = seg->serif->pos - seg->pos;
 
       {
         FT_Pos  dist = seg->serif->pos - seg->pos;
 
-        if (dist < 0)
+
+        if ( dist < 0 )
           dist = -dist;
 
           dist = -dist;
 
-        if (dist >= laxis->standard_width >> 1)
+        if ( dist >= laxis->standard_width >> 1 )
         {
           /* unlink this serif, it is too distant from its reference stem */
           seg->serif = NULL;
         {
           /* unlink this serif, it is too distant from its reference stem */
           seg->serif = NULL;
 
         /* insert a new edge in the list and */
         /* sort according to the position    */
 
         /* insert a new edge in the list and */
         /* sort according to the position    */
-        error = af_axis_hints_new_edge( axis, seg->pos, seg->dir, memory, &edge );
+        error = af_axis_hints_new_edge( axis, seg->pos, seg->dir,
+                                        memory, &edge );
         if ( error )
           goto Exit;
 
         if ( error )
           goto Exit;
 
       {
         FT_Int  is_round    = 0;  /* does it contain round segments?    */
         FT_Int  is_straight = 0;  /* does it contain straight segments? */
       {
         FT_Int  is_round    = 0;  /* does it contain round segments?    */
         FT_Int  is_straight = 0;  /* does it contain straight segments? */
+#if 0
         FT_Pos  ups         = 0;  /* number of upwards segments         */
         FT_Pos  downs       = 0;  /* number of downwards segments       */
         FT_Pos  ups         = 0;  /* number of upwards segments         */
         FT_Pos  downs       = 0;  /* number of downwards segments       */
+#endif
 
 
         seg = edge->first;
 
 
         seg = edge->first;
           else
             is_straight++;
 
           else
             is_straight++;
 
+#if 0
           /* check for segment direction */
           if ( seg->dir == up_dir )
             ups   += seg->max_coord-seg->min_coord;
           else
             downs += seg->max_coord-seg->min_coord;
           /* check for segment direction */
           if ( seg->dir == up_dir )
             ups   += seg->max_coord-seg->min_coord;
           else
             downs += seg->max_coord-seg->min_coord;
+#endif
 
           /* check for links -- if seg->serif is set, then seg->link must */
           /* be ignored                                                   */
 
           /* check for links -- if seg->serif is set, then seg->link must */
           /* be ignored                                                   */
 
   FT_LOCAL_DEF( FT_Error )
   af_latin2_hints_detect_features( AF_GlyphHints  hints,
 
   FT_LOCAL_DEF( FT_Error )
   af_latin2_hints_detect_features( AF_GlyphHints  hints,
-                                  AF_Dimension   dim )
+                                   AF_Dimension   dim )
   {
     FT_Error  error;
 
   {
     FT_Error  error;
 
 
   FT_LOCAL_DEF( void )
   af_latin2_hints_compute_blue_edges( AF_GlyphHints    hints,
 
   FT_LOCAL_DEF( void )
   af_latin2_hints_compute_blue_edges( AF_GlyphHints    hints,
-                                     AF_LatinMetrics  metrics )
+                                      AF_LatinMetrics  metrics )
   {
   {
-    AF_AxisHints  axis       = &hints->axis[ AF_DIMENSION_VERT ];
+    AF_AxisHints  axis       = &hints->axis[AF_DIMENSION_VERT];
     AF_Edge       edge       = axis->edges;
     AF_Edge       edge_limit = edge + axis->num_edges;
     AF_Edge       edge       = axis->edges;
     AF_Edge       edge_limit = edge + axis->num_edges;
-    AF_LatinAxis  latin      = &metrics->axis[ AF_DIMENSION_VERT ];
+    AF_LatinAxis  latin      = &metrics->axis[AF_DIMENSION_VERT];
     FT_Fixed      scale      = latin->scale;
     FT_Pos        best_dist0;  /* initial threshold */
 
     FT_Fixed      scale      = latin->scale;
     FT_Pos        best_dist0;  /* initial threshold */
 
             compare = &blue->ref;
 
           dist = edge->fpos - compare->org;
             compare = &blue->ref;
 
           dist = edge->fpos - compare->org;
-          if (dist < 0)
+          if ( dist < 0 )
             dist = -dist;
 
           dist = FT_MulFix( dist, scale );
             dist = -dist;
 
           dist = FT_MulFix( dist, scale );
 
   static FT_Error
   af_latin2_hints_init( AF_GlyphHints    hints,
 
   static FT_Error
   af_latin2_hints_init( AF_GlyphHints    hints,
-                       AF_LatinMetrics  metrics )
+                        AF_LatinMetrics  metrics )
   {
     FT_Render_Mode  mode;
     FT_UInt32       scaler_flags, other_flags;
   {
     FT_Render_Mode  mode;
     FT_UInt32       scaler_flags, other_flags;
     /* compute flags depending on render mode, etc. */
     mode = metrics->root.scaler.render_mode;
 
     /* compute flags depending on render mode, etc. */
     mode = metrics->root.scaler.render_mode;
 
-#if 0 /* #ifdef AF_USE_WARPER */
+#if 0 /* #ifdef AF_CONFIG_OPTION_USE_WARPER */
     if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )
     {
       metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;
     if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )
     {
       metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;
      *  In `light' hinting mode we disable horizontal hinting completely.
      *  We also do it if the face is italic.
      */
      *  In `light' hinting mode we disable horizontal hinting completely.
      *  We also do it if the face is italic.
      */
-    if ( mode == FT_RENDER_MODE_LIGHT                    ||
-         (face->style_flags & FT_STYLE_FLAG_ITALIC) != 0 )
+    if ( mode == FT_RENDER_MODE_LIGHT                      ||
+         ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
       scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
 
     hints->scaler_flags = scaler_flags;
       scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
 
     hints->scaler_flags = scaler_flags;
 
   static FT_Pos
   af_latin2_snap_width( AF_Width  widths,
 
   static FT_Pos
   af_latin2_snap_width( AF_Width  widths,
-                       FT_Int    count,
-                       FT_Pos    width )
+                        FT_Int    count,
+                        FT_Pos    width )
   {
     int     n;
     FT_Pos  best      = 64 + 32 + 2;
   {
     int     n;
     FT_Pos  best      = 64 + 32 + 2;
 
   static FT_Pos
   af_latin2_compute_stem_width( AF_GlyphHints  hints,
 
   static FT_Pos
   af_latin2_compute_stem_width( AF_GlyphHints  hints,
-                               AF_Dimension   dim,
-                               FT_Pos         width,
-                               AF_Edge_Flags  base_flags,
-                               AF_Edge_Flags  stem_flags )
+                                AF_Dimension   dim,
+                                FT_Pos         width,
+                                AF_Edge_Flags  base_flags,
+                                AF_Edge_Flags  stem_flags )
   {
     AF_LatinMetrics  metrics  = (AF_LatinMetrics) hints->metrics;
     AF_LatinAxis     axis     = & metrics->axis[dim];
   {
     AF_LatinMetrics  metrics  = (AF_LatinMetrics) hints->metrics;
     AF_LatinAxis     axis     = & metrics->axis[dim];
     FT_Int           sign     = 0;
     FT_Int           vertical = ( dim == AF_DIMENSION_VERT );
 
     FT_Int           sign     = 0;
     FT_Int           vertical = ( dim == AF_DIMENSION_VERT );
 
+    FT_UNUSED( base_flags );
 
 
-    FT_UNUSED(base_flags);
 
     if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||
           axis->extra_light                      )
 
     if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||
           axis->extra_light                      )
             if ( delta < 0 )
               delta = -delta;
 
             if ( delta < 0 )
               delta = -delta;
 
-            if (delta >= 16)
+            if ( delta >= 16 )
             {
               dist = org_dist;
               if ( dist < 48 )
             {
               dist = org_dist;
               if ( dist < 48 )
 
   static void
   af_latin2_align_linked_edge( AF_GlyphHints  hints,
 
   static void
   af_latin2_align_linked_edge( AF_GlyphHints  hints,
-                              AF_Dimension   dim,
-                              AF_Edge        base_edge,
-                              AF_Edge        stem_edge )
+                               AF_Dimension   dim,
+                               AF_Edge        base_edge,
+                               AF_Edge        stem_edge )
   {
     FT_Pos  dist = stem_edge->opos - base_edge->opos;
 
   {
     FT_Pos  dist = stem_edge->opos - base_edge->opos;
 
 
     stem_edge->pos = base_edge->pos + fitted_width;
 
 
     stem_edge->pos = base_edge->pos + fitted_width;
 
-    AF_LOG(( "LINK: edge %d (opos=%.2f) linked to (%.2f), "
-             "dist was %.2f, now %.2f\n",
-             stem_edge-hints->axis[dim].edges, stem_edge->opos / 64.0,
-             stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
+    FT_TRACE5(( "LINK: edge %d (opos=%.2f) linked to (%.2f), "
+                "dist was %.2f, now %.2f\n",
+                stem_edge-hints->axis[dim].edges, stem_edge->opos / 64.0,
+                stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
   }
 
 
   static void
   af_latin2_align_serif_edge( AF_GlyphHints  hints,
   }
 
 
   static void
   af_latin2_align_serif_edge( AF_GlyphHints  hints,
-                             AF_Edge        base,
-                             AF_Edge        serif )
+                              AF_Edge        base,
+                              AF_Edge        serif )
   {
     FT_UNUSED( hints );
 
   {
     FT_UNUSED( hints );
 
-    serif->pos = base->pos + (serif->opos - base->opos);
+    serif->pos = base->pos + ( serif->opos - base->opos );
   }
 
 
   }
 
 
 
   FT_LOCAL_DEF( void )
   af_latin2_hint_edges( AF_GlyphHints  hints,
 
   FT_LOCAL_DEF( void )
   af_latin2_hint_edges( AF_GlyphHints  hints,
-                       AF_Dimension   dim )
+                        AF_Dimension   dim )
   {
     AF_AxisHints  axis       = &hints->axis[dim];
     AF_Edge       edges      = axis->edges;
   {
     AF_AxisHints  axis       = &hints->axis[dim];
     AF_Edge       edges      = axis->edges;
 
 
 
 
 
 
-    AF_LOG(( "==== hinting %s edges =====\n", dim == AF_DIMENSION_HORZ ? "vertical" : "horizontal" ));
+    FT_TRACE5(( "==== hinting %s edges =====\n",
+                dim == AF_DIMENSION_HORZ ? "vertical" : "horizontal" ));
 
     /* we begin by aligning all stems relative to the blue zone */
     /* if needed -- that's only for horizontal edges            */
 
     /* we begin by aligning all stems relative to the blue zone */
     /* if needed -- that's only for horizontal edges            */
         if ( !edge1 )
           continue;
 
         if ( !edge1 )
           continue;
 
-        AF_LOG(( "BLUE: edge %d (opos=%.2f) snapped to (%.2f), "
-                 "was (%.2f)\n",
-                 edge1-edges, edge1->opos / 64.0, blue->fit / 64.0,
-                 edge1->pos / 64.0 ));
+        FT_TRACE5(( "BLUE: edge %d (opos=%.2f) snapped to (%.2f), "
+                    "was (%.2f)\n",
+                    edge1-edges, edge1->opos / 64.0, blue->fit / 64.0,
+                    edge1->pos / 64.0 ));
 
         edge1->pos    = blue->fit;
         edge1->flags |= AF_EDGE_DONE;
 
         edge1->pos    = blue->fit;
         edge1->flags |= AF_EDGE_DONE;
         {
           anchor = edge;
 
         {
           anchor = edge;
 
-          anchor_drift = (anchor->pos - anchor->opos);
-          if (edge2)
-            anchor_drift = (anchor_drift + (edge2->pos - edge2->opos)) >> 1;
+          anchor_drift = ( anchor->pos - anchor->opos );
+          if ( edge2 )
+            anchor_drift = ( anchor_drift +
+                             ( edge2->pos - edge2->opos ) ) >> 1;
         }
       }
     }
         }
       }
     }
       /* this should not happen, but it's better to be safe */
       if ( edge2->blue_edge )
       {
       /* this should not happen, but it's better to be safe */
       if ( edge2->blue_edge )
       {
-        AF_LOG(( "ASSERTION FAILED for edge %d\n", edge2-edges ));
+        FT_TRACE5(( "ASSERTION FAILED for edge %d\n", edge2-edges ));
 
         af_latin2_align_linked_edge( hints, dim, edge2, edge );
         edge->flags |= AF_EDGE_DONE;
 
         af_latin2_align_linked_edge( hints, dim, edge2, edge );
         edge->flags |= AF_EDGE_DONE;
         else
           edge->pos = FT_PIX_ROUND( edge->opos );
 
         else
           edge->pos = FT_PIX_ROUND( edge->opos );
 
-        AF_LOG(( "ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f) "
-                 "snapped to (%.2f) (%.2f)\n",
-                 edge-edges, edge->opos / 64.0,
-                 edge2-edges, edge2->opos / 64.0,
-                 edge->pos / 64.0, edge2->pos / 64.0 ));
+        FT_TRACE5(( "ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f)"
+                    " snapped to (%.2f) (%.2f)\n",
+                    edge-edges, edge->opos / 64.0,
+                    edge2-edges, edge2->opos / 64.0,
+                    edge->pos / 64.0, edge2->pos / 64.0 ));
         anchor = edge;
 
         edge->flags |= AF_EDGE_DONE;
         anchor = edge;
 
         edge->flags |= AF_EDGE_DONE;
 
         edge2->flags |= AF_EDGE_DONE;
 
 
         edge2->flags |= AF_EDGE_DONE;
 
-        anchor_drift = ( (anchor->pos - anchor->opos) +
-                         (edge2->pos - edge2->opos)) >> 1;
+        anchor_drift = ( ( anchor->pos - anchor->opos ) +
+                         ( edge2->pos - edge2->opos ) ) >> 1;
 
 
-        AF_LOG(( "DRIFT: %.2f\n", anchor_drift/64.0 ));
+        FT_TRACE5(( "DRIFT: %.2f\n", anchor_drift/64.0 ));
       }
       else
       {
       }
       else
       {
                    (AF_Edge_Flags)edge->flags,
                    (AF_Edge_Flags)edge2->flags );
 
                    (AF_Edge_Flags)edge->flags,
                    (AF_Edge_Flags)edge2->flags );
 
-        org_left  = org_pos + ((org_len - cur_len) >> 1);
-        org_right = org_pos + ((org_len + cur_len) >> 1);
+        org_left  = org_pos + ( ( org_len - cur_len ) >> 1 );
+        org_right = org_pos + ( ( org_len + cur_len ) >> 1 );
 
 
-        AF_LOG(( "ALIGN: left=%.2f right=%.2f ", org_left/64.0, org_right/64.0 ));
+        FT_TRACE5(( "ALIGN: left=%.2f right=%.2f ",
+                    org_left / 64.0, org_right / 64.0 ));
         cur_center = org_center;
 
         if ( edge2->flags & AF_EDGE_DONE )
         {
         cur_center = org_center;
 
         if ( edge2->flags & AF_EDGE_DONE )
         {
-          AF_LOG(( "\n" ));
+          FT_TRACE5(( "\n" ));
           edge->pos = edge2->pos - cur_len;
         }
         else
           edge->pos = edge2->pos - cur_len;
         }
         else
           /* note: don't even try to fit tiny stems */
           if ( cur_len < 32 )
           {
           /* note: don't even try to fit tiny stems */
           if ( cur_len < 32 )
           {
-            AF_LOG(( "tiny stem\n" ));
+            FT_TRACE5(( "tiny stem\n" ));
             goto AlignStem;
           }
 
           /* if the span is within a single pixel, don't touch it */
             goto AlignStem;
           }
 
           /* if the span is within a single pixel, don't touch it */
-          if ( FT_PIX_FLOOR(org_left) == FT_PIX_CEIL(org_right) )
+          if ( FT_PIX_FLOOR( org_left ) == FT_PIX_CEIL( org_right ) )
           {
           {
-            AF_LOG(( "single pixel stem\n" ));
+            FT_TRACE5(( "single pixel stem\n" ));
             goto AlignStem;
           }
 
             goto AlignStem;
           }
 
-          if (cur_len <= 96)
+          if ( cur_len <= 96 )
           {
            /* we want to avoid the absolute worst case which is
             * when the left and right edges of the span each represent
           {
            /* we want to avoid the absolute worst case which is
             * when the left and right edges of the span each represent
             * to 25/75%, since this is much more pleasant to the eye with
             * very acceptable distortion
             */
             * to 25/75%, since this is much more pleasant to the eye with
             * very acceptable distortion
             */
-            FT_Pos  frac_left  = (org_left) & 63;
-            FT_Pos  frac_right = (org_right) & 63;
+            FT_Pos  frac_left  = org_left  & 63;
+            FT_Pos  frac_right = org_right & 63;
 
             if ( frac_left  >= 22 && frac_left  <= 42 &&
                  frac_right >= 22 && frac_right <= 42 )
             {
               org = frac_left;
 
             if ( frac_left  >= 22 && frac_left  <= 42 &&
                  frac_right >= 22 && frac_right <= 42 )
             {
               org = frac_left;
-              fit = (org <= 32) ? 16 : 48;
-              delta = FT_ABS(fit - org);
+              fit = ( org <= 32 ) ? 16 : 48;
+              delta = FT_ABS( fit - org );
               displacements[count] = fit - org;
               scores[count++]      = delta;
               displacements[count] = fit - org;
               scores[count++]      = delta;
-              AF_LOG(( "dispA=%.2f (%d) ", (fit - org)/64.0, delta ));
+              FT_TRACE5(( "dispA=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
 
               org = frac_right;
 
               org = frac_right;
-              fit = (org <= 32) ? 16 : 48;
-              delta = FT_ABS(fit - org);
+              fit = ( org <= 32 ) ? 16 : 48;
+              delta = FT_ABS( fit - org );
               displacements[count] = fit - org;
               scores[count++]     = delta;
               displacements[count] = fit - org;
               scores[count++]     = delta;
-              AF_LOG(( "dispB=%.2f (%d) ", (fit - org)/64.0, delta ));
+              FT_TRACE5(( "dispB=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
             }
           }
 
           /* snapping the left edge to the grid */
           org   = org_left;
             }
           }
 
           /* snapping the left edge to the grid */
           org   = org_left;
-          fit   = FT_PIX_ROUND(org);
-          delta = FT_ABS(fit - org);
+          fit   = FT_PIX_ROUND( org );
+          delta = FT_ABS( fit - org );
           displacements[count] = fit - org;
           scores[count++]      = delta;
           displacements[count] = fit - org;
           scores[count++]      = delta;
-          AF_LOG(( "dispC=%.2f (%d) ", (fit - org)/64.0, delta ));
+          FT_TRACE5(( "dispC=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
 
           /* snapping the right edge to the grid */
           org   = org_right;
 
           /* snapping the right edge to the grid */
           org   = org_right;
-          fit   = FT_PIX_ROUND(org);
-          delta = FT_ABS(fit - org);
+          fit   = FT_PIX_ROUND( org );
+          delta = FT_ABS( fit - org );
           displacements[count] = fit - org;
           scores[count++]      = delta;
           displacements[count] = fit - org;
           scores[count++]      = delta;
-          AF_LOG(( "dispD=%.2f (%d) ", (fit - org)/64.0, delta ));
+          FT_TRACE5(( "dispD=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
 
           /* now find the best displacement */
           {
 
           /* now find the best displacement */
           {
             FT_Pos  best_disp  = displacements[0];
             FT_UInt nn;
 
             FT_Pos  best_disp  = displacements[0];
             FT_UInt nn;
 
-            for (nn = 1; nn < count; nn++)
+            for ( nn = 1; nn < count; nn++ )
             {
             {
-              if (scores[nn] < best_score)
+              if ( scores[nn] < best_score )
               {
                 best_score = scores[nn];
                 best_disp  = displacements[nn];
               {
                 best_score = scores[nn];
                 best_disp  = displacements[nn];
 
             cur_center = org_center + best_disp;
           }
 
             cur_center = org_center + best_disp;
           }
-          AF_LOG(( "\n" ));
+          FT_TRACE5(( "\n" ));
         }
 
       AlignStem:
         }
 
       AlignStem:
-        edge->pos  = cur_center - (cur_len >> 1);
+        edge->pos  = cur_center - ( cur_len >> 1 );
         edge2->pos = edge->pos + cur_len;
 
         edge2->pos = edge->pos + cur_len;
 
-        AF_LOG(( "STEM1: %d (opos=%.2f) to %d (opos=%.2f) "
-                 "snapped to (%.2f) and (%.2f), org_len = %.2f cur_len=%.2f\n",
-                 edge-edges, edge->opos / 64.0,
-                 edge2-edges, edge2->opos / 64.0,
-                 edge->pos / 64.0, edge2->pos / 64.0,
-                 org_len / 64.0, cur_len / 64.0 ));
+        FT_TRACE5(( "STEM1: %d (opos=%.2f) to %d (opos=%.2f)"
+                    " snapped to (%.2f) and (%.2f),"
+                    " org_len=%.2f cur_len=%.2f\n",
+                    edge-edges, edge->opos / 64.0,
+                    edge2-edges, edge2->opos / 64.0,
+                    edge->pos / 64.0, edge2->pos / 64.0,
+                    org_len / 64.0, cur_len / 64.0 ));
 
         edge->flags  |= AF_EDGE_DONE;
         edge2->flags |= AF_EDGE_DONE;
 
         if ( edge > edges && edge->pos < edge[-1].pos )
         {
 
         edge->flags  |= AF_EDGE_DONE;
         edge2->flags |= AF_EDGE_DONE;
 
         if ( edge > edges && edge->pos < edge[-1].pos )
         {
-          AF_LOG(( "BOUND: %d (pos=%.2f) to (%.2f)\n",
-                   edge-edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));
+          FT_TRACE5(( "BOUND: %d (pos=%.2f) to (%.2f)\n",
+                      edge-edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));
           edge->pos = edge[-1].pos;
         }
       }
           edge->pos = edge[-1].pos;
         }
       }
         if ( delta < 64 + 16 )
         {
           af_latin2_align_serif_edge( hints, edge->serif, edge );
         if ( delta < 64 + 16 )
         {
           af_latin2_align_serif_edge( hints, edge->serif, edge );
-          AF_LOG(( "SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f) "
-                   "aligned to (%.2f)\n",
-                   edge-edges, edge->opos / 64.0,
-                   edge->serif - edges, edge->serif->opos / 64.0,
-                   edge->pos / 64.0 ));
+          FT_TRACE5(( "SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f)"
+                      " aligned to (%.2f)\n",
+                      edge-edges, edge->opos / 64.0,
+                      edge->serif - edges, edge->serif->opos / 64.0,
+                      edge->pos / 64.0 ));
         }
         else if ( !anchor )
         {
         }
         else if ( !anchor )
         {
-          AF_LOG(( "SERIF_ANCHOR: edge %d (opos=%.2f) snapped to (%.2f)\n",
-                   edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
+          FT_TRACE5(( "SERIF_ANCHOR: edge %d (opos=%.2f)"
+                      " snapped to (%.2f)\n",
+                      edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
           edge->pos = FT_PIX_ROUND( edge->opos );
           anchor    = edge;
         }
           edge->pos = FT_PIX_ROUND( edge->opos );
           anchor    = edge;
         }
                           FT_MulDiv( edge->opos - before->opos,
                                      after->pos - before->pos,
                                      after->opos - before->opos );
                           FT_MulDiv( edge->opos - before->opos,
                                      after->pos - before->pos,
                                      after->opos - before->opos );
-            AF_LOG(( "SERIF_LINK1: edge %d (opos=%.2f) snapped to (%.2f) from %d (opos=%.2f)\n",
-                     edge-edges, edge->opos / 64.0, edge->pos / 64.0, before - edges, before->opos / 64.0 ));
+            FT_TRACE5(( "SERIF_LINK1: edge %d (opos=%.2f) snapped to (%.2f)"
+                        " from %d (opos=%.2f)\n",
+                        edge-edges, edge->opos / 64.0, edge->pos / 64.0,
+                        before - edges, before->opos / 64.0 ));
           }
           else
           {
           }
           else
           {
-              edge->pos = anchor->pos + (( edge->opos - anchor->opos + 16) & ~31);
+            edge->pos = anchor->pos +
+                        ( ( edge->opos - anchor->opos + 16 ) & ~31 );
 
 
-            AF_LOG(( "SERIF_LINK2: edge %d (opos=%.2f) snapped to (%.2f)\n",
-                     edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
+            FT_TRACE5(( "SERIF_LINK2: edge %d (opos=%.2f)"
+                        " snapped to (%.2f)\n",
+                        edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
           }
         }
 
           }
         }
 
 
   static FT_Error
   af_latin2_hints_apply( AF_GlyphHints    hints,
 
   static FT_Error
   af_latin2_hints_apply( AF_GlyphHints    hints,
-                        FT_Outline*      outline,
-                        AF_LatinMetrics  metrics )
+                         FT_Outline*      outline,
+                         AF_LatinMetrics  metrics )
   {
     FT_Error  error;
     int       dim;
   {
     FT_Error  error;
     int       dim;
       goto Exit;
 
     /* analyze glyph outline */
       goto Exit;
 
     /* analyze glyph outline */
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
     if ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ||
          AF_HINTS_DO_HORIZONTAL( hints ) )
 #else
     if ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ||
          AF_HINTS_DO_HORIZONTAL( hints ) )
 #else
     /* grid-fit the outline */
     for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
     {
     /* grid-fit the outline */
     for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
     {
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
       if ( ( dim == AF_DIMENSION_HORZ &&
              metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ) )
       {
       if ( ( dim == AF_DIMENSION_HORZ &&
              metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ) )
       {
 
   static const AF_Script_UniRangeRec  af_latin2_uniranges[] =
   {
 
   static const AF_Script_UniRangeRec  af_latin2_uniranges[] =
   {
-    AF_UNIRANGE_REC( 32UL,  127UL ),    /* XXX: TODO: Add new Unicode ranges here! */
+    AF_UNIRANGE_REC( 32UL,  127UL ),    /* TODO: Add new Unicode ranges here! */
     AF_UNIRANGE_REC( 160UL, 255UL ),
     AF_UNIRANGE_REC( 0UL,   0UL )
   };
 
 
     AF_UNIRANGE_REC( 160UL, 255UL ),
     AF_UNIRANGE_REC( 0UL,   0UL )
   };
 
 
-  AF_DEFINE_SCRIPT_CLASS(af_latin2_script_class,
+  AF_DEFINE_SCRIPT_CLASS( af_latin2_script_class,
     AF_SCRIPT_LATIN2,
     af_latin2_uniranges,
     AF_SCRIPT_LATIN2,
     af_latin2_uniranges,
+    'o',
 
 
-    sizeof( AF_LatinMetricsRec ),
+    sizeof ( AF_LatinMetricsRec ),
 
     (AF_Script_InitMetricsFunc) af_latin2_metrics_init,
     (AF_Script_ScaleMetricsFunc)af_latin2_metrics_scale,
 
     (AF_Script_InitMetricsFunc) af_latin2_metrics_init,
     (AF_Script_ScaleMetricsFunc)af_latin2_metrics_scale,
index 925c621..cbfa395 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines for latin script (specification).       */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter hinting routines for latin script (specification).       */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007 by                              */
+/*  Copyright 2003-2007, 2012 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -27,7 +27,7 @@ FT_BEGIN_HEADER
 
   /* the latin-specific script class */
 
 
   /* the latin-specific script class */
 
-  AF_DECLARE_SCRIPT_CLASS(af_latin2_script_class)
+  AF_DECLARE_SCRIPT_CLASS( af_latin2_script_class )
 
 /* */
 
 
 /* */
 
index 6dd9f2a..17a6fb7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter glyph loading routines (body).                           */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter glyph loading routines (body).                           */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by                  */
+/*  Copyright 2003-2009, 2011-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
+#include "afglobal.h"
 #include "afloader.h"
 #include "afhints.h"
 #include "afloader.h"
 #include "afhints.h"
-#include "afglobal.h"
 #include "aferrors.h"
 #include "aferrors.h"
+#include "afmodule.h"
 
 
 
 
+  /* Initialize glyph loader. */
+
   FT_LOCAL_DEF( FT_Error )
   FT_LOCAL_DEF( FT_Error )
-  af_loader_init( AF_Loader  loader,
-                  FT_Memory  memory )
+  af_loader_init( AF_Module  module )
   {
   {
+    AF_Loader  loader = module->loader;
+    FT_Memory  memory = module->root.library->memory;
+
+
     FT_ZERO( loader );
 
     af_glyph_hints_init( &loader->hints, memory );
     FT_ZERO( loader );
 
     af_glyph_hints_init( &loader->hints, memory );
-#ifdef AF_DEBUG
+#ifdef FT_DEBUG_AUTOFIT
     _af_debug_hints = &loader->hints;
 #endif
     return FT_GlyphLoader_New( memory, &loader->gloader );
   }
 
 
     _af_debug_hints = &loader->hints;
 #endif
     return FT_GlyphLoader_New( memory, &loader->gloader );
   }
 
 
+  /* Reset glyph loader and compute globals if necessary. */
+
   FT_LOCAL_DEF( FT_Error )
   FT_LOCAL_DEF( FT_Error )
-  af_loader_reset( AF_Loader  loader,
+  af_loader_reset( AF_Module  module,
                    FT_Face    face )
   {
                    FT_Face    face )
   {
-    FT_Error  error = AF_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
+    AF_Loader  loader = module->loader;
 
 
     loader->face    = face;
 
 
     loader->face    = face;
@@ -50,7 +59,7 @@
 
     if ( loader->globals == NULL )
     {
 
     if ( loader->globals == NULL )
     {
-      error = af_face_globals_new( face, &loader->globals );
+      error = af_face_globals_new( face, &loader->globals, module );
       if ( !error )
       {
         face->autohint.data =
       if ( !error )
       {
         face->autohint.data =
   }
 
 
   }
 
 
+  /* Finalize glyph loader. */
+
   FT_LOCAL_DEF( void )
   FT_LOCAL_DEF( void )
-  af_loader_done( AF_Loader  loader )
+  af_loader_done( AF_Module  module )
   {
   {
+    AF_Loader  loader = module->loader;
+
+
     af_glyph_hints_done( &loader->hints );
 
     loader->face    = NULL;
     loader->globals = NULL;
 
     af_glyph_hints_done( &loader->hints );
 
     loader->face    = NULL;
     loader->globals = NULL;
 
-#ifdef AF_DEBUG
+#ifdef FT_DEBUG_AUTOFIT
     _af_debug_hints = NULL;
 #endif
     FT_GlyphLoader_Done( loader->gloader );
     _af_debug_hints = NULL;
 #endif
     FT_GlyphLoader_Done( loader->gloader );
   }
 
 
   }
 
 
+  /* Load a single glyph component.  This routine calls itself */
+  /* recursively, if necessary, and does the main work of      */
+  /* `af_loader_load_glyph.'                                   */
+
   static FT_Error
   af_loader_load_g( AF_Loader  loader,
                     AF_Scaler  scaler,
   static FT_Error
   af_loader_load_g( AF_Loader  loader,
                     AF_Scaler  scaler,
     AF_GlyphHints     hints    = &loader->hints;
     FT_GlyphSlot      slot     = face->glyph;
     FT_Slot_Internal  internal = slot->internal;
     AF_GlyphHints     hints    = &loader->hints;
     FT_GlyphSlot      slot     = face->glyph;
     FT_Slot_Internal  internal = slot->internal;
+    FT_Int32          flags;
 
 
 
 
-    error = FT_Load_Glyph( face, glyph_index, load_flags );
+    flags = load_flags | FT_LOAD_LINEAR_DESIGN;
+    error = FT_Load_Glyph( face, glyph_index, flags );
     if ( error )
       goto Exit;
 
     if ( error )
       goto Exit;
 
       FT_Vector_Transform( &loader->trans_delta, &inverse );
     }
 
       FT_Vector_Transform( &loader->trans_delta, &inverse );
     }
 
-    /* set linear metrics */
-    slot->linearHoriAdvance = slot->metrics.horiAdvance;
-    slot->linearVertAdvance = slot->metrics.vertAdvance;
-
     switch ( slot->format )
     {
     case FT_GLYPH_FORMAT_OUTLINE:
     switch ( slot->format )
     {
     case FT_GLYPH_FORMAT_OUTLINE:
                               loader->trans_delta.x,
                               loader->trans_delta.y );
 
                               loader->trans_delta.x,
                               loader->trans_delta.y );
 
-      /* copy the outline points in the loader's current               */
-      /* extra points which is used to keep original glyph coordinates */
+      /* copy the outline points in the loader's current                */
+      /* extra points which are used to keep original glyph coordinates */
       error = FT_GLYPHLOADER_CHECK_POINTS( gloader,
                                            slot->outline.n_points + 4,
                                            slot->outline.n_contours );
       error = FT_GLYPHLOADER_CHECK_POINTS( gloader,
                                            slot->outline.n_points + 4,
                                            slot->outline.n_contours );
                                             &gloader->current.outline,
                                             metrics );
 
                                             &gloader->current.outline,
                                             metrics );
 
-      /* we now need to hint the metrics according to the change in */
-      /* width/positioning that occurred during the hinting process */
+      /* we now need to adjust the metrics according to the change in */
+      /* width/positioning that occurred during the hinting process   */
       if ( scaler->render_mode != FT_RENDER_MODE_LIGHT )
       {
         FT_Pos        old_rsb, old_lsb, new_lsb;
       if ( scaler->render_mode != FT_RENDER_MODE_LIGHT )
       {
         FT_Pos        old_rsb, old_lsb, new_lsb;
         gloader->current.num_subglyphs = num_subglyphs;
         num_base_subgs                 = gloader->base.num_subglyphs;
 
         gloader->current.num_subglyphs = num_subglyphs;
         num_base_subgs                 = gloader->base.num_subglyphs;
 
-        /* now, read each subglyph independently */
+        /* now read each subglyph independently */
         for ( nn = 0; nn < num_subglyphs; nn++ )
         {
           FT_Vector  pp1, pp2;
         for ( nn = 0; nn < num_subglyphs; nn++ )
         {
           FT_Vector  pp1, pp2;
           num_points     = gloader->base.outline.n_points;
           num_new_points = num_points - num_base_points;
 
           num_points     = gloader->base.outline.n_points;
           num_new_points = num_points - num_base_points;
 
-          /* now perform the transform required for this subglyph */
+          /* now perform the transformation required for this subglyph */
 
           if ( subglyph->flags & ( FT_SUBGLYPH_FLAG_SCALE    |
                                    FT_SUBGLYPH_FLAG_XY_SCALE |
 
           if ( subglyph->flags & ( FT_SUBGLYPH_FLAG_SCALE    |
                                    FT_SUBGLYPH_FLAG_XY_SCALE |
             if ( start_point + k >= num_base_points         ||
                                l >= (FT_UInt)num_new_points )
             {
             if ( start_point + k >= num_base_points         ||
                                l >= (FT_UInt)num_new_points )
             {
-              error = AF_Err_Invalid_Composite;
+              error = FT_THROW( Invalid_Composite );
               goto Exit;
             }
 
             l += num_base_points;
 
               goto Exit;
             }
 
             l += num_base_points;
 
-            /* for now, only use the current point coordinates;    */
-            /* we may consider another approach in the near future */
+            /* for now, only use the current point coordinates; */
+            /* we eventually may consider another approach      */
             p1 = gloader->base.outline.points + start_point + k;
             p2 = gloader->base.outline.points + start_point + l;
 
             p1 = gloader->base.outline.points + start_point + k;
             p2 = gloader->base.outline.points + start_point + l;
 
 
     default:
       /* we don't support other formats (yet?) */
 
     default:
       /* we don't support other formats (yet?) */
-      error = AF_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
     }
 
   Hint_Metrics:
     }
 
   Hint_Metrics:
         slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
                                                x_scale );
 #else
         slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
                                                x_scale );
 #else
-      if ( FT_IS_FIXED_WIDTH( slot->face )                              ||
-           ( af_face_globals_is_digit( loader->globals, glyph_index ) &&
-             metrics->digits_have_same_width                          ) )
+      if ( scaler->render_mode != FT_RENDER_MODE_LIGHT                      &&
+           ( FT_IS_FIXED_WIDTH( slot->face )                              ||
+             ( af_face_globals_is_digit( loader->globals, glyph_index ) &&
+               metrics->digits_have_same_width                          ) ) )
       {
         slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
                                                metrics->scaler.x_scale );
       {
         slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
                                                metrics->scaler.x_scale );
 #endif
 
       slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance,
 #endif
 
       slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance,
-                                              metrics->scaler.y_scale );
+                                             metrics->scaler.y_scale );
 
       slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
       slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
 
       slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
       slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
       if ( error )
         goto Exit;
 
       if ( error )
         goto Exit;
 
-      slot->outline = internal->loader->base.outline;
+      /* reassign all outline fields except flags to protect them */
+      slot->outline.n_contours = internal->loader->base.outline.n_contours;
+      slot->outline.n_points   = internal->loader->base.outline.n_points;
+      slot->outline.points     = internal->loader->base.outline.points;
+      slot->outline.tags       = internal->loader->base.outline.tags;
+      slot->outline.contours   = internal->loader->base.outline.contours;
+
       slot->format  = FT_GLYPH_FORMAT_OUTLINE;
     }
 
       slot->format  = FT_GLYPH_FORMAT_OUTLINE;
     }
 
-#ifdef DEBUG_HINTER
-    af_debug_hinter = hinter;
-#endif
-
   Exit:
     return error;
   }
 
 
   Exit:
     return error;
   }
 
 
+  /* Load a glyph. */
+
   FT_LOCAL_DEF( FT_Error )
   FT_LOCAL_DEF( FT_Error )
-  af_loader_load_glyph( AF_Loader  loader,
+  af_loader_load_glyph( AF_Module  module,
                         FT_Face    face,
                         FT_UInt    gindex,
                         FT_Face    face,
                         FT_UInt    gindex,
-                        FT_UInt32  load_flags )
+                        FT_Int32   load_flags )
   {
     FT_Error      error;
   {
     FT_Error      error;
-    FT_Size       size = face->size;
+    FT_Size       size   = face->size;
+    AF_Loader     loader = module->loader;
     AF_ScalerRec  scaler;
 
 
     if ( !size )
     AF_ScalerRec  scaler;
 
 
     if ( !size )
-      return AF_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     FT_ZERO( &scaler );
 
 
     FT_ZERO( &scaler );
 
     scaler.render_mode = FT_LOAD_TARGET_MODE( load_flags );
     scaler.flags       = 0;  /* XXX: fix this */
 
     scaler.render_mode = FT_LOAD_TARGET_MODE( load_flags );
     scaler.flags       = 0;  /* XXX: fix this */
 
-    error = af_loader_reset( loader, face );
+    error = af_loader_reset( module, face );
     if ( !error )
     {
       AF_ScriptMetrics  metrics;
     if ( !error )
     {
       AF_ScriptMetrics  metrics;
index fa67c10..1f34d17 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter glyph loading routines (specification).                  */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter glyph loading routines (specification).                  */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005 by                                          */
+/*  Copyright 2003-2005, 2011-2012 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -16,8 +16,8 @@
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
-#ifndef __AF_LOADER_H__
-#define __AF_LOADER_H__
+#ifndef __AFLOADER_H__
+#define __AFLOADER_H__
 
 #include "afhints.h"
 #include "afglobal.h"
 
 #include "afhints.h"
 #include "afglobal.h"
 
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
 
-  typedef struct AF_LoaderRec_
+  typedef struct AF_ModuleRec_*  AF_Module;
+
+  /*
+   *  The autofitter module's (global) data structure to communicate with
+   *  actual fonts.  If necessary, `local' data like the current face, the
+   *  current face's auto-hint data, or the current glyph's parameters
+   *  relevant to auto-hinting are `swapped in'.  Cf. functions like
+   *  `af_loader_reset' and `af_loader_load_g'.
+   */
+
+  typedef struct  AF_LoaderRec_
   {
   {
-    FT_Face           face;           /* current face */
-    AF_FaceGlobals    globals;        /* current face globals */
-    FT_GlyphLoader    gloader;        /* glyph loader */
+    /* current face data */
+    FT_Face           face;
+    AF_FaceGlobals    globals;
+
+    /* current glyph data */
+    FT_GlyphLoader    gloader;
     AF_GlyphHintsRec  hints;
     AF_ScriptMetrics  metrics;
     FT_Bool           transformed;
     AF_GlyphHintsRec  hints;
     AF_ScriptMetrics  metrics;
     FT_Bool           transformed;
@@ -43,31 +56,30 @@ FT_BEGIN_HEADER
 
 
   FT_LOCAL( FT_Error )
 
 
   FT_LOCAL( FT_Error )
-  af_loader_init( AF_Loader  loader,
-                  FT_Memory  memory );
+  af_loader_init( AF_Module  module );
 
 
   FT_LOCAL( FT_Error )
 
 
   FT_LOCAL( FT_Error )
-  af_loader_reset( AF_Loader  loader,
+  af_loader_reset( AF_Module  module,
                    FT_Face    face );
 
 
   FT_LOCAL( void )
                    FT_Face    face );
 
 
   FT_LOCAL( void )
-  af_loader_done( AF_Loader  loader );
+  af_loader_done( AF_Module  module );
 
 
   FT_LOCAL( FT_Error )
 
 
   FT_LOCAL( FT_Error )
-  af_loader_load_glyph( AF_Loader  loader,
+  af_loader_load_glyph( AF_Module  module,
                         FT_Face    face,
                         FT_UInt    gindex,
                         FT_Face    face,
                         FT_UInt    gindex,
-                        FT_UInt32  load_flags );
+                        FT_Int32   load_flags );
 
 /* */
 
 
 FT_END_HEADER
 
 
 /* */
 
 
 FT_END_HEADER
 
-#endif /* __AF_LOADER_H__ */
+#endif /* __AFLOADER_H__ */
 
 
 /* END */
 
 
 /* END */
index ec2d707..b1bb5ee 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter module implementation (body).                            */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter module implementation (body).                            */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006 by                                    */
+/*  Copyright 2003-2006, 2009, 2011-2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
+#include "afglobal.h"
 #include "afmodule.h"
 #include "afloader.h"
 #include "afmodule.h"
 #include "afloader.h"
+#include "aferrors.h"
 #include "afpic.h"
 
 #include "afpic.h"
 
-#ifdef AF_DEBUG
-  int    _af_debug;
+#ifdef FT_DEBUG_AUTOFIT
   int    _af_debug_disable_horz_hints;
   int    _af_debug_disable_vert_hints;
   int    _af_debug_disable_blue_hints;
   int    _af_debug_disable_horz_hints;
   int    _af_debug_disable_vert_hints;
   int    _af_debug_disable_blue_hints;
 #endif
 
 #include FT_INTERNAL_OBJECTS_H
 #endif
 
 #include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_AUTOHINTER_H
+#include FT_SERVICE_PROPERTIES_H
 
 
 
 
-  typedef struct  FT_AutofitterRec_
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_afmodule
+
+
+  FT_Error
+  af_property_get_face_globals( FT_Face          face,
+                                AF_FaceGlobals*  aglobals,
+                                AF_Module        module )
+  {
+    FT_Error        error = FT_Err_Ok;
+    AF_FaceGlobals  globals;
+
+
+    if ( !face )
+      return FT_THROW( Invalid_Argument );
+
+    globals = (AF_FaceGlobals)face->autohint.data;
+    if ( !globals )
+    {
+      /* trigger computation of the global script data */
+      /* in case it hasn't been done yet               */
+      error = af_face_globals_new( face, &globals, module );
+      if ( !error )
+      {
+        face->autohint.data =
+          (FT_Pointer)globals;
+        face->autohint.finalizer =
+          (FT_Generic_Finalizer)af_face_globals_free;
+      }
+    }
+
+    if ( !error )
+      *aglobals = globals;
+
+    return error;
+  }
+
+
+  FT_Error
+  af_property_set( FT_Module    ft_module,
+                   const char*  property_name,
+                   const void*  value )
+  {
+    FT_Error   error  = FT_Err_Ok;
+    AF_Module  module = (AF_Module)ft_module;
+
+
+    if ( !ft_strcmp( property_name, "fallback-script" ) )
+    {
+      FT_UInt*  fallback_script = (FT_UInt*)value;
+
+
+      module->fallback_script = *fallback_script;
+
+      return error;
+    }
+    else if ( !ft_strcmp( property_name, "increase-x-height" ) )
+    {
+      FT_Prop_IncreaseXHeight*  prop = (FT_Prop_IncreaseXHeight*)value;
+      AF_FaceGlobals            globals;
+
+
+      error = af_property_get_face_globals( prop->face, &globals, module );
+      if ( !error )
+        globals->increase_x_height = prop->limit;
+
+      return error;
+    }
+
+    FT_TRACE0(( "af_property_set: missing property `%s'\n",
+                property_name ));
+    return FT_THROW( Missing_Property );
+  }
+
+
+  FT_Error
+  af_property_get( FT_Module    ft_module,
+                   const char*  property_name,
+                   void*        value )
   {
   {
-    FT_ModuleRec  root;
-    AF_LoaderRec  loader[1];
+    FT_Error   error           = FT_Err_Ok;
+    AF_Module  module          = (AF_Module)ft_module;
+    FT_UInt    fallback_script = module->fallback_script;
+
+
+    if ( !ft_strcmp( property_name, "glyph-to-script-map" ) )
+    {
+      FT_Prop_GlyphToScriptMap*  prop = (FT_Prop_GlyphToScriptMap*)value;
+      AF_FaceGlobals             globals;
+
+
+      error = af_property_get_face_globals( prop->face, &globals, module );
+      if ( !error )
+        prop->map = globals->glyph_scripts;
 
 
-  } FT_AutofitterRec, *FT_Autofitter;
+      return error;
+    }
+    else if ( !ft_strcmp( property_name, "fallback-script" ) )
+    {
+      FT_UInt*  val = (FT_UInt*)value;
+
+
+      *val = fallback_script;
+
+      return error;
+    }
+    else if ( !ft_strcmp( property_name, "increase-x-height" ) )
+    {
+      FT_Prop_IncreaseXHeight*  prop = (FT_Prop_IncreaseXHeight*)value;
+      AF_FaceGlobals            globals;
+
+
+      error = af_property_get_face_globals( prop->face, &globals, module );
+      if ( !error )
+        prop->limit = globals->increase_x_height;
+
+      return error;
+    }
+
+
+    FT_TRACE0(( "af_property_get: missing property `%s'\n",
+                property_name ));
+    return FT_THROW( Missing_Property );
+  }
+
+
+  FT_DEFINE_SERVICE_PROPERTIESREC(
+    af_service_properties,
+    (FT_Properties_SetFunc)af_property_set,
+    (FT_Properties_GetFunc)af_property_get )
+
+
+  FT_DEFINE_SERVICEDESCREC1(
+    af_services,
+    FT_SERVICE_ID_PROPERTIES, &AF_SERVICE_PROPERTIES_GET )
+
+
+  FT_CALLBACK_DEF( FT_Module_Interface )
+  af_get_interface( FT_Module    module,
+                    const char*  module_interface )
+  {
+    /* AF_SERVICES_GET derefers `library' in PIC mode */
+#ifdef FT_CONFIG_OPTION_PIC
+    FT_Library  library;
+
+
+    if ( !module )
+      return NULL;
+    library = module->library;
+    if ( !library )
+      return NULL;
+#else
+    FT_UNUSED( module );
+#endif
+
+    return ft_service_list_lookup( AF_SERVICES_GET, module_interface );
+  }
 
 
   FT_CALLBACK_DEF( FT_Error )
 
 
   FT_CALLBACK_DEF( FT_Error )
-  af_autofitter_init( FT_Autofitter  module )
+  af_autofitter_init( FT_Module  ft_module )      /* AF_Module */
   {
   {
-    return af_loader_init( module->loader, module->root.library->memory );
+    AF_Module  module = (AF_Module)ft_module;
+
+
+    module->fallback_script = AF_SCRIPT_FALLBACK;
+
+    return af_loader_init( module );
   }
 
 
   FT_CALLBACK_DEF( void )
   }
 
 
   FT_CALLBACK_DEF( void )
-  af_autofitter_done( FT_Autofitter  module )
+  af_autofitter_done( FT_Module  ft_module )      /* AF_Module */
   {
   {
-    af_loader_done( module->loader );
+    AF_Module  module = (AF_Module)ft_module;
+
+
+    af_loader_done( module );
   }
 
 
   FT_CALLBACK_DEF( FT_Error )
   }
 
 
   FT_CALLBACK_DEF( FT_Error )
-  af_autofitter_load_glyph( FT_Autofitter  module,
-                            FT_GlyphSlot   slot,
-                            FT_Size        size,
-                            FT_UInt        glyph_index,
-                            FT_Int32       load_flags )
+  af_autofitter_load_glyph( AF_Module     module,
+                            FT_GlyphSlot  slot,
+                            FT_Size       size,
+                            FT_UInt       glyph_index,
+                            FT_Int32      load_flags )
   {
     FT_UNUSED( size );
 
   {
     FT_UNUSED( size );
 
-    return af_loader_load_glyph( module->loader, slot->face,
+    return af_loader_load_glyph( module, slot->face,
                                  glyph_index, load_flags );
   }
 
 
                                  glyph_index, load_flags );
   }
 
 
-  FT_DEFINE_AUTOHINTER_SERVICE(af_autofitter_service,
-    NULL,
-    NULL,
-    NULL,
-    (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph
-  )
+  FT_DEFINE_AUTOHINTER_INTERFACE(
+    af_autofitter_interface,
+    NULL,                                                    /* reset_face */
+    NULL,                                              /* get_global_hints */
+    NULL,                                             /* done_global_hints */
+    (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph )  /* load_glyph */
+
 
 
-  FT_DEFINE_MODULE(autofit_module_class,
+  FT_DEFINE_MODULE(
+    autofit_module_class,
 
     FT_MODULE_HINTER,
 
     FT_MODULE_HINTER,
-    sizeof ( FT_AutofitterRec ),
+    sizeof ( AF_ModuleRec ),
 
     "autofitter",
     0x10000L,   /* version 1.0 of the autofitter  */
     0x20000L,   /* requires FreeType 2.0 or above */
 
 
     "autofitter",
     0x10000L,   /* version 1.0 of the autofitter  */
     0x20000L,   /* requires FreeType 2.0 or above */
 
-    (const void*)&AF_AF_AUTOFITTER_SERVICE_GET,
+    (const void*)&AF_INTERFACE_GET,
 
     (FT_Module_Constructor)af_autofitter_init,
     (FT_Module_Destructor) af_autofitter_done,
 
     (FT_Module_Constructor)af_autofitter_init,
     (FT_Module_Destructor) af_autofitter_done,
-    (FT_Module_Requester)  NULL
-  )
+    (FT_Module_Requester)  af_get_interface )
 
 
 /* END */
 
 
 /* END */
index d979239..c4e8f8f 100644 (file)
 #include FT_INTERNAL_OBJECTS_H
 #include FT_MODULE_H
 
 #include FT_INTERNAL_OBJECTS_H
 #include FT_MODULE_H
 
+#include "afloader.h"
+
 
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
 
+
+  /*
+   *  This is the `extended' FT_Module structure which holds the
+   *  autofitter's global data.  Right before hinting a glyph, the data
+   *  specific to the glyph's face (blue zones, stem widths, etc.) are
+   *  loaded into `loader' (see function `af_loader_reset').
+   */
+
+  typedef struct  AF_ModuleRec_
+  {
+    FT_ModuleRec  root;
+
+    FT_UInt       fallback_script;
+
+    AF_LoaderRec  loader[1];
+
+  } AF_ModuleRec;
+
+
 FT_DECLARE_MODULE(autofit_module_class)
 
 
 FT_DECLARE_MODULE(autofit_module_class)
 
 
index 5b9aba6..45e1448 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for autofit module.  */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for autofit module.  */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009-2013 by                                                 */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "afpic.h"
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "afpic.h"
+#include "aferrors.h"
+
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from afmodule.c */
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from afmodule.c */
-  void FT_Init_Class_af_autofitter_service( FT_Library, FT_AutoHinter_ServiceRec*);
+  FT_Error
+  FT_Create_Class_af_services( FT_Library           library,
+                               FT_ServiceDescRec**  output_class );
+
+  void
+  FT_Destroy_Class_af_services( FT_Library          library,
+                                FT_ServiceDescRec*  clazz );
+
+  void
+  FT_Init_Class_af_service_properties( FT_Service_PropertiesRec*  clazz );
+
+  void FT_Init_Class_af_autofitter_interface(
+    FT_Library                   library,
+    FT_AutoHinter_InterfaceRec*  clazz );
+
 
   /* forward declaration of PIC init functions from script classes */
 #include "aflatin.h"
 
   /* forward declaration of PIC init functions from script classes */
 #include "aflatin.h"
+#ifdef FT_OPTION_AUTOFIT2
 #include "aflatin2.h"
 #include "aflatin2.h"
+#endif
 #include "afcjk.h"
 #include "afdummy.h"
 #include "afindic.h"
 
 #include "afcjk.h"
 #include "afdummy.h"
 #include "afindic.h"
 
+
   void
   void
-  autofit_module_class_pic_free( FT_Library library )
+  autofit_module_class_pic_free( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Memory memory = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Memory          memory        = library->memory;
+
+
     if ( pic_container->autofit )
     {
     if ( pic_container->autofit )
     {
-      FT_FREE( pic_container->autofit );
+      AFModulePIC*  container = (AFModulePIC*)pic_container->autofit;
+
+
+      if ( container->af_services )
+        FT_Destroy_Class_af_services( library,
+                                      container->af_services );
+      container->af_services = NULL;
+
+      FT_FREE( container );
       pic_container->autofit = NULL;
     }
   }
       pic_container->autofit = NULL;
     }
   }
@@ -51,8 +80,8 @@
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
     FT_UInt            ss;
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
     FT_UInt            ss;
-    FT_Error           error         = AF_Err_Ok;
-    AFModulePIC*       container;
+    FT_Error           error         = FT_Err_Ok;
+    AFModulePIC*       container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
     FT_Memory          memory        = library->memory;
 
 
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->autofit = container;
 
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->autofit = container;
 
-    /* initialize pointer table - this is how the module usually expects this data */
+    /* initialize pointer table -                       */
+    /* this is how the module usually expects this data */
+    error = FT_Create_Class_af_services( library,
+                                         &container->af_services );
+    if ( error )
+      goto Exit;
+
+    FT_Init_Class_af_service_properties( &container->af_service_properties );
+
     for ( ss = 0 ; ss < AF_SCRIPT_CLASSES_REC_COUNT ; ss++ )
     {
     for ( ss = 0 ; ss < AF_SCRIPT_CLASSES_REC_COUNT ; ss++ )
     {
-      container->af_script_classes[ss] = &container->af_script_classes_rec[ss];
+      container->af_script_classes[ss] =
+        &container->af_script_classes_rec[ss];
     }
     }
-    container->af_script_classes[AF_SCRIPT_CLASSES_COUNT-1] = NULL;
-    
+    container->af_script_classes[AF_SCRIPT_CLASSES_COUNT - 1] = NULL;
+
     /* add call to initialization function when you add new scripts */
     ss = 0;
     /* add call to initialization function when you add new scripts */
     ss = 0;
-    FT_Init_Class_af_dummy_script_class(&container->af_script_classes_rec[ss++]);
+    FT_Init_Class_af_dummy_script_class(
+      &container->af_script_classes_rec[ss++] );
 #ifdef FT_OPTION_AUTOFIT2
 #ifdef FT_OPTION_AUTOFIT2
-    FT_Init_Class_af_latin2_script_class(&container->af_script_classes_rec[ss++]);
+    FT_Init_Class_af_latin2_script_class(
+      &container->af_script_classes_rec[ss++] );
 #endif
 #endif
-    FT_Init_Class_af_latin_script_class(&container->af_script_classes_rec[ss++]);
-    FT_Init_Class_af_cjk_script_class(&container->af_script_classes_rec[ss++]);
-    FT_Init_Class_af_indic_script_class(&container->af_script_classes_rec[ss++]);    
-
-    FT_Init_Class_af_autofitter_service(library, &container->af_autofitter_service);
-
-/*Exit:*/
-    if(error)
-      autofit_module_class_pic_free(library);
+    FT_Init_Class_af_latin_script_class(
+      &container->af_script_classes_rec[ss++] );
+    FT_Init_Class_af_cjk_script_class(
+      &container->af_script_classes_rec[ss++] );
+    FT_Init_Class_af_indic_script_class(
+      &container->af_script_classes_rec[ss++] );
+
+    FT_Init_Class_af_autofitter_interface(
+      library, &container->af_autofitter_interface );
+
+  Exit:
+    if ( error )
+      autofit_module_class_pic_free( library );
     return error;
   }
 
     return error;
   }
 
-
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
index 80e62d3..0acf803 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for autofit module.  */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for autofit module.  */
 /*                                                                         */
-/*  Copyright 2009 by                                                      */
+/*  Copyright 2009, 2011-2012 by                                           */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #ifndef __AFPIC_H__
 #define __AFPIC_H__
 
 #ifndef __AFPIC_H__
 #define __AFPIC_H__
 
-  
+
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define AF_SCRIPT_CLASSES_GET         af_script_classes
-#define AF_AF_AUTOFITTER_SERVICE_GET  af_autofitter_service
+#define AF_SERVICES_GET            af_services
+#define AF_SERVICE_PROPERTIES_GET  af_service_properties
+
+#define AF_SCRIPT_CLASSES_GET      af_script_classes
+#define AF_INTERFACE_GET           af_autofitter_interface
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 
 #else /* FT_CONFIG_OPTION_PIC */
 
+  /* some include files required for members of AFModulePIC */
+#include FT_SERVICE_PROPERTIES_H
+
 #include "aftypes.h"
 
 #include "aftypes.h"
 
-/* increase these when you add new scripts, and update autofit_module_class_pic_init */
+  /* increase these when you add new scripts, */
+  /* and update autofit_module_class_pic_init */
 #ifdef FT_OPTION_AUTOFIT2
 #ifdef FT_OPTION_AUTOFIT2
-  #define AF_SCRIPT_CLASSES_COUNT     6
+#define AF_SCRIPT_CLASSES_COUNT  6
 #else
 #else
-  #define AF_SCRIPT_CLASSES_COUNT     5  
+#define AF_SCRIPT_CLASSES_COUNT  5
 #endif
 #endif
-#define AF_SCRIPT_CLASSES_REC_COUNT  (AF_SCRIPT_CLASSES_COUNT-1)    
 
 
-  typedef struct AFModulePIC_
+#define AF_SCRIPT_CLASSES_REC_COUNT  ( AF_SCRIPT_CLASSES_COUNT - 1 )
+
+
+  typedef struct  AFModulePIC_
   {
   {
-    AF_ScriptClass    af_script_classes[AF_SCRIPT_CLASSES_COUNT];
-    AF_ScriptClassRec af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT];
-    FT_AutoHinter_ServiceRec af_autofitter_service;
+    FT_ServiceDescRec*          af_services;
+    FT_Service_PropertiesRec    af_service_properties;
+
+    AF_ScriptClass              af_script_classes[AF_SCRIPT_CLASSES_COUNT];
+    AF_ScriptClassRec           af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT];
+    FT_AutoHinter_InterfaceRec  af_autofitter_interface;
+
   } AFModulePIC;
 
   } AFModulePIC;
 
-#define GET_PIC(lib)                  ((AFModulePIC*)((lib)->pic_container.autofit))
-#define AF_SCRIPT_CLASSES_GET         (GET_PIC(FT_FACE_LIBRARY(globals->face))->af_script_classes)
-#define AF_AF_AUTOFITTER_SERVICE_GET  (GET_PIC(library)->af_autofitter_service)
+
+#define GET_PIC( lib )  \
+          ( (AFModulePIC*)((lib)->pic_container.autofit) )
+
+#define AF_SERVICES_GET  \
+          ( GET_PIC( library )->af_services )
+#define AF_SERVICE_PROPERTIES_GET  \
+          ( GET_PIC( library )->af_service_properties )
+
+#define AF_SCRIPT_CLASSES_GET  \
+          ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes )
+#define AF_INTERFACE_GET  \
+          ( GET_PIC( library )->af_autofitter_interface )
+
+
+  /* see afpic.c for the implementation */
+  void
+  autofit_module_class_pic_free( FT_Library  library );
+
+  FT_Error
+  autofit_module_class_pic_init( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
index 5574f0c..9acd7ad 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter types (specification only).                              */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter types (specification only).                              */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by                  */
+/*  Copyright 2003-2009, 2011-2012 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -53,26 +53,16 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
 
-#define xxAF_USE_WARPER  /* only define to use warp hinting */
-#define xxAF_DEBUG
-
-#ifdef AF_DEBUG
+#ifdef FT_DEBUG_AUTOFIT
 
 #include FT_CONFIG_STANDARD_LIBRARY_H
 
 
 #include FT_CONFIG_STANDARD_LIBRARY_H
 
-#define AF_LOG( x )  do { if ( _af_debug ) printf x; } while ( 0 )
-
-extern int    _af_debug;
 extern int    _af_debug_disable_horz_hints;
 extern int    _af_debug_disable_vert_hints;
 extern int    _af_debug_disable_blue_hints;
 extern void*  _af_debug_hints;
 
 extern int    _af_debug_disable_horz_hints;
 extern int    _af_debug_disable_vert_hints;
 extern int    _af_debug_disable_blue_hints;
 extern void*  _af_debug_hints;
 
-#else /* !AF_DEBUG */
-
-#define AF_LOG( x )  do { } while ( 0 )        /* nothing */
-
-#endif /* !AF_DEBUG */
+#endif /* FT_DEBUG_AUTOFIT */
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
@@ -97,8 +87,9 @@ extern void*  _af_debug_hints;
                FT_Pos*  table );
 
   FT_LOCAL( void )
                FT_Pos*  table );
 
   FT_LOCAL( void )
-  af_sort_widths( FT_UInt   count,
-                  AF_Width  widths );
+  af_sort_and_quantize_widths( FT_UInt*  count,
+                               AF_Width  widths,
+                               FT_Pos    threshold );
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
@@ -159,36 +150,11 @@ extern void*  _af_debug_hints;
   FT_END_STMNT
 
 
   FT_END_STMNT
 
 
-  /*************************************************************************/
-  /*************************************************************************/
-  /*****                                                               *****/
-  /*****                    O U T L I N E S                            *****/
-  /*****                                                               *****/
-  /*************************************************************************/
-  /*************************************************************************/
-
   /*  opaque handle to glyph-specific hints -- see `afhints.h' for more
    *  details
    */
   typedef struct AF_GlyphHintsRec_*  AF_GlyphHints;
 
   /*  opaque handle to glyph-specific hints -- see `afhints.h' for more
    *  details
    */
   typedef struct AF_GlyphHintsRec_*  AF_GlyphHints;
 
-  /*  This structure is used to model an input glyph outline to
-   *  the auto-hinter.  The latter will set the `hints' field
-   *  depending on the glyph's script.
-   */
-  typedef struct  AF_OutlineRec_
-  {
-    FT_Face        face;
-    FT_Outline     outline;
-    FT_UInt        outline_resolution;
-
-    FT_Int         advance;
-    FT_UInt        metrics_resolution;
-
-    AF_GlyphHints  hints;
-
-  } AF_OutlineRec;
-
 
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
@@ -241,7 +207,7 @@ extern void*  _af_debug_hints;
   /*************************************************************************/
 
   /*
   /*************************************************************************/
 
   /*
-   *  The list of know scripts.  Each different script corresponds to the
+   *  The list of known scripts.  Each different script corresponds to the
    *  following information:
    *
    *   - A set of Unicode ranges to test whether the face supports the
    *  following information:
    *
    *   - A set of Unicode ranges to test whether the face supports the
@@ -263,12 +229,12 @@ extern void*  _af_debug_hints;
 
   typedef enum  AF_Script_
   {
 
   typedef enum  AF_Script_
   {
-    AF_SCRIPT_NONE  = 0,
+    AF_SCRIPT_DUMMY = 0,
     AF_SCRIPT_LATIN = 1,
     AF_SCRIPT_CJK   = 2,
     AF_SCRIPT_LATIN = 1,
     AF_SCRIPT_CJK   = 2,
-    AF_SCRIPT_INDIC = 3, 
+    AF_SCRIPT_INDIC = 3,
 #ifdef FT_OPTION_AUTOFIT2
 #ifdef FT_OPTION_AUTOFIT2
-    AF_SCRIPT_LATIN2,
+    AF_SCRIPT_LATIN2 = 4,
 #endif
 
     /* add new scripts here.  Don't forget to update the list in */
 #endif
 
     /* add new scripts here.  Don't forget to update the list in */
@@ -280,6 +246,7 @@ extern void*  _af_debug_hints;
 
 
   typedef struct AF_ScriptClassRec_ const*  AF_ScriptClass;
 
 
   typedef struct AF_ScriptClassRec_ const*  AF_ScriptClass;
+  typedef struct AF_FaceGlobalsRec_*        AF_FaceGlobals;
 
   typedef struct  AF_ScriptMetricsRec_
   {
 
   typedef struct  AF_ScriptMetricsRec_
   {
@@ -287,6 +254,8 @@ extern void*  _af_debug_hints;
     AF_ScalerRec    scaler;
     FT_Bool         digits_have_same_width;
 
     AF_ScalerRec    scaler;
     FT_Bool         digits_have_same_width;
 
+    AF_FaceGlobals  globals;    /* to access properties */
+
   } AF_ScriptMetricsRec, *AF_ScriptMetrics;
 
 
   } AF_ScriptMetricsRec, *AF_ScriptMetrics;
 
 
@@ -329,8 +298,9 @@ extern void*  _af_debug_hints;
 
   typedef struct  AF_ScriptClassRec_
   {
 
   typedef struct  AF_ScriptClassRec_
   {
-    AF_Script                   script;
-    AF_Script_UniRange          script_uni_ranges; /* last must be { 0, 0 } */
+    AF_Script           script;
+    AF_Script_UniRange  script_uni_ranges; /* last must be { 0, 0 }        */
+    FT_UInt32           standard_char;     /* for default width and height */
 
     FT_Offset                   script_metrics_size;
     AF_Script_InitMetricsFunc   script_metrics_init;
 
     FT_Offset                   script_metrics_size;
     AF_Script_InitMetricsFunc   script_metrics_init;
@@ -342,55 +312,60 @@ extern void*  _af_debug_hints;
 
   } AF_ScriptClassRec;
 
 
   } AF_ScriptClassRec;
 
-/* Declare and define vtables for classes */
+
+  /* Declare and define vtables for classes */
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define AF_DECLARE_SCRIPT_CLASS(script_class)                                \
-  FT_CALLBACK_TABLE const AF_ScriptClassRec                                  \
+#define AF_DECLARE_SCRIPT_CLASS( script_class ) \
+  FT_CALLBACK_TABLE const AF_ScriptClassRec     \
   script_class;
 
   script_class;
 
-#define AF_DEFINE_SCRIPT_CLASS(script_class, script_, ranges, m_size,        \
-                               m_init, m_scale, m_done, h_init, h_apply)     \
-  FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec                              \
-  script_class =                                                             \
-  {                                                                          \
-    script_,                                                                 \
-    ranges,                                                                  \
-                                                                             \
-    m_size,                                                                  \
-                                                                             \
-    m_init,                                                                  \
-    m_scale,                                                                 \
-    m_done,                                                                  \
-                                                                             \
-    h_init,                                                                  \
-    h_apply                                                                  \
+#define AF_DEFINE_SCRIPT_CLASS( script_class, script_, ranges, def_char,   \
+                                m_size,                                    \
+                                m_init, m_scale, m_done, h_init, h_apply ) \
+  FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec  script_class =            \
+  {                                                                        \
+    script_,                                                               \
+    ranges,                                                                \
+    def_char,                                                              \
+                                                                           \
+    m_size,                                                                \
+                                                                           \
+    m_init,                                                                \
+    m_scale,                                                               \
+    m_done,                                                                \
+                                                                           \
+    h_init,                                                                \
+    h_apply                                                                \
   };
 
   };
 
-#else 
-
-#define AF_DECLARE_SCRIPT_CLASS(script_class)                                \
-  FT_LOCAL(void)                                                             \
-  FT_Init_Class_##script_class(AF_ScriptClassRec* ac);
-
-#define AF_DEFINE_SCRIPT_CLASS(script_class, script_, ranges, m_size,        \
-                               m_init, m_scale, m_done, h_init, h_apply)     \
-  FT_LOCAL_DEF(void)                                                         \
-  FT_Init_Class_##script_class(AF_ScriptClassRec* ac)                        \
-  {                                                                          \
-    ac->script                = script_;                                     \
-    ac->script_uni_ranges     = ranges;                                      \
-                                                                             \
-    ac->script_metrics_size   = m_size;                                      \
-                                                                             \
-    ac->script_metrics_init   = m_init;                                      \
-    ac->script_metrics_scale  = m_scale;                                     \
-    ac->script_metrics_done   = m_done;                                      \
-                                                                             \
-    ac->script_hints_init     = h_init;                                      \
-    ac->script_hints_apply    = h_apply;                                     \
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define AF_DECLARE_SCRIPT_CLASS( script_class )             \
+  FT_LOCAL( void )                                          \
+  FT_Init_Class_ ## script_class( AF_ScriptClassRec*  ac );
+
+#define AF_DEFINE_SCRIPT_CLASS( script_class, script_, ranges, def_char,   \
+                                m_size,                                    \
+                                m_init, m_scale, m_done, h_init, h_apply ) \
+  FT_LOCAL_DEF( void )                                                     \
+  FT_Init_Class_ ## script_class( AF_ScriptClassRec*  ac )                 \
+  {                                                                        \
+    ac->script               = script_;                                    \
+    ac->script_uni_ranges    = ranges;                                     \
+    ac->default_char         = def_char;                                   \
+                                                                           \
+    ac->script_metrics_size  = m_size;                                     \
+                                                                           \
+    ac->script_metrics_init  = m_init;                                     \
+    ac->script_metrics_scale = m_scale;                                    \
+    ac->script_metrics_done  = m_done;                                     \
+                                                                           \
+    ac->script_hints_init    = h_init;                                     \
+    ac->script_hints_apply   = h_apply;                                    \
   }
   }
-#endif
+
+#endif /* FT_CONFIG_OPTION_PIC */
 
 
 /* */
 
 
 /* */
index f5bb9b1..34a97ff 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter warping algorithm (body).                                */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter warping algorithm (body).                                */
 /*                                                                         */
-/*  Copyright 2006, 2007 by                                                */
+/*  Copyright 2006, 2007, 2011 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
+  /*
+   *  The idea of the warping code is to slightly scale and shift a glyph
+   *  within a single dimension so that as much of its segments are aligned
+   *  (more or less) on the grid.  To find out the optimal scaling and
+   *  shifting value, various parameter combinations are tried and scored.
+   */
+
 #include "afwarp.h"
 
 #include "afwarp.h"
 
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_afwarp
+
 
 
+  /* The weights cover the range 0/64 - 63/64 of a pixel.  Obviously, */
+  /* values around a half pixel (which means exactly between two grid */
+  /* lines) gets the worst weight.                                    */
 #if 1
   static const AF_WarpScore
   af_warper_weights[64] =
 #if 1
   static const AF_WarpScore
   af_warper_weights[64] =
 #endif
 
 
 #endif
 
 
+  /* Score segments for a given `scale' and `delta' in the range */
+  /* `xx1' to `xx2', and store the best result in `warper'.  If  */
+  /* the new best score is equal to the old one, prefer the      */
+  /* value with a smaller distortion (around `base_distort').    */
+
   static void
   af_warper_compute_line_best( AF_Warper     warper,
                                FT_Fixed      scale,
   static void
   af_warper_compute_line_best( AF_Warper     warper,
                                FT_Fixed      scale,
 
       if ( idx_min < 0 || idx_min > idx_max || idx_max > 64 )
       {
 
       if ( idx_min < 0 || idx_min > idx_max || idx_max > 64 )
       {
-        AF_LOG(( "invalid indices:\n"
-                 "  min=%d max=%d, xx1=%ld xx2=%ld,\n"
-                 "  x1min=%ld x1max=%ld, x2min=%ld x2max=%ld\n",
-                 idx_min, idx_max, xx1, xx2,
-                 warper->x1min, warper->x1max,
-                 warper->x2min, warper->x2max ));
+        FT_TRACE5(( "invalid indices:\n"
+                    "  min=%d max=%d, xx1=%ld xx2=%ld,\n"
+                    "  x1min=%ld x1max=%ld, x2min=%ld x2max=%ld\n",
+                    idx_min, idx_max, xx1, xx2,
+                    warper->x1min, warper->x1max,
+                    warper->x2min, warper->x2max ));
         return;
       }
     }
         return;
       }
     }
       FT_Int  idx;
 
 
       FT_Int  idx;
 
 
+      /* score the length of the segments for the given range */
       for ( idx = idx_min; idx <= idx_max; idx++, y++ )
         scores[idx] += af_warper_weights[y & 63] * len;
     }
       for ( idx = idx_min; idx <= idx_max; idx++, y++ )
         scores[idx] += af_warper_weights[y & 63] * len;
     }
         AF_WarpScore  distort = base_distort + ( idx - idx0 );
 
 
         AF_WarpScore  distort = base_distort + ( idx - idx0 );
 
 
-        if ( score > warper->best_score           ||
+        if ( score > warper->best_score         ||
              ( score == warper->best_score    &&
              ( score == warper->best_score    &&
-               distort < warper->best_distort )   )
+               distort < warper->best_distort ) )
         {
           warper->best_score   = score;
           warper->best_distort = distort;
         {
           warper->best_score   = score;
           warper->best_distort = distort;
   }
 
 
   }
 
 
+  /* Compute optimal scaling and delta values for a given glyph and */
+  /* dimension.                                                     */
+
   FT_LOCAL_DEF( void )
   af_warper_compute( AF_Warper      warper,
                      AF_GlyphHints  hints,
   FT_LOCAL_DEF( void )
   af_warper_compute( AF_Warper      warper,
                      AF_GlyphHints  hints,
     warper->t1 = AF_WARPER_FLOOR( warper->x1 );
     warper->t2 = AF_WARPER_CEIL( warper->x2 );
 
     warper->t1 = AF_WARPER_FLOOR( warper->x1 );
     warper->t2 = AF_WARPER_CEIL( warper->x2 );
 
+    /* examine a half pixel wide range around the maximum coordinates */
     warper->x1min = warper->x1 & ~31;
     warper->x1max = warper->x1min + 32;
     warper->x2min = warper->x2 & ~31;
     warper->x1min = warper->x1 & ~31;
     warper->x1max = warper->x1min + 32;
     warper->x2min = warper->x2 & ~31;
       warper->x2min = warper->x2;
     }
 
       warper->x2min = warper->x2;
     }
 
+    /* examine (at most) a pixel wide range around the natural width */
     warper->wmin = warper->x2min - warper->x1max;
     warper->wmax = warper->x2max - warper->x1min;
 
 #if 1
     warper->wmin = warper->x2min - warper->x1max;
     warper->wmax = warper->x2max - warper->x1min;
 
 #if 1
+    /* some heuristics to reduce the number of widths to be examined */
     {
       int  margin = 16;
 
     {
       int  margin = 16;
 
       FT_Pos    xx1, xx2;
 
 
       FT_Pos    xx1, xx2;
 
 
+      /* compute min and max positions for given width,       */
+      /* assuring that they stay within the coordinate ranges */
       xx1 = warper->x1;
       xx2 = warper->x2;
       if ( w >= warper->w0 )
       xx1 = warper->x1;
       xx2 = warper->x2;
       if ( w >= warper->w0 )
       else
         base_distort += xx2 - warper->x2;
 
       else
         base_distort += xx2 - warper->x2;
 
+      /* give base distortion a greater weight while scoring */
       base_distort *= 10;
 
       new_scale = org_scale + FT_DivFix( w - warper->w0, X2 - X1 );
       base_distort *= 10;
 
       new_scale = org_scale + FT_DivFix( w - warper->w0, X2 - X1 );
     {
       FT_Fixed  best_scale = warper->best_scale;
       FT_Pos    best_delta = warper->best_delta;
     {
       FT_Fixed  best_scale = warper->best_scale;
       FT_Pos    best_delta = warper->best_delta;
-     
+
 
       hints->xmin_delta = FT_MulFix( X1, best_scale - org_scale )
                           + best_delta;
 
       hints->xmin_delta = FT_MulFix( X1, best_scale - org_scale )
                           + best_delta;
     }
   }
 
     }
   }
 
-#else /* !AF_USE_WARPER */
+#else /* !AF_CONFIG_OPTION_USE_WARPER */
 
 
-char  af_warper_dummy = 0;  /* make compiler happy */
+  /* ANSI C doesn't like empty source files */
+  typedef int  _af_warp_dummy;
 
 
-#endif /* !AF_USE_WARPER */
+#endif /* !AF_CONFIG_OPTION_USE_WARPER */
 
 /* END */
 
 /* END */
index 83b613e..3883a0a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter module (body).                                           */
 /*                                                                         */
 /*                                                                         */
 /*    Auto-fitter module (body).                                           */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007 by                              */
+/*  Copyright 2003-2007, 2011 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -34,7 +34,7 @@
 #include "afloader.c"
 #include "afmodule.c"
 
 #include "afloader.c"
 #include "afmodule.c"
 
-#ifdef AF_USE_WARPER
+#ifdef AF_CONFIG_OPTION_USE_WARPER
 #include "afwarp.c"
 #endif
 
 #include "afwarp.c"
 #endif
 
index 017489d..b76bb79 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
 #
 
 
-# Copyright 2003, 2004, 2005, 2006, 2007 by
+# Copyright 2003, 2004, 2005, 2006, 2007, 2011 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -34,13 +34,14 @@ AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \
                  $(AUTOF_DIR)/aflatin.c  \
                  $(AUTOF_DIR)/afloader.c \
                  $(AUTOF_DIR)/afmodule.c \
                  $(AUTOF_DIR)/aflatin.c  \
                  $(AUTOF_DIR)/afloader.c \
                  $(AUTOF_DIR)/afmodule.c \
+                 $(AUTOF_DIR)/afpic.c    \
                  $(AUTOF_DIR)/afwarp.c
 
 # AUTOF driver headers
 #
 AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h)  \
                  $(AUTOF_DIR)/afwarp.c
 
 # AUTOF driver headers
 #
 AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h)  \
-               $(AUTOF_DIR)/aftypes.h  \
-               $(AUTOF_DIR)/aferrors.h
+               $(AUTOF_DIR)/aferrors.h \
+               $(AUTOF_DIR)/aftypes.h
 
 
 # AUTOF driver object(s)
 
 
 # AUTOF driver object(s)
diff --git a/reactos/lib/3rdparty/freetype/src/base/Jamfile b/reactos/lib/3rdparty/freetype/src/base/Jamfile
deleted file mode 100644 (file)
index 832e8b8..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-# FreeType 2 src/base Jamfile
-#
-# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) base ;
-
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = ftadvanc ftcalc   ftdbgmem ftgloadr
-               ftobjs   ftoutln  ftrfork  ftsnames
-               ftstream fttrigon ftutil
-               basepic  ftpic
-               ;
-  }
-  else
-  {
-    _sources = ftbase ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# Add the optional/replaceable files.
-#
-{
-  local  _sources = bbox   bdf    bitmap debug  gasp
-                    glyph  gxval  init   lcdfil mm
-                    otval  pfr    stroke synth  system
-                    type1  winfnt xf86   patent
-                    ;
-
-  Library  $(FT2_LIB) : ft$(_sources).c ;
-}
-
-# Add Macintosh-specific file to the library when necessary.
-#
-if $(MAC)
-{
-  Library  $(FT2_LIB) : ftmac.c ;
-}
-else if $(OS) = MACOSX
-{
-  if $(FT2_MULTI)
-  {
-    Library  $(FT2_LIB) : ftmac.c ;
-  }
-}
-
-# end of src/base Jamfile
index c0bccb6..0af770e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for base.            */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for base.            */
 /*                                                                         */
-/*  Copyright 2009 by                                                      */
+/*  Copyright 2009, 2012 by                                                */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_INTERNAL_OBJECTS_H
 #include "basepic.h"
 
 #include FT_INTERNAL_OBJECTS_H
 #include "basepic.h"
 
+
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ftglyph.c */
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ftglyph.c */
-  void FT_Init_Class_ft_outline_glyph_class(FT_Glyph_Class*);
-  void FT_Init_Class_ft_bitmap_glyph_class(FT_Glyph_Class*);
+  void
+  FT_Init_Class_ft_outline_glyph_class( FT_Glyph_Class*  clazz );
+
+  void
+  FT_Init_Class_ft_bitmap_glyph_class( FT_Glyph_Class*  clazz );
+
+#ifdef FT_CONFIG_OPTION_MAC_FONTS
+  /* forward declaration of PIC init function from ftrfork.c */
+  /* (not modularized)                                       */
+  void
+  FT_Init_Table_raccess_guess_table( ft_raccess_guess_rec*  record );
+#endif
 
   /* forward declaration of PIC init functions from ftinit.c */
 
   /* forward declaration of PIC init functions from ftinit.c */
-  FT_Error ft_create_default_module_classes(FT_Library);
-  void ft_destroy_default_module_classes(FT_Library);
+  FT_Error
+  ft_create_default_module_classes( FT_Library  library );
+
+  void
+  ft_destroy_default_module_classes( FT_Library  library );
+
 
   void
 
   void
-  ft_base_pic_free( FT_Library library )
+  ft_base_pic_free( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Memory    memory = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Memory          memory        = library->memory;
+
+
     if ( pic_container->base )
     {
     if ( pic_container->base )
     {
-      /* Destroy default module classes (in case FT_Add_Default_Modules was used) */
+      /* destroy default module classes            */
+      /* (in case FT_Add_Default_Modules was used) */
       ft_destroy_default_module_classes( library );
 
       FT_FREE( pic_container->base );
       ft_destroy_default_module_classes( library );
 
       FT_FREE( pic_container->base );
 
 
   FT_Error
 
 
   FT_Error
-  ft_base_pic_init( FT_Library library )
+  ft_base_pic_init( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Error        error = FT_Err_Ok;
-    BasePIC*     container;
-    FT_Memory    memory = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Error           error         = FT_Err_Ok;
+    BasePIC*           container     = NULL;
+    FT_Memory          memory        = library->memory;
+
 
     /* allocate pointer, clear and set global container pointer */
 
     /* allocate pointer, clear and set global container pointer */
-    if ( FT_ALLOC ( container, sizeof ( *container ) ) )
+    if ( FT_ALLOC( container, sizeof ( *container ) ) )
       return error;
       return error;
-    FT_MEM_SET( container, 0, sizeof(*container) );
+    FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->base = container;
 
     /* initialize default modules list and pointers */
     pic_container->base = container;
 
     /* initialize default modules list and pointers */
     if ( error )
       goto Exit;
 
     if ( error )
       goto Exit;
 
-    /* initialize pointer table - this is how the module usually expects this data */
-    FT_Init_Class_ft_outline_glyph_class(&container->ft_outline_glyph_class);
-    FT_Init_Class_ft_bitmap_glyph_class(&container->ft_bitmap_glyph_class);
-
-Exit:
-    if(error)
-      ft_base_pic_free(library);
+    /* initialize pointer table -                       */
+    /* this is how the module usually expects this data */
+    FT_Init_Class_ft_outline_glyph_class(
+      &container->ft_outline_glyph_class );
+    FT_Init_Class_ft_bitmap_glyph_class(
+      &container->ft_bitmap_glyph_class );
+#ifdef FT_CONFIG_OPTION_MAC_FONTS
+    FT_Init_Table_raccess_guess_table(
+      (ft_raccess_guess_rec*)&container->ft_raccess_guess_table );
+#endif
+
+  Exit:
+    if ( error )
+      ft_base_pic_free( library );
     return error;
   }
 
     return error;
   }
 
-
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
index bb17745..329d7c8 100644 (file)
 #ifndef __BASEPIC_H__
 #define __BASEPIC_H__
 
 #ifndef __BASEPIC_H__
 #define __BASEPIC_H__
 
-  
+
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 #ifndef FT_CONFIG_OPTION_PIC
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 #ifndef FT_CONFIG_OPTION_PIC
-#define FT_OUTLINE_GLYPH_CLASS_GET &ft_outline_glyph_class
-#define FT_BITMAP_GLYPH_CLASS_GET  &ft_bitmap_glyph_class
-#define FT_DEFAULT_MODULES_GET     ft_default_modules
+
+#define FT_OUTLINE_GLYPH_CLASS_GET  &ft_outline_glyph_class
+#define FT_BITMAP_GLYPH_CLASS_GET   &ft_bitmap_glyph_class
+#define FT_DEFAULT_MODULES_GET      ft_default_modules
+
+#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
+#define FT_RACCESS_GUESS_TABLE_GET  ft_raccess_guess_table
+#endif
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 #include FT_GLYPH_H
 
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 #include FT_GLYPH_H
 
-  typedef struct BasePIC_
+#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
+#include FT_INTERNAL_RFORK_H
+#endif
+
+
+  typedef struct  BasePIC_
   {
   {
-    FT_Module_Class** default_module_classes;
-    FT_Glyph_Class ft_outline_glyph_class;
-    FT_Glyph_Class ft_bitmap_glyph_class;
+    FT_Module_Class**  default_module_classes;
+    FT_Glyph_Class     ft_outline_glyph_class;
+    FT_Glyph_Class     ft_bitmap_glyph_class;
+
+#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
+    ft_raccess_guess_rec  ft_raccess_guess_table[FT_RACCESS_N_RULES];
+#endif
+
   } BasePIC;
 
   } BasePIC;
 
-#define GET_PIC(lib)                  ((BasePIC*)((lib)->pic_container.base))
-#define FT_OUTLINE_GLYPH_CLASS_GET    (&GET_PIC(library)->ft_outline_glyph_class)
-#define FT_BITMAP_GLYPH_CLASS_GET     (&GET_PIC(library)->ft_bitmap_glyph_class)
-#define FT_DEFAULT_MODULES_GET        (GET_PIC(library)->default_module_classes)
 
 
+#define GET_PIC( lib )  ( (BasePIC*)( (lib)->pic_container.base ) )
+
+#define FT_OUTLINE_GLYPH_CLASS_GET                      \
+          ( &GET_PIC( library )->ft_outline_glyph_class )
+#define FT_BITMAP_GLYPH_CLASS_GET                        \
+          ( &GET_PIC( library )->ft_bitmap_glyph_class )
+#define FT_DEFAULT_MODULES_GET                           \
+          ( GET_PIC( library )->default_module_classes )
+
+#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
+#define FT_RACCESS_GUESS_TABLE_GET                       \
+          ( GET_PIC( library )->ft_raccess_guess_table )
+#endif
+
+
+  /* see basepic.c for the implementation */
   void
   void
-  ft_base_pic_free( FT_Library library );
+  ft_base_pic_free( FT_Library  library );
 
   FT_Error
 
   FT_Error
-  ft_base_pic_init( FT_Library library );
+  ft_base_pic_init( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 #endif /* FT_CONFIG_OPTION_PIC */
- /* */
+
+  /* */
 
 FT_END_HEADER
 
 
 FT_END_HEADER
 
index 8ab7fcb..5207847 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Quick computation of advance widths (body).                          */
 /*                                                                         */
 /*                                                                         */
 /*    Quick computation of advance widths (body).                          */
 /*                                                                         */
-/*  Copyright 2008, 2009 by                                                */
+/*  Copyright 2008, 2009, 2011, 2013 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -17,6 +17,8 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_ADVANCES_H
 #include FT_INTERNAL_OBJECTS_H
 
 #include FT_ADVANCES_H
 #include FT_INTERNAL_OBJECTS_H
 
@@ -35,7 +37,7 @@
       return FT_Err_Ok;
 
     if ( face->size == NULL )
       return FT_Err_Ok;
 
     if ( face->size == NULL )
-      return FT_Err_Invalid_Size_Handle;
+      return FT_THROW( Invalid_Size_Handle );
 
     if ( flags & FT_LOAD_VERTICAL_LAYOUT )
       scale = face->size->metrics.y_scale;
 
     if ( flags & FT_LOAD_VERTICAL_LAYOUT )
       scale = face->size->metrics.y_scale;
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( gindex >= (FT_UInt)face->num_glyphs )
 
     if ( gindex >= (FT_UInt)face->num_glyphs )
-      return FT_Err_Invalid_Glyph_Index;
+      return FT_THROW( Invalid_Glyph_Index );
 
     func = face->driver->clazz->get_advances;
     if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )
 
     func = face->driver->clazz->get_advances;
     if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )
@@ -91,7 +93,7 @@
       if ( !error )
         return _ft_face_scale_advances( face, padvance, 1, flags );
 
       if ( !error )
         return _ft_face_scale_advances( face, padvance, 1, flags );
 
-      if ( error != FT_ERROR_BASE( FT_Err_Unimplemented_Feature ) )
+      if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )
         return error;
     }
 
         return error;
     }
 
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     num = (FT_UInt)face->num_glyphs;
     end = start + count;
     if ( start >= num || end < start || end > num )
 
     num = (FT_UInt)face->num_glyphs;
     end = start + count;
     if ( start >= num || end < start || end > num )
-      return FT_Err_Invalid_Glyph_Index;
+      return FT_THROW( Invalid_Glyph_Index );
 
     if ( count == 0 )
       return FT_Err_Ok;
 
     if ( count == 0 )
       return FT_Err_Ok;
     {
       error = func( face, start, count, flags, padvances );
       if ( !error )
     {
       error = func( face, start, count, flags, padvances );
       if ( !error )
-        goto Exit;
+        return _ft_face_scale_advances( face, padvances, count, flags );
 
 
-      if ( error != FT_ERROR_BASE( FT_Err_Unimplemented_Feature ) )
+      if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )
         return error;
     }
 
     error = FT_Err_Ok;
 
     if ( flags & FT_ADVANCE_FLAG_FAST_ONLY )
         return error;
     }
 
     error = FT_Err_Ok;
 
     if ( flags & FT_ADVANCE_FLAG_FAST_ONLY )
-      return FT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 
     flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;
     for ( nn = 0; nn < count; nn++ )
 
     flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;
     for ( nn = 0; nn < count; nn++ )
       if ( error )
         break;
 
       if ( error )
         break;
 
+      /* scale from 26.6 to 16.16 */
       padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
       padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
-                      ? face->glyph->advance.y
-                      : face->glyph->advance.x;
+                      ? face->glyph->advance.y << 10
+                      : face->glyph->advance.x << 10;
     }
 
     }
 
-    if ( error )
-      return error;
-
-  Exit:
-    return _ft_face_scale_advances( face, padvances, count, flags );
+    return error;
   }
 
 
   }
 
 
index 6a27ea9..5e5d70e 100644 (file)
@@ -34,7 +34,7 @@
 #include "fttrigon.c"
 #include "ftutil.c"
 
 #include "fttrigon.c"
 #include "ftutil.c"
 
-#if defined( FT_MACINTOSH ) && !defined ( DARWIN_NO_CARBON )
+#ifdef FT_MACINTOSH
 #include "ftmac.c"
 #endif
 
 #include "ftmac.c"
 #endif
 
index 6375613..51a1db1 100644 (file)
@@ -49,15 +49,16 @@ FT_BEGIN_HEADER
                          FT_Face     *aface );
 
 
                          FT_Face     *aface );
 
 
-#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
+#if  defined( FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK ) && \
+    !defined( FT_MACINTOSH )
   /* Mac OS X/Darwin kernel often changes recommended method to access */
   /* the resource fork and older methods makes the kernel issue the    */
   /* warning of deprecated method.  To calm it down, the methods based */
   /* on Darwin VFS should be grouped and skip the rest methods after   */
   /* the case the resource is opened but found to lack a font in it.   */
   FT_LOCAL( FT_Bool )
   /* Mac OS X/Darwin kernel often changes recommended method to access */
   /* the resource fork and older methods makes the kernel issue the    */
   /* warning of deprecated method.  To calm it down, the methods based */
   /* on Darwin VFS should be grouped and skip the rest methods after   */
   /* the case the resource is opened but found to lack a font in it.   */
   FT_LOCAL( FT_Bool )
-  raccess_rule_by_darwin_vfs( FT_UInt  rule_index );
-#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
+  ft_raccess_rule_by_darwin_vfs( FT_Library library, FT_UInt  rule_index );
+#endif
 
 
 FT_END_HEADER
 
 
 FT_END_HEADER
index 4b8e911..6d1c44c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType bbox computation (body).                                    */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType bbox computation (body).                                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2006, 2010 by                         */
+/*  Copyright 1996-2002, 2004, 2006, 2010, 2013 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used        */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used        */
@@ -25,6 +25,8 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_BBOX_H
 #include FT_IMAGE_H
 #include FT_OUTLINE_H
 #include FT_BBOX_H
 #include FT_IMAGE_H
 #include FT_OUTLINE_H
                     FT_Pos*  min,
                     FT_Pos*  max )
   {
                     FT_Pos*  min,
                     FT_Pos*  max )
   {
-    FT_Pos  stack[32*3 + 1], *arc;
-
+    FT_Pos  q1, q2, q3, q4;
 
 
-    arc = stack;
 
 
-    arc[0] = p1;
-    arc[1] = p2;
-    arc[2] = p3;
-    arc[3] = p4;
+    q1 = p1;
+    q2 = p2;
+    q3 = p3;
+    q4 = p4;
 
 
-    do
+    /* for a conic segment to possibly reach new maximum     */
+    /* one of its off-points must be above the current value */
+    while ( q2 > *max || q3 > *max )
     {
     {
-      FT_Pos  y1 = arc[0];
-      FT_Pos  y2 = arc[1];
-      FT_Pos  y3 = arc[2];
-      FT_Pos  y4 = arc[3];
-
-
-      if ( y1 == y4 )
+      /* determine which half contains the maximum and split */
+      if ( q1 + q2 > q3 + q4 ) /* first half */
       {
       {
-        if ( y1 == y2 && y1 == y3 )                         /* flat */
-          goto Test;
+        q4 = q4 + q3;
+        q3 = q3 + q2;
+        q2 = q2 + q1;
+        q4 = q4 + q3;
+        q3 = q3 + q2;
+        q4 = ( q4 + q3 ) / 8;
+        q3 = q3 / 4;
+        q2 = q2 / 2;
       }
       }
-      else if ( y1 < y4 )
+      else                     /* second half */
       {
       {
-        if ( y2 >= y1 && y2 <= y4 && y3 >= y1 && y3 <= y4 ) /* ascending */
-          goto Test;
+        q1 = q1 + q2;
+        q2 = q2 + q3;
+        q3 = q3 + q4;
+        q1 = q1 + q2;
+        q2 = q2 + q3;
+        q1 = ( q1 + q2 ) / 8;
+        q2 = q2 / 4;
+        q3 = q3 / 2;
       }
       }
-      else
+
+      /* check if either end reached the maximum */
+      if ( q1 == q2 && q1 >= q3 )
       {
       {
-        if ( y2 >= y4 && y2 <= y1 && y3 >= y4 && y3 <= y1 ) /* descending */
-        {
-          y2 = y1;
-          y1 = y4;
-          y4 = y2;
-          goto Test;
-        }
+        *max = q1;
+        break;
       }
       }
+      if ( q3 == q4 && q2 <= q4 )
+      {
+        *max = q4;
+        break;
+      }
+    }
 
 
-      /* unknown direction -- split the arc in two */
-      arc[6] = y4;
-      arc[1] = y1 = ( y1 + y2 ) / 2;
-      arc[5] = y4 = ( y4 + y3 ) / 2;
-      y2 = ( y2 + y3 ) / 2;
-      arc[2] = y1 = ( y1 + y2 ) / 2;
-      arc[4] = y4 = ( y4 + y2 ) / 2;
-      arc[3] = ( y1 + y4 ) / 2;
-
-      arc += 3;
-      goto Suite;
+    q1 = p1;
+    q2 = p2;
+    q3 = p3;
+    q4 = p4;
 
 
-   Test:
-      if ( y1 < *min ) *min = y1;
-      if ( y4 > *max ) *max = y4;
-      arc -= 3;
+    /* for a conic segment to possibly reach new minimum     */
+    /* one of its off-points must be below the current value */
+    while ( q2 < *min || q3 < *min )
+    {
+      /* determine which half contains the minimum and split */
+      if ( q1 + q2 < q3 + q4 ) /* first half */
+      {
+        q4 = q4 + q3;
+        q3 = q3 + q2;
+        q2 = q2 + q1;
+        q4 = q4 + q3;
+        q3 = q3 + q2;
+        q4 = ( q4 + q3 ) / 8;
+        q3 = q3 / 4;
+        q2 = q2 / 2;
+      }
+      else                     /* second half */
+      {
+        q1 = q1 + q2;
+        q2 = q2 + q3;
+        q3 = q3 + q4;
+        q1 = q1 + q2;
+        q2 = q2 + q3;
+        q1 = ( q1 + q2 ) / 8;
+        q2 = q2 / 4;
+        q3 = q3 / 2;
+      }
 
 
-    Suite:
-      ;
-    } while ( arc >= stack );
+      /* check if either end reached the minimum */
+      if ( q1 == q2 && q1 <= q3 )
+      {
+        *min = q1;
+        break;
+      }
+      if ( q3 == q4 && q2 >= q4 )
+      {
+        *min = q4;
+        break;
+      }
+    }
   }
 
 #else
   }
 
 #else
         return;
     }
 
         return;
     }
 
-    /* There are some split points.  Find them. */
+    /* There are some split points.  Find them.                        */
+    /* We already made sure that a, b, and c below cannot be all zero. */
     {
       FT_Pos    a = y4 - 3*y3 + 3*y2 - y1;
       FT_Pos    b = y3 - 2*y2 + y1;
       FT_Pos    c = y2 - y1;
       FT_Pos    d;
       FT_Fixed  t;
     {
       FT_Pos    a = y4 - 3*y3 + 3*y2 - y1;
       FT_Pos    b = y3 - 2*y2 + y1;
       FT_Pos    c = y2 - y1;
       FT_Pos    d;
       FT_Fixed  t;
+      FT_Int    shift;
 
 
       /* We need to solve `ax^2+2bx+c' here, without floating points!      */
       /* The trick is to normalize to a different representation in order  */
 
 
       /* We need to solve `ax^2+2bx+c' here, without floating points!      */
       /* The trick is to normalize to a different representation in order  */
-      /* to use our 16.16 fixed point routines.                            */
+      /* to use our 16.16 fixed-point routines.                            */
       /*                                                                   */
       /* We compute FT_MulFix(b,b) and FT_MulFix(a,c) after normalization. */
       /* These values must fit into a single 16.16 value.                  */
       /*                                                                   */
       /*                                                                   */
       /* We compute FT_MulFix(b,b) and FT_MulFix(a,c) after normalization. */
       /* These values must fit into a single 16.16 value.                  */
       /*                                                                   */
-      /* We normalize a, b, and c to `8.16' fixed float values to ensure   */
-      /* that its product is held in a `16.16' value.                      */
+      /* We normalize a, b, and c to `8.16' fixed-point values to ensure   */
+      /* that their product is held in a `16.16' value including the sign. */
+      /* Necessarily, we need to shift `a', `b', and `c' so that the most  */
+      /* significant bit of their absolute values is at position 22.       */
+      /*                                                                   */
+      /* This also means that we are using 23 bits of precision to compute */
+      /* the zeros, independently of the range of the original polynomial  */
+      /* coefficients.                                                     */
+      /*                                                                   */
+      /* This algorithm should ensure reasonably accurate values for the   */
+      /* zeros.  Note that they are only expressed with 16 bits when       */
+      /* computing the extrema (the zeros need to be in 0..1 exclusive     */
+      /* to be considered part of the arc).                                */
 
 
-      {
-        FT_ULong  t1, t2;
-        int       shift = 0;
-
-
-        /* The following computation is based on the fact that for   */
-        /* any value `y', if `n' is the position of the most         */
-        /* significant bit of `abs(y)' (starting from 0 for the      */
-        /* least significant bit), then `y' is in the range          */
-        /*                                                           */
-        /*   -2^n..2^n-1                                             */
-        /*                                                           */
-        /* We want to shift `a', `b', and `c' concurrently in order  */
-        /* to ensure that they all fit in 8.16 values, which maps    */
-        /* to the integer range `-2^23..2^23-1'.                     */
-        /*                                                           */
-        /* Necessarily, we need to shift `a', `b', and `c' so that   */
-        /* the most significant bit of its absolute values is at     */
-        /* _most_ at position 23.                                    */
-        /*                                                           */
-        /* We begin by computing `t1' as the bitwise `OR' of the     */
-        /* absolute values of `a', `b', `c'.                         */
-
-        t1  = (FT_ULong)( ( a >= 0 ) ? a : -a );
-        t2  = (FT_ULong)( ( b >= 0 ) ? b : -b );
-        t1 |= t2;
-        t2  = (FT_ULong)( ( c >= 0 ) ? c : -c );
-        t1 |= t2;
-
-        /* Now we can be sure that the most significant bit of `t1'  */
-        /* is the most significant bit of either `a', `b', or `c',   */
-        /* depending on the greatest integer range of the particular */
-        /* variable.                                                 */
-        /*                                                           */
-        /* Next, we compute the `shift', by shifting `t1' as many    */
-        /* times as necessary to move its MSB to position 23.  This  */
-        /* corresponds to a value of `t1' that is in the range       */
-        /* 0x40_0000..0x7F_FFFF.                                     */
-        /*                                                           */
-        /* Finally, we shift `a', `b', and `c' by the same amount.   */
-        /* This ensures that all values are now in the range         */
-        /* -2^23..2^23, i.e., they are now expressed as 8.16         */
-        /* fixed-float numbers.  This also means that we are using   */
-        /* 24 bits of precision to compute the zeros, independently  */
-        /* of the range of the original polynomial coefficients.     */
-        /*                                                           */
-        /* This algorithm should ensure reasonably accurate values   */
-        /* for the zeros.  Note that they are only expressed with    */
-        /* 16 bits when computing the extrema (the zeros need to     */
-        /* be in 0..1 exclusive to be considered part of the arc).   */
-
-        if ( t1 == 0 )  /* all coefficients are 0! */
-          return;
+      shift = FT_MSB( FT_ABS( a ) | FT_ABS( b ) | FT_ABS( c ) );
 
 
-        if ( t1 > 0x7FFFFFUL )
-        {
-          do
-          {
-            shift++;
-            t1 >>= 1;
-
-          } while ( t1 > 0x7FFFFFUL );
-
-          /* this loses some bits of precision, but we use 24 of them */
-          /* for the computation anyway                               */
-          a >>= shift;
-          b >>= shift;
-          c >>= shift;
-        }
-        else if ( t1 < 0x400000UL )
-        {
-          do
-          {
-            shift++;
-            t1 <<= 1;
+      if ( shift > 22 )
+      {
+        shift -= 22;
 
 
-          } while ( t1 < 0x400000UL );
+        /* this loses some bits of precision, but we use 23 of them */
+        /* for the computation anyway                               */
+        a >>= shift;
+        b >>= shift;
+        c >>= shift;
+      }
+      else
+      {
+        shift = 22 - shift;
 
 
-          a <<= shift;
-          b <<= shift;
-          c <<= shift;
-        }
+        a <<= shift;
+        b <<= shift;
+        c <<= shift;
       }
 
       /* handle a == 0 */
       }
 
       /* handle a == 0 */
@@ -581,10 +568,10 @@ FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
 
 
     if ( !abbox )
 
 
     if ( !abbox )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( !outline )
 
     if ( !outline )
-      return FT_Err_Invalid_Outline;
+      return FT_THROW( Invalid_Outline );
 
     /* if outline is empty, return (0,0,0,0) */
     if ( outline->n_points == 0 || outline->n_contours <= 0 )
 
     /* if outline is empty, return (0,0,0,0) */
     if ( outline->n_points == 0 || outline->n_contours <= 0 )
index d29adf0..5755f85 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing BDF-specific strings (body).              */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType API for accessing BDF-specific strings (body).              */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004 by                                          */
+/*  Copyright 2002-2004, 2013 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -33,7 +33,7 @@
     const char*  registry = NULL;
 
 
     const char*  registry = NULL;
 
 
-    error = FT_Err_Invalid_Argument;
+    error = FT_ERR( Invalid_Argument );
 
     if ( face )
     {
 
     if ( face )
     {
@@ -66,7 +66,7 @@
     FT_Error  error;
 
 
     FT_Error  error;
 
 
-    error = FT_Err_Invalid_Argument;
+    error = FT_ERR( Invalid_Argument );
 
     aproperty->type = BDF_PROPERTY_TYPE_NONE;
 
 
     aproperty->type = BDF_PROPERTY_TYPE_NONE;
 
index 82b5baf..0127114 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility functions for bitmaps (body).                       */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType utility functions for bitmaps (body).                       */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2007, 2008, 2009 by                        */
+/*  Copyright 2004-2009, 2011, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -17,6 +17,8 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_BITMAP_H
 #include FT_IMAGE_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_BITMAP_H
 #include FT_IMAGE_H
 #include FT_INTERNAL_OBJECTS_H
     int             new_pitch;
     FT_UInt         bpp;
     FT_Int          i, width, height;
     int             new_pitch;
     FT_UInt         bpp;
     FT_Int          i, width, height;
-    unsigned char*  buffer;
+    unsigned char*  buffer = NULL;
 
 
     width  = bitmap->width;
 
 
     width  = bitmap->width;
       new_pitch = ( width + xpixels );
       break;
     default:
       new_pitch = ( width + xpixels );
       break;
     default:
-      return FT_Err_Invalid_Glyph_Format;
+      return FT_THROW( Invalid_Glyph_Format );
     }
 
     /* if no need to allocate memory */
     }
 
     /* if no need to allocate memory */
 
 
     if ( !library )
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !bitmap || !bitmap->buffer )
 
     if ( !bitmap || !bitmap->buffer )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( ( ( FT_PIX_ROUND( xStrength ) >> 6 ) > FT_INT_MAX ) ||
          ( ( FT_PIX_ROUND( yStrength ) >> 6 ) > FT_INT_MAX ) )
 
     if ( ( ( FT_PIX_ROUND( xStrength ) >> 6 ) > FT_INT_MAX ) ||
          ( ( FT_PIX_ROUND( yStrength ) >> 6 ) > FT_INT_MAX ) )
-      return FT_Err_Invalid_Argument;
-       
+      return FT_THROW( Invalid_Argument );
+
     xstr = (FT_Int)FT_PIX_ROUND( xStrength ) >> 6;
     ystr = (FT_Int)FT_PIX_ROUND( yStrength ) >> 6;
 
     if ( xstr == 0 && ystr == 0 )
       return FT_Err_Ok;
     else if ( xstr < 0 || ystr < 0 )
     xstr = (FT_Int)FT_PIX_ROUND( xStrength ) >> 6;
     ystr = (FT_Int)FT_PIX_ROUND( yStrength ) >> 6;
 
     if ( xstr == 0 && ystr == 0 )
       return FT_Err_Ok;
     else if ( xstr < 0 || ystr < 0 )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     switch ( bitmap->pixel_mode )
     {
 
     switch ( bitmap->pixel_mode )
     {
     case FT_PIXEL_MODE_LCD_V:
       ystr *= 3;
       break;
     case FT_PIXEL_MODE_LCD_V:
       ystr *= 3;
       break;
+
+    case FT_PIXEL_MODE_BGRA:
+      /* We don't embolden color glyphs. */
+      return FT_Err_Ok;
     }
 
     error = ft_bitmap_assure_buffer( library->memory, bitmap, xstr, ystr );
     }
 
     error = ft_bitmap_assure_buffer( library->memory, bitmap, xstr, ystr );
   }
 
 
   }
 
 
+  FT_Byte
+  ft_gray_for_premultiplied_srgb_bgra( const FT_Byte*  bgra )
+  {
+    FT_Long  a = bgra[3];
+    FT_Long  b = bgra[0];
+    FT_Long  g = bgra[1];
+    FT_Long  r = bgra[2];
+    FT_Long  l;
+
+
+    /*
+     * Luminosity for sRGB is defined using ~0.2126,0.7152,0.0722
+     * coefficients for RGB channels *on the linear colors*.
+     * A gamma of 2.2 is fair to assume.  And then, we need to
+     * undo the premultiplication too.
+     *
+     * http://accessibility.kde.org/hsl-adjusted.php
+     *
+     * We do the computation with integers only.
+     */
+
+    /* Undo premultification, get the number in a 16.16 form. */
+    b = FT_MulDiv( b, 65536, a );
+    g = FT_MulDiv( g, 65536, a );
+    r = FT_MulDiv( r, 65536, a );
+    a = a * 256;
+
+    /* Apply gamma of 2.0 instead of 2.2. */
+    b = FT_MulFix( b, b );
+    g = FT_MulFix( g, g );
+    r = FT_MulFix( r, r );
+
+    /* Apply coefficients. */
+    b = FT_MulFix( b,  4731 /* 0.0722 * 65536 */ );
+    g = FT_MulFix( g, 46871 /* 0.7152 * 65536 */ );
+    r = FT_MulFix( r, 13933 /* 0.2126 * 65536 */ );
+
+    l = r + g + b;
+
+    /*
+     * Final transparency can be determined this way:
+     *
+     * - If alpha is zero, we want 0.
+     * - If alpha is zero and luminosity is zero, we want 255.
+     * - If alpha is zero and luminosity is one, we want 0.
+     *
+     * So the formula is a * (1 - l).
+     */
+
+    return (FT_Byte)( FT_MulFix( 65535 - l, a ) >> 8 );
+  }
+
+
   /* documentation is in ftbitmap.h */
 
   FT_EXPORT_DEF( FT_Error )
   /* documentation is in ftbitmap.h */
 
   FT_EXPORT_DEF( FT_Error )
 
 
     if ( !library )
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     memory = library->memory;
 
 
     memory = library->memory;
 
     case FT_PIXEL_MODE_GRAY4:
     case FT_PIXEL_MODE_LCD:
     case FT_PIXEL_MODE_LCD_V:
     case FT_PIXEL_MODE_GRAY4:
     case FT_PIXEL_MODE_LCD:
     case FT_PIXEL_MODE_LCD_V:
+    case FT_PIXEL_MODE_BGRA:
       {
         FT_Int   pad;
         FT_Long  old_size;
       {
         FT_Int   pad;
         FT_Long  old_size;
 
         target->pitch = source->width + pad;
 
 
         target->pitch = source->width + pad;
 
+        if ( target->pitch > 0                                     &&
+             (FT_ULong)target->rows > FT_ULONG_MAX / target->pitch )
+          return FT_THROW( Invalid_Argument );
+
         if ( target->rows * target->pitch > old_size             &&
              FT_QREALLOC( target->buffer,
                           old_size, target->rows * target->pitch ) )
         if ( target->rows * target->pitch > old_size             &&
              FT_QREALLOC( target->buffer,
                           old_size, target->rows * target->pitch ) )
       break;
 
     default:
       break;
 
     default:
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
     }
 
     switch ( source->pixel_mode )
     }
 
     switch ( source->pixel_mode )
       }
       break;
 
       }
       break;
 
+    case FT_PIXEL_MODE_BGRA:
+      {
+        FT_Byte*  s       = source->buffer;
+        FT_Byte*  t       = target->buffer;
+        FT_Int    s_pitch = source->pitch;
+        FT_Int    t_pitch = target->pitch;
+        FT_Int    i;
+
+
+        target->num_grays = 256;
+
+        for ( i = source->rows; i > 0; i-- )
+        {
+          FT_Byte*  ss = s;
+          FT_Byte*  tt = t;
+          FT_Int    j;
+
+
+          for ( j = source->width; j > 0; j-- )
+          {
+            tt[0] = ft_gray_for_premultiplied_srgb_bgra( ss );
+
+            ss += 4;
+            tt += 1;
+          }
+
+          s += s_pitch;
+          t += t_pitch;
+        }
+      }
+      break;
 
     default:
       ;
 
     default:
       ;
 
 
     if ( !library )
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !bitmap )
 
     if ( !bitmap )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     memory = library->memory;
 
 
     memory = library->memory;
 
index 3892fab..0ec0d78 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Arithmetic computations (body).                                      */
 /*                                                                         */
 /*                                                                         */
 /*    Arithmetic computations (body).                                      */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by             */
+/*  Copyright 1996-2006, 2008, 2012-2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -34,6 +34,7 @@
 
 #include <ft2build.h>
 #include FT_GLYPH_H
 
 #include <ft2build.h>
 #include FT_GLYPH_H
+#include FT_TRIGONOMETRY_H
 #include FT_INTERNAL_CALC_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_CALC_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 #undef FT_MulFix
 #endif
 
 #undef FT_MulFix
 #endif
 
-/* we need to define a 64-bits data type here */
+/* we need to emulate a 64-bit data type if a real one isn't available */
 
 
-#ifdef FT_LONG64
-
-  typedef FT_INT64  FT_Int64;
-
-#else
+#ifndef FT_LONG64
 
   typedef struct  FT_Int64_
   {
 
   typedef struct  FT_Int64_
   {
@@ -57,7 +54,7 @@
 
   } FT_Int64;
 
 
   } FT_Int64;
 
-#endif /* FT_LONG64 */
+#endif /* !FT_LONG64 */
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
   }
 
 
   }
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
+  FT_BASE_DEF ( FT_Int )
+  FT_MSB( FT_UInt32 z )
+  {
+    FT_Int shift = 0;
 
 
-  /* documentation is in ftcalc.h */
+    /* determine msb bit index in `shift' */
+    if ( z >= ( 1L << 16 ) )
+    {
+      z     >>= 16;
+      shift  += 16;
+    }
+    if ( z >= ( 1L << 8 ) )
+    {
+      z     >>= 8;
+      shift  += 8;
+    }
+    if ( z >= ( 1L << 4 ) )
+    {
+      z     >>= 4;
+      shift  += 4;
+    }
+    if ( z >= ( 1L << 2 ) )
+    {
+      z     >>= 2;
+      shift  += 2;
+    }
+    if ( z >= ( 1L << 1 ) )
+    {
+      z     >>= 1;
+      shift  += 1;
+    }
 
 
-  FT_EXPORT_DEF( FT_Int32 )
-  FT_Sqrt32( FT_Int32  x )
-  {
-    FT_UInt32  val, root, newroot, mask;
+    return shift;
+  }
 
 
 
 
-    root = 0;
-    mask = (FT_UInt32)0x40000000UL;
-    val  = (FT_UInt32)x;
+  /* documentation is in ftcalc.h */
 
 
-    do
-    {
-      newroot = root + mask;
-      if ( newroot <= val )
-      {
-        val -= newroot;
-        root = newroot + mask;
-      }
+  FT_BASE_DEF( FT_Fixed )
+  FT_Hypot( FT_Fixed  x,
+            FT_Fixed  y )
+  {
+    FT_Vector  v;
 
 
-      root >>= 1;
-      mask >>= 2;
 
 
-    } while ( mask != 0 );
+    v.x = x;
+    v.y = y;
 
 
-    return root;
+    return FT_Vector_Length( &v );
   }
 
   }
 
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
 
 #ifdef FT_LONG64
 
 
 #ifdef FT_LONG64
 
   }
 
 
   }
 
 
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
   /* documentation is in ftcalc.h */
 
   FT_BASE_DEF( FT_Long )
   /* documentation is in ftcalc.h */
 
   FT_BASE_DEF( FT_Long )
     return ( s > 0 ) ? d : -d;
   }
 
     return ( s > 0 ) ? d : -d;
   }
 
-#endif /* TT_USE_BYTECODE_INTERPRETER */
-
 
   /* documentation is in freetype.h */
 
 
   /* documentation is in freetype.h */
 
     FT_Int32   s;
     FT_UInt32  q;
 
     FT_Int32   s;
     FT_UInt32  q;
 
+
     s = 1;
     s = 1;
-    if ( a < 0 ) { a = -a; s = -1; }
-    if ( b < 0 ) { b = -b; s = -s; }
+    if ( a < 0 )
+    {
+      a = -a;
+      s = -1;
+    }
+    if ( b < 0 )
+    {
+      b = -b;
+      s = -s;
+    }
 
     if ( b == 0 )
       /* check for division by 0 */
       q = 0x7FFFFFFFL;
     else
       /* compute result directly */
 
     if ( b == 0 )
       /* check for division by 0 */
       q = 0x7FFFFFFFL;
     else
       /* compute result directly */
-      q = (FT_UInt32)( ( ( (FT_Int64)a << 16 ) + ( b >> 1 ) ) / b );
+      q = (FT_UInt32)( ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b );
 
     return ( s < 0 ? -(FT_Long)q : (FT_Long)q );
   }
 
     return ( s < 0 ? -(FT_Long)q : (FT_Long)q );
   }
       q <<= 1;
       r  |= lo >> 31;
 
       q <<= 1;
       r  |= lo >> 31;
 
-      if ( r >= (FT_UInt32)y )
+      if ( r >= y )
       {
         r -= y;
         q |= 1;
       {
         r -= y;
         q |= 1;
     if ( a <= 46340L && b <= 46340L && c <= 176095L && c > 0 )
       a = ( a * b + ( c >> 1 ) ) / c;
 
     if ( a <= 46340L && b <= 46340L && c <= 176095L && c > 0 )
       a = ( a * b + ( c >> 1 ) ) / c;
 
-    else if ( c > 0 )
+    else if ( (FT_Int32)c > 0 )
     {
       FT_Int64  temp, temp2;
 
     {
       FT_Int64  temp, temp2;
 
   }
 
 
   }
 
 
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
   FT_BASE_DEF( FT_Long )
   FT_MulDiv_No_Round( FT_Long  a,
                       FT_Long  b,
   FT_BASE_DEF( FT_Long )
   FT_MulDiv_No_Round( FT_Long  a,
                       FT_Long  b,
     if ( a <= 46340L && b <= 46340L && c > 0 )
       a = a * b / c;
 
     if ( a <= 46340L && b <= 46340L && c > 0 )
       a = a * b / c;
 
-    else if ( c > 0 )
+    else if ( (FT_Int32)c > 0 )
     {
       FT_Int64  temp;
 
     {
       FT_Int64  temp;
 
     return ( s < 0 ? -a : a );
   }
 
     return ( s < 0 ? -a : a );
   }
 
-#endif /* TT_USE_BYTECODE_INTERPRETER */
-
 
   /* documentation is in freetype.h */
 
 
   /* documentation is in freetype.h */
 
      *  Unfortunately, it doesn't work (at least not portably).
      *
      *  It makes the assumption that right-shift on a negative signed value
      *  Unfortunately, it doesn't work (at least not portably).
      *
      *  It makes the assumption that right-shift on a negative signed value
-     *  fills the leftmost bits by copying the sign bit.  This is wrong. 
+     *  fills the leftmost bits by copying the sign bit.  This is wrong.
      *  According to K&R 2nd ed, section `A7.8 Shift Operators' on page 206,
      *  the result of right-shift of a negative signed value is
      *  implementation-defined.  At least one implementation fills the
      *  According to K&R 2nd ed, section `A7.8 Shift Operators' on page 206,
      *  the result of right-shift of a negative signed value is
      *  implementation-defined.  At least one implementation fills the
     s  = (FT_Int32)a; a = FT_ABS( a );
     s ^= (FT_Int32)b; b = FT_ABS( b );
 
     s  = (FT_Int32)a; a = FT_ABS( a );
     s ^= (FT_Int32)b; b = FT_ABS( b );
 
-    if ( b == 0 )
+    if ( (FT_UInt32)b == 0 )
     {
       /* check for division by 0 */
       q = (FT_UInt32)0x7FFFFFFFL;
     {
       /* check for division by 0 */
       q = (FT_UInt32)0x7FFFFFFFL;
     else if ( ( a >> 16 ) == 0 )
     {
       /* compute result directly */
     else if ( ( a >> 16 ) == 0 )
     {
       /* compute result directly */
-      q = (FT_UInt32)( (a << 16) + (b >> 1) ) / (FT_UInt32)b;
+      q = (FT_UInt32)( ( (FT_ULong)a << 16 ) + ( b >> 1 ) ) / (FT_UInt32)b;
     }
     else
     {
       /* we need more bits; we have to do it by hand */
       FT_Int64  temp, temp2;
 
     }
     else
     {
       /* we need more bits; we have to do it by hand */
       FT_Int64  temp, temp2;
 
-      temp.hi  = (FT_Int32) (a >> 16);
-      temp.lo  = (FT_UInt32)(a << 16);
+
+      temp.hi  = (FT_Int32)( a >> 16 );
+      temp.lo  = (FT_UInt32)a << 16;
       temp2.hi = 0;
       temp2.lo = (FT_UInt32)( b >> 1 );
       FT_Add64( &temp, &temp2, &temp );
       temp2.hi = 0;
       temp2.lo = (FT_UInt32)( b >> 1 );
       FT_Add64( &temp, &temp2, &temp );
 
 
     if ( !matrix )
 
 
     if ( !matrix )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* compute discriminant */
     delta = FT_MulFix( matrix->xx, matrix->yy ) -
             FT_MulFix( matrix->xy, matrix->yx );
 
     if ( !delta )
 
     /* compute discriminant */
     delta = FT_MulFix( matrix->xx, matrix->yy ) -
             FT_MulFix( matrix->xy, matrix->yx );
 
     if ( !delta )
-      return FT_Err_Invalid_Argument;  /* matrix can't be inverted */
+      return FT_THROW( Invalid_Argument );  /* matrix can't be inverted */
 
     matrix->xy = - FT_DivFix( matrix->xy, delta );
     matrix->yx = - FT_DivFix( matrix->yx, delta );
 
     matrix->xy = - FT_DivFix( matrix->xy, delta );
     matrix->yx = - FT_DivFix( matrix->yx, delta );
index 733aae1..741879d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing CID font information.                     */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType API for accessing CID font information.                     */
 /*                                                                         */
-/*  Copyright 2007, 2009 by Derek Clegg, Michael Toftdal.                  */
+/*  Copyright 2007, 2009, 2013 by Derek Clegg, Michael Toftdal.            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
@@ -35,7 +35,7 @@
     FT_Int       s = 0;
 
 
     FT_Int       s = 0;
 
 
-    error = FT_Err_Invalid_Argument;
+    error = FT_ERR( Invalid_Argument );
 
     if ( face )
     {
 
     if ( face )
     {
@@ -65,7 +65,7 @@
   FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,
                                       FT_Bool  *is_cid )
   {
   FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,
                                       FT_Bool  *is_cid )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
     FT_Bool   ic = 0;
 
 
     FT_Bool   ic = 0;
 
 
@@ -92,7 +92,7 @@
                                FT_UInt   glyph_index,
                                FT_UInt  *cid )
   {
                                FT_UInt   glyph_index,
                                FT_UInt  *cid )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
     FT_UInt   c = 0;
 
 
     FT_UInt   c = 0;
 
 
index 12fed04..6fb86fe 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Memory debugger (body).                                              */
 /*                                                                         */
 /*                                                                         */
 /*    Memory debugger (body).                                              */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2009 by                  */
+/*  Copyright 2001-2006, 2009, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   ft_mem_table_destroy( FT_MemTable  table )
   {
     FT_ULong  i;
   ft_mem_table_destroy( FT_MemTable  table )
   {
     FT_ULong  i;
+    FT_Long   leak_count = 0;
+    FT_ULong  leaks      = 0;
 
 
     FT_DumpMemory( table->memory );
 
 
 
     FT_DumpMemory( table->memory );
 
-    if ( table )
+    /* remove all blocks from the table, revealing leaked ones */
+    for ( i = 0; i < table->size; i++ )
     {
     {
-      FT_Long   leak_count = 0;
-      FT_ULong  leaks      = 0;
+      FT_MemNode  *pnode = table->buckets + i, next, node = *pnode;
 
 
 
 
-      /* remove all blocks from the table, revealing leaked ones */
-      for ( i = 0; i < table->size; i++ )
+      while ( node )
       {
       {
-        FT_MemNode  *pnode = table->buckets + i, next, node = *pnode;
+        next       = node->link;
+        node->link = 0;
 
 
-
-        while ( node )
+        if ( node->size > 0 )
         {
         {
-          next       = node->link;
-          node->link = 0;
-
-          if ( node->size > 0 )
-          {
-            printf(
-              "leaked memory block at address %p, size %8ld in (%s:%ld)\n",
-              node->address, node->size,
-              FT_FILENAME( node->source->file_name ),
-              node->source->line_no );
+          printf(
+            "leaked memory block at address %p, size %8ld in (%s:%ld)\n",
+            node->address, node->size,
+            FT_FILENAME( node->source->file_name ),
+            node->source->line_no );
 
 
-            leak_count++;
-            leaks += node->size;
+          leak_count++;
+          leaks += node->size;
 
 
-            ft_mem_table_free( table, node->address );
-          }
+          ft_mem_table_free( table, node->address );
+        }
 
 
-          node->address = NULL;
-          node->size    = 0;
+        node->address = NULL;
+        node->size    = 0;
 
 
-          ft_mem_table_free( table, node );
-          node = next;
-        }
-        table->buckets[i] = 0;
+        ft_mem_table_free( table, node );
+        node = next;
       }
       }
+      table->buckets[i] = 0;
+    }
 
 
-      ft_mem_table_free( table, table->buckets );
-      table->buckets = NULL;
-
-      table->size  = 0;
-      table->nodes = 0;
+    ft_mem_table_free( table, table->buckets );
+    table->buckets = NULL;
 
 
-      /* remove all sources */
-      for ( i = 0; i < FT_MEM_SOURCE_BUCKETS; i++ )
-      {
-        FT_MemSource  source, next;
+    table->size  = 0;
+    table->nodes = 0;
 
 
+    /* remove all sources */
+    for ( i = 0; i < FT_MEM_SOURCE_BUCKETS; i++ )
+    {
+      FT_MemSource  source, next;
 
 
-        for ( source = table->sources[i]; source != NULL; source = next )
-        {
-          next = source->link;
-          ft_mem_table_free( table, source );
-        }
 
 
-        table->sources[i] = NULL;
+      for ( source = table->sources[i]; source != NULL; source = next )
+      {
+        next = source->link;
+        ft_mem_table_free( table, source );
       }
 
       }
 
-      printf(
-        "FreeType: total memory allocations = %ld\n", table->alloc_total );
-      printf(
-        "FreeType: maximum memory footprint = %ld\n", table->alloc_max );
+      table->sources[i] = NULL;
+    }
 
 
-      ft_mem_table_free( table, table );
+    printf( "FreeType: total memory allocations = %ld\n",
+            table->alloc_total );
+    printf( "FreeType: maximum memory footprint = %ld\n",
+            table->alloc_max );
 
 
-      if ( leak_count > 0 )
-        ft_mem_debug_panic(
-          "FreeType: %ld bytes of memory leaked in %ld blocks\n",
-          leaks, leak_count );
+    ft_mem_table_free( table, table );
 
 
-      printf( "FreeType: no memory leaks detected\n" );
-    }
+    if ( leak_count > 0 )
+      ft_mem_debug_panic(
+        "FreeType: %ld bytes of memory leaked in %ld blocks\n",
+        leaks, leak_count );
+
+    printf( "FreeType: no memory leaks detected\n" );
   }
 
 
   }
 
 
index 2adbeab..b9156d1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Debugging and logging component (body).                              */
 /*                                                                         */
 /*                                                                         */
 /*    Debugging and logging component (body).                              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2008 by                               */
+/*  Copyright 1996-2001, 2002, 2004, 2008, 2013 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -51,7 +51,8 @@
   /* documentation is in ftdebug.h */
 
   FT_BASE_DEF( void )
   /* documentation is in ftdebug.h */
 
   FT_BASE_DEF( void )
-  FT_Message( const char*  fmt, ... )
+  FT_Message( const char*  fmt,
+              ... )
   {
     va_list  ap;
 
   {
     va_list  ap;
 
@@ -65,7 +66,8 @@
   /* documentation is in ftdebug.h */
 
   FT_BASE_DEF( void )
   /* documentation is in ftdebug.h */
 
   FT_BASE_DEF( void )
-  FT_Panic( const char*  fmt, ... )
+  FT_Panic( const char*  fmt,
+            ... )
   {
     va_list  ap;
 
   {
     va_list  ap;
 
     exit( EXIT_FAILURE );
   }
 
     exit( EXIT_FAILURE );
   }
 
+
+  /* documentation is in ftdebug.h */
+
+  FT_BASE_DEF( int )
+  FT_Throw( FT_Error     error,
+            int          line,
+            const char*  file )
+  {
+    FT_UNUSED( error );
+    FT_UNUSED( line );
+    FT_UNUSED( file );
+
+    return 0;
+  }
+
 #endif /* FT_DEBUG_LEVEL_ERROR */
 
 
 #endif /* FT_DEBUG_LEVEL_ERROR */
 
 
         while ( *p && *p != ':' )
           p++;
 
         while ( *p && *p != ':' )
           p++;
 
+        if ( !*p )
+          break;
+
         if ( *p == ':' && p > q )
         {
           FT_Int  n, i, len = (FT_Int)( p - q );
         if ( *p == ':' && p > q )
         {
           FT_Int  n, i, len = (FT_Int)( p - q );
           p++;
           if ( *p )
           {
           p++;
           if ( *p )
           {
-            level = *p++ - '0';
+            level = *p - '0';
             if ( level < 0 || level > 7 )
               level = -1;
           }
             if ( level < 0 || level > 7 )
               level = -1;
           }
index 8483450..3cc5c7a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType glyph loader (body).                                    */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType glyph loader (body).                                    */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2010 by                        */
+/*  Copyright 2002-2006, 2010, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg                       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg                       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -17,6 +17,7 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_GLYPH_LOADER_H
 #include FT_INTERNAL_MEMORY_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_GLYPH_LOADER_H
 #include FT_INTERNAL_MEMORY_H
 #include FT_INTERNAL_OBJECTS_H
       new_max = FT_PAD_CEIL( new_max, 8 );
 
       if ( new_max > FT_OUTLINE_POINTS_MAX )
       new_max = FT_PAD_CEIL( new_max, 8 );
 
       if ( new_max > FT_OUTLINE_POINTS_MAX )
-        return FT_Err_Array_Too_Large;
+        return FT_THROW( Array_Too_Large );
 
       if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||
            FT_RENEW_ARRAY( base->tags,   old_max, new_max ) )
 
       if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||
            FT_RENEW_ARRAY( base->tags,   old_max, new_max ) )
       new_max = FT_PAD_CEIL( new_max, 4 );
 
       if ( new_max > FT_OUTLINE_CONTOURS_MAX )
       new_max = FT_PAD_CEIL( new_max, 4 );
 
       if ( new_max > FT_OUTLINE_CONTOURS_MAX )
-        return FT_Err_Array_Too_Large;
+        return FT_THROW( Array_Too_Large );
 
       if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) )
         goto Exit;
 
       if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) )
         goto Exit;
       FT_GlyphLoader_Adjust_Points( loader );
 
   Exit:
       FT_GlyphLoader_Adjust_Points( loader );
 
   Exit:
+    if ( error )
+      FT_GlyphLoader_Reset( loader );
+
     return error;
   }
 
     return error;
   }
 
   }
 
 
   }
 
 
-  /* add current glyph to the base image - and prepare for another */
+  /* add current glyph to the base image -- and prepare for another */
   FT_BASE_DEF( void )
   FT_GlyphLoader_Add( FT_GlyphLoader  loader )
   {
   FT_BASE_DEF( void )
   FT_GlyphLoader_Add( FT_GlyphLoader  loader )
   {
index b220508..5dd28a8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType convenience functions to handle glyphs (body).              */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType convenience functions to handle glyphs (body).              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010 by       */
+/*  Copyright 1996-2005, 2007, 2008, 2010, 2012, 2013 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,6 +29,8 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_GLYPH_H
 #include FT_OUTLINE_H
 #include FT_BITMAP_H
 #include FT_GLYPH_H
 #include FT_OUTLINE_H
 #include FT_BITMAP_H
@@ -65,7 +67,7 @@
 
     if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
     {
 
     if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
     {
-      error = FT_Err_Invalid_Glyph_Format;
+      error = FT_THROW( Invalid_Glyph_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
     /* check format in glyph slot */
     if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
     {
     /* check format in glyph slot */
     if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
     {
-      error = FT_Err_Invalid_Glyph_Format;
+      error = FT_THROW( Invalid_Glyph_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
   }
 
 
   }
 
 
-  FT_DEFINE_GLYPH( ft_outline_glyph_class, 
+  FT_DEFINE_GLYPH( ft_outline_glyph_class,
     sizeof ( FT_OutlineGlyphRec ),
     FT_GLYPH_FORMAT_OUTLINE,
 
     sizeof ( FT_OutlineGlyphRec ),
     FT_GLYPH_FORMAT_OUTLINE,
 
     /* check arguments */
     if ( !target )
     {
     /* check arguments */
     if ( !target )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
     if ( !source || !source->clazz )
     {
 
     if ( !source || !source->clazz )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
 
     if ( !slot )
 
 
     if ( !slot )
-      return FT_Err_Invalid_Slot_Handle;
+      return FT_THROW( Invalid_Slot_Handle );
 
     library = slot->library;
 
     if ( !aglyph )
 
     library = slot->library;
 
     if ( !aglyph )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* if it is a bitmap, that's easy :-) */
     if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
 
     /* if it is a bitmap, that's easy :-) */
     if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
 
     if ( !clazz )
     {
 
     if ( !clazz )
     {
-      error = FT_Err_Invalid_Glyph_Format;
+      error = FT_THROW( Invalid_Glyph_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
 
     if ( !glyph || !glyph->clazz )
 
 
     if ( !glyph || !glyph->clazz )
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
     else
     {
       clazz = glyph->clazz;
     else
     {
       clazz = glyph->clazz;
           FT_Vector_Transform( &glyph->advance, matrix );
       }
       else
           FT_Vector_Transform( &glyph->advance, matrix );
       }
       else
-        error = FT_Err_Invalid_Glyph_Format;
+        error = FT_THROW( Invalid_Glyph_Format );
     }
     return error;
   }
     }
     return error;
   }
     FT_GlyphSlotRec           dummy;
     FT_GlyphSlot_InternalRec  dummy_internal;
     FT_Error                  error = FT_Err_Ok;
     FT_GlyphSlotRec           dummy;
     FT_GlyphSlot_InternalRec  dummy_internal;
     FT_Error                  error = FT_Err_Ok;
-    FT_Glyph                  glyph;
+    FT_Glyph                  b, glyph;
     FT_BitmapGlyph            bitmap = NULL;
     FT_BitmapGlyph            bitmap = NULL;
-
     const FT_Glyph_Class*     clazz;
 
     const FT_Glyph_Class*     clazz;
 
-#ifdef FT_CONFIG_OPTION_PIC
-    FT_Library                library = FT_GLYPH( glyph )->library;
-#endif
+    /* FT_BITMAP_GLYPH_CLASS_GET derefers `library' in PIC mode */
+    FT_Library                library;
 
 
     /* check argument */
     if ( !the_glyph )
       goto Bad;
 
 
     /* check argument */
     if ( !the_glyph )
       goto Bad;
-
-    /* we render the glyph into a glyph bitmap using a `dummy' glyph slot */
-    /* then calling FT_Render_Glyph_Internal()                            */
-
     glyph = *the_glyph;
     if ( !glyph )
       goto Bad;
 
     glyph = *the_glyph;
     if ( !glyph )
       goto Bad;
 
-    clazz = glyph->clazz;
+    clazz   = glyph->clazz;
+    library = glyph->library;
+    if ( !library || !clazz )
+      goto Bad;
 
     /* when called with a bitmap glyph, do nothing and return successfully */
     if ( clazz == FT_BITMAP_GLYPH_CLASS_GET )
       goto Exit;
 
 
     /* when called with a bitmap glyph, do nothing and return successfully */
     if ( clazz == FT_BITMAP_GLYPH_CLASS_GET )
       goto Exit;
 
-    if ( !clazz || !clazz->glyph_prepare )
+    if ( !clazz->glyph_prepare )
       goto Bad;
 
       goto Bad;
 
+    /* we render the glyph into a glyph bitmap using a `dummy' glyph slot */
+    /* then calling FT_Render_Glyph_Internal()                            */
+
     FT_MEM_ZERO( &dummy, sizeof ( dummy ) );
     FT_MEM_ZERO( &dummy_internal, sizeof ( dummy_internal ) );
     dummy.internal = &dummy_internal;
     FT_MEM_ZERO( &dummy, sizeof ( dummy ) );
     FT_MEM_ZERO( &dummy_internal, sizeof ( dummy_internal ) );
     dummy.internal = &dummy_internal;
-    dummy.library  = glyph->library;
+    dummy.library  = library;
     dummy.format   = clazz->glyph_format;
 
     /* create result bitmap glyph */
     dummy.format   = clazz->glyph_format;
 
     /* create result bitmap glyph */
-    error = ft_new_glyph( glyph->library, FT_BITMAP_GLYPH_CLASS_GET,
-                          (FT_Glyph*)(void*)&bitmap );
+    error = ft_new_glyph( library, FT_BITMAP_GLYPH_CLASS_GET, &b );
     if ( error )
       goto Exit;
     if ( error )
       goto Exit;
+    bitmap = (FT_BitmapGlyph)b;
 
 #if 1
     /* if `origin' is set, translate the glyph image */
 
 #if 1
     /* if `origin' is set, translate the glyph image */
     return error;
 
   Bad:
     return error;
 
   Bad:
-    error = FT_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_Argument );
     goto Exit;
   }
 
     goto Exit;
   }
 
index aeeb8ce..a8ec44a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for validating TrueTyepGX/AAT tables (body).            */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType API for validating TrueTyepGX/AAT tables (body).            */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2010 by                                    */
+/*  Copyright 2004-2006, 2010, 2013 by                                     */
 /*  Masatake YAMATO, Redhat K.K,                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  Masatake YAMATO, Redhat K.K,                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
@@ -26,6 +26,8 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_GX_VALIDATE_H
 
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_GX_VALIDATE_H
 
 
     if ( !face )
     {
 
     if ( !face )
     {
-      error = FT_Err_Invalid_Face_Handle;
+      error = FT_THROW( Invalid_Face_Handle );
       goto Exit;
     }
 
     if ( tables == NULL )
     {
       goto Exit;
     }
 
     if ( tables == NULL )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
@@ -62,7 +64,7 @@
                                  tables,
                                  table_length );
     else
                                  tables,
                                  table_length );
     else
-      error = FT_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
 
   Exit:
     return error;
 
   Exit:
     return error;
 
     if ( !face )
     {
 
     if ( !face )
     {
-      error = FT_Err_Invalid_Face_Handle;
+      error = FT_THROW( Invalid_Face_Handle );
       goto Exit;
     }
 
     if ( ckern_table == NULL )
     {
       goto Exit;
     }
 
     if ( ckern_table == NULL )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
                                  validation_flags,
                                  ckern_table );
     else
                                  validation_flags,
                                  ckern_table );
     else
-      error = FT_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
 
   Exit:
     return error;
 
   Exit:
     return error;
index 305177a..85f321f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType initialization layer (body).                                */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType initialization layer (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2005, 2007, 2009 by                         */
+/*  Copyright 1996-2002, 2005, 2007, 2009, 2012, 2013 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_init
 
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_init
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
+
 #undef  FT_USE_MODULE
 #ifdef __cplusplus
 #define FT_USE_MODULE( type, x )  extern "C" const type  x;
 #undef  FT_USE_MODULE
 #ifdef __cplusplus
 #define FT_USE_MODULE( type, x )  extern "C" const type  x;
 #define FT_USE_MODULE( type, x )  extern const type  x;
 #endif
 
 #define FT_USE_MODULE( type, x )  extern const type  x;
 #endif
 
-
 #include FT_CONFIG_MODULES_H
 
 #include FT_CONFIG_MODULES_H
 
-
 #undef  FT_USE_MODULE
 #define FT_USE_MODULE( type, x )  (const FT_Module_Class*)&(x),
 
 #undef  FT_USE_MODULE
 #define FT_USE_MODULE( type, x )  (const FT_Module_Class*)&(x),
 
     0
   };
 
     0
   };
 
+
 #else /* FT_CONFIG_OPTION_PIC */
 
 #else /* FT_CONFIG_OPTION_PIC */
 
+
 #ifdef __cplusplus
 #define FT_EXTERNC  extern "C"
 #else
 #ifdef __cplusplus
 #define FT_EXTERNC  extern "C"
 #else
 
   /* declare the module's class creation/destruction functions */
 #undef  FT_USE_MODULE
 
   /* declare the module's class creation/destruction functions */
 #undef  FT_USE_MODULE
-#define FT_USE_MODULE( type, x )  \
-  FT_EXTERNC FT_Error FT_Create_Class_##x( FT_Library library, FT_Module_Class** output_class ); \
-  FT_EXTERNC void     FT_Destroy_Class_##x( FT_Library library, FT_Module_Class*  clazz );
+#define FT_USE_MODULE( type, x )                            \
+  FT_EXTERNC FT_Error                                       \
+  FT_Create_Class_ ## x( FT_Library         library,        \
+                         FT_Module_Class*  *output_class ); \
+  FT_EXTERNC void                                           \
+  FT_Destroy_Class_ ## x( FT_Library        library,        \
+                          FT_Module_Class*  clazz );
 
 #include FT_CONFIG_MODULES_H
 
 
 #include FT_CONFIG_MODULES_H
 
-
   /* count all module classes */
 #undef  FT_USE_MODULE
   /* count all module classes */
 #undef  FT_USE_MODULE
-#define FT_USE_MODULE( type, x )  MODULE_CLASS_##x,
+#define FT_USE_MODULE( type, x )  MODULE_CLASS_ ## x,
 
   enum
   {
 
   enum
   {
     FT_NUM_MODULE_CLASSES
   };
 
     FT_NUM_MODULE_CLASSES
   };
 
-  /* destroy all module classes */  
+  /* destroy all module classes */
 #undef  FT_USE_MODULE
 #undef  FT_USE_MODULE
-#define FT_USE_MODULE( type, x )  \
-  if ( classes[i] ) { FT_Destroy_Class_##x(library, classes[i]); } \
-  i++;                                                             \
+#define FT_USE_MODULE( type, x )                   \
+  if ( classes[i] )                                \
+  {                                                \
+    FT_Destroy_Class_ ## x( library, classes[i] ); \
+  }                                                \
+  i++;
+
 
   FT_BASE_DEF( void )
   ft_destroy_default_module_classes( FT_Library  library )
   {
 
   FT_BASE_DEF( void )
   ft_destroy_default_module_classes( FT_Library  library )
   {
-    FT_Module_Class** classes;
-    FT_Memory         memory;
-    FT_UInt           i;
-    BasePIC*          pic_container = (BasePIC*)library->pic_container.base;
+    FT_Module_Class*  *classes;
+    FT_Memory          memory;
+    FT_UInt            i;
+    BasePIC*           pic_container = (BasePIC*)library->pic_container.base;
+
 
     if ( !pic_container->default_module_classes )
       return;
 
 
     if ( !pic_container->default_module_classes )
       return;
 
-    memory = library->memory;
+    memory  = library->memory;
     classes = pic_container->default_module_classes;
     classes = pic_container->default_module_classes;
-    i = 0;
+    i       = 0;
 
 #include FT_CONFIG_MODULES_H
 
 
 #include FT_CONFIG_MODULES_H
 
     pic_container->default_module_classes = 0;
   }
 
     pic_container->default_module_classes = 0;
   }
 
+
   /* initialize all module classes and the pointer table */
 #undef  FT_USE_MODULE
   /* initialize all module classes and the pointer table */
 #undef  FT_USE_MODULE
-#define FT_USE_MODULE( type, x )                \
-  error = FT_Create_Class_##x(library, &clazz); \
-  if (error) goto Exit;                         \
+#define FT_USE_MODULE( type, x )                     \
+  error = FT_Create_Class_ ## x( library, &clazz );  \
+  if ( error )                                       \
+    goto Exit;                                       \
   classes[i++] = clazz;
 
   classes[i++] = clazz;
 
+
   FT_BASE_DEF( FT_Error )
   ft_create_default_module_classes( FT_Library  library )
   {
   FT_BASE_DEF( FT_Error )
   ft_create_default_module_classes( FT_Library  library )
   {
-    FT_Error          error;
-    FT_Memory         memory;
-    FT_Module_Class** classes;
-    FT_Module_Class*  clazz;
-    FT_UInt           i;
-    BasePIC*          pic_container = (BasePIC*)library->pic_container.base;
-
-    memory = library->memory;  
+    FT_Error           error;
+    FT_Memory          memory;
+    FT_Module_Class*  *classes = NULL;
+    FT_Module_Class*   clazz;
+    FT_UInt            i;
+    BasePIC*           pic_container = (BasePIC*)library->pic_container.base;
+
+
+    memory = library->memory;
+
     pic_container->default_module_classes = 0;
 
     pic_container->default_module_classes = 0;
 
-    if ( FT_ALLOC(classes, sizeof(FT_Module_Class*) * (FT_NUM_MODULE_CLASSES + 1) ) )
+    if ( FT_ALLOC( classes, sizeof ( FT_Module_Class* ) *
+                              ( FT_NUM_MODULE_CLASSES + 1 ) ) )
       return error;
       return error;
+
     /* initialize all pointers to 0, especially the last one */
     /* initialize all pointers to 0, especially the last one */
-    for (i = 0; i < FT_NUM_MODULE_CLASSES; i++)
+    for ( i = 0; i < FT_NUM_MODULE_CLASSES; i++ )
       classes[i] = 0;
     classes[FT_NUM_MODULE_CLASSES] = 0;
 
       classes[i] = 0;
     classes[FT_NUM_MODULE_CLASSES] = 0;
 
 
 #include FT_CONFIG_MODULES_H
 
 
 #include FT_CONFIG_MODULES_H
 
-Exit:    
-    if (error) ft_destroy_default_module_classes( library );
-    else pic_container->default_module_classes = classes;
+  Exit:
+    if ( error )
+      ft_destroy_default_module_classes( library );
+    else
+      pic_container->default_module_classes = classes;
 
 
-    return error;    
+    return error;
   }
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
   }
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
+
   /* documentation is in ftmodapi.h */
 
   FT_EXPORT_DEF( void )
   /* documentation is in ftmodapi.h */
 
   FT_EXPORT_DEF( void )
@@ -181,9 +201,18 @@ Exit:
     const FT_Module_Class* const*  cur;
 
 
     const FT_Module_Class* const*  cur;
 
 
-    /* test for valid `library' delayed to FT_Add_Module() */
+    /* FT_DEFAULT_MODULES_GET dereferences `library' in PIC mode */
+#ifdef FT_CONFIG_OPTION_PIC
+    if ( !library )
+      return;
+#endif
+
+    /* GCC 4.6 warns the type difference:
+     *   FT_Module_Class** != const FT_Module_Class* const*
+     */
+    cur = (const FT_Module_Class* const*)FT_DEFAULT_MODULES_GET;
 
 
-    cur = FT_DEFAULT_MODULES_GET;
+    /* test for valid `library' delayed to FT_Add_Module() */
     while ( *cur )
     {
       error = FT_Add_Module( library, *cur );
     while ( *cur )
     {
       error = FT_Add_Module( library, *cur );
@@ -213,7 +242,7 @@ Exit:
     if ( !memory )
     {
       FT_ERROR(( "FT_Init_FreeType: cannot find memory manager\n" ));
     if ( !memory )
     {
       FT_ERROR(( "FT_Init_FreeType: cannot find memory manager\n" ));
-      return FT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
     }
 
     /* build a library out of it, then fill it with the set of */
     }
 
     /* build a library out of it, then fill it with the set of */
index 0da4ba1..852fb32 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for color filtering of subpixel bitmap glyphs (body).   */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType API for color filtering of subpixel bitmap glyphs (body).   */
 /*                                                                         */
-/*  Copyright 2006, 2008, 2009, 2010 by                                    */
+/*  Copyright 2006, 2008-2010, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -17,6 +17,8 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_LCD_FILTER_H
 #include FT_IMAGE_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_LCD_FILTER_H
 #include FT_IMAGE_H
 #include FT_INTERNAL_OBJECTS_H
                                   unsigned char  *weights )
   {
     if ( !library || !weights )
                                   unsigned char  *weights )
   {
     if ( !library || !weights )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     ft_memcpy( library->lcd_weights, weights, 5 );
 
 
     ft_memcpy( library->lcd_weights, weights, 5 );
 
 
 
     if ( !library )
 
 
     if ( !library )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     switch ( filter )
     {
 
     switch ( filter )
     {
 #endif
 
     default:
 #endif
 
     default:
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
     }
 
     library->lcd_filter = filter;
     }
 
     library->lcd_filter = filter;
     FT_UNUSED( library );
     FT_UNUSED( weights );
 
     FT_UNUSED( library );
     FT_UNUSED( weights );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 
   }
 
 
     FT_UNUSED( library );
     FT_UNUSED( filter );
 
     FT_UNUSED( library );
     FT_UNUSED( filter );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 #endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
   }
 
 #endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
index 63f927d..5b5aae6 100644 (file)
@@ -8,8 +8,7 @@
 /*  This file is for Mac OS X only; see builds/mac/ftoldmac.c for          */
 /*  classic platforms built by MPW.                                        */
 /*                                                                         */
 /*  This file is for Mac OS X only; see builds/mac/ftoldmac.c for          */
 /*  classic platforms built by MPW.                                        */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,         */
-/*            2009 by                                                      */
+/*  Copyright 1996-2009, 2013 by                                           */
 /*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #endif
 
 
 #endif
 
 
+#ifdef FT_MACINTOSH
+
   /* This function is deprecated because FSSpec is deprecated in Mac OS X  */
   FT_EXPORT_DEF( FT_Error )
   FT_GetFile_From_Mac_Name( const char*  fontName,
   /* This function is deprecated because FSSpec is deprecated in Mac OS X  */
   FT_EXPORT_DEF( FT_Error )
   FT_GetFile_From_Mac_Name( const char*  fontName,
     FT_UNUSED( pathSpec );
     FT_UNUSED( face_index );
 
     FT_UNUSED( pathSpec );
     FT_UNUSED( face_index );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 
   }
 
 
   {
 #if defined( MAC_OS_X_VERSION_10_5 ) && \
     ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 )
   {
 #if defined( MAC_OS_X_VERSION_10_5 ) && \
     ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 )
+
     OSStatus  err;
 
     err = ATSFontGetFileReference( ats_font_id, ats_font_ref );
     OSStatus  err;
 
     err = ATSFontGetFileReference( ats_font_id, ats_font_ref );
     CFRelease( cf_fontName );
 
     if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )
     CFRelease( cf_fontName );
 
     if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     if ( noErr != FT_ATSFontGetFileReference( ats_font_id, ats_font_ref ) )
 
     if ( noErr != FT_ATSFontGetFileReference( ats_font_id, ats_font_ref ) )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     /* face_index calculation by searching preceding fontIDs */
     /* with same FSRef                                       */
 
     /* face_index calculation by searching preceding fontIDs */
     /* with same FSRef                                       */
 
 
     err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index );
 
 
     err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index );
-    if ( FT_Err_Ok != err )
+    if ( err )
       return err;
 
     if ( noErr != FSRefMakePath( &ref, path, maxPathSize ) )
       return err;
 
     if ( noErr != FSRefMakePath( &ref, path, maxPathSize ) )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     return FT_Err_Ok;
   }
 
     return FT_Err_Ok;
   }
     FT_UNUSED( pathSpec );
     FT_UNUSED( face_index );
 
     FT_UNUSED( pathSpec );
     FT_UNUSED( face_index );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
 #else
     FSRef     ref;
     FT_Error  err;
 
 
     err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index );
 #else
     FSRef     ref;
     FT_Error  err;
 
 
     err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index );
-    if ( FT_Err_Ok != err )
+    if ( err )
       return err;
 
     if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone, NULL, NULL,
                                     pathSpec, NULL ) )
       return err;
 
     if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone, NULL, NULL,
                                     pathSpec, NULL ) )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     return FT_Err_Ok;
 #endif
 
     return FT_Err_Ok;
 #endif
 
 
     if ( noErr != FSPathMakeRef( pathname, &ref, FALSE ) )
 
 
     if ( noErr != FSPathMakeRef( pathname, &ref, FALSE ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     /* at present, no support for dfont format */
     err = FSOpenResourceFile( &ref, 0, NULL, fsRdPerm, res );
 
     /* at present, no support for dfont format */
     err = FSOpenResourceFile( &ref, 0, NULL, fsRdPerm, res );
   count_faces_scalable( char*  fond_data )
   {
     AsscEntry*  assoc;
   count_faces_scalable( char*  fond_data )
   {
     AsscEntry*  assoc;
-    FamRec*     fond;
     short       i, face, face_all;
 
 
     short       i, face, face_all;
 
 
-    fond     = (FamRec*)fond_data;
     face_all = EndianS16_BtoN( *( (short *)( fond_data +
                                              sizeof ( FamRec ) ) ) ) + 1;
     assoc    = (AsscEntry*)( fond_data + sizeof ( FamRec ) + 2 );
     face_all = EndianS16_BtoN( *( (short *)( fond_data +
                                              sizeof ( FamRec ) ) ) ) + 1;
     assoc    = (AsscEntry*)( fond_data + sizeof ( FamRec ) + 2 );
     /* We should not extract parent directory by string manipulation.      */
 
     if ( noErr != FSPathMakeRef( path_fond, &ref, FALSE ) )
     /* We should not extract parent directory by string manipulation.      */
 
     if ( noErr != FSPathMakeRef( path_fond, &ref, FALSE ) )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone,
                                     NULL, NULL, NULL, &par_ref ) )
 
     if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone,
                                     NULL, NULL, NULL, &par_ref ) )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( noErr != FSRefMakePath( &par_ref, path_lwfn, path_size ) )
 
     if ( noErr != FSRefMakePath( &par_ref, path_lwfn, path_size ) )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( ft_strlen( (char *)path_lwfn ) + 1 + base_lwfn[0] > path_size )
 
     if ( ft_strlen( (char *)path_lwfn ) + 1 + base_lwfn[0] > path_size )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* now we have absolute dirname in path_lwfn */
     ft_strcat( (char *)path_lwfn, "/" );
 
     /* now we have absolute dirname in path_lwfn */
     ft_strcat( (char *)path_lwfn, "/" );
     path_lwfn[dirname_len + base_lwfn[0]] = '\0';
 
     if ( noErr != FSPathMakeRef( path_lwfn, &ref, FALSE ) )
     path_lwfn[dirname_len + base_lwfn[0]] = '\0';
 
     if ( noErr != FSPathMakeRef( path_lwfn, &ref, FALSE ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone,
                                     NULL, NULL, NULL, NULL ) )
 
     if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone,
                                     NULL, NULL, NULL, NULL ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     return FT_Err_Ok;
   }
 
     return FT_Err_Ok;
   }
     {
       err = lookup_lwfn_by_fond( pathname, lwfn_file_name,
                                  buff, sizeof ( buff )  );
     {
       err = lookup_lwfn_by_fond( pathname, lwfn_file_name,
                                  buff, sizeof ( buff )  );
-      if ( FT_Err_Ok == err )
+      if ( !err )
         have_lwfn = 1;
     }
 
         have_lwfn = 1;
     }
 
       /* detect integer overflows */
       if ( total_size < old_total_size )
       {
       /* detect integer overflows */
       if ( total_size < old_total_size )
       {
-        error = FT_Err_Array_Too_Large;
+        error = FT_THROW( Array_Too_Large );
         goto Error;
       }
 
         goto Error;
       }
 
 
 
     if ( noErr != FT_FSPathMakeRes( pathname, &res ) )
 
 
     if ( noErr != FT_FSPathMakeRes( pathname, &res ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     pfb_data = NULL;
     pfb_size = 0;
 
     pfb_data = NULL;
     pfb_size = 0;
 
     sfnt = GetResource( TTAG_sfnt, sfnt_id );
     if ( sfnt == NULL )
 
     sfnt = GetResource( TTAG_sfnt, sfnt_id );
     if ( sfnt == NULL )
-      return FT_Err_Invalid_Handle;
+      return FT_THROW( Invalid_Handle );
 
     sfnt_size = (FT_ULong)GetHandleSize( sfnt );
     if ( FT_ALLOC( sfnt_data, (FT_Long)sfnt_size ) )
 
     sfnt_size = (FT_ULong)GetHandleSize( sfnt );
     if ( FT_ALLOC( sfnt_data, (FT_Long)sfnt_size ) )
                              FT_Long       face_index,
                              FT_Face*      aface )
   {
                              FT_Long       face_index,
                              FT_Face*      aface )
   {
-    FT_Error       error = FT_Err_Cannot_Open_Resource;
+    FT_Error       error = FT_ERR( Cannot_Open_Resource );
     ResFileRefNum  res_ref;
     ResourceIndex  res_index;
     Handle         fond;
     ResFileRefNum  res_ref;
     ResourceIndex  res_index;
     Handle         fond;
-    short          num_faces_in_res, num_faces_in_fond;
+    short          num_faces_in_res;
 
 
     if ( noErr != FT_FSPathMakeRes( pathname, &res_ref ) )
 
 
     if ( noErr != FT_FSPathMakeRes( pathname, &res_ref ) )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     UseResFile( res_ref );
     if ( ResError() )
 
     UseResFile( res_ref );
     if ( ResError() )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     num_faces_in_res = 0;
     for ( res_index = 1; ; ++res_index )
     {
 
     num_faces_in_res = 0;
     for ( res_index = 1; ; ++res_index )
     {
+      short  num_faces_in_fond;
+
+
       fond = Get1IndResource( TTAG_FOND, res_index );
       if ( ResError() )
         break;
       fond = Get1IndResource( TTAG_FOND, res_index );
       if ( ResError() )
         break;
     }
 
     CloseResFile( res_ref );
     }
 
     CloseResFile( res_ref );
-    if ( FT_Err_Ok == error && NULL != aface && NULL != *aface )
+    if ( !error && aface && *aface )
       (*aface)->num_faces = num_faces_in_res;
     return error;
   }
       (*aface)->num_faces = num_faces_in_res;
     return error;
   }
 
     GetResInfo( fond, &fond_id, &fond_type, fond_name );
     if ( ResError() != noErr || fond_type != TTAG_FOND )
 
     GetResInfo( fond, &fond_id, &fond_type, fond_name );
     if ( ResError() != noErr || fond_type != TTAG_FOND )
-      return FT_Err_Invalid_File_Format;
+      return FT_THROW( Invalid_File_Format );
 
     parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name, face_index );
 
 
     parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name, face_index );
 
 
         error = lookup_lwfn_by_fond( path_fond, lwfn_file_name,
                                      path_lwfn, sizeof ( path_lwfn ) );
 
         error = lookup_lwfn_by_fond( path_fond, lwfn_file_name,
                                      path_lwfn, sizeof ( path_lwfn ) );
-        if ( FT_Err_Ok == error )
+        if ( !error )
           have_lwfn = 1;
       }
     }
           have_lwfn = 1;
       }
     }
                                      face_index,
                                      aface );
     else
                                      face_index,
                                      aface );
     else
-      error = FT_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
 
   found_no_lwfn_file:
 
   found_no_lwfn_file:
-    if ( have_sfnt && FT_Err_Ok != error )
+    if ( have_sfnt && error )
       error = FT_New_Face_From_SFNT( library,
                                      sfnt_id,
                                      face_index,
       error = FT_New_Face_From_SFNT( library,
                                      sfnt_id,
                                      face_index,
 
     /* test for valid `library' and `aface' delayed to FT_Open_Face() */
     if ( !pathname )
 
     /* test for valid `library' and `aface' delayed to FT_Open_Face() */
     if ( !pathname )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     error  = FT_Err_Ok;
     *aface = NULL;
 
     error  = FT_Err_Ok;
     *aface = NULL;
 
 
     if ( !ref )
 
 
     if ( !ref )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     err = FSRefMakePath( ref, pathname, sizeof ( pathname ) );
     if ( err )
 
     err = FSRefMakePath( ref, pathname, sizeof ( pathname ) );
     if ( err )
-      error = FT_Err_Cannot_Open_Resource;
+      error = FT_THROW( Cannot_Open_Resource );
 
     error = FT_New_Face_From_Resource( library, pathname, face_index, aface );
     if ( error != 0 || *aface != NULL )
 
     error = FT_New_Face_From_Resource( library, pathname, face_index, aface );
     if ( error != 0 || *aface != NULL )
     FT_UNUSED( face_index );
     FT_UNUSED( aface );
 
     FT_UNUSED( face_index );
     FT_UNUSED( aface );
 
-    return FT_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
 #else
     FSRef  ref;
 
 
     if ( !spec || FSpMakeFSRef( spec, &ref ) != noErr )
 #else
     FSRef  ref;
 
 
     if ( !spec || FSpMakeFSRef( spec, &ref ) != noErr )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
     else
       return FT_New_Face_From_FSRef( library, &ref, face_index, aface );
 #endif
   }
 
     else
       return FT_New_Face_From_FSRef( library, &ref, face_index, aface );
 #endif
   }
 
+#endif /* FT_MACINTOSH */
+
 
 /* END */
 
 /* END */
index 0307729..18ff879 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Multiple Master font support (body).                                 */
 /*                                                                         */
 /*                                                                         */
 /*    Multiple Master font support (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003, 2004, 2009 by                               */
+/*  Copyright 1996-2001, 2003, 2004, 2009, 2013 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -17,6 +17,8 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_MULTIPLE_MASTERS_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_MULTIPLE_MASTERS_H
 #include FT_MULTIPLE_MASTERS_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_MULTIPLE_MASTERS_H
@@ -42,9 +44,9 @@
     *aservice = NULL;
 
     if ( !face )
     *aservice = NULL;
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
 
-    error = FT_Err_Invalid_Argument;
+    error = FT_ERR( Invalid_Argument );
 
     if ( FT_HAS_MULTIPLE_MASTERS( face ) )
     {
 
     if ( FT_HAS_MULTIPLE_MASTERS( face ) )
     {
@@ -73,7 +75,7 @@
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_ERR( Invalid_Argument );
       if ( service->get_mm )
         error = service->get_mm( face, amaster );
     }
       if ( service->get_mm )
         error = service->get_mm( face, amaster );
     }
@@ -95,7 +97,7 @@
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_ERR( Invalid_Argument );
       if ( service->get_mm_var )
         error = service->get_mm_var( face, amaster );
     }
       if ( service->get_mm_var )
         error = service->get_mm_var( face, amaster );
     }
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_ERR( Invalid_Argument );
       if ( service->set_mm_design )
         error = service->set_mm_design( face, num_coords, coords );
     }
       if ( service->set_mm_design )
         error = service->set_mm_design( face, num_coords, coords );
     }
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_ERR( Invalid_Argument );
       if ( service->set_var_design )
         error = service->set_var_design( face, num_coords, coords );
     }
       if ( service->set_var_design )
         error = service->set_var_design( face, num_coords, coords );
     }
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_ERR( Invalid_Argument );
       if ( service->set_mm_blend )
          error = service->set_mm_blend( face, num_coords, coords );
     }
       if ( service->set_mm_blend )
          error = service->set_mm_blend( face, num_coords, coords );
     }
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
     error = ft_face_get_mm_service( face, &service );
     if ( !error )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_ERR( Invalid_Argument );
       if ( service->set_mm_blend )
          error = service->set_mm_blend( face, num_coords, coords );
     }
       if ( service->set_mm_blend )
          error = service->set_mm_blend( face, num_coords, coords );
     }
diff --git a/reactos/lib/3rdparty/freetype/src/base/ftnames.c b/reactos/lib/3rdparty/freetype/src/base/ftnames.c
deleted file mode 100644 (file)
index 7fde5c4..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftnames.c                                                              */
-/*                                                                         */
-/*    Simple interface to access SFNT name tables (which are used          */
-/*    to hold font names, copyright info, notices, etc.) (body).           */
-/*                                                                         */
-/*    This is _not_ used to retrieve glyph names!                          */
-/*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#include <ft2build.h>
-#include FT_SFNT_NAMES_H
-#include FT_INTERNAL_TRUETYPE_TYPES_H
-#include FT_INTERNAL_STREAM_H
-
-
-#ifdef TT_CONFIG_OPTION_SFNT_NAMES
-
-
-  /* documentation is in ftnames.h */
-
-  FT_EXPORT_DEF( FT_UInt )
-  FT_Get_Sfnt_Name_Count( FT_Face  face )
-  {
-    return (face && FT_IS_SFNT( face )) ? ((TT_Face)face)->num_names : 0;
-  }
-
-
-  /* documentation is in ftnames.h */
-
-  FT_EXPORT_DEF( FT_Error )
-  FT_Get_Sfnt_Name( FT_Face       face,
-                    FT_UInt       idx,
-                    FT_SfntName  *aname )
-  {
-    FT_Error  error = FT_Err_Invalid_Argument;
-
-
-    if ( aname && face && FT_IS_SFNT( face ) )
-    {
-      TT_Face  ttface = (TT_Face)face;
-
-
-      if ( idx < (FT_UInt)ttface->num_names )
-      {
-        TT_NameEntryRec*  entry = ttface->name_table.names + idx;
-
-
-        /* load name on demand */
-        if ( entry->stringLength > 0 && entry->string == NULL )
-        {
-          FT_Memory  memory = face->memory;
-          FT_Stream  stream = face->stream;
-
-
-          if ( FT_NEW_ARRAY  ( entry->string, entry->stringLength ) ||
-               FT_STREAM_SEEK( entry->stringOffset )                ||
-               FT_STREAM_READ( entry->string, entry->stringLength ) )
-          {
-            FT_FREE( entry->string );
-            entry->stringLength = 0;
-          }
-        }
-
-        aname->platform_id = entry->platformID;
-        aname->encoding_id = entry->encodingID;
-        aname->language_id = entry->languageID;
-        aname->name_id     = entry->nameID;
-        aname->string      = (FT_Byte*)entry->string;
-        aname->string_len  = entry->stringLength;
-
-        error = FT_Err_Ok;
-      }
-    }
-
-    return error;
-  }
-
-
-#endif /* TT_CONFIG_OPTION_SFNT_NAMES */
-
-
-/* END */
index cb44b8c..157bf45 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    The FreeType private base classes (body).                            */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType private base classes (body).                            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,6 +29,7 @@
 #include FT_TRUETYPE_TAGS_H
 #include FT_TRUETYPE_IDS_H
 
 #include FT_TRUETYPE_TAGS_H
 #include FT_TRUETYPE_IDS_H
 
+#include FT_SERVICE_PROPERTIES_H
 #include FT_SERVICE_SFNT_H
 #include FT_SERVICE_POSTSCRIPT_NAME_H
 #include FT_SERVICE_GLYPH_DICT_H
 #include FT_SERVICE_SFNT_H
 #include FT_SERVICE_POSTSCRIPT_NAME_H
 #include FT_SERVICE_GLYPH_DICT_H
 #include "ftbase.h"
 #endif
 
 #include "ftbase.h"
 #endif
 
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+#include FT_BITMAP_H
+
+#if defined( _MSC_VER )      /* Visual C++ (and Intel C++)   */
+  /* We disable the warning `conversion from XXX to YYY,     */
+  /* possible loss of data' in order to compile cleanly with */
+  /* the maximum level of warnings: `md5.c' is non-FreeType  */
+  /* code, and it gets used during development builds only.  */
+#pragma warning( push )
+#pragma warning( disable : 4244 )
+#endif /* _MSC_VER */
+
+  /* it's easiest to include `md5.c' directly */
+#define free  md5_free /* suppress a shadow warning */
+#include "md5.c"
+#undef free
+
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
+
 #define GRID_FIT_METRICS
 
 
 #define GRID_FIT_METRICS
 
 
   {
     FT_Error   error;
     FT_Memory  memory;
   {
     FT_Error   error;
     FT_Memory  memory;
-    FT_Stream  stream;
+    FT_Stream  stream = NULL;
 
 
     *astream = 0;
 
     if ( !library )
 
 
     *astream = 0;
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !args )
 
     if ( !args )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     memory = library->memory;
 
 
     memory = library->memory;
 
                             (const FT_Byte*)args->memory_base,
                             args->memory_size );
     }
                             (const FT_Byte*)args->memory_base,
                             args->memory_size );
     }
+
+#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
+
     else if ( args->flags & FT_OPEN_PATHNAME )
     {
       /* create a normal system stream */
     else if ( args->flags & FT_OPEN_PATHNAME )
     {
       /* create a normal system stream */
       FT_FREE( stream );
       stream = args->stream;
     }
       FT_FREE( stream );
       stream = args->stream;
     }
+
+#endif
+
     else
     else
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
 
     if ( error )
       FT_FREE( stream );
 
     if ( error )
       FT_FREE( stream );
     FT_Driver        driver;
     FT_Driver_Class  clazz;
     FT_Memory        memory;
     FT_Driver        driver;
     FT_Driver_Class  clazz;
     FT_Memory        memory;
-    FT_GlyphSlot     slot;
+    FT_GlyphSlot     slot = NULL;
 
 
     if ( !face || !face->driver )
 
 
     if ( !face || !face->driver )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     driver = face->driver;
     clazz  = driver->clazz;
 
     driver = face->driver;
     clazz  = driver->clazz;
           else
             prev->next = cur->next;
 
           else
             prev->next = cur->next;
 
+          /* finalize client-specific data */
+          if ( slot->generic.finalizer )
+            slot->generic.finalizer( slot );
+
           ft_glyphslot_done( slot );
           FT_FREE( slot );
           break;
           ft_glyphslot_done( slot );
           FT_FREE( slot );
           break;
     FT_Library    library;
     FT_Bool       autohint = FALSE;
     FT_Module     hinter;
     FT_Library    library;
     FT_Bool       autohint = FALSE;
     FT_Module     hinter;
+    TT_Face       ttface = (TT_Face)face;
 
 
     if ( !face || !face->size || !face->glyph )
 
 
     if ( !face || !face->size || !face->glyph )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     /* The validity test for `glyph_index' is performed by the */
     /* font drivers.                                           */
 
     /* The validity test for `glyph_index' is performed by the */
     /* font drivers.                                           */
      * - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't
      *   have a native font hinter.
      *
      * - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't
      *   have a native font hinter.
      *
-     * - Otherwise, auto-hint for LIGHT hinting mode.
+     * - Otherwise, auto-hint for LIGHT hinting mode or if there isn't
+     *   any hinting bytecode in the TrueType/OpenType font.
      *
      * - Exception: The font is `tricky' and requires the native hinter to
      *   load properly.
      *
      * - Exception: The font is `tricky' and requires the native hinter to
      *   load properly.
          FT_DRIVER_IS_SCALABLE( driver )                  &&
          FT_DRIVER_USES_OUTLINES( driver )                &&
          !FT_IS_TRICKY( face )                            &&
          FT_DRIVER_IS_SCALABLE( driver )                  &&
          FT_DRIVER_USES_OUTLINES( driver )                &&
          !FT_IS_TRICKY( face )                            &&
-         ( ( face->internal->transform_matrix.yx == 0 &&
+         ( ( load_flags & FT_LOAD_IGNORE_TRANSFORM )    ||
+           ( face->internal->transform_matrix.yx == 0 &&
              face->internal->transform_matrix.xx != 0 ) ||
            ( face->internal->transform_matrix.xx == 0 &&
              face->internal->transform_matrix.yx != 0 ) ) )
              face->internal->transform_matrix.xx != 0 ) ||
            ( face->internal->transform_matrix.xx == 0 &&
              face->internal->transform_matrix.yx != 0 ) ) )
         FT_Render_Mode  mode = FT_LOAD_TARGET_MODE( load_flags );
 
 
         FT_Render_Mode  mode = FT_LOAD_TARGET_MODE( load_flags );
 
 
-        if ( mode == FT_RENDER_MODE_LIGHT             ||
-             face->internal->ignore_unpatented_hinter )
+        /* the check for `num_locations' assures that we actually    */
+        /* test for instructions in a TTF and not in a CFF-based OTF */
+        if ( mode == FT_RENDER_MODE_LIGHT                       ||
+             face->internal->ignore_unpatented_hinter           ||
+             ( FT_IS_SFNT( face )                             &&
+               ttface->num_locations                          &&
+               ttface->max_profile.maxSizeOfInstructions == 0 ) )
           autohint = TRUE;
       }
     }
 
     if ( autohint )
     {
           autohint = TRUE;
       }
     }
 
     if ( autohint )
     {
-      FT_AutoHinter_Service  hinting;
+      FT_AutoHinter_Interface  hinting;
 
 
       /* try to load embedded bitmaps first if available            */
 
 
       /* try to load embedded bitmaps first if available            */
         internal->transform_flags = 0;
 
         /* load auto-hinted outline */
         internal->transform_flags = 0;
 
         /* load auto-hinted outline */
-        hinting = (FT_AutoHinter_Service)hinter->clazz->module_interface;
+        hinting = (FT_AutoHinter_Interface)hinter->clazz->module_interface;
 
         error   = hinting->load_glyph( (FT_AutoHinter)hinter,
                                        slot, face->size,
 
         error   = hinting->load_glyph( (FT_AutoHinter)hinter,
                                        slot, face->size,
         else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
         {
           /* apply `standard' transformation if no renderer is available */
         else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
         {
           /* apply `standard' transformation if no renderer is available */
-          if ( &internal->transform_matrix )
+          if ( internal->transform_flags & 1 )
             FT_Outline_Transform( &slot->outline,
                                   &internal->transform_matrix );
 
             FT_Outline_Transform( &slot->outline,
                                   &internal->transform_matrix );
 
-          if ( &internal->transform_delta )
+          if ( internal->transform_flags & 2 )
             FT_Outline_Translate( &slot->outline,
                                   internal->transform_delta.x,
                                   internal->transform_delta.y );
             FT_Outline_Translate( &slot->outline,
                                   internal->transform_delta.x,
                                   internal->transform_delta.y );
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     glyph_index = (FT_UInt)char_code;
     if ( face->charmap )
 
     glyph_index = (FT_UInt)char_code;
     if ( face->charmap )
     first = face->charmaps;
 
     if ( !first )
     first = face->charmaps;
 
     if ( !first )
-      return FT_Err_Invalid_CharMap_Handle;
+      return FT_THROW( Invalid_CharMap_Handle );
 
     /*
      *  The original TrueType specification(s) only specified charmap
 
     /*
      *  The original TrueType specification(s) only specified charmap
       }
     }
 
       }
     }
 
-    return FT_Err_Invalid_CharMap_Handle;
+    return FT_THROW( Invalid_CharMap_Handle );
   }
 
 
   }
 
 
     if ( FT_ALLOC( face, clazz->face_object_size ) )
       goto Fail;
 
     if ( FT_ALLOC( face, clazz->face_object_size ) )
       goto Fail;
 
+    face->driver = driver;
+    face->memory = memory;
+    face->stream = stream;
+
     if ( FT_NEW( internal ) )
       goto Fail;
 
     face->internal = internal;
 
     if ( FT_NEW( internal ) )
       goto Fail;
 
     face->internal = internal;
 
-    face->driver   = driver;
-    face->memory   = memory;
-    face->stream   = stream;
-
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     {
       int  i;
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     {
       int  i;
     /* is returned.                                                      */
 
     /* no error should happen, but we want to play safe */
     /* is returned.                                                      */
 
     /* no error should happen, but we want to play safe */
-    if ( error2 && error2 != FT_Err_Invalid_CharMap_Handle )
+    if ( error2 && FT_ERR_NEQ( error2, Invalid_CharMap_Handle ) )
     {
       error = error2;
       goto Fail;
     {
       error = error2;
       goto Fail;
   /* there's a Mac-specific extended implementation of FT_New_Face() */
   /* in src/base/ftmac.c                                             */
 
   /* there's a Mac-specific extended implementation of FT_New_Face() */
   /* in src/base/ftmac.c                                             */
 
-#if !defined( FT_MACINTOSH ) || defined( DARWIN_NO_CARBON )
+#ifndef FT_MACINTOSH
 
   /* documentation is in freetype.h */
 
 
   /* documentation is in freetype.h */
 
 
     /* test for valid `library' and `aface' delayed to FT_Open_Face() */
     if ( !pathname )
 
     /* test for valid `library' and `aface' delayed to FT_Open_Face() */
     if ( !pathname )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     args.flags    = FT_OPEN_PATHNAME;
     args.pathname = (char*)pathname;
 
     args.flags    = FT_OPEN_PATHNAME;
     args.pathname = (char*)pathname;
     return FT_Open_Face( library, &args, face_index, aface );
   }
 
     return FT_Open_Face( library, &args, face_index, aface );
   }
 
-#endif  /* defined( FT_MACINTOSH ) && !defined( DARWIN_NO_CARBON ) */
+#endif
 
 
   /* documentation is in freetype.h */
 
 
   /* documentation is in freetype.h */
 
     /* test for valid `library' and `face' delayed to FT_Open_Face() */
     if ( !file_base )
 
     /* test for valid `library' and `face' delayed to FT_Open_Face() */
     if ( !file_base )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     args.flags       = FT_OPEN_MEMORY;
     args.memory_base = file_base;
 
     args.flags       = FT_OPEN_MEMORY;
     args.memory_base = file_base;
   {
     FT_Error   error;
     FT_Memory  memory;
   {
     FT_Error   error;
     FT_Memory  memory;
-    FT_Stream  stream;
+    FT_Stream  stream = NULL;
 
 
     if ( !library )
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !base )
 
     if ( !base )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     *astream = 0;
     memory = library->memory;
 
     *astream = 0;
     memory = library->memory;
     if ( FT_READ_ULONG( tag ) )
       return error;
     if ( tag != TTAG_typ1 )
     if ( FT_READ_ULONG( tag ) )
       return error;
     if ( tag != TTAG_typ1 )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     if ( FT_READ_USHORT( numTables ) )
       return error;
 
     if ( FT_READ_USHORT( numTables ) )
       return error;
       if ( face_index >= 0 && pstable_index == face_index )
         return FT_Err_Ok;
     }
       if ( face_index >= 0 && pstable_index == face_index )
         return FT_Err_Ok;
     }
-    return FT_Err_Table_Missing;
+    return FT_THROW( Table_Missing );
   }
 
 
   }
 
 
     FT_ULong   offset, length;
     FT_Long    pos;
     FT_Bool    is_sfnt_cid;
     FT_ULong   offset, length;
     FT_Long    pos;
     FT_Bool    is_sfnt_cid;
-    FT_Byte*   sfnt_ps;
+    FT_Byte*   sfnt_ps = NULL;
 
     FT_UNUSED( num_params );
     FT_UNUSED( params );
 
     FT_UNUSED( num_params );
     FT_UNUSED( params );
     error = open_face_from_buffer( library,
                                    sfnt_ps,
                                    length,
     error = open_face_from_buffer( library,
                                    sfnt_ps,
                                    length,
-                                   face_index < 0 ? face_index : 0,
+                                   FT_MIN( face_index, 0 ),
                                    is_sfnt_cid ? "cid" : "type1",
                                    aface );
   Exit:
                                    is_sfnt_cid ? "cid" : "type1",
                                    aface );
   Exit:
       FT_Error  error1;
 
 
       FT_Error  error1;
 
 
-      if ( error == FT_Err_Unknown_File_Format )
+      if ( FT_ERR_EQ( error, Unknown_File_Format ) )
       {
         error1 = FT_Stream_Seek( stream, pos );
         if ( error1 )
       {
         error1 = FT_Stream_Seek( stream, pos );
         if ( error1 )
   }
 
 
   }
 
 
-#if !defined( FT_MACINTOSH ) || defined( DARWIN_NO_CARBON )
+#ifndef FT_MACINTOSH
 
   /* The resource header says we've got resource_cnt `POST' (type1) */
   /* resources in this file.  They all need to be coalesced into    */
 
   /* The resource header says we've got resource_cnt `POST' (type1) */
   /* resources in this file.  They all need to be coalesced into    */
                           FT_Long     face_index,
                           FT_Face    *aface )
   {
                           FT_Long     face_index,
                           FT_Face    *aface )
   {
-    FT_Error   error  = FT_Err_Cannot_Open_Resource;
+    FT_Error   error  = FT_ERR( Cannot_Open_Resource );
     FT_Memory  memory = library->memory;
     FT_Memory  memory = library->memory;
-    FT_Byte*   pfb_data;
+    FT_Byte*   pfb_data = NULL;
     int        i, type, flags;
     FT_Long    len;
     FT_Long    pfb_len, pfb_pos, pfb_lenpos;
     int        i, type, flags;
     FT_Long    len;
     FT_Long    pfb_len, pfb_pos, pfb_lenpos;
         pfb_data[pfb_pos++] = 0;
       }
 
         pfb_data[pfb_pos++] = 0;
       }
 
-      error = FT_Err_Cannot_Open_Resource;
+      error = FT_ERR( Cannot_Open_Resource );
       if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len )
         goto Exit2;
 
       if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len )
         goto Exit2;
 
                           FT_Face    *aface )
   {
     FT_Memory  memory = library->memory;
                           FT_Face    *aface )
   {
     FT_Memory  memory = library->memory;
-    FT_Byte*   sfnt_data;
+    FT_Byte*   sfnt_data = NULL;
     FT_Error   error;
     FT_Long    flag_offset;
     FT_Long    rlen;
     FT_Error   error;
     FT_Long    flag_offset;
     FT_Long    rlen;
     if ( face_index == -1 )
       face_index = 0;
     if ( face_index >= resource_cnt )
     if ( face_index == -1 )
       face_index = 0;
     if ( face_index >= resource_cnt )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     flag_offset = offsets[face_index];
     error = FT_Stream_Seek( stream, flag_offset );
 
     flag_offset = offsets[face_index];
     error = FT_Stream_Seek( stream, flag_offset );
     if ( FT_READ_LONG( rlen ) )
       goto Exit;
     if ( rlen == -1 )
     if ( FT_READ_LONG( rlen ) )
       goto Exit;
     if ( rlen == -1 )
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     error = open_face_PS_from_sfnt_stream( library,
                                            stream,
 
     error = open_face_PS_from_sfnt_stream( library,
                                            stream,
 
 
     if ( NULL == stream )
 
 
     if ( NULL == stream )
-      return FT_Err_Invalid_Stream_Operation;
+      return FT_THROW( Invalid_Stream_Operation );
 
     error = FT_Stream_Seek( stream, 0 );
     if ( error )
 
     error = FT_Stream_Seek( stream, 0 );
     if ( error )
                     header[ 1] >  33 ||
                     header[63] !=  0 ||
          header[2 + header[1]] !=  0 )
                     header[ 1] >  33 ||
                     header[63] !=  0 ||
          header[2 + header[1]] !=  0 )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     dlen = ( header[0x53] << 24 ) |
            ( header[0x54] << 16 ) |
 
     dlen = ( header[0x53] << 24 ) |
            ( header[0x54] << 16 ) |
 #define FT_COMPONENT  trace_raccess
 
     FT_Memory  memory = library->memory;
 #define FT_COMPONENT  trace_raccess
 
     FT_Memory  memory = library->memory;
-    FT_Error   error  = FT_Err_Unknown_File_Format;
+    FT_Error   error  = FT_ERR( Unknown_File_Format );
     int        i;
 
     char *     file_names[FT_RACCESS_N_RULES];
     int        i;
 
     char *     file_names[FT_RACCESS_N_RULES];
 
     for ( i = 0; i < FT_RACCESS_N_RULES; i++ )
     {
 
     for ( i = 0; i < FT_RACCESS_N_RULES; i++ )
     {
-      is_darwin_vfs = raccess_rule_by_darwin_vfs( i );
+      is_darwin_vfs = ft_raccess_rule_by_darwin_vfs( library, i );
       if ( is_darwin_vfs && vfs_rfork_has_no_font )
       {
         FT_TRACE3(( "Skip rule %d: darwin vfs resource fork"
                     " is already checked and"
                     " no font is found\n", i ));
         continue;
       if ( is_darwin_vfs && vfs_rfork_has_no_font )
       {
         FT_TRACE3(( "Skip rule %d: darwin vfs resource fork"
                     " is already checked and"
                     " no font is found\n", i ));
         continue;
-      }  
+      }
 
       if ( errors[i] )
       {
 
       if ( errors[i] )
       {
                   i, args2.pathname, offsets[i] ));
 
       error = FT_Stream_New( library, &args2, &stream2 );
                   i, args2.pathname, offsets[i] ));
 
       error = FT_Stream_New( library, &args2, &stream2 );
-      if ( is_darwin_vfs && error == FT_Err_Cannot_Open_Stream )
+      if ( is_darwin_vfs && FT_ERR_EQ( error, Cannot_Open_Stream ) )
         vfs_rfork_has_no_font = TRUE;
 
       if ( error )
         vfs_rfork_has_no_font = TRUE;
 
       if ( error )
 
     /* Caller (load_mac_face) requires FT_Err_Unknown_File_Format. */
     if ( error )
 
     /* Caller (load_mac_face) requires FT_Err_Unknown_File_Format. */
     if ( error )
-      error = FT_Err_Unknown_File_Format;
+      error = FT_ERR( Unknown_File_Format );
 
     return error;
 
 
     return error;
 
 
 
     error = IsMacBinary( library, stream, face_index, aface );
 
 
     error = IsMacBinary( library, stream, face_index, aface );
-    if ( FT_ERROR_BASE( error ) == FT_Err_Unknown_File_Format )
+    if ( FT_ERR_EQ( error, Unknown_File_Format ) )
     {
 
 #undef  FT_COMPONENT
     {
 
 #undef  FT_COMPONENT
 
     }
 
 
     }
 
-    if ( ( FT_ERROR_BASE( error ) == FT_Err_Unknown_File_Format      ||
-           FT_ERROR_BASE( error ) == FT_Err_Invalid_Stream_Operation ) &&
-         ( args->flags & FT_OPEN_PATHNAME )                            )
+    if ( ( FT_ERR_EQ( error, Unknown_File_Format )      ||
+           FT_ERR_EQ( error, Invalid_Stream_Operation ) ) &&
+         ( args->flags & FT_OPEN_PATHNAME )               )
       error = load_face_in_embedded_rfork( library, stream,
                                            face_index, aface, args );
     return error;
       error = load_face_in_embedded_rfork( library, stream,
                                            face_index, aface, args );
     return error;
                 FT_Face             *aface )
   {
     FT_Error     error;
                 FT_Face             *aface )
   {
     FT_Error     error;
-    FT_Driver    driver;
-    FT_Memory    memory;
+    FT_Driver    driver = NULL;
+    FT_Memory    memory = NULL;
     FT_Stream    stream = NULL;
     FT_Face      face   = NULL;
     FT_ListNode  node   = NULL;
     FT_Stream    stream = NULL;
     FT_Face      face   = NULL;
     FT_ListNode  node   = NULL;
     /* FT_Stream_New()                     */
 
     if ( ( !aface && face_index >= 0 ) || !args )
     /* FT_Stream_New()                     */
 
     if ( ( !aface && face_index >= 0 ) || !args )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     external_stream = FT_BOOL( ( args->flags & FT_OPEN_STREAM ) &&
                                args->stream                     );
 
     external_stream = FT_BOOL( ( args->flags & FT_OPEN_STREAM ) &&
                                args->stream                     );
           goto Success;
       }
       else
           goto Success;
       }
       else
-        error = FT_Err_Invalid_Handle;
+        error = FT_THROW( Invalid_Handle );
 
       FT_Stream_Free( stream, external_stream );
       goto Fail;
     }
     else
     {
 
       FT_Stream_Free( stream, external_stream );
       goto Fail;
     }
     else
     {
+      error = FT_ERR( Missing_Module );
+
       /* check each font driver for an appropriate format */
       cur   = library->modules;
       limit = cur + library->num_modules;
 
       /* check each font driver for an appropriate format */
       cur   = library->modules;
       limit = cur + library->num_modules;
 
-
       for ( ; cur < limit; cur++ )
       {
         /* not all modules are font drivers, so check... */
       for ( ; cur < limit; cur++ )
       {
         /* not all modules are font drivers, so check... */
 
 #ifdef FT_CONFIG_OPTION_MAC_FONTS
           if ( ft_strcmp( cur[0]->clazz->module_name, "truetype" ) == 0 &&
 
 #ifdef FT_CONFIG_OPTION_MAC_FONTS
           if ( ft_strcmp( cur[0]->clazz->module_name, "truetype" ) == 0 &&
-               FT_ERROR_BASE( error ) == FT_Err_Table_Missing           )
+               FT_ERR_EQ( error, Table_Missing )                        )
           {
             /* TrueType but essential tables are missing */
             if ( FT_Stream_Seek( stream, 0 ) )
           {
             /* TrueType but essential tables are missing */
             if ( FT_Stream_Seek( stream, 0 ) )
           }
 #endif
 
           }
 #endif
 
-          if ( FT_ERROR_BASE( error ) != FT_Err_Unknown_File_Format )
+          if ( FT_ERR_NEQ( error, Unknown_File_Format ) )
             goto Fail3;
         }
       }
 
             goto Fail3;
         }
       }
 
-  Fail3:
-    /* If we are on the mac, and we get an FT_Err_Invalid_Stream_Operation */
-    /* it may be because we have an empty data fork, so we need to check   */
-    /* the resource fork.                                                  */
-    if ( FT_ERROR_BASE( error ) != FT_Err_Cannot_Open_Stream       &&
-         FT_ERROR_BASE( error ) != FT_Err_Unknown_File_Format      &&
-         FT_ERROR_BASE( error ) != FT_Err_Invalid_Stream_Operation )
-      goto Fail2;
+    Fail3:
+      /* If we are on the mac, and we get an                          */
+      /* FT_Err_Invalid_Stream_Operation it may be because we have an */
+      /* empty data fork, so we need to check the resource fork.      */
+      if ( FT_ERR_NEQ( error, Cannot_Open_Stream )       &&
+           FT_ERR_NEQ( error, Unknown_File_Format )      &&
+           FT_ERR_NEQ( error, Invalid_Stream_Operation ) )
+        goto Fail2;
 
 #if !defined( FT_MACINTOSH ) && defined( FT_CONFIG_OPTION_MAC_FONTS )
 
 #if !defined( FT_MACINTOSH ) && defined( FT_CONFIG_OPTION_MAC_FONTS )
-    error = load_mac_face( library, stream, face_index, aface, args );
-    if ( !error )
-    {
-      /* We don't want to go to Success here.  We've already done that. */
-      /* On the other hand, if we succeeded we still need to close this */
-      /* stream (we opened a different stream which extracted the       */
-      /* interesting information out of this stream here.  That stream  */
-      /* will still be open and the face will point to it).             */
-      FT_Stream_Free( stream, external_stream );
-      return error;
-    }
+      error = load_mac_face( library, stream, face_index, aface, args );
+      if ( !error )
+      {
+        /* We don't want to go to Success here.  We've already done that. */
+        /* On the other hand, if we succeeded we still need to close this */
+        /* stream (we opened a different stream which extracted the       */
+        /* interesting information out of this stream here.  That stream  */
+        /* will still be open and the face will point to it).             */
+        FT_Stream_Free( stream, external_stream );
+        return error;
+      }
 
 
-    if ( FT_ERROR_BASE( error ) != FT_Err_Unknown_File_Format )
-      goto Fail2;
+      if ( FT_ERR_NEQ( error, Unknown_File_Format ) )
+        goto Fail2;
 #endif  /* !FT_MACINTOSH && FT_CONFIG_OPTION_MAC_FONTS */
 
       /* no driver is able to handle this format */
 #endif  /* !FT_MACINTOSH && FT_CONFIG_OPTION_MAC_FONTS */
 
       /* no driver is able to handle this format */
-      error = FT_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
 
   Fail2:
       FT_Stream_Free( stream, external_stream );
 
   Fail2:
       FT_Stream_Free( stream, external_stream );
     goto Exit;
 
   Fail:
     goto Exit;
 
   Fail:
-    FT_Done_Face( face );
+    if ( node )
+      FT_Done_Face( face );    /* face must be in the driver's list */
+    else if ( face )
+      destroy_face( memory, face, driver );
 
   Exit:
     FT_TRACE4(( "FT_Open_Face: Return %d\n", error ));
 
   Exit:
     FT_TRACE4(( "FT_Open_Face: Return %d\n", error ));
     /* test for valid `face' delayed to FT_Attach_Stream() */
 
     if ( !filepathname )
     /* test for valid `face' delayed to FT_Attach_Stream() */
 
     if ( !filepathname )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     open.stream   = NULL;
     open.flags    = FT_OPEN_PATHNAME;
 
     open.stream   = NULL;
     open.flags    = FT_OPEN_PATHNAME;
     /* test for valid `parameters' delayed to FT_Stream_New() */
 
     if ( !face )
     /* test for valid `parameters' delayed to FT_Stream_New() */
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     driver = face->driver;
     if ( !driver )
 
     driver = face->driver;
     if ( !driver )
-      return FT_Err_Invalid_Driver_Handle;
+      return FT_THROW( Invalid_Driver_Handle );
 
     error = FT_Stream_New( driver->root.library, parameters, &stream );
     if ( error )
 
     error = FT_Stream_New( driver->root.library, parameters, &stream );
     if ( error )
     /* we implement FT_Attach_Stream in each driver through the */
     /* `attach_file' interface                                  */
 
     /* we implement FT_Attach_Stream in each driver through the */
     /* `attach_file' interface                                  */
 
-    error = FT_Err_Unimplemented_Feature;
+    error = FT_ERR( Unimplemented_Feature );
     clazz = driver->clazz;
     if ( clazz->attach_file )
       error = clazz->attach_file( face, stream );
     clazz = driver->clazz;
     if ( clazz->attach_file )
       error = clazz->attach_file( face, stream );
     FT_ListNode  node;
 
 
     FT_ListNode  node;
 
 
-    error = FT_Err_Invalid_Face_Handle;
+    error = FT_ERR( Invalid_Face_Handle );
     if ( face && face->driver )
     {
       face->internal->refcount--;
     if ( face && face->driver )
     {
       face->internal->refcount--;
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( !asize )
 
     if ( !asize )
-      return FT_Err_Invalid_Size_Handle;
+      return FT_THROW( Invalid_Size_Handle );
 
     if ( !face->driver )
 
     if ( !face->driver )
-      return FT_Err_Invalid_Driver_Handle;
+      return FT_THROW( Invalid_Driver_Handle );
 
     *asize = 0;
 
 
     *asize = 0;
 
 
 
     if ( !size )
 
 
     if ( !size )
-      return FT_Err_Invalid_Size_Handle;
+      return FT_THROW( Invalid_Size_Handle );
 
     face = size->face;
     if ( !face )
 
     face = size->face;
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     driver = face->driver;
     if ( !driver )
 
     driver = face->driver;
     if ( !driver )
-      return FT_Err_Invalid_Driver_Handle;
+      return FT_THROW( Invalid_Driver_Handle );
 
     memory = driver->root.memory;
 
 
     memory = driver->root.memory;
 
       destroy_size( memory, size, driver );
     }
     else
       destroy_size( memory, size, driver );
     }
     else
-      error = FT_Err_Invalid_Size_Handle;
+      error = FT_THROW( Invalid_Size_Handle );
 
     return error;
   }
 
     return error;
   }
 
 
     if ( !FT_HAS_FIXED_SIZES( face ) )
 
 
     if ( !FT_HAS_FIXED_SIZES( face ) )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     /* FT_Bitmap_Size doesn't provide enough info... */
     if ( req->type != FT_SIZE_REQUEST_TYPE_NOMINAL )
 
     /* FT_Bitmap_Size doesn't provide enough info... */
     if ( req->type != FT_SIZE_REQUEST_TYPE_NOMINAL )
-      return FT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 
     w = FT_REQUEST_WIDTH ( req );
     h = FT_REQUEST_HEIGHT( req );
 
     w = FT_REQUEST_WIDTH ( req );
     h = FT_REQUEST_HEIGHT( req );
 
       if ( w == FT_PIX_ROUND( bsize->x_ppem ) || ignore_width )
       {
 
       if ( w == FT_PIX_ROUND( bsize->x_ppem ) || ignore_width )
       {
+        FT_TRACE3(( "FT_Match_Size: bitmap strike %d matches\n", i ));
+
         if ( size_index )
           *size_index = (FT_ULong)i;
 
         if ( size_index )
           *size_index = (FT_ULong)i;
 
       }
     }
 
       }
     }
 
-    return FT_Err_Invalid_Pixel_Size;
+    return FT_THROW( Invalid_Pixel_Size );
   }
 
 
   }
 
 
       metrics->height      = bsize->height << 6;
       metrics->max_advance = bsize->x_ppem;
     }
       metrics->height      = bsize->height << 6;
       metrics->max_advance = bsize->x_ppem;
     }
+
+    FT_TRACE5(( "FT_Select_Metrics:\n" ));
+    FT_TRACE5(( "  x scale: %d (%f)\n",
+                metrics->x_scale, metrics->x_scale / 65536.0 ));
+    FT_TRACE5(( "  y scale: %d (%f)\n",
+                metrics->y_scale, metrics->y_scale / 65536.0 ));
+    FT_TRACE5(( "  ascender: %f\n",    metrics->ascender / 64.0 ));
+    FT_TRACE5(( "  descender: %f\n",   metrics->descender / 64.0 ));
+    FT_TRACE5(( "  height: %f\n",      metrics->height / 64.0 ));
+    FT_TRACE5(( "  max advance: %f\n", metrics->max_advance / 64.0 ));
+    FT_TRACE5(( "  x ppem: %d\n",      metrics->x_ppem ));
+    FT_TRACE5(( "  y ppem: %d\n",      metrics->y_ppem ));
   }
 
 
   }
 
 
       metrics->x_scale = 1L << 16;
       metrics->y_scale = 1L << 16;
     }
       metrics->x_scale = 1L << 16;
       metrics->y_scale = 1L << 16;
     }
+
+    FT_TRACE5(( "FT_Request_Metrics:\n" ));
+    FT_TRACE5(( "  x scale: %d (%f)\n",
+                metrics->x_scale, metrics->x_scale / 65536.0 ));
+    FT_TRACE5(( "  y scale: %d (%f)\n",
+                metrics->y_scale, metrics->y_scale / 65536.0 ));
+    FT_TRACE5(( "  ascender: %f\n",    metrics->ascender / 64.0 ));
+    FT_TRACE5(( "  descender: %f\n",   metrics->descender / 64.0 ));
+    FT_TRACE5(( "  height: %f\n",      metrics->height / 64.0 ));
+    FT_TRACE5(( "  max advance: %f\n", metrics->max_advance / 64.0 ));
+    FT_TRACE5(( "  x ppem: %d\n",      metrics->x_ppem ));
+    FT_TRACE5(( "  y ppem: %d\n",      metrics->y_ppem ));
   }
 
 
   }
 
 
 
 
     if ( !face || !FT_HAS_FIXED_SIZES( face ) )
 
 
     if ( !face || !FT_HAS_FIXED_SIZES( face ) )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( strike_index < 0 || strike_index >= face->num_fixed_sizes )
 
     if ( strike_index < 0 || strike_index >= face->num_fixed_sizes )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     clazz = face->driver->clazz;
 
     if ( clazz->select_size )
 
     clazz = face->driver->clazz;
 
     if ( clazz->select_size )
-      return clazz->select_size( face->size, (FT_ULong)strike_index );
+    {
+      FT_Error  error;
+
+
+      error = clazz->select_size( face->size, (FT_ULong)strike_index );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+      {
+        FT_Size_Metrics*  metrics = &face->size->metrics;
+
+
+        FT_TRACE5(( "FT_Select_Size (font driver's `select_size'):\n" ));
+        FT_TRACE5(( "  x scale: %d (%f)\n",
+                    metrics->x_scale, metrics->x_scale / 65536.0 ));
+        FT_TRACE5(( "  y scale: %d (%f)\n",
+                    metrics->y_scale, metrics->y_scale / 65536.0 ));
+        FT_TRACE5(( "  ascender: %f\n",    metrics->ascender / 64.0 ));
+        FT_TRACE5(( "  descender: %f\n",   metrics->descender / 64.0 ));
+        FT_TRACE5(( "  height: %f\n",      metrics->height / 64.0 ));
+        FT_TRACE5(( "  max advance: %f\n", metrics->max_advance / 64.0 ));
+        FT_TRACE5(( "  x ppem: %d\n",      metrics->x_ppem ));
+        FT_TRACE5(( "  y ppem: %d\n",      metrics->y_ppem ));
+      }
+#endif
+
+      return error;
+    }
 
     FT_Select_Metrics( face, (FT_ULong)strike_index );
 
 
     FT_Select_Metrics( face, (FT_ULong)strike_index );
 
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( !req || req->width < 0 || req->height < 0 ||
          req->type >= FT_SIZE_REQUEST_TYPE_MAX )
 
     if ( !req || req->width < 0 || req->height < 0 ||
          req->type >= FT_SIZE_REQUEST_TYPE_MAX )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     clazz = face->driver->clazz;
 
     if ( clazz->request_size )
 
     clazz = face->driver->clazz;
 
     if ( clazz->request_size )
-      return clazz->request_size( face->size, req );
+    {
+      FT_Error  error;
+
+
+      error = clazz->request_size( face->size, req );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+      {
+        FT_Size_Metrics*  metrics = &face->size->metrics;
+
+
+        FT_TRACE5(( "FT_Request_Size (font driver's `request_size'):\n" ));
+        FT_TRACE5(( "  x scale: %d (%f)\n",
+                    metrics->x_scale, metrics->x_scale / 65536.0 ));
+        FT_TRACE5(( "  y scale: %d (%f)\n",
+                    metrics->y_scale, metrics->y_scale / 65536.0 ));
+        FT_TRACE5(( "  ascender: %f\n",    metrics->ascender / 64.0 ));
+        FT_TRACE5(( "  descender: %f\n",   metrics->descender / 64.0 ));
+        FT_TRACE5(( "  height: %f\n",      metrics->height / 64.0 ));
+        FT_TRACE5(( "  max advance: %f\n", metrics->max_advance / 64.0 ));
+        FT_TRACE5(( "  x ppem: %d\n",      metrics->x_ppem ));
+        FT_TRACE5(( "  y ppem: %d\n",      metrics->y_ppem ));
+      }
+#endif
+
+      return error;
+    }
 
     /*
      * The reason that a driver doesn't have `request_size' defined is
 
     /*
      * The reason that a driver doesn't have `request_size' defined is
       if ( error )
         return error;
 
       if ( error )
         return error;
 
-      FT_TRACE3(( "FT_Request_Size: bitmap strike %lu matched\n",
-                  strike_index ));
-
       return FT_Select_Size( face, (FT_Int)strike_index );
     }
 
       return FT_Select_Size( face, (FT_Int)strike_index );
     }
 
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( !akerning )
 
     if ( !akerning )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     driver = face->driver;
 
 
     driver = face->driver;
 
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( !akerning )
 
     if ( !akerning )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     FT_FACE_FIND_SERVICE( face, service, KERNING );
     if ( !service )
 
     FT_FACE_FIND_SERVICE( face, service, KERNING );
     if ( !service )
-      return FT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 
     error = service->get_track( face,
                                 point_size,
 
     error = service->get_track( face,
                                 point_size,
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( encoding == FT_ENCODING_NONE )
 
     if ( encoding == FT_ENCODING_NONE )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* FT_ENCODING_UNICODE is special.  We try to find the `best' Unicode */
     /* charmap available, i.e., one with UCS-4 characters, if possible.   */
 
     /* FT_ENCODING_UNICODE is special.  We try to find the `best' Unicode */
     /* charmap available, i.e., one with UCS-4 characters, if possible.   */
 
     cur = face->charmaps;
     if ( !cur )
 
     cur = face->charmaps;
     if ( !cur )
-      return FT_Err_Invalid_CharMap_Handle;
+      return FT_THROW( Invalid_CharMap_Handle );
 
     limit = cur + face->num_charmaps;
 
 
     limit = cur + face->num_charmaps;
 
       }
     }
 
       }
     }
 
-    return FT_Err_Invalid_Argument;
+    return FT_THROW( Invalid_Argument );
   }
 
 
   }
 
 
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     cur = face->charmaps;
     if ( !cur )
 
     cur = face->charmaps;
     if ( !cur )
-      return FT_Err_Invalid_CharMap_Handle;
+      return FT_THROW( Invalid_CharMap_Handle );
     if ( FT_Get_CMap_Format( charmap ) == 14 )
     if ( FT_Get_CMap_Format( charmap ) == 14 )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     limit = cur + face->num_charmaps;
 
 
     limit = cur + face->num_charmaps;
 
         return 0;
       }
     }
         return 0;
       }
     }
-    return FT_Err_Invalid_Argument;
+    return FT_THROW( Invalid_Argument );
   }
 
 
   }
 
 
   {
     FT_CMap_Class  clazz  = cmap->clazz;
     FT_Face        face   = cmap->charmap.face;
   {
     FT_CMap_Class  clazz  = cmap->clazz;
     FT_Face        face   = cmap->charmap.face;
-    FT_Memory      memory = FT_FACE_MEMORY(face);
+    FT_Memory      memory = FT_FACE_MEMORY( face );
 
 
     if ( clazz->done )
 
 
     if ( clazz->done )
     FT_Error   error = FT_Err_Ok;
     FT_Face    face;
     FT_Memory  memory;
     FT_Error   error = FT_Err_Ok;
     FT_Face    face;
     FT_Memory  memory;
-    FT_CMap    cmap;
+    FT_CMap    cmap = NULL;
 
 
     if ( clazz == NULL || charmap == NULL || charmap->face == NULL )
 
 
     if ( clazz == NULL || charmap == NULL || charmap->face == NULL )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     face   = charmap->face;
     memory = FT_FACE_MEMORY( face );
 
     face   = charmap->face;
     memory = FT_FACE_MEMORY( face );
                      FT_Pointer  buffer,
                      FT_UInt     buffer_max )
   {
                      FT_Pointer  buffer,
                      FT_UInt     buffer_max )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
 
 
     /* clean up buffer */
 
 
     /* clean up buffer */
 
 
     if ( !face || !FT_IS_SFNT( face ) )
 
 
     if ( !face || !FT_IS_SFNT( face ) )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
     if ( service == NULL )
 
     FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
     if ( service == NULL )
-      return FT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 
     return service->load_table( face, tag, offset, buffer, length );
   }
 
     return service->load_table( face, tag, offset, buffer, length );
   }
 
 
     if ( !face || !FT_IS_SFNT( face ) )
 
 
     if ( !face || !FT_IS_SFNT( face ) )
-      return FT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
     if ( service == NULL )
 
     FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
     if ( service == NULL )
-      return FT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 
     return service->table_info( face, table_index, tag, &offset, length );
   }
 
     return service->table_info( face, table_index, tag, &offset, length );
   }
 
 
     if ( size == NULL )
 
 
     if ( size == NULL )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     face = size->face;
     if ( face == NULL || face->driver == NULL )
 
     face = size->face;
     if ( face == NULL || face->driver == NULL )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* we don't need anything more complex than that; all size objects */
     /* are already listed by the face                                  */
 
     /* we don't need anything more complex than that; all size objects */
     /* are already listed by the face                                  */
 
 
     if ( !library )
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !renderer )
 
     if ( !renderer )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     node = FT_List_Find( &library->renderers, renderer );
     if ( !node )
     {
 
     node = FT_List_Find( &library->renderers, renderer );
     if ( !node )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
         error = set_mode( renderer, parameters->tag, parameters->data );
         if ( error )
           break;
         error = set_mode( renderer, parameters->tag, parameters->data );
         if ( error )
           break;
+        parameters++;
       }
     }
 
       }
     }
 
         else
           renderer = FT_Lookup_Renderer( library, slot->format, &node );
 
         else
           renderer = FT_Lookup_Renderer( library, slot->format, &node );
 
-        error = FT_Err_Unimplemented_Feature;
+        error = FT_ERR( Unimplemented_Feature );
         while ( renderer )
         {
           error = renderer->render( renderer, slot, render_mode, NULL );
         while ( renderer )
         {
           error = renderer->render( renderer, slot, render_mode, NULL );
-          if ( !error                                               ||
-               FT_ERROR_BASE( error ) != FT_Err_Cannot_Render_Glyph )
+          if ( !error                                   ||
+               FT_ERR_NEQ( error, Cannot_Render_Glyph ) )
             break;
 
           /* FT_Err_Cannot_Render_Glyph is returned if the render mode   */
             break;
 
           /* FT_Err_Cannot_Render_Glyph is returned if the render mode   */
       }
     }
 
       }
     }
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_bitmap
+
+    /* we convert to a single bitmap format for computing the checksum */
+    {
+      FT_Bitmap  bitmap;
+      FT_Error   err;
+
+
+      FT_Bitmap_New( &bitmap );
+
+      err = FT_Bitmap_Convert( library, &slot->bitmap, &bitmap, 1 );
+      if ( !err )
+      {
+        MD5_CTX        ctx;
+        unsigned char  md5[16];
+        int            i;
+
+
+        MD5_Init( &ctx);
+        MD5_Update( &ctx, bitmap.buffer, bitmap.rows * bitmap.pitch );
+        MD5_Final( md5, &ctx );
+
+        FT_TRACE3(( "MD5 checksum for %dx%d bitmap:\n"
+                    "  ",
+                    bitmap.rows, bitmap.pitch ));
+        for ( i = 0; i < 16; i++ )
+          FT_TRACE3(( "%02X", md5[i] ));
+        FT_TRACE3(( "\n" ));
+      }
+
+      FT_Bitmap_Done( library, &bitmap );
+    }
+
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_objs
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
     return error;
   }
 
     return error;
   }
 
 
 
     if ( !slot || !slot->face )
 
 
     if ( !slot || !slot->face )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     library = FT_FACE_LIBRARY( slot->face );
 
 
     library = FT_FACE_LIBRARY( slot->face );
 
   /*    all child faces.                                                   */
   /*                                                                       */
   /* <InOut>                                                               */
   /*    all child faces.                                                   */
   /*                                                                       */
   /* <InOut>                                                               */
-  /*     module :: A handle to the target driver object.                   */
+  /*    module :: A handle to the target driver object.                    */
   /*                                                                       */
   /* <Note>                                                                */
   /*                                                                       */
   /* <Note>                                                                */
-  /*     The driver _must_ be LOCKED!                                      */
+  /*    The driver _must_ be LOCKED!                                       */
   /*                                                                       */
   static void
   Destroy_Module( FT_Module  module )
   /*                                                                       */
   static void
   Destroy_Module( FT_Module  module )
     FT_Library        library = module->library;
 
 
     FT_Library        library = module->library;
 
 
-    /* finalize client-data - before anything else */
-    if ( module->generic.finalizer )
-      module->generic.finalizer( module );
-
     if ( library && library->auto_hinter == module )
       library->auto_hinter = 0;
 
     if ( library && library->auto_hinter == module )
       library->auto_hinter = 0;
 
                                 FREETYPE_MINOR                  )
 
     if ( !library )
                                 FREETYPE_MINOR                  )
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !clazz )
 
     if ( !clazz )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* check freetype version */
     if ( clazz->module_requires > FREETYPE_VER_FIXED )
 
     /* check freetype version */
     if ( clazz->module_requires > FREETYPE_VER_FIXED )
-      return FT_Err_Invalid_Version;
+      return FT_THROW( Invalid_Version );
 
     /* look for a module with the same name in the library's table */
     for ( nn = 0; nn < library->num_modules; nn++ )
 
     /* look for a module with the same name in the library's table */
     for ( nn = 0; nn < library->num_modules; nn++ )
       {
         /* this installed module has the same name, compare their versions */
         if ( clazz->module_version <= module->clazz->module_version )
       {
         /* this installed module has the same name, compare their versions */
         if ( clazz->module_version <= module->clazz->module_version )
-          return FT_Err_Lower_Module_Version;
+          return FT_THROW( Lower_Module_Version );
 
         /* remove the module from our list, then exit the loop to replace */
         /* it by our new version..                                        */
 
         /* remove the module from our list, then exit the loop to replace */
         /* it by our new version..                                        */
 
     if ( library->num_modules >= FT_MAX_MODULES )
     {
 
     if ( library->num_modules >= FT_MAX_MODULES )
     {
-      error = FT_Err_Too_Many_Drivers;
+      error = FT_THROW( Too_Many_Drivers );
       goto Exit;
     }
 
       goto Exit;
     }
 
       FT_Renderer  renderer = FT_RENDERER( module );
 
 
       FT_Renderer  renderer = FT_RENDERER( module );
 
 
-      if ( renderer->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE && 
+      if ( renderer->clazz                                          &&
+           renderer->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&
            renderer->raster                                         )
         renderer->clazz->raster_class->raster_done( renderer->raster );
     }
            renderer->raster                                         )
         renderer->clazz->raster_class->raster_done( renderer->raster );
     }
   {
     FT_Pointer  result = NULL;
 
   {
     FT_Pointer  result = NULL;
 
+
     if ( module )
     {
       FT_ASSERT( module->clazz && module->clazz->get_interface );
 
     if ( module )
     {
       FT_ASSERT( module->clazz && module->clazz->get_interface );
 
-     /* first, look for the service in the module
-      */
+      /* first, look for the service in the module */
       if ( module->clazz->get_interface )
         result = module->clazz->get_interface( module, service_id );
 
       if ( result == NULL )
       {
       if ( module->clazz->get_interface )
         result = module->clazz->get_interface( module, service_id );
 
       if ( result == NULL )
       {
-       /* we didn't find it, look in all other modules then
-        */
+        /* we didn't find it, look in all other modules then */
         FT_Library  library = module->library;
         FT_Module*  cur     = library->modules;
         FT_Module*  limit   = cur + library->num_modules;
 
         FT_Library  library = module->library;
         FT_Module*  cur     = library->modules;
         FT_Module*  limit   = cur + library->num_modules;
 
+
         for ( ; cur < limit; cur++ )
         {
           if ( cur[0] != module )
         for ( ; cur < limit; cur++ )
         {
           if ( cur[0] != module )
     /* try to find the module from the table, then remove it from there */
 
     if ( !library )
     /* try to find the module from the table, then remove it from there */
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( module )
     {
 
     if ( module )
     {
         }
       }
     }
         }
       }
     }
-    return FT_Err_Invalid_Driver_Handle;
+    return FT_THROW( Invalid_Driver_Handle );
+  }
+
+
+  FT_Error
+  ft_property_do( FT_Library        library,
+                  const FT_String*  module_name,
+                  const FT_String*  property_name,
+                  void*             value,
+                  FT_Bool           set )
+  {
+    FT_Module*           cur;
+    FT_Module*           limit;
+    FT_Module_Interface  interface;
+
+    FT_Service_Properties  service;
+
+#ifdef FT_DEBUG_LEVEL_ERROR
+    const FT_String*  set_name  = "FT_Property_Set";
+    const FT_String*  get_name  = "FT_Property_Get";
+    const FT_String*  func_name = set ? set_name : get_name;
+#endif
+
+    FT_Bool  missing_func;
+
+
+    if ( !library )
+      return FT_THROW( Invalid_Library_Handle );
+
+    if ( !module_name || !property_name || !value )
+      return FT_THROW( Invalid_Argument );
+
+    cur   = library->modules;
+    limit = cur + library->num_modules;
+
+    /* search module */
+    for ( ; cur < limit; cur++ )
+      if ( !ft_strcmp( cur[0]->clazz->module_name, module_name ) )
+        break;
+
+    if ( cur == limit )
+    {
+      FT_ERROR(( "%s: can't find module `%s'\n",
+                 func_name, module_name ));
+      return FT_THROW( Missing_Module );
+    }
+
+    /* check whether we have a service interface */
+    if ( !cur[0]->clazz->get_interface )
+    {
+      FT_ERROR(( "%s: module `%s' doesn't support properties\n",
+                 func_name, module_name ));
+      return FT_THROW( Unimplemented_Feature );
+    }
+
+    /* search property service */
+    interface = cur[0]->clazz->get_interface( cur[0],
+                                              FT_SERVICE_ID_PROPERTIES );
+    if ( !interface )
+    {
+      FT_ERROR(( "%s: module `%s' doesn't support properties\n",
+                 func_name, module_name ));
+      return FT_THROW( Unimplemented_Feature );
+    }
+
+    service = (FT_Service_Properties)interface;
+
+    if ( set )
+      missing_func = (FT_Bool)( !service->set_property );
+    else
+      missing_func = (FT_Bool)( !service->get_property );
+
+    if ( missing_func )
+    {
+      FT_ERROR(( "%s: property service of module `%s' is broken\n",
+                 func_name, module_name ));
+      return FT_THROW( Unimplemented_Feature );
+    }
+
+    return set ? service->set_property( cur[0], property_name, value )
+               : service->get_property( cur[0], property_name, value );
+  }
+
+
+  /* documentation is in ftmodapi.h */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Property_Set( FT_Library        library,
+                   const FT_String*  module_name,
+                   const FT_String*  property_name,
+                   const void*       value )
+  {
+    return ft_property_do( library,
+                           module_name,
+                           property_name,
+                           (void*)value,
+                           TRUE );
+  }
+
+
+  /* documentation is in ftmodapi.h */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Property_Get( FT_Library        library,
+                   const FT_String*  module_name,
+                   const FT_String*  property_name,
+                   void*             value )
+  {
+    return ft_property_do( library,
+                           module_name,
+                           property_name,
+                           value,
+                           FALSE );
   }
 
 
   }
 
 
 
 
     if ( !memory )
 
 
     if ( !memory )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
 #ifdef FT_DEBUG_LEVEL_ERROR
     /* init debugging support */
 
 #ifdef FT_DEBUG_LEVEL_ERROR
     /* init debugging support */
 
 
     if ( !library )
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     library->refcount--;
     if ( library->refcount > 0 )
 
     library->refcount--;
     if ( library->refcount > 0 )
 
     memory = library->memory;
 
 
     memory = library->memory;
 
-    /* Discard client-data */
-    if ( library->generic.finalizer )
-      library->generic.finalizer( library );
-
     /*
      * Close all faces in the library.  If we don't do this, we can have
      * some subtle memory leaks.
     /*
      * Close all faces in the library.  If we don't do this, we can have
      * some subtle memory leaks.
   }
 
 
   }
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  FT_BASE_DEF( FT_Error )
-  ft_stub_set_char_sizes( FT_Size     size,
-                          FT_F26Dot6  width,
-                          FT_F26Dot6  height,
-                          FT_UInt     horz_res,
-                          FT_UInt     vert_res )
-  {
-    FT_Size_RequestRec  req;
-    FT_Driver           driver = size->face->driver;
-
-
-    if ( driver->clazz->request_size )
-    {
-      req.type   = FT_SIZE_REQUEST_TYPE_NOMINAL;
-      req.width  = width;
-      req.height = height;
-
-      if ( horz_res == 0 )
-        horz_res = vert_res;
-
-      if ( vert_res == 0 )
-        vert_res = horz_res;
-
-      if ( horz_res == 0 )
-        horz_res = vert_res = 72;
-
-      req.horiResolution = horz_res;
-      req.vertResolution = vert_res;
-
-      return driver->clazz->request_size( size, &req );
-    }
-
-    return 0;
-  }
-
-
-  FT_BASE_DEF( FT_Error )
-  ft_stub_set_pixel_sizes( FT_Size  size,
-                           FT_UInt  width,
-                           FT_UInt  height )
-  {
-    FT_Size_RequestRec  req;
-    FT_Driver           driver = size->face->driver;
-
-
-    if ( driver->clazz->request_size )
-    {
-      req.type           = FT_SIZE_REQUEST_TYPE_NOMINAL;
-      req.width          = width  << 6;
-      req.height         = height << 6;
-      req.horiResolution = 0;
-      req.vertResolution = 0;
-
-      return driver->clazz->request_size( size, &req );
-    }
-
-    return 0;
-  }
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
   /* documentation is in freetype.h */
 
   FT_EXPORT_DEF( FT_Error )
   /* documentation is in freetype.h */
 
   FT_EXPORT_DEF( FT_Error )
                         FT_Int       *p_arg2,
                         FT_Matrix    *p_transform )
   {
                         FT_Int       *p_arg2,
                         FT_Matrix    *p_transform )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
 
 
     if ( glyph                                      &&
 
 
     if ( glyph                                      &&
index 694fd2b..5fc73d7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for validating OpenType tables (body).                  */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType API for validating OpenType tables (body).                  */
 /*                                                                         */
-/*  Copyright 2004, 2006, 2008, 2010 by                                    */
+/*  Copyright 2004, 2006, 2008, 2010, 2013 by                              */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -16,6 +16,8 @@
 /***************************************************************************/
 
 #include <ft2build.h>
 /***************************************************************************/
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_OPENTYPE_VALIDATE_H
 #include FT_OPENTYPE_VALIDATE_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_OPENTYPE_VALIDATE_H
 #include FT_OPENTYPE_VALIDATE_H
@@ -38,7 +40,7 @@
 
     if ( !face )
     {
 
     if ( !face )
     {
-      error = FT_Err_Invalid_Face_Handle;
+      error = FT_THROW( Invalid_Face_Handle );
       goto Exit;
     }
 
       goto Exit;
     }
 
@@ -48,7 +50,7 @@
             GSUB_table &&
             JSTF_table ) )
     {
             GSUB_table &&
             JSTF_table ) )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
@@ -63,7 +65,7 @@
                                  GSUB_table,
                                  JSTF_table );
     else
                                  GSUB_table,
                                  JSTF_table );
     else
-      error = FT_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
 
   Exit:
     return error;
 
   Exit:
     return error;
index 356b156..54ca5cd 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType outline management (body).                                  */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType outline management (body).                                  */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
+/*  Copyright 1996-2008, 2010, 2012-2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -26,6 +26,7 @@
 #include <ft2build.h>
 #include FT_OUTLINE_H
 #include FT_INTERNAL_OBJECTS_H
 #include <ft2build.h>
 #include FT_OUTLINE_H
 #include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_CALC_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_TRIGONOMETRY_H
 
 #include FT_INTERNAL_DEBUG_H
 #include FT_TRIGONOMETRY_H
 
@@ -73,7 +74,7 @@
 
 
     if ( !outline || !func_interface )
 
 
     if ( !outline || !func_interface )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     shift = func_interface->shift;
     delta = func_interface->delta;
 
     shift = func_interface->shift;
     delta = func_interface->delta;
     return error;
 
   Invalid_Outline:
     return error;
 
   Invalid_Outline:
-    return FT_Err_Invalid_Outline;
+    return FT_THROW( Invalid_Outline );
   }
 
 
   }
 
 
 
 
     if ( !anoutline || !memory )
 
 
     if ( !anoutline || !memory )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     *anoutline = null_outline;
 
 
     *anoutline = null_outline;
 
+    if ( numContours < 0                  ||
+         (FT_UInt)numContours > numPoints )
+      return FT_THROW( Invalid_Argument );
+
+    if ( numPoints > FT_OUTLINE_POINTS_MAX )
+      return FT_THROW( Array_Too_Large );
+
     if ( FT_NEW_ARRAY( anoutline->points,   numPoints   ) ||
          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 ) )
                   FT_Outline  *anoutline )
   {
     if ( !library )
                   FT_Outline  *anoutline )
   {
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     return FT_Outline_New_Internal( library->memory, numPoints,
                                     numContours, anoutline );
 
     return FT_Outline_New_Internal( library->memory, numPoints,
                                     numContours, anoutline );
     }
 
   Bad:
     }
 
   Bad:
-    return FT_Err_Invalid_Argument;
+    return FT_THROW( Invalid_Argument );
   }
 
 
   }
 
 
     if ( !source            || !target            ||
          source->n_points   != target->n_points   ||
          source->n_contours != target->n_contours )
     if ( !source            || !target            ||
          source->n_points   != target->n_points   ||
          source->n_contours != target->n_contours )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( source == target )
       return FT_Err_Ok;
 
     if ( source == target )
       return FT_Err_Ok;
       return FT_Err_Ok;
     }
     else
       return FT_Err_Ok;
     }
     else
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
   }
 
 
   }
 
 
     /* check for valid `outline' in FT_Outline_Done_Internal() */
 
     if ( !library )
     /* check for valid `outline' in FT_Outline_Done_Internal() */
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     return FT_Outline_Done_Internal( library->memory, outline );
   }
 
     return FT_Outline_Done_Internal( library->memory, outline );
   }
 
 
     if ( !library )
 
 
     if ( !library )
-      return FT_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     if ( !outline || !params )
 
     if ( !outline || !params )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     renderer = library->cur_renderer;
     node     = library->renderers.head;
 
     params->source = (void*)outline;
 
 
     renderer = library->cur_renderer;
     node     = library->renderers.head;
 
     params->source = (void*)outline;
 
-    error = FT_Err_Cannot_Render_Glyph;
+    error = FT_ERR( Cannot_Render_Glyph );
     while ( renderer )
     {
       error = renderer->raster_render( renderer->raster, params );
     while ( renderer )
     {
       error = renderer->raster_render( renderer->raster, params );
-      if ( !error || FT_ERROR_BASE( error ) != FT_Err_Cannot_Render_Glyph )
+      if ( !error || FT_ERR_NEQ( error, Cannot_Render_Glyph ) )
         break;
 
       /* FT_Err_Cannot_Render_Glyph is returned if the render mode   */
         break;
 
       /* FT_Err_Cannot_Render_Glyph is returned if the render mode   */
 
 
     if ( !abitmap )
 
 
     if ( !abitmap )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* other checks are delayed to FT_Outline_Render() */
 
 
     /* other checks are delayed to FT_Outline_Render() */
 
         return 1;
     }
 
         return 1;
     }
 
-    return ( n % 2 );
+    return n & 1;
   }
 
 
   }
 
 
   FT_EXPORT_DEF( FT_Error )
   FT_Outline_Embolden( FT_Outline*  outline,
                        FT_Pos       strength )
   FT_EXPORT_DEF( FT_Error )
   FT_Outline_Embolden( FT_Outline*  outline,
                        FT_Pos       strength )
+  {
+    return FT_Outline_EmboldenXY( outline, strength, strength );
+  }
+
+
+  /* documentation is in ftoutln.h */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Outline_EmboldenXY( FT_Outline*  outline,
+                         FT_Pos       xstrength,
+                         FT_Pos       ystrength )
   {
     FT_Vector*  points;
     FT_Vector   v_prev, v_first, v_next, v_cur;
   {
     FT_Vector*  points;
     FT_Vector   v_prev, v_first, v_next, v_cur;
-    FT_Angle    rotate, angle_in, angle_out;
     FT_Int      c, n, first;
     FT_Int      orientation;
 
 
     if ( !outline )
     FT_Int      c, n, first;
     FT_Int      orientation;
 
 
     if ( !outline )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
 
-    strength /= 2;
-    if ( strength == 0 )
+    xstrength /= 2;
+    ystrength /= 2;
+    if ( xstrength == 0 && ystrength == 0 )
       return FT_Err_Ok;
 
     orientation = FT_Outline_Get_Orientation( outline );
     if ( orientation == FT_ORIENTATION_NONE )
     {
       if ( outline->n_contours )
       return FT_Err_Ok;
 
     orientation = FT_Outline_Get_Orientation( outline );
     if ( orientation == FT_ORIENTATION_NONE )
     {
       if ( outline->n_contours )
-        return FT_Err_Invalid_Argument;
+        return FT_THROW( Invalid_Argument );
       else
         return FT_Err_Ok;
     }
 
       else
         return FT_Err_Ok;
     }
 
-    if ( orientation == FT_ORIENTATION_TRUETYPE )
-      rotate = -FT_ANGLE_PI2;
-    else
-      rotate = FT_ANGLE_PI2;
-
     points = outline->points;
 
     first = 0;
     for ( c = 0; c < outline->n_contours; c++ )
     {
     points = outline->points;
 
     first = 0;
     for ( c = 0; c < outline->n_contours; c++ )
     {
-      int  last = outline->contours[c];
+      FT_Vector  in, out, shift;
+      FT_Fixed   l_in, l_out, l, q, d;
+      int        last = outline->contours[c];
 
 
       v_first = points[first];
       v_prev  = points[last];
       v_cur   = v_first;
 
 
 
       v_first = points[first];
       v_prev  = points[last];
       v_cur   = v_first;
 
-      for ( n = first; n <= last; n++ )
+      /* compute incoming normalized vector */
+      in.x = v_cur.x - v_prev.x;
+      in.y = v_cur.y - v_prev.y;
+      l_in = FT_Vector_Length( &in );
+      if ( l_in )
       {
       {
-        FT_Vector  in, out;
-        FT_Angle   angle_diff;
-        FT_Pos     d;
-        FT_Fixed   scale;
-
+        in.x = FT_DivFix( in.x, l_in );
+        in.y = FT_DivFix( in.y, l_in );
+      }
 
 
+      for ( n = first; n <= last; n++ )
+      {
         if ( n < last )
           v_next = points[n + 1];
         else
           v_next = v_first;
 
         if ( n < last )
           v_next = points[n + 1];
         else
           v_next = v_first;
 
-        /* compute the in and out vectors */
-        in.x = v_cur.x - v_prev.x;
-        in.y = v_cur.y - v_prev.y;
-
+        /* compute outgoing normalized vector */
         out.x = v_next.x - v_cur.x;
         out.y = v_next.y - v_cur.y;
         out.x = v_next.x - v_cur.x;
         out.y = v_next.y - v_cur.y;
+        l_out = FT_Vector_Length( &out );
+        if ( l_out )
+        {
+          out.x = FT_DivFix( out.x, l_out );
+          out.y = FT_DivFix( out.y, l_out );
+        }
 
 
-        angle_in   = FT_Atan2( in.x, in.y );
-        angle_out  = FT_Atan2( out.x, out.y );
-        angle_diff = FT_Angle_Diff( angle_in, angle_out );
-        scale      = FT_Cos( angle_diff / 2 );
+        d = FT_MulFix( in.x, out.x ) + FT_MulFix( in.y, out.y );
 
 
-        if ( scale < 0x4000L && scale > -0x4000L )
-          in.x = in.y = 0;
-        else
+        /* shift only if turn is less than ~160 degrees */
+        if ( d > -0xF000L )
         {
         {
-          d = FT_DivFix( strength, scale );
+          d = d + 0x10000L;
 
 
-          FT_Vector_From_Polar( &in, d, angle_in + angle_diff / 2 - rotate );
+          /* shift components are aligned along lateral bisector */
+          /* and directed according to the outline orientation.  */
+          shift.x = in.y + out.y;
+          shift.y = in.x + out.x;
+
+          if ( orientation == FT_ORIENTATION_TRUETYPE )
+            shift.x = -shift.x;
+          else
+            shift.y = -shift.y;
+
+          /* restrict shift magnitude to better handle collapsing segments */
+          q = FT_MulFix( out.x, in.y ) - FT_MulFix( out.y, in.x );
+          if ( orientation == FT_ORIENTATION_TRUETYPE )
+            q = -q;
+
+          l = FT_MIN( l_in, l_out );
+
+          /* non-strict inequalities avoid divide-by-zero when q == l == 0 */
+          if ( FT_MulFix( xstrength, q ) <= FT_MulFix( d, l ) )
+            shift.x = FT_MulDiv( shift.x, xstrength, d );
+          else
+            shift.x = FT_MulDiv( shift.x, l, q );
+
+
+          if ( FT_MulFix( ystrength, q ) <= FT_MulFix( d, l ) )
+            shift.y = FT_MulDiv( shift.y, ystrength, d );
+          else
+            shift.y = FT_MulDiv( shift.y, l, q );
         }
         }
+        else
+          shift.x = shift.y = 0;
 
 
-        outline->points[n].x = v_cur.x + strength + in.x;
-        outline->points[n].y = v_cur.y + strength + in.y;
+        outline->points[n].x = v_cur.x + xstrength + shift.x;
+        outline->points[n].y = v_cur.y + ystrength + shift.y;
 
 
-        v_prev = v_cur;
-        v_cur  = v_next;
+        in    = out;
+        l_in  = l_out;
+        v_cur = v_next;
       }
 
       first = last + 1;
       }
 
       first = last + 1;
   FT_EXPORT_DEF( FT_Orientation )
   FT_Outline_Get_Orientation( FT_Outline*  outline )
   {
   FT_EXPORT_DEF( FT_Orientation )
   FT_Outline_Get_Orientation( FT_Outline*  outline )
   {
-    FT_Pos      xmin       = 32768L;
-    FT_Pos      xmin_ymin  = 32768L;
-    FT_Pos      xmin_ymax  = -32768L;
-    FT_Vector*  xmin_first = NULL;
-    FT_Vector*  xmin_last  = NULL;
-
-    short*      contour;
-
-    FT_Vector*  first;
-    FT_Vector*  last;
-    FT_Vector*  prev;
-    FT_Vector*  point;
-
-    int             i;
-    FT_Pos          ray_y[3];
-    FT_Orientation  result[3] =
-      { FT_ORIENTATION_NONE, FT_ORIENTATION_NONE, FT_ORIENTATION_NONE };
+    FT_BBox     cbox;
+    FT_Int      xshift, yshift;
+    FT_Vector*  points;
+    FT_Vector   v_prev, v_cur;
+    FT_Int      c, n, first;
+    FT_Pos      area = 0;
 
 
     if ( !outline || outline->n_points <= 0 )
 
 
     if ( !outline || outline->n_points <= 0 )
     /* cubic or quadratic curves, this test deals with the polygon    */
     /* only which is spanned up by the control points.                */
 
     /* cubic or quadratic curves, this test deals with the polygon    */
     /* only which is spanned up by the control points.                */
 
-    first = outline->points;
-    for ( contour = outline->contours;
-          contour < outline->contours + outline->n_contours;
-          contour++, first = last + 1 )
-    {
-      FT_Pos  contour_xmin = 32768L;
-      FT_Pos  contour_xmax = -32768L;
-      FT_Pos  contour_ymin = 32768L;
-      FT_Pos  contour_ymax = -32768L;
-
-
-      last = outline->points + *contour;
+    FT_Outline_Get_CBox( outline, &cbox );
 
 
-      /* skip degenerate contours */
-      if ( last < first + 2 )
-        continue;
-
-      for ( point = first; point <= last; ++point )
-      {
-        if ( point->x < contour_xmin )
-          contour_xmin = point->x;
-
-        if ( point->x > contour_xmax )
-          contour_xmax = point->x;
-
-        if ( point->y < contour_ymin )
-          contour_ymin = point->y;
-
-        if ( point->y > contour_ymax )
-          contour_ymax = point->y;
-      }
-
-      if ( contour_xmin < xmin          &&
-           contour_xmin != contour_xmax &&
-           contour_ymin != contour_ymax )
-      {
-        xmin       = contour_xmin;
-        xmin_ymin  = contour_ymin;
-        xmin_ymax  = contour_ymax;
-        xmin_first = first;
-        xmin_last  = last;
-      }
-    }
+    xshift = FT_MSB( FT_ABS( cbox.xMax ) | FT_ABS( cbox.xMin ) ) - 14;
+    xshift = FT_MAX( xshift, 0 );
 
 
-    if ( xmin == 32768L )
-      return FT_ORIENTATION_TRUETYPE;
+    yshift = FT_MSB( cbox.yMax - cbox.yMin ) - 14;
+    yshift = FT_MAX( yshift, 0 );
 
 
-    ray_y[0] = ( xmin_ymin * 3 + xmin_ymax     ) >> 2;
-    ray_y[1] = ( xmin_ymin     + xmin_ymax     ) >> 1;
-    ray_y[2] = ( xmin_ymin     + xmin_ymax * 3 ) >> 2;
+    points = outline->points;
 
 
-    for ( i = 0; i < 3; i++ )
+    first = 0;
+    for ( c = 0; c < outline->n_contours; c++ )
     {
     {
-      FT_Pos      left_x;
-      FT_Pos      right_x;
-      FT_Vector*  left1;
-      FT_Vector*  left2;
-      FT_Vector*  right1;
-      FT_Vector*  right2;
-
+      FT_Int  last = outline->contours[c];
 
 
-    RedoRay:
-      left_x  = 32768L;
-      right_x = -32768L;
 
 
-      left1 = left2 = right1 = right2 = NULL;
+      v_prev = points[last];
 
 
-      prev = xmin_last;
-      for ( point = xmin_first; point <= xmin_last; prev = point, ++point )
+      for ( n = first; n <= last; n++ )
       {
       {
-        FT_Pos  tmp_x;
-
-
-        if ( point->y == ray_y[i] || prev->y == ray_y[i] )
-        {
-          ray_y[i]++;
-          goto RedoRay;
-        }
-
-        if ( ( point->y < ray_y[i] && prev->y < ray_y[i] ) ||
-             ( point->y > ray_y[i] && prev->y > ray_y[i] ) )
-          continue;
-
-        tmp_x = FT_MulDiv( point->x - prev->x,
-                           ray_y[i] - prev->y,
-                           point->y - prev->y ) + prev->x;
-
-        if ( tmp_x < left_x )
-        {
-          left_x = tmp_x;
-          left1  = prev;
-          left2  = point;
-        }
-
-        if ( tmp_x > right_x )
-        {
-          right_x = tmp_x;
-          right1  = prev;
-          right2  = point;
-        }
+        v_cur = points[n];
+        area += ( ( v_cur.y - v_prev.y ) >> yshift ) *
+                ( ( v_cur.x + v_prev.x ) >> xshift );
+        v_prev = v_cur;
       }
 
       }
 
-      if ( left1 && right1 )
-      {
-        if ( left1->y < left2->y && right1->y > right2->y )
-          result[i] = FT_ORIENTATION_TRUETYPE;
-        else if ( left1->y > left2->y && right1->y < right2->y )
-          result[i] = FT_ORIENTATION_POSTSCRIPT;
-        else
-          result[i] = FT_ORIENTATION_NONE;
-      }
+      first = last + 1;
     }
 
     }
 
-    if ( result[0] != FT_ORIENTATION_NONE                     &&
-         ( result[0] == result[1] || result[0] == result[2] ) )
-      return result[0];
-
-    if ( result[1] != FT_ORIENTATION_NONE && result[1] == result[2] )
-      return result[1];
-
-    return FT_ORIENTATION_TRUETYPE;
+    if ( area > 0 )
+      return FT_ORIENTATION_POSTSCRIPT;
+    else if ( area < 0 )
+      return FT_ORIENTATION_TRUETYPE;
+    else
+      return FT_ORIENTATION_NONE;
   }
 
 
   }
 
 
index 501cab5..82b42f0 100644 (file)
 
 
 #if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING ) && \
 
 
 #if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING ) && \
-    !defined( TT_CONFIG_OPTION_BYTECODE_INTEPRETER )
+    !defined( TT_CONFIG_OPTION_BYTECODE_INTERPRETER )
     if ( face && FT_IS_SFNT( face ) )
     {
       result = !face->internal->ignore_unpatented_hinter;
     if ( face && FT_IS_SFNT( face ) )
     {
       result = !face->internal->ignore_unpatented_hinter;
index 3a0f92d..0ba955f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for accessing PFR-specific data (body).                 */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType API for accessing PFR-specific data (body).                 */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2008, 2010 by                              */
+/*  Copyright 2002-2004, 2008, 2010, 2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -16,6 +16,8 @@
 /***************************************************************************/
 
 #include <ft2build.h>
 /***************************************************************************/
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_PFR_H
 
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_PFR_H
 
@@ -48,7 +50,7 @@
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     service = ft_pfr_check( face );
     if ( service )
 
     service = ft_pfr_check( face );
     if ( service )
@@ -84,7 +86,7 @@
       if ( ametrics_y_scale )
         *ametrics_y_scale = y_scale;
 
       if ( ametrics_y_scale )
         *ametrics_y_scale = y_scale;
 
-      error = FT_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
     }
 
     return error;
     }
 
     return error;
 
 
     if ( !face )
 
 
     if ( !face )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     service = ft_pfr_check( face );
     if ( service )
 
     service = ft_pfr_check( face );
     if ( service )
     }
     else
       /* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */
     }
     else
       /* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
 
     return error;
   }
 
     return error;
   }
index d5271a9..1c87101 100644 (file)
   /* documentation is in ftpic.h */
 
   FT_BASE_DEF( FT_Error )
   /* documentation is in ftpic.h */
 
   FT_BASE_DEF( FT_Error )
-  ft_pic_container_init( FT_Library library )
+  ft_pic_container_init( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Error error = FT_Err_Ok;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Error           error         = FT_Err_Ok;
 
 
-    FT_MEM_SET( pic_container, 0, sizeof(*pic_container) );
+
+    FT_MEM_SET( pic_container, 0, sizeof ( *pic_container ) );
 
     error = ft_base_pic_init( library );
 
     error = ft_base_pic_init( library );
-    if(error)
+    if ( error )
       return error;
 
     return FT_Err_Ok;
       return error;
 
     return FT_Err_Ok;
@@ -43,7 +44,7 @@
 
   /* Destroy the contents of the container. */
   FT_BASE_DEF( void )
 
   /* Destroy the contents of the container. */
   FT_BASE_DEF( void )
-  ft_pic_container_destroy( FT_Library library )
+  ft_pic_container_destroy( FT_Library  library )
   {
     ft_base_pic_free( library );
   }
   {
     ft_base_pic_free( library );
   }
index 6df2def..8049117 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Embedded resource forks accessor (body).                             */
 /*                                                                         */
 /*                                                                         */
 /*    Embedded resource forks accessor (body).                             */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010 by                  */
+/*  Copyright 2004-2010, 2013 by                                           */
 /*  Masatake YAMATO and Redhat K.K.                                        */
 /*                                                                         */
 /*  FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are     */
 /*  Masatake YAMATO and Redhat K.K.                                        */
 /*                                                                         */
 /*  FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are     */
@@ -28,7 +28,7 @@
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_RFORK_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_RFORK_H
-
+#include "basepic.h"
 
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_raccess
 
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_raccess
@@ -86,7 +86,7 @@
     /* map_len = head[12] .. head[15] */
 
     if ( *rdata_pos + rdata_len != map_pos || map_pos == rfork_offset )
     /* map_len = head[12] .. head[15] */
 
     if ( *rdata_pos + rdata_len != map_pos || map_pos == rfork_offset )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     error = FT_Stream_Seek( stream, map_pos );
     if ( error )
 
     error = FT_Stream_Seek( stream, map_pos );
     if ( error )
         allmatch = 0;
     }
     if ( !allzeros && !allmatch )
         allmatch = 0;
     }
     if ( !allzeros && !allmatch )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     /* If we have reached this point then it is probably a mac resource */
     /* file.  Now, does it contain any interesting resources?           */
 
     /* If we have reached this point then it is probably a mac resource */
     /* file.  Now, does it contain any interesting resources?           */
     if ( FT_READ_USHORT( type_list ) )
       return error;
     if ( type_list == -1 )
     if ( FT_READ_USHORT( type_list ) )
       return error;
     if ( type_list == -1 )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     error = FT_Stream_Seek( stream, map_pos + type_list );
     if ( error )
 
     error = FT_Stream_Seek( stream, map_pos + type_list );
     if ( error )
     FT_Long       tag_internal, rpos;
     FT_Memory     memory = library->memory;
     FT_Long       temp;
     FT_Long       tag_internal, rpos;
     FT_Memory     memory = library->memory;
     FT_Long       temp;
-    FT_Long       *offsets_internal;
-    FT_RFork_Ref  *ref;
+    FT_Long       *offsets_internal = NULL;
+    FT_RFork_Ref  *ref = NULL;
 
 
     error = FT_Stream_Seek( stream, map_offset );
 
 
     error = FT_Stream_Seek( stream, map_offset );
       }
     }
 
       }
     }
 
-    return FT_Err_Cannot_Open_Resource;
+    return FT_THROW( Cannot_Open_Resource );
   }
 
 
   }
 
 
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
 
-  typedef FT_Error
-  (*raccess_guess_func)( FT_Library  library,
-                         FT_Stream   stream,
-                         char       *base_file_name,
-                         char      **result_file_name,
-                         FT_Long    *result_offset );
-
-
   static FT_Error
   raccess_guess_apple_double( FT_Library  library,
                               FT_Stream   stream,
   static FT_Error
   raccess_guess_apple_double( FT_Library  library,
                               FT_Stream   stream,
                                 FT_Long    *result_offset );
 
 
                                 FT_Long    *result_offset );
 
 
+  CONST_FT_RFORK_RULE_ARRAY_BEGIN(ft_raccess_guess_table,
+                                  ft_raccess_guess_rec)
+  CONST_FT_RFORK_RULE_ARRAY_ENTRY(apple_double,      apple_double)
+  CONST_FT_RFORK_RULE_ARRAY_ENTRY(apple_single,      apple_single)
+  CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_ufs_export, darwin_ufs_export)
+  CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_newvfs,     darwin_newvfs)
+  CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_hfsplus,    darwin_hfsplus)
+  CONST_FT_RFORK_RULE_ARRAY_ENTRY(vfat,              vfat)
+  CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_cap,         linux_cap)
+  CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_double,      linux_double)
+  CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_netatalk,    linux_netatalk)
+  CONST_FT_RFORK_RULE_ARRAY_END
+
+
   /*************************************************************************/
   /****                                                                 ****/
   /****                       Helper functions                          ****/
   /*************************************************************************/
   /****                                                                 ****/
   /****                       Helper functions                          ****/
                           const char  *original_name,
                           const char  *insertion );
 
                           const char  *original_name,
                           const char  *insertion );
 
-
-  typedef enum  FT_RFork_Rule_ {
-    FT_RFork_Rule_invalid = -2,
-    FT_RFork_Rule_uknown, /* -1 */
-    FT_RFork_Rule_apple_double,
-    FT_RFork_Rule_apple_single,
-    FT_RFork_Rule_darwin_ufs_export,
-    FT_RFork_Rule_darwin_newvfs,
-    FT_RFork_Rule_darwin_hfsplus,
-    FT_RFork_Rule_vfat,
-    FT_RFork_Rule_linux_cap,
-    FT_RFork_Rule_linux_double,
-    FT_RFork_Rule_linux_netatalk
-  } FT_RFork_Rule;
-
-  /* For fast translation between rule index and rule type,
-   * the macros FT_RFORK_xxx should be kept consistent with
-   * the raccess_guess_funcs table
-   */
-  typedef struct raccess_guess_rec_ {
-    raccess_guess_func  func;
-    FT_RFork_Rule       type;
-  } raccess_guess_rec;
-
-  static raccess_guess_rec  raccess_guess_table[FT_RACCESS_N_RULES] =
-  {
-    { raccess_guess_apple_double,      FT_RFork_Rule_apple_double, },
-    { raccess_guess_apple_single,      FT_RFork_Rule_apple_single, },
-    { raccess_guess_darwin_ufs_export, FT_RFork_Rule_darwin_ufs_export, },
-    { raccess_guess_darwin_newvfs,     FT_RFork_Rule_darwin_newvfs, },
-    { raccess_guess_darwin_hfsplus,    FT_RFork_Rule_darwin_hfsplus, },
-    { raccess_guess_vfat,              FT_RFork_Rule_vfat, },
-    { raccess_guess_linux_cap,         FT_RFork_Rule_linux_cap, },
-    { raccess_guess_linux_double,      FT_RFork_Rule_linux_double, },
-    { raccess_guess_linux_netatalk,    FT_RFork_Rule_linux_netatalk, },
-  };
-
   FT_BASE_DEF( void )
   FT_Raccess_Guess( FT_Library  library,
                     FT_Stream   stream,
   FT_BASE_DEF( void )
   FT_Raccess_Guess( FT_Library  library,
                     FT_Stream   stream,
                     FT_Long    *offsets,
                     FT_Error   *errors )
   {
                     FT_Long    *offsets,
                     FT_Error   *errors )
   {
-    FT_Long  i;
+    FT_Int  i;
 
 
     for ( i = 0; i < FT_RACCESS_N_RULES; i++ )
 
 
     for ( i = 0; i < FT_RACCESS_N_RULES; i++ )
       if ( errors[i] )
         continue ;
 
       if ( errors[i] )
         continue ;
 
-      errors[i] = (raccess_guess_table[i].func)( library,
+      errors[i] = (FT_RACCESS_GUESS_TABLE_GET[i].func)( library,
                                                  stream, base_name,
                                                  &(new_names[i]),
                                                  &(offsets[i]) );
                                                  stream, base_name,
                                                  &(new_names[i]),
                                                  &(offsets[i]) );
   }
 
 
   }
 
 
+#ifndef FT_MACINTOSH
   static FT_RFork_Rule
   static FT_RFork_Rule
-  raccess_get_rule_type_from_rule_index( FT_UInt  rule_index )
+  raccess_get_rule_type_from_rule_index( FT_Library  library,
+                                         FT_UInt     rule_index )
   {
   {
+    FT_UNUSED( library );
+
     if ( rule_index >= FT_RACCESS_N_RULES )
       return FT_RFork_Rule_invalid;
 
     if ( rule_index >= FT_RACCESS_N_RULES )
       return FT_RFork_Rule_invalid;
 
-    return raccess_guess_table[rule_index].type;
+    return FT_RACCESS_GUESS_TABLE_GET[rule_index].type;
   }
 
 
   }
 
 
+  /*
+   * For this function, refer ftbase.h.
+   */
   FT_LOCAL_DEF( FT_Bool )
   FT_LOCAL_DEF( FT_Bool )
-  raccess_rule_by_darwin_vfs( FT_UInt  rule_index )
+  ft_raccess_rule_by_darwin_vfs( FT_Library  library,
+                                 FT_UInt     rule_index )
   {
   {
-    switch( raccess_get_rule_type_from_rule_index( rule_index ) )
+    switch( raccess_get_rule_type_from_rule_index( library, rule_index ) )
     {
       case FT_RFork_Rule_darwin_newvfs:
       case FT_RFork_Rule_darwin_hfsplus:
     {
       case FT_RFork_Rule_darwin_newvfs:
       case FT_RFork_Rule_darwin_hfsplus:
         return FALSE;
     }
   }
         return FALSE;
     }
   }
+#endif
 
 
   static FT_Error
 
 
   static FT_Error
 
     *result_file_name = NULL;
     if ( NULL == stream )
 
     *result_file_name = NULL;
     if ( NULL == stream )
-      return FT_Err_Cannot_Open_Stream;
+      return FT_THROW( Cannot_Open_Stream );
 
     return raccess_guess_apple_generic( library, stream, base_file_name,
                                         magic, result_offset );
 
     return raccess_guess_apple_generic( library, stream, base_file_name,
                                         magic, result_offset );
 
     *result_file_name = NULL;
     if ( NULL == stream )
 
     *result_file_name = NULL;
     if ( NULL == stream )
-      return FT_Err_Cannot_Open_Stream;
+      return FT_THROW( Cannot_Open_Stream );
 
     return raccess_guess_apple_generic( library, stream, base_file_name,
                                         magic, result_offset );
 
     return raccess_guess_apple_generic( library, stream, base_file_name,
                                         magic, result_offset );
     memory  = library->memory;
     newpath = raccess_make_file_name( memory, base_file_name, "._" );
     if ( !newpath )
     memory  = library->memory;
     newpath = raccess_make_file_name( memory, base_file_name, "._" );
     if ( !newpath )
-      return FT_Err_Out_Of_Memory;
+      return FT_THROW( Out_Of_Memory );
 
     error = raccess_guess_linux_double_from_file_name( library, newpath,
                                                        result_offset );
 
     error = raccess_guess_linux_double_from_file_name( library, newpath,
                                                        result_offset );
       Only meaningful on systems with hfs+ drivers (or Macs).
      */
     FT_Error   error;
       Only meaningful on systems with hfs+ drivers (or Macs).
      */
     FT_Error   error;
-    char*      newpath;
+    char*      newpath = NULL;
     FT_Memory  memory;
     FT_Memory  memory;
-    FT_Long    base_file_len = ft_strlen( base_file_name );
+    FT_Long    base_file_len = (FT_Long)ft_strlen( base_file_name );
 
     FT_UNUSED( stream );
 
 
     FT_UNUSED( stream );
 
     memory = library->memory;
 
     if ( base_file_len + 6 > FT_INT_MAX )
     memory = library->memory;
 
     if ( base_file_len + 6 > FT_INT_MAX )
-      return FT_Err_Array_Too_Large;
+      return FT_THROW( Array_Too_Large );
 
     if ( FT_ALLOC( newpath, base_file_len + 6 ) )
       return error;
 
     if ( FT_ALLOC( newpath, base_file_len + 6 ) )
       return error;
       Only meaningful on systems with Mac OS X (> 10.1).
      */
     FT_Error   error;
       Only meaningful on systems with Mac OS X (> 10.1).
      */
     FT_Error   error;
-    char*      newpath;
+    char*      newpath = NULL;
     FT_Memory  memory;
     FT_Memory  memory;
-    FT_Long    base_file_len = ft_strlen( base_file_name );
+    FT_Long    base_file_len = (FT_Long)ft_strlen( base_file_name );
 
     FT_UNUSED( stream );
 
 
     FT_UNUSED( stream );
 
     memory = library->memory;
 
     if ( base_file_len + 18 > FT_INT_MAX )
     memory = library->memory;
 
     if ( base_file_len + 18 > FT_INT_MAX )
-      return FT_Err_Array_Too_Large;
+      return FT_THROW( Array_Too_Large );
 
     if ( FT_ALLOC( newpath, base_file_len + 18 ) )
       return error;
 
     if ( FT_ALLOC( newpath, base_file_len + 18 ) )
       return error;
     newpath = raccess_make_file_name( memory, base_file_name,
                                       "resource.frk/" );
     if ( !newpath )
     newpath = raccess_make_file_name( memory, base_file_name,
                                       "resource.frk/" );
     if ( !newpath )
-      return FT_Err_Out_Of_Memory;
+      return FT_THROW( Out_Of_Memory );
 
     *result_file_name = newpath;
     *result_offset    = 0;
 
     *result_file_name = newpath;
     *result_offset    = 0;
 
     newpath = raccess_make_file_name( memory, base_file_name, ".resource/" );
     if ( !newpath )
 
     newpath = raccess_make_file_name( memory, base_file_name, ".resource/" );
     if ( !newpath )
-      return FT_Err_Out_Of_Memory;
+      return FT_THROW( Out_Of_Memory );
 
     *result_file_name = newpath;
     *result_offset    = 0;
 
     *result_file_name = newpath;
     *result_offset    = 0;
 
     newpath = raccess_make_file_name( memory, base_file_name, "%" );
     if ( !newpath )
 
     newpath = raccess_make_file_name( memory, base_file_name, "%" );
     if ( !newpath )
-      return FT_Err_Out_Of_Memory;
+      return FT_THROW( Out_Of_Memory );
 
     error = raccess_guess_linux_double_from_file_name( library, newpath,
                                                        result_offset );
 
     error = raccess_guess_linux_double_from_file_name( library, newpath,
                                                        result_offset );
     newpath = raccess_make_file_name( memory, base_file_name,
                                       ".AppleDouble/" );
     if ( !newpath )
     newpath = raccess_make_file_name( memory, base_file_name,
                                       ".AppleDouble/" );
     if ( !newpath )
-      return FT_Err_Out_Of_Memory;
+      return FT_THROW( Out_Of_Memory );
 
     error = raccess_guess_linux_double_from_file_name( library, newpath,
                                                        result_offset );
 
     error = raccess_guess_linux_double_from_file_name( library, newpath,
                                                        result_offset );
     if ( FT_READ_LONG( magic_from_stream ) )
       return error;
     if ( magic_from_stream != magic )
     if ( FT_READ_LONG( magic_from_stream ) )
       return error;
     if ( magic_from_stream != magic )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     if ( FT_READ_LONG( version_number ) )
       return error;
 
     if ( FT_READ_LONG( version_number ) )
       return error;
     if ( FT_READ_USHORT( n_of_entries ) )
       return error;
     if ( n_of_entries == 0 )
     if ( FT_READ_USHORT( n_of_entries ) )
       return error;
     if ( n_of_entries == 0 )
-      return FT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     for ( i = 0; i < n_of_entries; i++ )
     {
 
     for ( i = 0; i < n_of_entries; i++ )
     {
       }
     }
 
       }
     }
 
-    return FT_Err_Unknown_File_Format;
+    return FT_THROW( Unknown_File_Format );
   }
 
 
   }
 
 
                     FT_Long    *offsets,
                     FT_Error   *errors )
   {
                     FT_Long    *offsets,
                     FT_Error   *errors )
   {
-    int  i;
+    FT_Int  i;
 
     FT_UNUSED( library );
     FT_UNUSED( stream );
 
     FT_UNUSED( library );
     FT_UNUSED( stream );
     {
       new_names[i] = NULL;
       offsets[i]   = 0;
     {
       new_names[i] = NULL;
       offsets[i]   = 0;
-      errors[i]    = FT_Err_Unimplemented_Feature;
+      errors[i]    = FT_ERR( Unimplemented_Feature );
     }
   }
 
     }
   }
 
index 3447888..260e91c 100644 (file)
@@ -44,7 +44,7 @@
                     FT_UInt       idx,
                     FT_SfntName  *aname )
   {
                     FT_UInt       idx,
                     FT_SfntName  *aname )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
 
 
     if ( aname && face && FT_IS_SFNT( face ) )
 
 
     if ( aname && face && FT_IS_SFNT( face ) )
index 210aaa4..d965333 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    I/O stream support (body).                                           */
 /*                                                                         */
 /*                                                                         */
 /*    I/O stream support (body).                                           */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2004, 2005, 2006, 2008, 2009, 2010 by       */
+/*  Copyright 2000-2002, 2004-2006, 2008-2011, 2013 by                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -68,7 +68,7 @@
                    " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                    pos, stream->size ));
 
                    " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                    pos, stream->size ));
 
-        error = FT_Err_Invalid_Stream_Operation;
+        error = FT_THROW( Invalid_Stream_Operation );
       }
     }
     /* note that seeking to the first position after the file is valid */
       }
     }
     /* note that seeking to the first position after the file is valid */
@@ -78,7 +78,7 @@
                  " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                  pos, stream->size ));
 
                  " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                  pos, stream->size ));
 
-      error = FT_Err_Invalid_Stream_Operation;
+      error = FT_THROW( Invalid_Stream_Operation );
     }
 
     if ( !error )
     }
 
     if ( !error )
@@ -93,7 +93,7 @@
                   FT_Long    distance )
   {
     if ( distance < 0 )
                   FT_Long    distance )
   {
     if ( distance < 0 )
-      return FT_Err_Invalid_Stream_Operation;
+      return FT_THROW( Invalid_Stream_Operation );
 
     return FT_Stream_Seek( stream, (FT_ULong)( stream->pos + distance ) );
   }
 
     return FT_Stream_Seek( stream, (FT_ULong)( stream->pos + distance ) );
   }
                  " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                  pos, stream->size ));
 
                  " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                  pos, stream->size ));
 
-      return FT_Err_Invalid_Stream_Operation;
+      return FT_THROW( Invalid_Stream_Operation );
     }
 
     if ( stream->read )
     }
 
     if ( stream->read )
                  " invalid read; expected %lu bytes, got %lu\n",
                  count, read_bytes ));
 
                  " invalid read; expected %lu bytes, got %lu\n",
                  count, read_bytes ));
 
-      error = FT_Err_Invalid_Stream_Operation;
+      error = FT_THROW( Invalid_Stream_Operation );
     }
 
     return error;
     }
 
     return error;
                    " frame size (%lu) larger than stream size (%lu)\n",
                    count, stream->size ));
 
                    " frame size (%lu) larger than stream size (%lu)\n",
                    count, stream->size ));
 
-        error = FT_Err_Invalid_Stream_Operation;
+        error = FT_THROW( Invalid_Stream_Operation );
         goto Exit;
       }
 
         goto Exit;
       }
 
                    count, read_bytes ));
 
         FT_FREE( stream->base );
                    count, read_bytes ));
 
         FT_FREE( stream->base );
-        error = FT_Err_Invalid_Stream_Operation;
+        error = FT_THROW( Invalid_Stream_Operation );
       }
       stream->cursor = stream->base;
       stream->limit  = stream->cursor + count;
       }
       stream->cursor = stream->base;
       stream->limit  = stream->cursor + count;
                    " invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx\n",
                    stream->pos, count, stream->size ));
 
                    " invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx\n",
                    stream->pos, count, stream->size ));
 
-        error = FT_Err_Invalid_Stream_Operation;
+        error = FT_THROW( Invalid_Stream_Operation );
         goto Exit;
       }
 
         goto Exit;
       }
 
   }
 
 
   }
 
 
-  FT_BASE_DEF( FT_Short )
-  FT_Stream_GetShort( FT_Stream  stream )
+  FT_BASE_DEF( FT_UShort )
+  FT_Stream_GetUShort( FT_Stream  stream )
   {
     FT_Byte*  p;
     FT_Short  result;
   {
     FT_Byte*  p;
     FT_Short  result;
     result         = 0;
     p              = stream->cursor;
     if ( p + 1 < stream->limit )
     result         = 0;
     p              = stream->cursor;
     if ( p + 1 < stream->limit )
-      result       = FT_NEXT_SHORT( p );
+      result       = FT_NEXT_USHORT( p );
     stream->cursor = p;
 
     return result;
   }
 
 
     stream->cursor = p;
 
     return result;
   }
 
 
-  FT_BASE_DEF( FT_Short )
-  FT_Stream_GetShortLE( FT_Stream  stream )
+  FT_BASE_DEF( FT_UShort )
+  FT_Stream_GetUShortLE( FT_Stream  stream )
   {
     FT_Byte*  p;
     FT_Short  result;
   {
     FT_Byte*  p;
     FT_Short  result;
     result         = 0;
     p              = stream->cursor;
     if ( p + 1 < stream->limit )
     result         = 0;
     p              = stream->cursor;
     if ( p + 1 < stream->limit )
-      result       = FT_NEXT_SHORT_LE( p );
+      result       = FT_NEXT_USHORT_LE( p );
     stream->cursor = p;
 
     return result;
   }
 
 
     stream->cursor = p;
 
     return result;
   }
 
 
-  FT_BASE_DEF( FT_Long )
-  FT_Stream_GetOffset( FT_Stream  stream )
+  FT_BASE_DEF( FT_ULong )
+  FT_Stream_GetUOffset( FT_Stream  stream )
   {
     FT_Byte*  p;
     FT_Long   result;
   {
     FT_Byte*  p;
     FT_Long   result;
     result         = 0;
     p              = stream->cursor;
     if ( p + 2 < stream->limit )
     result         = 0;
     p              = stream->cursor;
     if ( p + 2 < stream->limit )
-      result       = FT_NEXT_OFF3( p );
+      result       = FT_NEXT_UOFF3( p );
     stream->cursor = p;
     return result;
   }
 
 
     stream->cursor = p;
     return result;
   }
 
 
-  FT_BASE_DEF( FT_Long )
-  FT_Stream_GetLong( FT_Stream  stream )
+  FT_BASE_DEF( FT_ULong )
+  FT_Stream_GetULong( FT_Stream  stream )
   {
     FT_Byte*  p;
     FT_Long   result;
   {
     FT_Byte*  p;
     FT_Long   result;
     result         = 0;
     p              = stream->cursor;
     if ( p + 3 < stream->limit )
     result         = 0;
     p              = stream->cursor;
     if ( p + 3 < stream->limit )
-      result       = FT_NEXT_LONG( p );
+      result       = FT_NEXT_ULONG( p );
     stream->cursor = p;
     return result;
   }
 
 
     stream->cursor = p;
     return result;
   }
 
 
-  FT_BASE_DEF( FT_Long )
-  FT_Stream_GetLongLE( FT_Stream  stream )
+  FT_BASE_DEF( FT_ULong )
+  FT_Stream_GetULongLE( FT_Stream  stream )
   {
     FT_Byte*  p;
     FT_Long   result;
   {
     FT_Byte*  p;
     FT_Long   result;
     result         = 0;
     p              = stream->cursor;
     if ( p + 3 < stream->limit )
     result         = 0;
     p              = stream->cursor;
     if ( p + 3 < stream->limit )
-      result       = FT_NEXT_LONG_LE( p );
+      result       = FT_NEXT_ULONG_LE( p );
     stream->cursor = p;
     return result;
   }
     stream->cursor = p;
     return result;
   }
     return result;
 
   Fail:
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
+    *error = FT_THROW( Invalid_Stream_Operation );
     FT_ERROR(( "FT_Stream_ReadChar:"
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
     FT_ERROR(( "FT_Stream_ReadChar:"
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
   }
 
 
   }
 
 
-  FT_BASE_DEF( FT_Short )
-  FT_Stream_ReadShort( FT_Stream  stream,
+  FT_BASE_DEF( FT_UShort )
+  FT_Stream_ReadUShort( FT_Stream  stream,
                        FT_Error*  error )
   {
     FT_Byte   reads[2];
                        FT_Error*  error )
   {
     FT_Byte   reads[2];
       }
 
       if ( p )
       }
 
       if ( p )
-        result = FT_NEXT_SHORT( p );
+        result = FT_NEXT_USHORT( p );
     }
     else
       goto Fail;
     }
     else
       goto Fail;
     return result;
 
   Fail:
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
-    FT_ERROR(( "FT_Stream_ReadShort:"
+    *error = FT_THROW( Invalid_Stream_Operation );
+    FT_ERROR(( "FT_Stream_ReadUShort:"
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
   }
 
 
   }
 
 
-  FT_BASE_DEF( FT_Short )
-  FT_Stream_ReadShortLE( FT_Stream  stream,
+  FT_BASE_DEF( FT_UShort )
+  FT_Stream_ReadUShortLE( FT_Stream  stream,
                          FT_Error*  error )
   {
     FT_Byte   reads[2];
                          FT_Error*  error )
   {
     FT_Byte   reads[2];
       }
 
       if ( p )
       }
 
       if ( p )
-        result = FT_NEXT_SHORT_LE( p );
+        result = FT_NEXT_USHORT_LE( p );
     }
     else
       goto Fail;
     }
     else
       goto Fail;
     return result;
 
   Fail:
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
-    FT_ERROR(( "FT_Stream_ReadShortLE:"
+    *error = FT_THROW( Invalid_Stream_Operation );
+    FT_ERROR(( "FT_Stream_ReadUShortLE:"
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
   }
 
 
   }
 
 
-  FT_BASE_DEF( FT_Long )
-  FT_Stream_ReadOffset( FT_Stream  stream,
+  FT_BASE_DEF( FT_ULong )
+  FT_Stream_ReadUOffset( FT_Stream  stream,
                         FT_Error*  error )
   {
     FT_Byte   reads[3];
                         FT_Error*  error )
   {
     FT_Byte   reads[3];
       }
 
       if ( p )
       }
 
       if ( p )
-        result = FT_NEXT_OFF3( p );
+        result = FT_NEXT_UOFF3( p );
     }
     else
       goto Fail;
     }
     else
       goto Fail;
     return result;
 
   Fail:
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
-    FT_ERROR(( "FT_Stream_ReadOffset:"
+    *error = FT_THROW( Invalid_Stream_Operation );
+    FT_ERROR(( "FT_Stream_ReadUOffset:"
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
   }
 
 
   }
 
 
-  FT_BASE_DEF( FT_Long )
-  FT_Stream_ReadLong( FT_Stream  stream,
+  FT_BASE_DEF( FT_ULong )
+  FT_Stream_ReadULong( FT_Stream  stream,
                       FT_Error*  error )
   {
     FT_Byte   reads[4];
                       FT_Error*  error )
   {
     FT_Byte   reads[4];
       }
 
       if ( p )
       }
 
       if ( p )
-        result = FT_NEXT_LONG( p );
+        result = FT_NEXT_ULONG( p );
     }
     else
       goto Fail;
     }
     else
       goto Fail;
     return result;
 
   Fail:
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
-    FT_ERROR(( "FT_Stream_ReadLong:"
+    *error = FT_THROW( Invalid_Stream_Operation );
+    FT_ERROR(( "FT_Stream_ReadULong:"
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
   }
 
 
   }
 
 
-  FT_BASE_DEF( FT_Long )
-  FT_Stream_ReadLongLE( FT_Stream  stream,
+  FT_BASE_DEF( FT_ULong )
+  FT_Stream_ReadULongLE( FT_Stream  stream,
                         FT_Error*  error )
   {
     FT_Byte   reads[4];
                         FT_Error*  error )
   {
     FT_Byte   reads[4];
       }
 
       if ( p )
       }
 
       if ( p )
-        result = FT_NEXT_LONG_LE( p );
+        result = FT_NEXT_ULONG_LE( p );
     }
     else
       goto Fail;
     }
     else
       goto Fail;
     return result;
 
   Fail:
     return result;
 
   Fail:
-    *error = FT_Err_Invalid_Stream_Operation;
-    FT_ERROR(( "FT_Stream_ReadLongLE:"
+    *error = FT_THROW( Invalid_Stream_Operation );
+    FT_ERROR(( "FT_Stream_ReadULongLE:"
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
                " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
     FT_Bool   frame_accessed = 0;
     FT_Byte*  cursor;
 
     FT_Bool   frame_accessed = 0;
     FT_Byte*  cursor;
 
+
     if ( !fields || !stream )
     if ( !fields || !stream )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     cursor = stream->cursor;
 
 
     cursor = stream->cursor;
 
 
           if ( cursor + len > stream->limit )
           {
 
           if ( cursor + len > stream->limit )
           {
-            error = FT_Err_Invalid_Stream_Operation;
+            error = FT_THROW( Invalid_Stream_Operation );
             goto Exit;
           }
 
             goto Exit;
           }
 
 
       case ft_frame_byte:
       case ft_frame_schar:  /* read a single byte */
 
       case ft_frame_byte:
       case ft_frame_schar:  /* read a single byte */
-        value = FT_NEXT_BYTE(cursor);
+        value = FT_NEXT_BYTE( cursor );
         sign_shift = 24;
         break;
 
       case ft_frame_short_be:
       case ft_frame_ushort_be:  /* read a 2-byte big-endian short */
         sign_shift = 24;
         break;
 
       case ft_frame_short_be:
       case ft_frame_ushort_be:  /* read a 2-byte big-endian short */
-        value = FT_NEXT_USHORT(cursor);
+        value = FT_NEXT_USHORT( cursor) ;
         sign_shift = 16;
         break;
 
       case ft_frame_short_le:
       case ft_frame_ushort_le:  /* read a 2-byte little-endian short */
         sign_shift = 16;
         break;
 
       case ft_frame_short_le:
       case ft_frame_ushort_le:  /* read a 2-byte little-endian short */
-        value = FT_NEXT_USHORT_LE(cursor);
+        value = FT_NEXT_USHORT_LE( cursor );
         sign_shift = 16;
         break;
 
       case ft_frame_long_be:
       case ft_frame_ulong_be:  /* read a 4-byte big-endian long */
         sign_shift = 16;
         break;
 
       case ft_frame_long_be:
       case ft_frame_ulong_be:  /* read a 4-byte big-endian long */
-        value = FT_NEXT_ULONG(cursor);
+        value = FT_NEXT_ULONG( cursor );
         sign_shift = 0;
         break;
 
       case ft_frame_long_le:
       case ft_frame_ulong_le:  /* read a 4-byte little-endian long */
         sign_shift = 0;
         break;
 
       case ft_frame_long_le:
       case ft_frame_ulong_le:  /* read a 4-byte little-endian long */
-        value = FT_NEXT_ULONG_LE(cursor);
+        value = FT_NEXT_ULONG_LE( cursor );
         sign_shift = 0;
         break;
 
       case ft_frame_off3_be:
       case ft_frame_uoff3_be:  /* read a 3-byte big-endian long */
         sign_shift = 0;
         break;
 
       case ft_frame_off3_be:
       case ft_frame_uoff3_be:  /* read a 3-byte big-endian long */
-        value = FT_NEXT_UOFF3(cursor);
+        value = FT_NEXT_UOFF3( cursor );
         sign_shift = 8;
         break;
 
       case ft_frame_off3_le:
       case ft_frame_uoff3_le:  /* read a 3-byte little-endian long */
         sign_shift = 8;
         break;
 
       case ft_frame_off3_le:
       case ft_frame_uoff3_le:  /* read a 3-byte little-endian long */
-        value = FT_NEXT_UOFF3_LE(cursor);
+        value = FT_NEXT_UOFF3_LE( cursor );
         sign_shift = 8;
         break;
 
         sign_shift = 8;
         break;
 
       p = (FT_Byte*)structure + fields->offset;
       switch ( fields->size )
       {
       p = (FT_Byte*)structure + fields->offset;
       switch ( fields->size )
       {
-      case (8 / FT_CHAR_BIT):
+      case ( 8 / FT_CHAR_BIT ):
         *(FT_Byte*)p = (FT_Byte)value;
         break;
 
         *(FT_Byte*)p = (FT_Byte)value;
         break;
 
-      case (16 / FT_CHAR_BIT):
+      case ( 16 / FT_CHAR_BIT ):
         *(FT_UShort*)p = (FT_UShort)value;
         break;
 
         *(FT_UShort*)p = (FT_UShort)value;
         break;
 
-      case (32 / FT_CHAR_BIT):
+      case ( 32 / FT_CHAR_BIT ):
         *(FT_UInt32*)p = (FT_UInt32)value;
         break;
 
         *(FT_UInt32*)p = (FT_UInt32)value;
         break;
 
index 75bcbde..ee61cec 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType path stroker (body).                                        */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType path stroker (body).                                        */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by            */
+/*  Copyright 2002-2006, 2008-2011, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -34,7 +34,7 @@
 
 
     return o == FT_ORIENTATION_TRUETYPE ? FT_STROKER_BORDER_RIGHT
 
 
     return o == FT_ORIENTATION_TRUETYPE ? FT_STROKER_BORDER_RIGHT
-                                        : FT_STROKER_BORDER_LEFT ;
+                                        : FT_STROKER_BORDER_LEFT;
   }
 
 
   }
 
 
 
 
     return o == FT_ORIENTATION_TRUETYPE ? FT_STROKER_BORDER_LEFT
 
 
     return o == FT_ORIENTATION_TRUETYPE ? FT_STROKER_BORDER_LEFT
-                                        : FT_STROKER_BORDER_RIGHT ;
+                                        : FT_STROKER_BORDER_RIGHT;
   }
 
 
   }
 
 
/***************************************************************************/
/***************************************************************************/
/*****                                                                 *****/
/*****                       BEZIER COMPUTATIONS                       *****/
/*****                                                                 *****/
/***************************************************************************/
/***************************************************************************/
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****                      BEZIER COMPUTATIONS                      *****/
 /*****                                                               *****/
 /*************************************************************************/
 /*************************************************************************/
 
 #define FT_SMALL_CONIC_THRESHOLD  ( FT_ANGLE_PI / 6 )
 
 #define FT_SMALL_CONIC_THRESHOLD  ( FT_ANGLE_PI / 6 )
-#define FT_SMALL_CUBIC_THRESHOLD  ( FT_ANGLE_PI / 6 )
+#define FT_SMALL_CUBIC_THRESHOLD  ( FT_ANGLE_PI / 8 )
+
 #define FT_EPSILON  2
 
 #define FT_IS_SMALL( x )  ( (x) > -FT_EPSILON && (x) < FT_EPSILON )
 #define FT_EPSILON  2
 
 #define FT_IS_SMALL( x )  ( (x) > -FT_EPSILON && (x) < FT_EPSILON )
@@ -69,7 +70,7 @@
   static FT_Pos
   ft_pos_abs( FT_Pos  x )
   {
   static FT_Pos
   ft_pos_abs( FT_Pos  x )
   {
-    return x >= 0 ? x : -x ;
+    return x >= 0 ? x : -x;
   }
 
 
   }
 
 
     if ( close1 )
     {
       if ( close2 )
     if ( close1 )
     {
       if ( close2 )
-        *angle_in = *angle_out = 0;
+      {
+        /* basically a point;                      */
+        /* do nothing to retain original direction */
+      }
       else
       else
-        *angle_in = *angle_out = FT_Atan2( d2.x, d2.y );
-    }
-    else if ( close2 )
-    {
-      *angle_in = *angle_out = FT_Atan2( d1.x, d1.y );
+      {
+        *angle_in  =
+        *angle_out = FT_Atan2( d2.x, d2.y );
+      }
     }
     }
-    else
+    else /* !close1 */
     {
     {
-      *angle_in  = FT_Atan2( d1.x, d1.y );
-      *angle_out = FT_Atan2( d2.x, d2.y );
+      if ( close2 )
+      {
+        *angle_in  =
+        *angle_out = FT_Atan2( d1.x, d1.y );
+      }
+      else
+      {
+        *angle_in  = FT_Atan2( d1.x, d1.y );
+        *angle_out = FT_Atan2( d2.x, d2.y );
+      }
     }
 
     theta = ft_pos_abs( FT_Angle_Diff( *angle_in, *angle_out ) );
     }
 
     theta = ft_pos_abs( FT_Angle_Diff( *angle_in, *angle_out ) );
   }
 
 
   }
 
 
+  /* Return the average of `angle1' and `angle2'.            */
+  /* This gives correct result even if `angle1' and `angle2' */
+  /* have opposite signs.                                    */
+  static FT_Angle
+  ft_angle_mean( FT_Angle  angle1,
+                 FT_Angle  angle2 )
+  {
+    return angle1 + FT_Angle_Diff( angle1, angle2 ) / 2;
+  }
+
+
   static FT_Bool
   ft_cubic_is_small_enough( FT_Vector*  base,
                             FT_Angle   *angle_in,
   static FT_Bool
   ft_cubic_is_small_enough( FT_Vector*  base,
                             FT_Angle   *angle_in,
     close2 = FT_IS_SMALL( d2.x ) && FT_IS_SMALL( d2.y );
     close3 = FT_IS_SMALL( d3.x ) && FT_IS_SMALL( d3.y );
 
     close2 = FT_IS_SMALL( d2.x ) && FT_IS_SMALL( d2.y );
     close3 = FT_IS_SMALL( d3.x ) && FT_IS_SMALL( d3.y );
 
-    if ( close1 || close3 )
+    if ( close1 )
     {
       if ( close2 )
       {
     {
       if ( close2 )
       {
-        /* basically a point */
-        *angle_in = *angle_out = *angle_mid = 0;
-      }
-      else if ( close1 )
-      {
-        *angle_in  = *angle_mid = FT_Atan2( d2.x, d2.y );
-        *angle_out = FT_Atan2( d3.x, d3.y );
+        if ( close3 )
+        {
+          /* basically a point;                      */
+          /* do nothing to retain original direction */
+        }
+        else /* !close3 */
+        {
+          *angle_in  =
+          *angle_mid =
+          *angle_out = FT_Atan2( d3.x, d3.y );
+        }
       }
       }
-      else  /* close2 */
+      else /* !close2 */
       {
       {
-        *angle_in  = FT_Atan2( d1.x, d1.y );
-        *angle_mid = *angle_out = FT_Atan2( d2.x, d2.y );
+        if ( close3 )
+        {
+          *angle_in  =
+          *angle_mid =
+          *angle_out = FT_Atan2( d2.x, d2.y );
+        }
+        else /* !close3 */
+        {
+          *angle_in  =
+          *angle_mid = FT_Atan2( d2.x, d2.y );
+          *angle_out = FT_Atan2( d3.x, d3.y );
+        }
       }
     }
       }
     }
-    else if ( close2 )
+    else /* !close1 */
     {
     {
-      *angle_in  = *angle_mid = FT_Atan2( d1.x, d1.y );
-      *angle_out = FT_Atan2( d3.x, d3.y );
-    }
-    else
-    {
-      *angle_in  = FT_Atan2( d1.x, d1.y );
-      *angle_mid = FT_Atan2( d2.x, d2.y );
-      *angle_out = FT_Atan2( d3.x, d3.y );
+      if ( close2 )
+      {
+        if ( close3 )
+        {
+          *angle_in  =
+          *angle_mid =
+          *angle_out = FT_Atan2( d1.x, d1.y );
+        }
+        else /* !close3 */
+        {
+          *angle_in  = FT_Atan2( d1.x, d1.y );
+          *angle_out = FT_Atan2( d3.x, d3.y );
+          *angle_mid = ft_angle_mean( *angle_in, *angle_out );
+        }
+      }
+      else /* !close2 */
+      {
+        if ( close3 )
+        {
+          *angle_in  = FT_Atan2( d1.x, d1.y );
+          *angle_mid =
+          *angle_out = FT_Atan2( d2.x, d2.y );
+        }
+        else /* !close3 */
+        {
+          *angle_in  = FT_Atan2( d1.x, d1.y );
+          *angle_mid = FT_Atan2( d2.x, d2.y );
+          *angle_out = FT_Atan2( d3.x, d3.y );
+        }
+      }
     }
 
     theta1 = ft_pos_abs( FT_Angle_Diff( *angle_in,  *angle_mid ) );
     }
 
     theta1 = ft_pos_abs( FT_Angle_Diff( *angle_in,  *angle_mid ) );
   }
 
 
   }
 
 
/***************************************************************************/
/***************************************************************************/
/*****                                                                 *****/
/*****                       STROKE BORDERS                            *****/
/*****                                                                 *****/
/***************************************************************************/
/***************************************************************************/
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****                       STROKE BORDERS                          *****/
 /*****                                                               *****/
 /*************************************************************************/
 /*************************************************************************/
 
   typedef enum  FT_StrokeTags_
   {
 
   typedef enum  FT_StrokeTags_
   {
 
   } FT_StrokeTags;
 
 
   } FT_StrokeTags;
 
-#define  FT_STROKE_TAG_BEGIN_END  (FT_STROKE_TAG_BEGIN|FT_STROKE_TAG_END)
+#define  FT_STROKE_TAG_BEGIN_END  ( FT_STROKE_TAG_BEGIN | FT_STROKE_TAG_END )
 
   typedef struct  FT_StrokeBorderRec_
   {
 
   typedef struct  FT_StrokeBorderRec_
   {
     FT_UInt     max_points;
     FT_Vector*  points;
     FT_Byte*    tags;
     FT_UInt     max_points;
     FT_Vector*  points;
     FT_Byte*    tags;
-    FT_Bool     movable;
+    FT_Bool     movable;  /* TRUE for ends of lineto borders */
     FT_Int      start;    /* index of current sub-path start point */
     FT_Memory   memory;
     FT_Bool     valid;
     FT_Int      start;    /* index of current sub-path start point */
     FT_Memory   memory;
     FT_Bool     valid;
     }
     else
     {
     }
     else
     {
+      /* don't add zero-length lineto */
+      if ( border->num_points > 0                                          &&
+           FT_IS_SMALL( border->points[border->num_points - 1].x - to->x ) &&
+           FT_IS_SMALL( border->points[border->num_points - 1].y - to->y ) )
+        return error;
+
       /* add one point */
       error = ft_stroke_border_grow( border, 1 );
       if ( !error )
       /* add one point */
       error = ft_stroke_border_grow( border, 1 );
       if ( !error )
       FT_Vector*  vec = border->points + border->num_points;
       FT_Byte*    tag = border->tags   + border->num_points;
 
       FT_Vector*  vec = border->points + border->num_points;
       FT_Byte*    tag = border->tags   + border->num_points;
 
+
       vec[0] = *control;
       vec[1] = *to;
 
       vec[0] = *control;
       vec[1] = *to;
 
 
       border->num_points += 2;
     }
 
       border->num_points += 2;
     }
+
     border->movable = FALSE;
     border->movable = FALSE;
+
     return error;
   }
 
     return error;
   }
 
 
       border->num_points += 3;
     }
 
       border->num_points += 3;
     }
+
     border->movable = FALSE;
     border->movable = FALSE;
+
     return error;
   }
 
     return error;
   }
 
     if ( border->start >= 0 )
       ft_stroke_border_close( border, FALSE );
 
     if ( border->start >= 0 )
       ft_stroke_border_close( border, FALSE );
 
-    border->start   = border->num_points;
+    border->start = border->num_points;
     border->movable = FALSE;
 
     return ft_stroke_border_lineto( border, to, FALSE );
     border->movable = FALSE;
 
     return ft_stroke_border_lineto( border, to, FALSE );
       }
     }
 
       }
     }
 
-    outline->n_points  = (short)( outline->n_points + border->num_points );
+    outline->n_points = (short)( outline->n_points + border->num_points );
 
     FT_ASSERT( FT_Outline_Check( outline ) == 0 );
   }
 
 
 
     FT_ASSERT( FT_Outline_Check( outline ) == 0 );
   }
 
 
/***************************************************************************/
/***************************************************************************/
/*****                                                                 *****/
/*****                           STROKER                               *****/
/*****                                                                 *****/
/***************************************************************************/
/***************************************************************************/
 /*************************************************************************/
 /*************************************************************************/
 /*****                                                               *****/
 /*****                           STROKER                             *****/
 /*****                                                               *****/
 /*************************************************************************/
 /*************************************************************************/
 
 #define FT_SIDE_TO_ROTATE( s )   ( FT_ANGLE_PI2 - (s) * FT_ANGLE_PI )
 
   typedef struct  FT_StrokerRec_
   {
 
 #define FT_SIDE_TO_ROTATE( s )   ( FT_ANGLE_PI2 - (s) * FT_ANGLE_PI )
 
   typedef struct  FT_StrokerRec_
   {
-    FT_Angle             angle_in;
-    FT_Angle             angle_out;
-    FT_Vector            center;
-    FT_Bool              first_point;
-    FT_Bool              subpath_open;
-    FT_Angle             subpath_angle;
-    FT_Vector            subpath_start;
+    FT_Angle             angle_in;             /* direction into curr join */
+    FT_Angle             angle_out;            /* direction out of join  */
+    FT_Vector            center;               /* current position */
+    FT_Fixed             line_length;          /* length of last lineto */
+    FT_Bool              first_point;          /* is this the start? */
+    FT_Bool              subpath_open;         /* is the subpath open? */
+    FT_Angle             subpath_angle;        /* subpath start direction */
+    FT_Vector            subpath_start;        /* subpath start position */
+    FT_Fixed             subpath_line_length;  /* subpath start lineto len */
+    FT_Bool              handle_wide_strokes;  /* use wide strokes logic? */
 
     FT_Stroker_LineCap   line_cap;
     FT_Stroker_LineJoin  line_join;
 
     FT_Stroker_LineCap   line_cap;
     FT_Stroker_LineJoin  line_join;
+    FT_Stroker_LineJoin  line_join_saved;
     FT_Fixed             miter_limit;
     FT_Fixed             radius;
 
     FT_Fixed             miter_limit;
     FT_Fixed             radius;
 
-    FT_Bool              valid;
     FT_StrokeBorderRec   borders[2];
     FT_Library           library;
 
     FT_StrokeBorderRec   borders[2];
     FT_Library           library;
 
   FT_Stroker_New( FT_Library   library,
                   FT_Stroker  *astroker )
   {
   FT_Stroker_New( FT_Library   library,
                   FT_Stroker  *astroker )
   {
-    FT_Error    error;
+    FT_Error    error;           /* assigned in FT_NEW */
     FT_Memory   memory;
     FT_Memory   memory;
-    FT_Stroker  stroker;
+    FT_Stroker  stroker = NULL;
 
 
     if ( !library )
 
 
     if ( !library )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     memory = library->memory;
 
 
     memory = library->memory;
 
       ft_stroke_border_init( &stroker->borders[0], memory );
       ft_stroke_border_init( &stroker->borders[1], memory );
     }
       ft_stroke_border_init( &stroker->borders[0], memory );
       ft_stroke_border_init( &stroker->borders[1], memory );
     }
+
     *astroker = stroker;
     *astroker = stroker;
+
     return error;
   }
 
     return error;
   }
 
     stroker->line_join   = line_join;
     stroker->miter_limit = miter_limit;
 
     stroker->line_join   = line_join;
     stroker->miter_limit = miter_limit;
 
+    /* ensure miter limit has sensible value */
+    if ( stroker->miter_limit < 0x10000 )
+      stroker->miter_limit = 0x10000;
+
+    /* save line join style:                                           */
+    /* line join style can be temporarily changed when stroking curves */
+    stroker->line_join_saved = line_join;
+
     FT_Stroker_Rewind( stroker );
   }
 
     FT_Stroker_Rewind( stroker );
   }
 
   }
 
 
   }
 
 
-  /* creates a circular arc at a corner or cap */
+  /* create a circular arc at a corner or cap */
   static FT_Error
   ft_stroker_arcto( FT_Stroker  stroker,
                     FT_Int      side )
   static FT_Error
   ft_stroker_arcto( FT_Stroker  stroker,
                     FT_Int      side )
   }
 
 
   }
 
 
-  /* adds a cap at the end of an opened path */
+  /* add a cap at the end of an opened path */
   static FT_Error
   ft_stroker_cap( FT_Stroker  stroker,
                   FT_Angle    angle,
   static FT_Error
   ft_stroker_cap( FT_Stroker  stroker,
                   FT_Angle    angle,
       /* add a round cap */
       stroker->angle_in  = angle;
       stroker->angle_out = angle + FT_ANGLE_PI;
       /* add a round cap */
       stroker->angle_in  = angle;
       stroker->angle_out = angle + FT_ANGLE_PI;
+
       error = ft_stroker_arcto( stroker, side );
     }
     else if ( stroker->line_cap == FT_STROKER_LINECAP_SQUARE )
       error = ft_stroker_arcto( stroker, side );
     }
     else if ( stroker->line_cap == FT_STROKER_LINECAP_SQUARE )
       delta.x += stroker->center.x;
       delta.y += stroker->center.y;
 
       delta.x += stroker->center.x;
       delta.y += stroker->center.y;
 
-      error = ft_stroke_border_lineto( border, &delta, FALSE );   
+      error = ft_stroke_border_lineto( border, &delta, FALSE );
     }
 
   Exit:
     }
 
   Exit:
   /* process an inside corner, i.e. compute intersection */
   static FT_Error
   ft_stroker_inside( FT_Stroker  stroker,
   /* process an inside corner, i.e. compute intersection */
   static FT_Error
   ft_stroker_inside( FT_Stroker  stroker,
-                     FT_Int      side)
+                     FT_Int      side,
+                     FT_Fixed    line_length )
   {
     FT_StrokeBorder  border = stroker->borders + side;
     FT_Angle         phi, theta, rotate;
   {
     FT_StrokeBorder  border = stroker->borders + side;
     FT_Angle         phi, theta, rotate;
-    FT_Fixed         length, thcos, sigma;
+    FT_Fixed         length, thcos;
     FT_Vector        delta;
     FT_Error         error = FT_Err_Ok;
     FT_Vector        delta;
     FT_Error         error = FT_Err_Ok;
+    FT_Bool          intersect;          /* use intersection of lines? */
 
 
     rotate = FT_SIDE_TO_ROTATE( side );
 
 
 
     rotate = FT_SIDE_TO_ROTATE( side );
 
-    /* compute median angle */
-    theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out );
-    if ( theta == FT_ANGLE_PI )
-      theta = rotate;
+    theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out ) / 2;
+
+    /* Only intersect borders if between two lineto's and both */
+    /* lines are long enough (line_length is zero for curves). */
+    if ( !border->movable || line_length == 0 )
+      intersect = FALSE;
     else
     else
-      theta = theta / 2;
+    {
+      /* compute minimum required length of lines */
+      FT_Fixed  min_length = ft_pos_abs( FT_MulFix( stroker->radius,
+                                                    FT_Tan( theta ) ) );
 
 
-    phi = stroker->angle_in + theta;
 
 
-    thcos = FT_Cos( theta );
-    sigma = FT_MulFix( stroker->miter_limit, thcos );
+      intersect = FT_BOOL( stroker->line_length >= min_length &&
+                           line_length          >= min_length );
+    }
 
 
-    /* TODO: find better criterion to switch off the optimization */
-    if ( sigma < 0x10000L )
+    if ( !intersect )
     {
       FT_Vector_From_Polar( &delta, stroker->radius,
                             stroker->angle_out + rotate );
       delta.x += stroker->center.x;
       delta.y += stroker->center.y;
     {
       FT_Vector_From_Polar( &delta, stroker->radius,
                             stroker->angle_out + rotate );
       delta.x += stroker->center.x;
       delta.y += stroker->center.y;
+
       border->movable = FALSE;
     }
     else
     {
       border->movable = FALSE;
     }
     else
     {
+      /* compute median angle */
+      phi = stroker->angle_in + theta;
+
+      thcos = FT_Cos( theta );
+
       length = FT_DivFix( stroker->radius, thcos );
 
       FT_Vector_From_Polar( &delta, length, phi + rotate );
       length = FT_DivFix( stroker->radius, thcos );
 
       FT_Vector_From_Polar( &delta, length, phi + rotate );
   /* process an outside corner, i.e. compute bevel/miter/round */
   static FT_Error
   ft_stroker_outside( FT_Stroker  stroker,
   /* process an outside corner, i.e. compute bevel/miter/round */
   static FT_Error
   ft_stroker_outside( FT_Stroker  stroker,
-                      FT_Int      side )
+                      FT_Int      side,
+                      FT_Fixed    line_length )
   {
     FT_StrokeBorder  border = stroker->borders + side;
     FT_Error         error;
   {
     FT_StrokeBorder  border = stroker->borders + side;
     FT_Error         error;
       error = ft_stroker_arcto( stroker, side );
     else
     {
       error = ft_stroker_arcto( stroker, side );
     else
     {
-      /* this is a mitered or beveled corner */
-      FT_Fixed  sigma, radius = stroker->radius;
-      FT_Angle  theta, phi;
-      FT_Fixed  thcos;
-      FT_Bool   miter;
+      /* this is a mitered (pointed) or beveled (truncated) corner */
+      FT_Fixed  sigma = 0, radius = stroker->radius;
+      FT_Angle  theta = 0, phi = 0;
+      FT_Fixed  thcos = 0;
+      FT_Bool   bevel, fixed_bevel;
 
 
       rotate = FT_SIDE_TO_ROTATE( side );
 
 
       rotate = FT_SIDE_TO_ROTATE( side );
-      miter  = FT_BOOL( stroker->line_join == FT_STROKER_LINEJOIN_MITER );
 
 
-      theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out );
-      if ( theta == FT_ANGLE_PI )
+      bevel =
+        FT_BOOL( stroker->line_join == FT_STROKER_LINEJOIN_BEVEL );
+
+      fixed_bevel =
+        FT_BOOL( stroker->line_join != FT_STROKER_LINEJOIN_MITER_VARIABLE );
+
+      if ( !bevel )
       {
       {
-        theta = rotate;
-        phi   = stroker->angle_in;
+        theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out );
+
+        if ( theta == FT_ANGLE_PI )
+        {
+          theta = rotate;
+          phi   = stroker->angle_in;
+        }
+        else
+        {
+          theta /= 2;
+          phi    = stroker->angle_in + theta + rotate;
+        }
+
+        thcos = FT_Cos( theta );
+        sigma = FT_MulFix( stroker->miter_limit, thcos );
+
+        /* is miter limit exceeded? */
+        if ( sigma < 0x10000L )
+        {
+          /* don't create variable bevels for very small deviations; */
+          /* FT_Sin(x) = 0 for x <= 57                               */
+          if ( fixed_bevel || ft_pos_abs( theta ) > 57 )
+            bevel = TRUE;
+        }
       }
       }
-      else
+
+      if ( bevel )  /* this is a bevel (broken angle) */
       {
       {
-        theta = theta / 2;
-        phi   = stroker->angle_in + theta + rotate;
-      }
+        if ( fixed_bevel )
+        {
+          /* the outer corners are simply joined together */
+          FT_Vector  delta;
 
 
-      thcos = FT_Cos( theta );
-      sigma = FT_MulFix( stroker->miter_limit, thcos );
 
 
-      /* FT_Sin(x) = 0 for x <= 57 */
-      if ( sigma >= 0x10000L || ft_pos_abs( theta ) <= 57 )
-        miter = FALSE;
+          /* add bevel */
+          FT_Vector_From_Polar( &delta,
+                                radius,
+                                stroker->angle_out + rotate );
+          delta.x += stroker->center.x;
+          delta.y += stroker->center.y;
 
 
-      if ( miter )  /* this is a miter (broken angle) */
-      {
-        FT_Vector  middle, delta;
-        FT_Fixed   length;
+          border->movable = FALSE;
+          error = ft_stroke_border_lineto( border, &delta, FALSE );
+        }
+        else /* variable bevel */
+        {
+          /* the miter is truncated */
+          FT_Vector  middle, delta;
+          FT_Fixed   length;
 
 
 
 
-        /* compute middle point */
-        FT_Vector_From_Polar( &middle,
-                              FT_MulFix( radius, stroker->miter_limit ),
-                              phi );
-        middle.x += stroker->center.x;
-        middle.y += stroker->center.y;
+          /* compute middle point */
+          FT_Vector_From_Polar( &middle,
+                                FT_MulFix( radius, stroker->miter_limit ),
+                                phi );
+          middle.x += stroker->center.x;
+          middle.y += stroker->center.y;
 
 
-        /* compute first angle point */
-        length = FT_MulFix( radius,
-                            FT_DivFix( 0x10000L - sigma,
-                                       ft_pos_abs( FT_Sin( theta ) ) ) );
+          /* compute first angle point */
+          length = FT_MulDiv( radius, 0x10000L - sigma,
+                              ft_pos_abs( FT_Sin( theta ) ) );
 
 
-        FT_Vector_From_Polar( &delta, length, phi + rotate );
-        delta.x += middle.x;
-        delta.y += middle.y;
+          FT_Vector_From_Polar( &delta, length, phi + rotate );
+          delta.x += middle.x;
+          delta.y += middle.y;
 
 
-        error = ft_stroke_border_lineto( border, &delta, FALSE );
-        if ( error )
-          goto Exit;
+          error = ft_stroke_border_lineto( border, &delta, FALSE );
+          if ( error )
+            goto Exit;
 
 
-        /* compute second angle point */
-        FT_Vector_From_Polar( &delta, length, phi - rotate );
-        delta.x += middle.x;
-        delta.y += middle.y;
+          /* compute second angle point */
+          FT_Vector_From_Polar( &delta, length, phi - rotate );
+          delta.x += middle.x;
+          delta.y += middle.y;
 
 
-        error = ft_stroke_border_lineto( border, &delta, FALSE );
-        if ( error )
-          goto Exit;
+          error = ft_stroke_border_lineto( border, &delta, FALSE );
+          if ( error )
+            goto Exit;
 
 
-        /* finally, add a movable end point */
-        FT_Vector_From_Polar( &delta, radius, stroker->angle_out + rotate );
-        delta.x += stroker->center.x;
-        delta.y += stroker->center.y;
+          /* finally, add an end point; only needed if not lineto */
+          /* (line_length is zero for curves)                     */
+          if ( line_length == 0 )
+          {
+            FT_Vector_From_Polar( &delta,
+                                  radius,
+                                  stroker->angle_out + rotate );
 
 
-        error = ft_stroke_border_lineto( border, &delta, TRUE );
-      }
+            delta.x += stroker->center.x;
+            delta.y += stroker->center.y;
 
 
-      else /* this is a bevel (intersection) */
+            error = ft_stroke_border_lineto( border, &delta, FALSE );
+          }
+        }
+      }
+      else /* this is a miter (intersection) */
       {
         FT_Fixed   length;
         FT_Vector  delta;
       {
         FT_Fixed   length;
         FT_Vector  delta;
         if ( error )
           goto Exit;
 
         if ( error )
           goto Exit;
 
-        /* now add end point */
-        FT_Vector_From_Polar( &delta, stroker->radius,
-                              stroker->angle_out + rotate );
-        delta.x += stroker->center.x;
-        delta.y += stroker->center.y;
+        /* now add an end point; only needed if not lineto */
+        /* (line_length is zero for curves)                */
+        if ( line_length == 0 )
+        {
+          FT_Vector_From_Polar( &delta,
+                                stroker->radius,
+                                stroker->angle_out + rotate );
+          delta.x += stroker->center.x;
+          delta.y += stroker->center.y;
 
 
-        error = ft_stroke_border_lineto( border, &delta, TRUE );
+          error = ft_stroke_border_lineto( border, &delta, FALSE );
+        }
       }
     }
 
       }
     }
 
 
 
   static FT_Error
 
 
   static FT_Error
-  ft_stroker_process_corner( FT_Stroker  stroker )
+  ft_stroker_process_corner( FT_Stroker  stroker,
+                             FT_Fixed    line_length )
   {
     FT_Error  error = FT_Err_Ok;
     FT_Angle  turn;
   {
     FT_Error  error = FT_Err_Ok;
     FT_Angle  turn;
       inside_side = 1;
 
     /* process the inside side */
       inside_side = 1;
 
     /* process the inside side */
-    error = ft_stroker_inside( stroker, inside_side );
+    error = ft_stroker_inside( stroker, inside_side, line_length );
     if ( error )
       goto Exit;
 
     /* process the outside side */
     if ( error )
       goto Exit;
 
     /* process the outside side */
-    error = ft_stroker_outside( stroker, 1 - inside_side );
+    error = ft_stroker_outside( stroker, 1 - inside_side, line_length );
 
   Exit:
     return error;
 
   Exit:
     return error;
   /* start of the subpath                                              */
   static FT_Error
   ft_stroker_subpath_start( FT_Stroker  stroker,
   /* start of the subpath                                              */
   static FT_Error
   ft_stroker_subpath_start( FT_Stroker  stroker,
-                            FT_Angle    start_angle )
+                            FT_Angle    start_angle,
+                            FT_Fixed    line_length )
   {
     FT_Vector        delta;
     FT_Vector        point;
   {
     FT_Vector        delta;
     FT_Vector        point;
     border++;
     error = ft_stroke_border_moveto( border, &point );
 
     border++;
     error = ft_stroke_border_moveto( border, &point );
 
-    /* save angle for last cap */
-    stroker->subpath_angle = start_angle;
-    stroker->first_point   = FALSE;
+    /* save angle, position, and line length for last join */
+    /* (line_length is zero for curves)                    */
+    stroker->subpath_angle       = start_angle;
+    stroker->first_point         = FALSE;
+    stroker->subpath_line_length = line_length;
 
   Exit:
     return error;
 
   Exit:
     return error;
     FT_Vector        delta;
     FT_Angle         angle;
     FT_Int           side;
     FT_Vector        delta;
     FT_Angle         angle;
     FT_Int           side;
+    FT_Fixed         line_length;
+
 
     delta.x = to->x - stroker->center.x;
     delta.y = to->y - stroker->center.y;
 
 
     delta.x = to->x - stroker->center.x;
     delta.y = to->y - stroker->center.y;
 
+    /* a zero-length lineto is a no-op; avoid creating a spurious corner */
+    if ( delta.x == 0 && delta.y == 0 )
+       goto Exit;
+
+    /* compute length of line */
+    line_length = FT_Vector_Length( &delta );
+
     angle = FT_Atan2( delta.x, delta.y );
     FT_Vector_From_Polar( &delta, stroker->radius, angle + FT_ANGLE_PI2 );
 
     angle = FT_Atan2( delta.x, delta.y );
     FT_Vector_From_Polar( &delta, stroker->radius, angle + FT_ANGLE_PI2 );
 
       /* This is the first segment of a subpath.  We need to     */
       /* add a point to each border at their respective starting */
       /* point locations.                                        */
       /* This is the first segment of a subpath.  We need to     */
       /* add a point to each border at their respective starting */
       /* point locations.                                        */
-      error = ft_stroker_subpath_start( stroker, angle );
+      error = ft_stroker_subpath_start( stroker, angle, line_length );
       if ( error )
         goto Exit;
     }
       if ( error )
         goto Exit;
     }
     {
       /* process the current corner */
       stroker->angle_out = angle;
     {
       /* process the current corner */
       stroker->angle_out = angle;
-      error = ft_stroker_process_corner( stroker );
+      error = ft_stroker_process_corner( stroker, line_length );
       if ( error )
         goto Exit;
     }
 
     /* now add a line segment to both the `inside' and `outside' paths */
       if ( error )
         goto Exit;
     }
 
     /* now add a line segment to both the `inside' and `outside' paths */
-
     for ( border = stroker->borders, side = 1; side >= 0; side--, border++ )
     {
       FT_Vector  point;
     for ( border = stroker->borders, side = 1; side >= 0; side--, border++ )
     {
       FT_Vector  point;
       point.x = to->x + delta.x;
       point.y = to->y + delta.y;
 
       point.x = to->x + delta.x;
       point.y = to->y + delta.y;
 
+      /* the ends of lineto borders are movable */
       error = ft_stroke_border_lineto( border, &point, TRUE );
       if ( error )
         goto Exit;
       error = ft_stroke_border_lineto( border, &point, TRUE );
       if ( error )
         goto Exit;
       delta.y = -delta.y;
     }
 
       delta.y = -delta.y;
     }
 
-    stroker->angle_in = angle;
-    stroker->center   = *to;
+    stroker->angle_in    = angle;
+    stroker->center      = *to;
+    stroker->line_length = line_length;
 
   Exit:
     return error;
 
   Exit:
     return error;
     FT_Vector   bez_stack[34];
     FT_Vector*  arc;
     FT_Vector*  limit = bez_stack + 30;
     FT_Vector   bez_stack[34];
     FT_Vector*  arc;
     FT_Vector*  limit = bez_stack + 30;
-    FT_Angle    start_angle;
     FT_Bool     first_arc = TRUE;
 
 
     FT_Bool     first_arc = TRUE;
 
 
+    /* if all control points are coincident, this is a no-op; */
+    /* avoid creating a spurious corner                       */
+    if ( FT_IS_SMALL( stroker->center.x - control->x ) &&
+         FT_IS_SMALL( stroker->center.y - control->y ) &&
+         FT_IS_SMALL( control->x        - to->x      ) &&
+         FT_IS_SMALL( control->y        - to->y      ) )
+    {
+       stroker->center = *to;
+       goto Exit;
+    }
+
     arc    = bez_stack;
     arc[0] = *to;
     arc[1] = *control;
     arc    = bez_stack;
     arc[0] = *to;
     arc[1] = *control;
       FT_Angle  angle_in, angle_out;
 
 
       FT_Angle  angle_in, angle_out;
 
 
-      angle_in = angle_out = 0;  /* remove compiler warnings */
+      /* initialize with current direction */
+      angle_in = angle_out = stroker->angle_in;
 
       if ( arc < limit                                             &&
            !ft_conic_is_small_enough( arc, &angle_in, &angle_out ) )
       {
 
       if ( arc < limit                                             &&
            !ft_conic_is_small_enough( arc, &angle_in, &angle_out ) )
       {
+        if ( stroker->first_point )
+          stroker->angle_in = angle_in;
+
         ft_conic_split( arc );
         arc += 2;
         continue;
         ft_conic_split( arc );
         arc += 2;
         continue;
       {
         first_arc = FALSE;
 
       {
         first_arc = FALSE;
 
-        start_angle = angle_in;
-
         /* process corner if necessary */
         if ( stroker->first_point )
         /* process corner if necessary */
         if ( stroker->first_point )
-          error = ft_stroker_subpath_start( stroker, start_angle );
+          error = ft_stroker_subpath_start( stroker, angle_in, 0 );
         else
         {
         else
         {
-          stroker->angle_out = start_angle;
-          error = ft_stroker_process_corner( stroker );
+          stroker->angle_out = angle_in;
+          error = ft_stroker_process_corner( stroker, 0 );
         }
       }
         }
       }
+      else if ( ft_pos_abs( FT_Angle_Diff( stroker->angle_in, angle_in ) ) >
+                  FT_SMALL_CONIC_THRESHOLD / 4                             )
+      {
+        /* if the deviation from one arc to the next is too great, */
+        /* add a round corner                                      */
+        stroker->center    = arc[2];
+        stroker->angle_out = angle_in;
+        stroker->line_join = FT_STROKER_LINEJOIN_ROUND;
+
+        error = ft_stroker_process_corner( stroker, 0 );
+
+        /* reinstate line join style */
+        stroker->line_join = stroker->line_join_saved;
+      }
+
+      if ( error )
+        goto Exit;
 
       /* the arc's angle is small enough; we can add it directly to each */
       /* border                                                          */
       {
 
       /* the arc's angle is small enough; we can add it directly to each */
       /* border                                                          */
       {
-        FT_Vector  ctrl, end;
-        FT_Angle   theta, phi, rotate;
-        FT_Fixed   length;
-        FT_Int     side;
+        FT_Vector        ctrl, end;
+        FT_Angle         theta, phi, rotate, alpha0 = 0;
+        FT_Fixed         length;
+        FT_StrokeBorder  border;
+        FT_Int           side;
 
 
         theta  = FT_Angle_Diff( angle_in, angle_out ) / 2;
         phi    = angle_in + theta;
         length = FT_DivFix( stroker->radius, FT_Cos( theta ) );
 
 
 
         theta  = FT_Angle_Diff( angle_in, angle_out ) / 2;
         phi    = angle_in + theta;
         length = FT_DivFix( stroker->radius, FT_Cos( theta ) );
 
-        for ( side = 0; side <= 1; side++ )
+        /* compute direction of original arc */
+        if ( stroker->handle_wide_strokes )
+          alpha0 = FT_Atan2( arc[0].x - arc[2].x, arc[0].y - arc[2].y );
+
+        for ( border = stroker->borders, side = 0;
+              side <= 1;
+              side++, border++ )
         {
           rotate = FT_SIDE_TO_ROTATE( side );
 
         {
           rotate = FT_SIDE_TO_ROTATE( side );
 
           end.x += arc[0].x;
           end.y += arc[0].y;
 
           end.x += arc[0].x;
           end.y += arc[0].y;
 
-          error = ft_stroke_border_conicto( stroker->borders + side,
-                                            &ctrl, &end );
+          if ( stroker->handle_wide_strokes )
+          {
+            FT_Vector  start;
+            FT_Angle   alpha1;
+
+
+            /* determine whether the border radius is greater than the */
+            /* radius of curvature of the original arc                 */
+            start = border->points[border->num_points - 1];
+
+            alpha1 = FT_Atan2( end.x - start.x, end.y - start.y );
+
+            /* is the direction of the border arc opposite to */
+            /* that of the original arc? */
+            if ( ft_pos_abs( FT_Angle_Diff( alpha0, alpha1 ) ) >
+                   FT_ANGLE_PI / 2                             )
+            {
+              FT_Angle   beta, gamma;
+              FT_Vector  bvec, delta;
+              FT_Fixed   blen, sinA, sinB, alen;
+
+
+              /* use the sine rule to find the intersection point */
+              beta  = FT_Atan2( arc[2].x - start.x, arc[2].y - start.y );
+              gamma = FT_Atan2( arc[0].x - end.x,   arc[0].y - end.y );
+
+              bvec.x = end.x - start.x;
+              bvec.y = end.y - start.y;
+
+              blen = FT_Vector_Length( &bvec );
+
+              sinA = ft_pos_abs( FT_Sin( alpha1 - gamma ) );
+              sinB = ft_pos_abs( FT_Sin( beta - gamma ) );
+
+              alen = FT_MulDiv( blen, sinA, sinB );
+
+              FT_Vector_From_Polar( &delta, alen, beta );
+              delta.x += start.x;
+              delta.y += start.y;
+
+              /* circumnavigate the negative sector backwards */
+              border->movable = FALSE;
+              error = ft_stroke_border_lineto( border, &delta, FALSE );
+              if ( error )
+                goto Exit;
+              error = ft_stroke_border_lineto( border, &end, FALSE );
+              if ( error )
+                goto Exit;
+              error = ft_stroke_border_conicto( border, &ctrl, &start );
+              if ( error )
+                goto Exit;
+              /* and then move to the endpoint */
+              error = ft_stroke_border_lineto( border, &end, FALSE );
+              if ( error )
+                goto Exit;
+
+              continue;
+            }
+
+            /* else fall through */
+          }
+
+          /* simply add an arc */
+          error = ft_stroke_border_conicto( border, &ctrl, &end );
           if ( error )
             goto Exit;
         }
           if ( error )
             goto Exit;
         }
 
       arc -= 2;
 
 
       arc -= 2;
 
-      if ( arc < bez_stack )
-        stroker->angle_in = angle_out;
+      stroker->angle_in = angle_out;
     }
 
     stroker->center = *to;
     }
 
     stroker->center = *to;
     FT_Vector   bez_stack[37];
     FT_Vector*  arc;
     FT_Vector*  limit = bez_stack + 32;
     FT_Vector   bez_stack[37];
     FT_Vector*  arc;
     FT_Vector*  limit = bez_stack + 32;
-    FT_Angle    start_angle;
     FT_Bool     first_arc = TRUE;
 
 
     FT_Bool     first_arc = TRUE;
 
 
+    /* if all control points are coincident, this is a no-op; */
+    /* avoid creating a spurious corner */
+    if ( FT_IS_SMALL( stroker->center.x - control1->x ) &&
+         FT_IS_SMALL( stroker->center.y - control1->y ) &&
+         FT_IS_SMALL( control1->x       - control2->x ) &&
+         FT_IS_SMALL( control1->y       - control2->y ) &&
+         FT_IS_SMALL( control2->x       - to->x       ) &&
+         FT_IS_SMALL( control2->y       - to->y       ) )
+    {
+       stroker->center = *to;
+       goto Exit;
+    }
+
     arc    = bez_stack;
     arc[0] = *to;
     arc[1] = *control2;
     arc    = bez_stack;
     arc[0] = *to;
     arc[1] = *control2;
       FT_Angle  angle_in, angle_mid, angle_out;
 
 
       FT_Angle  angle_in, angle_mid, angle_out;
 
 
-      /* remove compiler warnings */
-      angle_in = angle_out = angle_mid = 0;
+      /* initialize with current direction */
+      angle_in = angle_out = angle_mid = stroker->angle_in;
 
       if ( arc < limit                                         &&
            !ft_cubic_is_small_enough( arc, &angle_in,
                                       &angle_mid, &angle_out ) )
       {
 
       if ( arc < limit                                         &&
            !ft_cubic_is_small_enough( arc, &angle_in,
                                       &angle_mid, &angle_out ) )
       {
+        if ( stroker->first_point )
+          stroker->angle_in = angle_in;
+
         ft_cubic_split( arc );
         arc += 3;
         continue;
         ft_cubic_split( arc );
         arc += 3;
         continue;
         first_arc = FALSE;
 
         /* process corner if necessary */
         first_arc = FALSE;
 
         /* process corner if necessary */
-        start_angle = angle_in;
-
         if ( stroker->first_point )
         if ( stroker->first_point )
-          error = ft_stroker_subpath_start( stroker, start_angle );
+          error = ft_stroker_subpath_start( stroker, angle_in, 0 );
         else
         {
         else
         {
-          stroker->angle_out = start_angle;
-          error = ft_stroker_process_corner( stroker );
+          stroker->angle_out = angle_in;
+          error = ft_stroker_process_corner( stroker, 0 );
         }
         }
-        if ( error )
-          goto Exit;
+      }
+      else if ( ft_pos_abs( FT_Angle_Diff( stroker->angle_in, angle_in ) ) >
+                  FT_SMALL_CUBIC_THRESHOLD / 4                             )
+      {
+        /* if the deviation from one arc to the next is too great, */
+        /* add a round corner                                      */
+        stroker->center    = arc[3];
+        stroker->angle_out = angle_in;
+        stroker->line_join = FT_STROKER_LINEJOIN_ROUND;
+
+        error = ft_stroker_process_corner( stroker, 0 );
+
+        /* reinstate line join style */
+        stroker->line_join = stroker->line_join_saved;
       }
 
       }
 
+      if ( error )
+        goto Exit;
+
       /* the arc's angle is small enough; we can add it directly to each */
       /* border                                                          */
       {
       /* the arc's angle is small enough; we can add it directly to each */
       /* border                                                          */
       {
-        FT_Vector  ctrl1, ctrl2, end;
-        FT_Angle   theta1, phi1, theta2, phi2, rotate;
-        FT_Fixed   length1, length2;
-        FT_Int     side;
+        FT_Vector        ctrl1, ctrl2, end;
+        FT_Angle         theta1, phi1, theta2, phi2, rotate, alpha0 = 0;
+        FT_Fixed         length1, length2;
+        FT_StrokeBorder  border;
+        FT_Int           side;
 
 
 
 
-        theta1  = ft_pos_abs( angle_mid - angle_in ) / 2;
-        theta2  = ft_pos_abs( angle_out - angle_mid ) / 2;
-        phi1    = (angle_mid + angle_in ) / 2;
-        phi2    = (angle_mid + angle_out ) / 2;
+        theta1  = FT_Angle_Diff( angle_in,  angle_mid ) / 2;
+        theta2  = FT_Angle_Diff( angle_mid, angle_out ) / 2;
+        phi1    = ft_angle_mean( angle_in,  angle_mid );
+        phi2    = ft_angle_mean( angle_mid, angle_out );
         length1 = FT_DivFix( stroker->radius, FT_Cos( theta1 ) );
         length2 = FT_DivFix( stroker->radius, FT_Cos( theta2 ) );
 
         length1 = FT_DivFix( stroker->radius, FT_Cos( theta1 ) );
         length2 = FT_DivFix( stroker->radius, FT_Cos( theta2 ) );
 
-        for ( side = 0; side <= 1; side++ )
+        /* compute direction of original arc */
+        if ( stroker->handle_wide_strokes )
+          alpha0 = FT_Atan2( arc[0].x - arc[3].x, arc[0].y - arc[3].y );
+
+        for ( border = stroker->borders, side = 0;
+              side <= 1;
+              side++, border++ )
         {
           rotate = FT_SIDE_TO_ROTATE( side );
 
         {
           rotate = FT_SIDE_TO_ROTATE( side );
 
           end.x += arc[0].x;
           end.y += arc[0].y;
 
           end.x += arc[0].x;
           end.y += arc[0].y;
 
-          error = ft_stroke_border_cubicto( stroker->borders + side,
-                                            &ctrl1, &ctrl2, &end );
+          if ( stroker->handle_wide_strokes )
+          {
+            FT_Vector  start;
+            FT_Angle   alpha1;
+
+
+            /* determine whether the border radius is greater than the */
+            /* radius of curvature of the original arc                 */
+            start = border->points[border->num_points - 1];
+
+            alpha1 = FT_Atan2( end.x - start.x, end.y - start.y );
+
+            /* is the direction of the border arc opposite to */
+            /* that of the original arc? */
+            if ( ft_pos_abs( FT_Angle_Diff( alpha0, alpha1 ) ) >
+                   FT_ANGLE_PI / 2                             )
+            {
+              FT_Angle   beta, gamma;
+              FT_Vector  bvec, delta;
+              FT_Fixed   blen, sinA, sinB, alen;
+
+
+              /* use the sine rule to find the intersection point */
+              beta  = FT_Atan2( arc[3].x - start.x, arc[3].y - start.y );
+              gamma = FT_Atan2( arc[0].x - end.x,   arc[0].y - end.y );
+
+              bvec.x = end.x - start.x;
+              bvec.y = end.y - start.y;
+
+              blen = FT_Vector_Length( &bvec );
+
+              sinA = ft_pos_abs( FT_Sin( alpha1 - gamma ) );
+              sinB = ft_pos_abs( FT_Sin( beta - gamma ) );
+
+              alen = FT_MulDiv( blen, sinA, sinB );
+
+              FT_Vector_From_Polar( &delta, alen, beta );
+              delta.x += start.x;
+              delta.y += start.y;
+
+              /* circumnavigate the negative sector backwards */
+              border->movable = FALSE;
+              error = ft_stroke_border_lineto( border, &delta, FALSE );
+              if ( error )
+                goto Exit;
+              error = ft_stroke_border_lineto( border, &end, FALSE );
+              if ( error )
+                goto Exit;
+              error = ft_stroke_border_cubicto( border,
+                                                &ctrl2,
+                                                &ctrl1,
+                                                &start );
+              if ( error )
+                goto Exit;
+              /* and then move to the endpoint */
+              error = ft_stroke_border_lineto( border, &end, FALSE );
+              if ( error )
+                goto Exit;
+
+              continue;
+            }
+
+            /* else fall through */
+          }
+
+          /* simply add an arc */
+          error = ft_stroke_border_cubicto( border, &ctrl1, &ctrl2, &end );
           if ( error )
             goto Exit;
         }
       }
 
       arc -= 3;
           if ( error )
             goto Exit;
         }
       }
 
       arc -= 3;
-      if ( arc < bez_stack )
-        stroker->angle_in = angle_out;
+
+      stroker->angle_in = angle_out;
     }
 
     stroker->center = *to;
     }
 
     stroker->center = *to;
     stroker->center       = *to;
     stroker->subpath_open = open;
 
     stroker->center       = *to;
     stroker->subpath_open = open;
 
+    /* Determine if we need to check whether the border radius is greater */
+    /* than the radius of curvature of a curve, to handle this case       */
+    /* specially.  This is only required if bevel joins or butt caps may  */
+    /* be created, because round & miter joins and round & square caps    */
+    /* cover the negative sector created with wide strokes.               */
+    stroker->handle_wide_strokes =
+      FT_BOOL( stroker->line_join != FT_STROKER_LINEJOIN_ROUND  ||
+               ( stroker->subpath_open                        &&
+                 stroker->line_cap == FT_STROKER_LINECAP_BUTT ) );
+
     /* record the subpath start point for each border */
     stroker->subpath_start = *to;
 
     /* record the subpath start point for each border */
     stroker->subpath_start = *to;
 
+    stroker->angle_in = 0;
+
     return FT_Err_Ok;
   }
 
     return FT_Err_Ok;
   }
 
         FT_Vector*  src_point = left->points  + left->num_points - 1;
         FT_Byte*    src_tag   = left->tags    + left->num_points - 1;
 
         FT_Vector*  src_point = left->points  + left->num_points - 1;
         FT_Byte*    src_tag   = left->tags    + left->num_points - 1;
 
+
         while ( src_point >= left->points + left->start )
         {
           *dst_point = *src_point;
         while ( src_point >= left->points + left->start )
         {
           *dst_point = *src_point;
             dst_tag[0] &= ~FT_STROKE_TAG_BEGIN_END;
           else
           {
             dst_tag[0] &= ~FT_STROKE_TAG_BEGIN_END;
           else
           {
-            FT_Byte  ttag = (FT_Byte)( dst_tag[0] & FT_STROKE_TAG_BEGIN_END );
+            FT_Byte  ttag =
+                       (FT_Byte)( dst_tag[0] & FT_STROKE_TAG_BEGIN_END );
 
 
             /* switch begin/end tags if necessary */
             if ( ttag == FT_STROKE_TAG_BEGIN ||
                  ttag == FT_STROKE_TAG_END   )
               dst_tag[0] ^= FT_STROKE_TAG_BEGIN_END;
 
 
             /* switch begin/end tags if necessary */
             if ( ttag == FT_STROKE_TAG_BEGIN ||
                  ttag == FT_STROKE_TAG_END   )
               dst_tag[0] ^= FT_STROKE_TAG_BEGIN_END;
-
           }
 
           src_point--;
           }
 
           src_point--;
     {
       FT_StrokeBorder  right = stroker->borders;
 
     {
       FT_StrokeBorder  right = stroker->borders;
 
+
       /* All right, this is an opened path, we need to add a cap between */
       /* right & left, add the reverse of left, then add a final cap     */
       /* between left & right.                                           */
       /* All right, this is an opened path, we need to add a cap between */
       /* right & left, add the reverse of left, then add a final cap     */
       /* between left & right.                                           */
       FT_Angle  turn;
       FT_Int    inside_side;
 
       FT_Angle  turn;
       FT_Int    inside_side;
 
+
       /* close the path if needed */
       if ( stroker->center.x != stroker->subpath_start.x ||
            stroker->center.y != stroker->subpath_start.y )
       {
       /* close the path if needed */
       if ( stroker->center.x != stroker->subpath_start.x ||
            stroker->center.y != stroker->subpath_start.y )
       {
-        error = FT_Stroker_LineTo( stroker, &stroker->subpath_start );
-        if ( error )
-          goto Exit;
+         error = FT_Stroker_LineTo( stroker, &stroker->subpath_start );
+         if ( error )
+           goto Exit;
       }
 
       /* process the corner */
       }
 
       /* process the corner */
         if ( turn < 0 )
           inside_side = 1;
 
         if ( turn < 0 )
           inside_side = 1;
 
-        error = ft_stroker_inside( stroker, inside_side );
+        error = ft_stroker_inside( stroker,
+                                   inside_side,
+                                   stroker->subpath_line_length );
         if ( error )
           goto Exit;
 
         /* process the outside side */
         if ( error )
           goto Exit;
 
         /* process the outside side */
-        error = ft_stroker_outside( stroker, 1 - inside_side );
+        error = ft_stroker_outside( stroker,
+                                    1 - inside_side,
+                                    stroker->subpath_line_length );
         if ( error )
           goto Exit;
       }
 
       /* then end our two subpaths */
         if ( error )
           goto Exit;
       }
 
       /* then end our two subpaths */
-      ft_stroke_border_close( stroker->borders + 0, TRUE );
-      ft_stroke_border_close( stroker->borders + 1, FALSE );
+      ft_stroke_border_close( stroker->borders + 0, FALSE );
+      ft_stroke_border_close( stroker->borders + 1, TRUE );
     }
 
   Exit:
     }
 
   Exit:
 
     if ( !stroker || border > 1 )
     {
 
     if ( !stroker || border > 1 )
     {
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
     FT_Error    error;
 
 
     FT_Error    error;
 
-    FT_Int   n;         /* index of contour in outline     */
-    FT_UInt  first;     /* index of first point in contour */
-    FT_Int   tag;       /* current point's state           */
+    FT_Int      n;         /* index of contour in outline     */
+    FT_UInt     first;     /* index of first point in contour */
+    FT_Int      tag;       /* current point's state           */
 
 
     if ( !outline || !stroker )
 
 
     if ( !outline || !stroker )
-      return FT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     FT_Stroker_Rewind( stroker );
 
 
     FT_Stroker_Rewind( stroker );
 
       if ( error )
         goto Exit;
 
       if ( error )
         goto Exit;
 
-      error = FT_Stroker_EndSubPath( stroker );
-      if ( error )
-        goto Exit;
+      /* don't try to end the path if no segments have been generated */
+      if ( !stroker->first_point )
+      {
+        error = FT_Stroker_EndSubPath( stroker );
+        if ( error )
+          goto Exit;
+      }
 
       first = last + 1;
     }
 
       first = last + 1;
     }
     return error;
 
   Invalid_Outline:
     return error;
 
   Invalid_Outline:
-    return FT_Err_Invalid_Outline;
+    return FT_THROW( Invalid_Outline );
   }
 
   }
 
-/* declare an extern to access ft_outline_glyph_class global allocated 
-   in ftglyph.c, and use the FT_OUTLINE_GLYPH_CLASS_GET macro to access 
-   it when FT_CONFIG_OPTION_PIC is defined */
+
+  /* declare an extern to access `ft_outline_glyph_class' globally     */
+  /* allocated  in `ftglyph.c', and use the FT_OUTLINE_GLYPH_CLASS_GET */
+  /* macro to access it when FT_CONFIG_OPTION_PIC is defined           */
 #ifndef FT_CONFIG_OPTION_PIC
   extern const FT_Glyph_Class  ft_outline_glyph_class;
 #endif
 #ifndef FT_CONFIG_OPTION_PIC
   extern const FT_Glyph_Class  ft_outline_glyph_class;
 #endif
                    FT_Stroker   stroker,
                    FT_Bool      destroy )
   {
                    FT_Stroker   stroker,
                    FT_Bool      destroy )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
-    FT_Glyph  glyph = NULL;
-    FT_Library library = stroker->library;
-    FT_UNUSED(library);
+    FT_Error    error   = FT_ERR( Invalid_Argument );
+    FT_Glyph    glyph   = NULL;
+    FT_Library  library = stroker->library;
+
+    FT_UNUSED( library );
+
 
     if ( pglyph == NULL )
       goto Exit;
 
     if ( pglyph == NULL )
       goto Exit;
     }
 
     {
     }
 
     {
-      FT_OutlineGlyph  oglyph  = (FT_OutlineGlyph) glyph;
+      FT_OutlineGlyph  oglyph  = (FT_OutlineGlyph)glyph;
       FT_Outline*      outline = &oglyph->outline;
       FT_UInt          num_points, num_contours;
 
       FT_Outline*      outline = &oglyph->outline;
       FT_UInt          num_points, num_contours;
 
                          FT_Bool      inside,
                          FT_Bool      destroy )
   {
                          FT_Bool      inside,
                          FT_Bool      destroy )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
-    FT_Glyph  glyph = NULL;
-    FT_Library library = stroker->library;
-    FT_UNUSED(library);
+    FT_Error    error   = FT_ERR( Invalid_Argument );
+    FT_Glyph    glyph   = NULL;
+    FT_Library  library = stroker->library;
+
+    FT_UNUSED( library );
+
 
     if ( pglyph == NULL )
       goto Exit;
 
     if ( pglyph == NULL )
       goto Exit;
     }
 
     {
     }
 
     {
-      FT_OutlineGlyph   oglyph  = (FT_OutlineGlyph) glyph;
+      FT_OutlineGlyph   oglyph  = (FT_OutlineGlyph)glyph;
       FT_StrokerBorder  border;
       FT_Outline*       outline = &oglyph->outline;
       FT_UInt           num_points, num_contours;
       FT_StrokerBorder  border;
       FT_Outline*       outline = &oglyph->outline;
       FT_UInt           num_points, num_contours;
index d4ec0da..241d37f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType synthesizing code for emboldening and slanting (body).      */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType synthesizing code for emboldening and slanting (body).      */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2010 by             */
+/*  Copyright 2000-2006, 2010, 2012 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -33,6 +33,7 @@
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_synth
 
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_synth
 
+
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
@@ -62,7 +63,7 @@
     transform.xx = 0x10000L;
     transform.yx = 0x00000L;
 
     transform.xx = 0x10000L;
     transform.yx = 0x00000L;
 
-    transform.xy = 0x06000L;
+    transform.xy = 0x0366AL;
     transform.yy = 0x10000L;
 
     FT_Outline_Transform( outline, &transform );
     transform.yy = 0x10000L;
 
     FT_Outline_Transform( outline, &transform );
@@ -72,7 +73,7 @@
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
-  /****   EXPERIMENTAL EMBOLDENING/OUTLINING SUPPORT                    ****/
+  /****   EXPERIMENTAL EMBOLDENING SUPPORT                              ****/
   /****                                                                 ****/
   /*************************************************************************/
   /*************************************************************************/
   /****                                                                 ****/
   /*************************************************************************/
   /*************************************************************************/
     if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
     {
       /* ignore error */
     if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
     {
       /* 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                   */
-      xstr = xstr * 2;
-      ystr = xstr;
+      (void)FT_Outline_EmboldenXY( &slot->outline, xstr, ystr );
     }
     else /* slot->format == FT_GLYPH_FORMAT_BITMAP */
     {
     }
     else /* slot->format == FT_GLYPH_FORMAT_BITMAP */
     {
     if ( slot->advance.y )
       slot->advance.y += ystr;
 
     if ( slot->advance.y )
       slot->advance.y += ystr;
 
-    slot->metrics.width        += xstr;
-    slot->metrics.height       += ystr;
-    slot->metrics.horiBearingY += ystr;
-    slot->metrics.horiAdvance  += xstr;
-    slot->metrics.vertBearingX -= xstr / 2;
-    slot->metrics.vertBearingY += ystr;
-    slot->metrics.vertAdvance  += ystr;
+    slot->metrics.width       += xstr;
+    slot->metrics.height      += ystr;
+    slot->metrics.horiAdvance += xstr;
+    slot->metrics.vertAdvance += ystr;
 
     /* XXX: 16-bit overflow case must be excluded before here */
     if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
 
     /* XXX: 16-bit overflow case must be excluded before here */
     if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
index 66c5d76..2c6ddac 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    ANSI-specific FreeType low-level system interface (body).            */
 /*                                                                         */
 /*                                                                         */
 /*    ANSI-specific FreeType low-level system interface (body).            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2006, 2008, 2009, 2010 by                   */
+/*  Copyright 1996-2002, 2006, 2008-2011, 2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   /*                                                                       */
   /*************************************************************************/
 
   /*                                                                       */
   /*************************************************************************/
 
+#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
 
 
     if ( !stream )
 
 
     if ( !stream )
-      return FT_Err_Invalid_Stream_Handle;
+      return FT_THROW( Invalid_Stream_Handle );
 
     stream->descriptor.pointer = NULL;
     stream->pathname.pointer   = (char*)filepathname;
 
     stream->descriptor.pointer = NULL;
     stream->pathname.pointer   = (char*)filepathname;
       FT_ERROR(( "FT_Stream_Open:"
                  " could not open `%s'\n", filepathname ));
 
       FT_ERROR(( "FT_Stream_Open:"
                  " could not open `%s'\n", filepathname ));
 
-      return FT_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
     }
 
     ft_fseek( file, 0, SEEK_END );
     }
 
     ft_fseek( file, 0, SEEK_END );
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " opened `%s' but zero-sized\n", filepathname ));
       ft_fclose( file );
       FT_ERROR(( "FT_Stream_Open:" ));
       FT_ERROR(( " opened `%s' but zero-sized\n", filepathname ));
       ft_fclose( file );
-      return FT_Err_Cannot_Open_Stream;
+      return FT_THROW( Cannot_Open_Stream );
     }
     ft_fseek( file, 0, SEEK_SET );
 
     }
     ft_fseek( file, 0, SEEK_SET );
 
     return FT_Err_Ok;
   }
 
     return FT_Err_Ok;
   }
 
+#endif /* !FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
 
 #ifdef FT_DEBUG_MEMORY
 
 
 #ifdef FT_DEBUG_MEMORY
 
index fdf433a..4ffdcb7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType trigonometric functions (body).                             */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType trigonometric functions (body).                             */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2005 by                              */
+/*  Copyright 2001-2005, 2012-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*                                                                         */
 /***************************************************************************/
 
 /*                                                                         */
 /***************************************************************************/
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* This is a fixed-point CORDIC implementation of trigonometric          */
+  /* functions as well as transformations between Cartesian and polar      */
+  /* coordinates.  The angles are represented as 16.16 fixed-point values  */
+  /* in degrees, i.e., the angular resolution is 2^-16 degrees.  Note that */
+  /* only vectors longer than 2^16*180/pi (or at least 22 bits) on a       */
+  /* discrete Cartesian grid can have the same or better angular           */
+  /* resolution.  Therefore, to maintain this precision, some functions    */
+  /* require an interim upscaling of the vectors, whereas others operate   */
+  /* with 24-bit long vectors directly.                                    */
+  /*                                                                       */
+  /*************************************************************************/
 
 #include <ft2build.h>
 #include FT_INTERNAL_OBJECTS_H
 
 #include <ft2build.h>
 #include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_CALC_H
 #include FT_TRIGONOMETRY_H
 
 
 #include FT_TRIGONOMETRY_H
 
 
-  /* the following is 0.2715717684432231 * 2^30 */
-#define FT_TRIG_COSCALE  0x11616E8EUL
+  /* the Cordic shrink factor 0.858785336480436 * 2^32 */
+#define FT_TRIG_SCALE      0xDBD95B16UL
+
+  /* the highest bit in overflow-safe vector components, */
+  /* MSB of 0.858785336480436 * sqrt(0.5) * 2^30         */
+#define FT_TRIG_SAFE_MSB   29
 
   /* this table was generated for FT_PI = 180L << 16, i.e. degrees */
 #define FT_TRIG_MAX_ITERS  23
 
   static const FT_Fixed
 
   /* this table was generated for FT_PI = 180L << 16, i.e. degrees */
 #define FT_TRIG_MAX_ITERS  23
 
   static const FT_Fixed
-  ft_trig_arctan_table[24] =
+  ft_trig_arctan_table[] =
   {
   {
-    4157273L, 2949120L, 1740967L, 919879L, 466945L, 234379L, 117304L,
-    58666L, 29335L, 14668L, 7334L, 3667L, 1833L, 917L, 458L, 229L, 115L,
+    1740967L, 919879L, 466945L, 234379L, 117304L, 58666L, 29335L,
+    14668L, 7334L, 3667L, 1833L, 917L, 458L, 229L, 115L,
     57L, 29L, 14L, 7L, 4L, 2L, 1L
   };
 
     57L, 29L, 14L, 7L, 4L, 2L, 1L
   };
 
-  /* the Cordic shrink factor, multiplied by 2^32 */
-#define FT_TRIG_SCALE    1166391785UL  /* 0x4585BA38UL */
-
 
 
-#ifdef FT_CONFIG_HAS_INT64
+#ifdef FT_LONG64
 
   /* multiply a given value by the CORDIC shrink factor */
   static FT_Fixed
 
   /* multiply a given value by the CORDIC shrink factor */
   static FT_Fixed
@@ -50,7 +65,7 @@
 
 
     s   = val;
 
 
     s   = val;
-    val = ( val >= 0 ) ? val : -val;
+    val = FT_ABS( val );
 
     v   = ( val * (FT_Int64)FT_TRIG_SCALE ) + 0x100000000UL;
     val = (FT_Fixed)( v >> 32 );
 
     v   = ( val * (FT_Int64)FT_TRIG_SCALE ) + 0x100000000UL;
     val = (FT_Fixed)( v >> 32 );
@@ -58,7 +73,7 @@
     return ( s >= 0 ) ? val : -val;
   }
 
     return ( s >= 0 ) ? val : -val;
   }
 
-#else /* !FT_CONFIG_HAS_INT64 */
+#else /* !FT_LONG64 */
 
   /* multiply a given value by the CORDIC shrink factor */
   static FT_Fixed
 
   /* multiply a given value by the CORDIC shrink factor */
   static FT_Fixed
 
 
     s   = val;
 
 
     s   = val;
-    val = ( val >= 0 ) ? val : -val;
+    val = FT_ABS( val );
 
     v1 = (FT_UInt32)val >> 16;
 
     v1 = (FT_UInt32)val >> 16;
-    v2 = (FT_UInt32)(val & 0xFFFFL);
+    v2 = (FT_UInt32)( val & 0xFFFFL );
 
 
-    k1 = (FT_UInt32)FT_TRIG_SCALE >> 16;       /* constant */
-    k2 = (FT_UInt32)(FT_TRIG_SCALE & 0xFFFFL);   /* constant */
+    k1 = (FT_UInt32)FT_TRIG_SCALE >> 16;           /* constant */
+    k2 = (FT_UInt32)( FT_TRIG_SCALE & 0xFFFFL );   /* constant */
 
     hi   = k1 * v1;
     lo1  = k1 * v2 + k2 * v1;       /* can't overflow */
 
     lo2  = ( k2 * v2 ) >> 16;
 
     hi   = k1 * v1;
     lo1  = k1 * v2 + k2 * v1;       /* can't overflow */
 
     lo2  = ( k2 * v2 ) >> 16;
-    lo3  = ( lo1 >= lo2 ) ? lo1 : lo2;
+    lo3  = FT_MAX( lo1, lo2 );
     lo1 += lo2;
 
     hi  += lo1 >> 16;
     lo1 += lo2;
 
     hi  += lo1 >> 16;
     return ( s >= 0 ) ? val : -val;
   }
 
     return ( s >= 0 ) ? val : -val;
   }
 
-#endif /* !FT_CONFIG_HAS_INT64 */
+#endif /* !FT_LONG64 */
 
 
   static FT_Int
   ft_trig_prenorm( FT_Vector*  vec )
   {
 
 
   static FT_Int
   ft_trig_prenorm( FT_Vector*  vec )
   {
-    FT_Fixed  x, y, z;
-    FT_Int    shift;
+    FT_Pos  x, y;
+    FT_Int  shift;
 
 
     x = vec->x;
     y = vec->y;
 
 
 
     x = vec->x;
     y = vec->y;
 
-    z     = ( ( x >= 0 ) ? x : - x ) | ( (y >= 0) ? y : -y );
-    shift = 0;
+    shift = FT_MSB( FT_ABS( x ) | FT_ABS( y ) );
 
 
-#if 1
-    /* determine msb bit index in `shift' */
-    if ( z >= ( 1L << 16 ) )
-    {
-      z     >>= 16;
-      shift  += 16;
-    }
-    if ( z >= ( 1L << 8 ) )
-    {
-      z     >>= 8;
-      shift  += 8;
-    }
-    if ( z >= ( 1L << 4 ) )
-    {
-      z     >>= 4;
-      shift  += 4;
-    }
-    if ( z >= ( 1L << 2 ) )
+    if ( shift <= FT_TRIG_SAFE_MSB )
     {
     {
-      z     >>= 2;
-      shift  += 2;
-    }
-    if ( z >= ( 1L << 1 ) )
-    {
-      z    >>= 1;
-      shift += 1;
-    }
-
-    if ( shift <= 27 )
-    {
-      shift  = 27 - shift;
-      vec->x = x << shift;
-      vec->y = y << shift;
+      shift  = FT_TRIG_SAFE_MSB - shift;
+      vec->x = (FT_Pos)( (FT_ULong)x << shift );
+      vec->y = (FT_Pos)( (FT_ULong)y << shift );
     }
     else
     {
     }
     else
     {
-      shift -= 27;
-      vec->x = x >> shift;
-      vec->y = y >> shift;
-      shift  = -shift;
-    }
-
-#else /* 0 */
-
-    if ( z < ( 1L << 27 ) )
-    {
-      do
-      {
-        shift++;
-        z <<= 1;
-      } while ( z < ( 1L << 27 ) );
-      vec->x = x << shift;
-      vec->y = y << shift;
-    }
-    else if ( z > ( 1L << 28 ) )
-    {
-      do
-      {
-        shift++;
-        z >>= 1;
-      } while ( z > ( 1L << 28 ) );
-
+      shift -= FT_TRIG_SAFE_MSB;
       vec->x = x >> shift;
       vec->y = y >> shift;
       shift  = -shift;
     }
 
       vec->x = x >> shift;
       vec->y = y >> shift;
       shift  = -shift;
     }
 
-#endif /* 0 */
-
     return shift;
   }
 
     return shift;
   }
 
                          FT_Angle    theta )
   {
     FT_Int           i;
                          FT_Angle    theta )
   {
     FT_Int           i;
-    FT_Fixed         x, y, xtemp;
+    FT_Fixed         x, y, xtemp, b;
     const FT_Fixed  *arctanptr;
 
 
     x = vec->x;
     y = vec->y;
 
     const FT_Fixed  *arctanptr;
 
 
     x = vec->x;
     y = vec->y;
 
-    /* Get angle between -90 and 90 degrees */
-    while ( theta <= -FT_ANGLE_PI2 )
+    /* Rotate inside [-PI/4,PI/4] sector */
+    while ( theta < -FT_ANGLE_PI4 )
     {
     {
-      x = -x;
-      y = -y;
-      theta += FT_ANGLE_PI;
+      xtemp  =  y;
+      y      = -x;
+      x      =  xtemp;
+      theta +=  FT_ANGLE_PI2;
     }
 
     }
 
-    while ( theta > FT_ANGLE_PI2 )
+    while ( theta > FT_ANGLE_PI4 )
     {
     {
-      x = -x;
-      y = -y;
-      theta -= FT_ANGLE_PI;
+      xtemp  = -y;
+      y      =  x;
+      x      =  xtemp;
+      theta -=  FT_ANGLE_PI2;
     }
 
     }
 
-    /* Initial pseudorotation, with left shift */
     arctanptr = ft_trig_arctan_table;
 
     arctanptr = ft_trig_arctan_table;
 
-    if ( theta < 0 )
-    {
-      xtemp  = x + ( y << 1 );
-      y      = y - ( x << 1 );
-      x      = xtemp;
-      theta += *arctanptr++;
-    }
-    else
-    {
-      xtemp  = x - ( y << 1 );
-      y      = y + ( x << 1 );
-      x      = xtemp;
-      theta -= *arctanptr++;
-    }
-
-    /* Subsequent pseudorotations, with right shifts */
-    i = 0;
-    do
+    /* Pseudorotations, with right shifts */
+    for ( i = 1, b = 1; i < FT_TRIG_MAX_ITERS; b <<= 1, i++ )
     {
       if ( theta < 0 )
       {
     {
       if ( theta < 0 )
       {
-        xtemp  = x + ( y >> i );
-        y      = y - ( x >> i );
+        xtemp  = x + ( ( y + b ) >> i );
+        y      = y - ( ( x + b ) >> i );
         x      = xtemp;
         theta += *arctanptr++;
       }
       else
       {
         x      = xtemp;
         theta += *arctanptr++;
       }
       else
       {
-        xtemp  = x - ( y >> i );
-        y      = y + ( x >> i );
+        xtemp  = x - ( ( y + b ) >> i );
+        y      = y + ( ( x + b ) >> i );
         x      = xtemp;
         theta -= *arctanptr++;
       }
         x      = xtemp;
         theta -= *arctanptr++;
       }
-    } while ( ++i < FT_TRIG_MAX_ITERS );
+    }
 
     vec->x = x;
     vec->y = y;
 
     vec->x = x;
     vec->y = y;
   static void
   ft_trig_pseudo_polarize( FT_Vector*  vec )
   {
   static void
   ft_trig_pseudo_polarize( FT_Vector*  vec )
   {
-    FT_Fixed         theta;
-    FT_Fixed         yi, i;
-    FT_Fixed         x, y;
+    FT_Angle         theta;
+    FT_Int           i;
+    FT_Fixed         x, y, xtemp, b;
     const FT_Fixed  *arctanptr;
 
 
     x = vec->x;
     y = vec->y;
 
     const FT_Fixed  *arctanptr;
 
 
     x = vec->x;
     y = vec->y;
 
-    /* Get the vector into the right half plane */
-    theta = 0;
-    if ( x < 0 )
+    /* Get the vector into [-PI/4,PI/4] sector */
+    if ( y > x )
     {
     {
-      x = -x;
-      y = -y;
-      theta = 2 * FT_ANGLE_PI2;
-    }
-
-    if ( y > 0 )
-      theta = - theta;
-
-    arctanptr = ft_trig_arctan_table;
-
-    if ( y < 0 )
-    {
-      /* Rotate positive */
-      yi     = y + ( x << 1 );
-      x      = x - ( y << 1 );
-      y      = yi;
-      theta -= *arctanptr++;  /* Subtract angle */
+      if ( y > -x )
+      {
+        theta =  FT_ANGLE_PI2;
+        xtemp =  y;
+        y     = -x;
+        x     =  xtemp;
+      }
+      else
+      {
+        theta =  y > 0 ? FT_ANGLE_PI : -FT_ANGLE_PI;
+        x     = -x;
+        y     = -y;
+      }
     }
     else
     {
     }
     else
     {
-      /* Rotate negative */
-      yi     = y - ( x << 1 );
-      x      = x + ( y << 1 );
-      y      = yi;
-      theta += *arctanptr++;  /* Add angle */
+      if ( y < -x )
+      {
+        theta = -FT_ANGLE_PI2;
+        xtemp = -y;
+        y     =  x;
+        x     =  xtemp;
+      }
+      else
+      {
+        theta = 0;
+      }
     }
 
     }
 
-    i = 0;
-    do
+    arctanptr = ft_trig_arctan_table;
+
+    /* Pseudorotations, with right shifts */
+    for ( i = 1, b = 1; i < FT_TRIG_MAX_ITERS; b <<= 1, i++ )
     {
     {
-      if ( y < 0 )
+      if ( y > 0 )
       {
       {
-        /* Rotate positive */
-        yi     = y + ( x >> i );
-        x      = x - ( y >> i );
-        y      = yi;
-        theta -= *arctanptr++;
+        xtemp  = x + ( ( y + b ) >> i );
+        y      = y - ( ( x + b ) >> i );
+        x      = xtemp;
+        theta += *arctanptr++;
       }
       else
       {
       }
       else
       {
-        /* Rotate negative */
-        yi     = y - ( x >> i );
-        x      = x + ( y >> i );
-        y      = yi;
-        theta += *arctanptr++;
+        xtemp  = x - ( ( y + b ) >> i );
+        y      = y + ( ( x + b ) >> i );
+        x      = xtemp;
+        theta -= *arctanptr++;
       }
       }
-    } while ( ++i < FT_TRIG_MAX_ITERS );
+    }
 
     /* round theta */
     if ( theta >= 0 )
 
     /* round theta */
     if ( theta >= 0 )
     FT_Vector  v;
 
 
     FT_Vector  v;
 
 
-    v.x = FT_TRIG_COSCALE >> 2;
+    v.x = FT_TRIG_SCALE >> 8;
     v.y = 0;
     ft_trig_pseudo_rotate( &v, angle );
 
     v.y = 0;
     ft_trig_pseudo_rotate( &v, angle );
 
-    return v.x / ( 1 << 12 );
+    return ( v.x + 0x80L ) >> 8;
   }
 
 
   }
 
 
     FT_Vector  v;
 
 
     FT_Vector  v;
 
 
-    v.x = FT_TRIG_COSCALE >> 2;
+    v.x = FT_TRIG_SCALE >> 8;
     v.y = 0;
     ft_trig_pseudo_rotate( &v, angle );
 
     v.y = 0;
     ft_trig_pseudo_rotate( &v, angle );
 
   FT_Vector_Unit( FT_Vector*  vec,
                   FT_Angle    angle )
   {
   FT_Vector_Unit( FT_Vector*  vec,
                   FT_Angle    angle )
   {
-    vec->x = FT_TRIG_COSCALE >> 2;
+    vec->x = FT_TRIG_SCALE >> 8;
     vec->y = 0;
     ft_trig_pseudo_rotate( vec, angle );
     vec->y = 0;
     ft_trig_pseudo_rotate( vec, angle );
-    vec->x >>= 12;
-    vec->y >>= 12;
+    vec->x = ( vec->x + 0x80L ) >> 8;
+    vec->y = ( vec->y + 0x80L ) >> 8;
   }
 
 
   }
 
 
       else
       {
         shift  = -shift;
       else
       {
         shift  = -shift;
-        vec->x = v.x << shift;
-        vec->y = v.y << shift;
+        vec->x = (FT_Pos)( (FT_ULong)v.x << shift );
+        vec->y = (FT_Pos)( (FT_ULong)v.y << shift );
       }
     }
   }
       }
     }
   }
     /* handle trivial cases */
     if ( v.x == 0 )
     {
     /* handle trivial cases */
     if ( v.x == 0 )
     {
-      return ( v.y >= 0 ) ? v.y : -v.y;
+      return FT_ABS( v.y );
     }
     else if ( v.y == 0 )
     {
     }
     else if ( v.y == 0 )
     {
-      return ( v.x >= 0 ) ? v.x : -v.x;
+      return FT_ABS( v.x );
     }
 
     /* general case */
     }
 
     /* general case */
     if ( shift > 0 )
       return ( v.x + ( 1 << ( shift - 1 ) ) ) >> shift;
 
     if ( shift > 0 )
       return ( v.x + ( 1 << ( shift - 1 ) ) ) >> shift;
 
-    return v.x << -shift;
+    return (FT_Fixed)( (FT_UInt32)v.x << -shift );
   }
 
 
   }
 
 
 
     v.x = ft_trig_downscale( v.x );
 
 
     v.x = ft_trig_downscale( v.x );
 
-    *length = ( shift >= 0 ) ? ( v.x >> shift ) : ( v.x << -shift );
+    *length = ( shift >= 0 ) ?                      ( v.x >>  shift )
+                             : (FT_Fixed)( (FT_UInt32)v.x << -shift );
     *angle  = v.y;
   }
 
     *angle  = v.y;
   }
 
index 3975584..c1f9931 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility file for PS names support (body).                   */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType utility file for PS names support (body).                   */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004 by                                          */
+/*  Copyright 2002-2004, 2011 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -28,7 +28,7 @@
   FT_Get_PS_Font_Info( FT_Face          face,
                        PS_FontInfoRec*  afont_info )
   {
   FT_Get_PS_Font_Info( FT_Face          face,
                        PS_FontInfoRec*  afont_info )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
 
 
     if ( face )
 
 
     if ( face )
@@ -73,7 +73,7 @@
   FT_Get_PS_Font_Private( FT_Face         face,
                           PS_PrivateRec*  afont_private )
   {
   FT_Get_PS_Font_Private( FT_Face         face,
                           PS_PrivateRec*  afont_private )
   {
-    FT_Error  error = FT_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
 
 
     if ( face )
 
 
     if ( face )
   }
 
 
   }
 
 
+  /* documentation is in t1tables.h */
+
+  FT_EXPORT_DEF( FT_Long )
+  FT_Get_PS_Font_Value( FT_Face       face,
+                        PS_Dict_Keys  key,
+                        FT_UInt       idx,
+                        void         *value,
+                        FT_Long       value_len )
+  {
+    FT_Int             result  = 0;
+    FT_Service_PsInfo  service = NULL;
+
+
+    if ( face )
+    {
+      FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
+
+      if ( service && service->ps_get_font_value )
+        result = service->ps_get_font_value( face, key, idx,
+                                             value, value_len );
+    }
+
+    return result;
+  }
+
+
 /* END */
 /* END */
index 5f77be5..879d027 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility file for memory and list management (body).         */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType utility file for memory and list management (body).         */
 /*                                                                         */
-/*  Copyright 2002, 2004, 2005, 2006, 2007 by                              */
+/*  Copyright 2002, 2004-2007, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     {
       block = memory->alloc( memory, size );
       if ( block == NULL )
     {
       block = memory->alloc( memory, size );
       if ( block == NULL )
-        error = FT_Err_Out_Of_Memory;
+        error = FT_THROW( Out_Of_Memory );
     }
     else if ( size < 0 )
     {
       /* may help catch/prevent security issues */
     }
     else if ( size < 0 )
     {
       /* may help catch/prevent security issues */
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
     }
 
     *p_error = error;
     }
 
     *p_error = error;
@@ -98,6 +98,7 @@
   {
     FT_Error  error = FT_Err_Ok;
 
   {
     FT_Error  error = FT_Err_Ok;
 
+
     block = ft_mem_qrealloc( memory, item_size,
                              cur_count, new_count, block, &error );
     if ( !error && new_count > cur_count )
     block = ft_mem_qrealloc( memory, item_size,
                              cur_count, new_count, block, &error );
     if ( !error && new_count > cur_count )
     if ( cur_count < 0 || new_count < 0 || item_size < 0 )
     {
       /* may help catch/prevent nasty security issues */
     if ( cur_count < 0 || new_count < 0 || item_size < 0 )
     {
       /* may help catch/prevent nasty security issues */
-      error = FT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
     }
     else if ( new_count == 0 || item_size == 0 )
     {
     }
     else if ( new_count == 0 || item_size == 0 )
     {
     }
     else if ( new_count > FT_INT_MAX/item_size )
     {
     }
     else if ( new_count > FT_INT_MAX/item_size )
     {
-      error = FT_Err_Array_Too_Large;
+      error = FT_THROW( Array_Too_Large );
     }
     else if ( cur_count == 0 )
     {
     }
     else if ( cur_count == 0 )
     {
 
       block2 = memory->realloc( memory, cur_size, new_size, block );
       if ( block2 == NULL )
 
       block2 = memory->realloc( memory, cur_size, new_size, block );
       if ( block2 == NULL )
-        error = FT_Err_Out_Of_Memory;
+        error = FT_THROW( Out_Of_Memory );
       else
         block = block2;
     }
       else
         block = block2;
     }
   }
 
 
   }
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  FT_BASE_DEF( FT_Error )
-  FT_Alloc( FT_Memory  memory,
-            FT_Long    size,
-            void*     *P )
-  {
-    FT_Error  error;
-
-
-    (void)FT_ALLOC( *P, size );
-    return error;
-  }
-
-
-  FT_BASE_DEF( FT_Error )
-  FT_QAlloc( FT_Memory  memory,
-             FT_Long    size,
-             void*     *p )
-  {
-    FT_Error  error;
-
-
-    (void)FT_QALLOC( *p, size );
-    return error;
-  }
-
-
-  FT_BASE_DEF( FT_Error )
-  FT_Realloc( FT_Memory  memory,
-              FT_Long    current,
-              FT_Long    size,
-              void*     *P )
-  {
-    FT_Error  error;
-
-
-    (void)FT_REALLOC( *P, current, size );
-    return error;
-  }
-
-
-  FT_BASE_DEF( FT_Error )
-  FT_QRealloc( FT_Memory  memory,
-               FT_Long    current,
-               FT_Long    size,
-               void*     *p )
-  {
-    FT_Error  error;
-
-
-    (void)FT_QREALLOC( *p, current, size );
-    return error;
-  }
-
-
-  FT_BASE_DEF( void )
-  FT_Free( FT_Memory  memory,
-           void*     *P )
-  {
-    if ( *P )
-      FT_MEM_FREE( *P );
-  }
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
 /* END */
 /* END */
index bc2e90e..463ae76 100644 (file)
@@ -32,7 +32,7 @@
     FT_Error           error;
 
 
     FT_Error           error;
 
 
-    error = FT_Err_Invalid_Argument;
+    error = FT_ERR( Invalid_Argument );
 
     if ( face != NULL )
     {
 
     if ( face != NULL )
     {
diff --git a/reactos/lib/3rdparty/freetype/src/base/md5.c b/reactos/lib/3rdparty/freetype/src/base/md5.c
new file mode 100644 (file)
index 0000000..2f01c93
--- /dev/null
@@ -0,0 +1,295 @@
+/*
+ * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
+ * MD5 Message-Digest Algorithm (RFC 1321).
+ *
+ * Homepage:
+ * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
+ *
+ * Author:
+ * Alexander Peslyak, better known as Solar Designer <solar at openwall.com>
+ *
+ * This software was written by Alexander Peslyak in 2001.  No copyright is
+ * claimed, and the software is hereby placed in the public domain.
+ * In case this attempt to disclaim copyright and place the software in the
+ * public domain is deemed null and void, then the software is
+ * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
+ * general public under the following terms:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted.
+ *
+ * There's ABSOLUTELY NO WARRANTY, express or implied.
+ *
+ * (This is a heavily cut-down "BSD license".)
+ *
+ * This differs from Colin Plumb's older public domain implementation in that
+ * no exactly 32-bit integer data type is required (any 32-bit or wider
+ * unsigned integer data type will do), there's no compile-time endianness
+ * configuration, and the function prototypes match OpenSSL's.  No code from
+ * Colin Plumb's implementation has been reused; this comment merely compares
+ * the properties of the two independent implementations.
+ *
+ * The primary goals of this implementation are portability and ease of use.
+ * It is meant to be fast, but not as fast as possible.  Some known
+ * optimizations are not included to reduce source code size and avoid
+ * compile-time configuration.
+ */
+
+#ifndef HAVE_OPENSSL
+
+#include <string.h>
+
+#include "md5.h"
+
+/*
+ * The basic MD5 functions.
+ *
+ * F and G are optimized compared to their RFC 1321 definitions for
+ * architectures that lack an AND-NOT instruction, just like in Colin Plumb's
+ * implementation.
+ */
+#define F(x, y, z)                     ((z) ^ ((x) & ((y) ^ (z))))
+#define G(x, y, z)                     ((y) ^ ((z) & ((x) ^ (y))))
+#define H(x, y, z)                     ((x) ^ (y) ^ (z))
+#define I(x, y, z)                     ((y) ^ ((x) | ~(z)))
+
+/*
+ * The MD5 transformation for all four rounds.
+ */
+#define STEP(f, a, b, c, d, x, t, s) \
+       (a) += f((b), (c), (d)) + (x) + (t); \
+       (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \
+       (a) += (b);
+
+/*
+ * SET reads 4 input bytes in little-endian byte order and stores them
+ * in a properly aligned word in host byte order.
+ *
+ * The check for little-endian architectures that tolerate unaligned
+ * memory accesses is just an optimization.  Nothing will break if it
+ * doesn't work.
+ */
+#if defined(__i386__) || defined(__x86_64__) || defined(__vax__)
+#define SET(n) \
+       (*(MD5_u32plus *)&ptr[(n) * 4])
+#define GET(n) \
+       SET(n)
+#else
+#define SET(n) \
+       (ctx->block[(n)] = \
+       (MD5_u32plus)ptr[(n) * 4] | \
+       ((MD5_u32plus)ptr[(n) * 4 + 1] << 8) | \
+       ((MD5_u32plus)ptr[(n) * 4 + 2] << 16) | \
+       ((MD5_u32plus)ptr[(n) * 4 + 3] << 24))
+#define GET(n) \
+       (ctx->block[(n)])
+#endif
+
+/*
+ * This processes one or more 64-byte data blocks, but does NOT update
+ * the bit counters.  There are no alignment requirements.
+ */
+static void *body(MD5_CTX *ctx, void *data, unsigned long size)
+{
+       unsigned char *ptr;
+       MD5_u32plus a, b, c, d;
+       MD5_u32plus saved_a, saved_b, saved_c, saved_d;
+
+       ptr = (unsigned char *)data;
+
+       a = ctx->a;
+       b = ctx->b;
+       c = ctx->c;
+       d = ctx->d;
+
+       do {
+               saved_a = a;
+               saved_b = b;
+               saved_c = c;
+               saved_d = d;
+
+/* Round 1 */
+               STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7)
+               STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12)
+               STEP(F, c, d, a, b, SET(2), 0x242070db, 17)
+               STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22)
+               STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7)
+               STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12)
+               STEP(F, c, d, a, b, SET(6), 0xa8304613, 17)
+               STEP(F, b, c, d, a, SET(7), 0xfd469501, 22)
+               STEP(F, a, b, c, d, SET(8), 0x698098d8, 7)
+               STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12)
+               STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17)
+               STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22)
+               STEP(F, a, b, c, d, SET(12), 0x6b901122, 7)
+               STEP(F, d, a, b, c, SET(13), 0xfd987193, 12)
+               STEP(F, c, d, a, b, SET(14), 0xa679438e, 17)
+               STEP(F, b, c, d, a, SET(15), 0x49b40821, 22)
+
+/* Round 2 */
+               STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5)
+               STEP(G, d, a, b, c, GET(6), 0xc040b340, 9)
+               STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14)
+               STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20)
+               STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5)
+               STEP(G, d, a, b, c, GET(10), 0x02441453, 9)
+               STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14)
+               STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20)
+               STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5)
+               STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9)
+               STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14)
+               STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20)
+               STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5)
+               STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9)
+               STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14)
+               STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20)
+
+/* Round 3 */
+               STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4)
+               STEP(H, d, a, b, c, GET(8), 0x8771f681, 11)
+               STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16)
+               STEP(H, b, c, d, a, GET(14), 0xfde5380c, 23)
+               STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4)
+               STEP(H, d, a, b, c, GET(4), 0x4bdecfa9, 11)
+               STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16)
+               STEP(H, b, c, d, a, GET(10), 0xbebfbc70, 23)
+               STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4)
+               STEP(H, d, a, b, c, GET(0), 0xeaa127fa, 11)
+               STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16)
+               STEP(H, b, c, d, a, GET(6), 0x04881d05, 23)
+               STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4)
+               STEP(H, d, a, b, c, GET(12), 0xe6db99e5, 11)
+               STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16)
+               STEP(H, b, c, d, a, GET(2), 0xc4ac5665, 23)
+
+/* Round 4 */
+               STEP(I, a, b, c, d, GET(0), 0xf4292244, 6)
+               STEP(I, d, a, b, c, GET(7), 0x432aff97, 10)
+               STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15)
+               STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21)
+               STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6)
+               STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10)
+               STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15)
+               STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21)
+               STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6)
+               STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10)
+               STEP(I, c, d, a, b, GET(6), 0xa3014314, 15)
+               STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21)
+               STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6)
+               STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10)
+               STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15)
+               STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21)
+
+               a += saved_a;
+               b += saved_b;
+               c += saved_c;
+               d += saved_d;
+
+               ptr += 64;
+       } while (size -= 64);
+
+       ctx->a = a;
+       ctx->b = b;
+       ctx->c = c;
+       ctx->d = d;
+
+       return ptr;
+}
+
+void MD5_Init(MD5_CTX *ctx)
+{
+       ctx->a = 0x67452301;
+       ctx->b = 0xefcdab89;
+       ctx->c = 0x98badcfe;
+       ctx->d = 0x10325476;
+
+       ctx->lo = 0;
+       ctx->hi = 0;
+}
+
+void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size)
+{
+       MD5_u32plus saved_lo;
+       unsigned long used, free;
+
+       saved_lo = ctx->lo;
+       if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
+               ctx->hi++;
+       ctx->hi += size >> 29;
+
+       used = saved_lo & 0x3f;
+
+       if (used) {
+               free = 64 - used;
+
+               if (size < free) {
+                       memcpy(&ctx->buffer[used], data, size);
+                       return;
+               }
+
+               memcpy(&ctx->buffer[used], data, free);
+               data = (unsigned char *)data + free;
+               size -= free;
+               body(ctx, ctx->buffer, 64);
+       }
+
+       if (size >= 64) {
+               data = body(ctx, data, size & ~(unsigned long)0x3f);
+               size &= 0x3f;
+       }
+
+       memcpy(ctx->buffer, data, size);
+}
+
+void MD5_Final(unsigned char *result, MD5_CTX *ctx)
+{
+       unsigned long used, free;
+
+       used = ctx->lo & 0x3f;
+
+       ctx->buffer[used++] = 0x80;
+
+       free = 64 - used;
+
+       if (free < 8) {
+               memset(&ctx->buffer[used], 0, free);
+               body(ctx, ctx->buffer, 64);
+               used = 0;
+               free = 64;
+       }
+
+       memset(&ctx->buffer[used], 0, free - 8);
+
+       ctx->lo <<= 3;
+       ctx->buffer[56] = ctx->lo;
+       ctx->buffer[57] = ctx->lo >> 8;
+       ctx->buffer[58] = ctx->lo >> 16;
+       ctx->buffer[59] = ctx->lo >> 24;
+       ctx->buffer[60] = ctx->hi;
+       ctx->buffer[61] = ctx->hi >> 8;
+       ctx->buffer[62] = ctx->hi >> 16;
+       ctx->buffer[63] = ctx->hi >> 24;
+
+       body(ctx, ctx->buffer, 64);
+
+       result[0] = ctx->a;
+       result[1] = ctx->a >> 8;
+       result[2] = ctx->a >> 16;
+       result[3] = ctx->a >> 24;
+       result[4] = ctx->b;
+       result[5] = ctx->b >> 8;
+       result[6] = ctx->b >> 16;
+       result[7] = ctx->b >> 24;
+       result[8] = ctx->c;
+       result[9] = ctx->c >> 8;
+       result[10] = ctx->c >> 16;
+       result[11] = ctx->c >> 24;
+       result[12] = ctx->d;
+       result[13] = ctx->d >> 8;
+       result[14] = ctx->d >> 16;
+       result[15] = ctx->d >> 24;
+
+       memset(ctx, 0, sizeof(*ctx));
+}
+
+#endif
diff --git a/reactos/lib/3rdparty/freetype/src/base/md5.h b/reactos/lib/3rdparty/freetype/src/base/md5.h
new file mode 100644 (file)
index 0000000..f1a6857
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
+ * MD5 Message-Digest Algorithm (RFC 1321).
+ *
+ * Homepage:
+ * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
+ *
+ * Author:
+ * Alexander Peslyak, better known as Solar Designer <solar at openwall.com>
+ *
+ * This software was written by Alexander Peslyak in 2001.  No copyright is
+ * claimed, and the software is hereby placed in the public domain.
+ * In case this attempt to disclaim copyright and place the software in the
+ * public domain is deemed null and void, then the software is
+ * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
+ * general public under the following terms:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted.
+ *
+ * There's ABSOLUTELY NO WARRANTY, express or implied.
+ *
+ * See md5.c for more information.
+ */
+
+#ifdef HAVE_OPENSSL
+#include <openssl/md5.h>
+#elif !defined(_MD5_H)
+#define _MD5_H
+
+/* Any 32-bit or wider unsigned integer data type will do */
+typedef unsigned int MD5_u32plus;
+
+typedef struct {
+       MD5_u32plus lo, hi;
+       MD5_u32plus a, b, c, d;
+       unsigned char buffer[64];
+       MD5_u32plus block[16];
+} MD5_CTX;
+
+extern void MD5_Init(MD5_CTX *ctx);
+extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size);
+extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
+
+#endif
index 10f578a..e932191 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
 #
 
 
-# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by
+# Copyright 1996-2000, 2002-2009, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -50,7 +50,10 @@ ifneq ($(ftmac_c),)
   BASE_SRC += $(BASE_DIR)/$(ftmac_c)
 endif
 
   BASE_SRC += $(BASE_DIR)/$(ftmac_c)
 endif
 
-BASE_H := $(BASE_DIR)/ftbase.h
+# for simplicity, we also handle `md5.c' (which gets included by `ftobjs.h')
+BASE_H := $(BASE_DIR)/ftbase.h \
+          $(BASE_DIR)/md5.c    \
+          $(BASE_DIR)/md5.h
 
 # Base layer `extensions' sources
 #
 
 # Base layer `extensions' sources
 #
index e3f2ae3..b761aba 100644 (file)
@@ -13,7 +13,7 @@ This code implements a BDF driver for the FreeType library, following the
 Adobe Specification V 2.2.  The specification of the BDF font format is
 available from Adobe's web site:
 
 Adobe Specification V 2.2.  The specification of the BDF font format is
 available from Adobe's web site:
 
-  http://partners.adobe.com/asn/developer/PDFS/TN/5005.BDF_Spec.pdf
+  http://partners.adobe.com/public/developer/en/font/5005.BDF_Spec.pdf
 
 Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).
 They do not define vertical metrics, because the X Consortium BDF
 
 Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).
 They do not define vertical metrics, because the X Consortium BDF
@@ -119,7 +119,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *** Portions of the driver (that is, bdflib.c and bdf.h):
 
 Copyright 2000 Computing Research Labs, New Mexico State University
 *** Portions of the driver (that is, bdflib.c and bdf.h):
 
 Copyright 2000 Computing Research Labs, New Mexico State University
-Copyright 2001-2002 Francesco Zappa Nardelli
+Copyright 2001-2002, 2011 Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the "Software"),
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the "Software"),
index 561b415..d11be6f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright 2000 Computing Research Labs, New Mexico State University
 /*
  * Copyright 2000 Computing Research Labs, New Mexico State University
- * Copyright 2001, 2002, 2003, 2004 Francesco Zappa Nardelli
+ * Copyright 2001-2004, 2011 Francesco Zappa Nardelli
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -226,8 +226,10 @@ FT_BEGIN_HEADER
 
     void*            internal;       /* Internal data for the font.         */
 
 
     void*            internal;       /* Internal data for the font.         */
 
-    unsigned long    nmod[2048];     /* Bitmap indicating modified glyphs.  */
-    unsigned long    umod[2048];     /* Bitmap indicating modified          */
+    /* The size of the next two arrays must be in sync with the */
+    /* size of the `have' array in the `bdf_parse_t' structure. */
+    unsigned long    nmod[34816];    /* Bitmap indicating modified glyphs.  */
+    unsigned long    umod[34816];    /* Bitmap indicating modified          */
                                      /* unencoded glyphs.                   */
     unsigned short   modified;       /* Boolean indicating font modified.   */
     unsigned short   bpp;            /* Bits per pixel.                     */
                                      /* unencoded glyphs.                   */
     unsigned short   modified;       /* Boolean indicating font modified.   */
     unsigned short   bpp;            /* Bits per pixel.                     */
index 47d0eae..0ea0a5e 100644 (file)
@@ -2,7 +2,7 @@
 
     FreeType font driver for bdf files
 
 
     FreeType font driver for bdf files
 
-    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by
+    Copyright (C) 2001-2008, 2011, 2013 by
     Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
     Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -30,7 +30,7 @@ THE SOFTWARE.
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_BDF_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_BDF_H
-#include FT_TRUETYPE_IDS_H 
+#include FT_TRUETYPE_IDS_H
 
 #include FT_SERVICE_BDF_H
 #include FT_SERVICE_XFREE86_NAME_H
 
 #include FT_SERVICE_BDF_H
 #include FT_SERVICE_XFREE86_NAME_H
@@ -72,7 +72,7 @@ THE SOFTWARE.
     cmap->num_encodings = face->bdffont->glyphs_used;
     cmap->encodings     = face->en_table;
 
     cmap->num_encodings = face->bdffont->glyphs_used;
     cmap->encodings     = face->en_table;
 
-    return BDF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
@@ -198,7 +198,7 @@ THE SOFTWARE.
   static FT_Error
   bdf_interpret_style( BDF_Face  bdf )
   {
   static FT_Error
   bdf_interpret_style( BDF_Face  bdf )
   {
-    FT_Error         error  = BDF_Err_Ok;
+    FT_Error         error  = FT_Err_Ok;
     FT_Face          face   = FT_FACE( bdf );
     FT_Memory        memory = face->memory;
     bdf_font_t*      font   = bdf->bdffont;
     FT_Face          face   = FT_FACE( bdf );
     FT_Memory        memory = face->memory;
     bdf_font_t*      font   = bdf->bdffont;
@@ -332,8 +332,6 @@ THE SOFTWARE.
     FT_FREE( bdfface->available_sizes );
 
     FT_FREE( face->bdffont );
     FT_FREE( bdfface->available_sizes );
 
     FT_FREE( face->bdffont );
-
-    FT_TRACE4(( "BDF_Face_Done: done face\n" ));
   }
 
 
   }
 
 
@@ -344,7 +342,7 @@ THE SOFTWARE.
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
-    FT_Error       error  = BDF_Err_Ok;
+    FT_Error       error  = FT_Err_Ok;
     BDF_Face       face   = (BDF_Face)bdfface;
     FT_Memory      memory = FT_FACE_MEMORY( face );
 
     BDF_Face       face   = (BDF_Face)bdfface;
     FT_Memory      memory = FT_FACE_MEMORY( face );
 
@@ -356,6 +354,8 @@ THE SOFTWARE.
     FT_UNUSED( face_index );
 
 
     FT_UNUSED( face_index );
 
 
+    FT_TRACE2(( "BDF driver\n" ));
+
     if ( FT_STREAM_SEEK( 0 ) )
       goto Exit;
 
     if ( FT_STREAM_SEEK( 0 ) )
       goto Exit;
 
@@ -365,9 +365,9 @@ THE SOFTWARE.
     options.font_spacing    = BDF_PROPORTIONAL;
 
     error = bdf_load_font( stream, memory, &options, &font );
     options.font_spacing    = BDF_PROPORTIONAL;
 
     error = bdf_load_font( stream, memory, &options, &font );
-    if ( error == BDF_Err_Missing_Startfont_Field )
+    if ( FT_ERR_EQ( error, Missing_Startfont_Field ) )
     {
     {
-      FT_TRACE2(( "[not a valid BDF file]\n" ));
+      FT_TRACE2(( "  not a BDF file\n" ));
       goto Fail;
     }
     else if ( error )
       goto Fail;
     }
     else if ( error )
@@ -379,10 +379,10 @@ THE SOFTWARE.
       bdf_property_t*  prop = NULL;
 
 
       bdf_property_t*  prop = NULL;
 
 
-      FT_TRACE4(( "number of glyphs: %d (%d)\n",
+      FT_TRACE4(( "  number of glyphs: allocated %d (used %d)\n",
                   font->glyphs_size,
                   font->glyphs_used ));
                   font->glyphs_size,
                   font->glyphs_used ));
-      FT_TRACE4(( "number of unencoded glyphs: %d (%d)\n",
+      FT_TRACE4(( "  number of unencoded glyphs: allocated %d (used %d)\n",
                   font->unencoded_size,
                   font->unencoded_used ));
 
                   font->unencoded_size,
                   font->unencoded_used ));
 
@@ -482,7 +482,7 @@ THE SOFTWARE.
         for ( n = 0; n < font->glyphs_size; n++ )
         {
           (face->en_table[n]).enc = cur[n].encoding;
         for ( n = 0; n < font->glyphs_size; n++ )
         {
           (face->en_table[n]).enc = cur[n].encoding;
-          FT_TRACE4(( "idx %d, val 0x%lX\n", n, cur[n].encoding ));
+          FT_TRACE4(( "  idx %d, val 0x%lX\n", n, cur[n].encoding ));
           (face->en_table[n]).glyph = (FT_Short)n;
 
           if ( cur[n].encoding == font->default_char )
           (face->en_table[n]).glyph = (FT_Short)n;
 
           if ( cur[n].encoding == font->default_char )
@@ -490,7 +490,8 @@ THE SOFTWARE.
             if ( n < FT_UINT_MAX )
               face->default_glyph = (FT_UInt)n;
             else
             if ( n < FT_UINT_MAX )
               face->default_glyph = (FT_UInt)n;
             else
-              FT_TRACE1(( "idx %d is too large for this system\n", n ));
+              FT_TRACE1(( "BDF_Face_Init:"
+                          " idx %d is too large for this system\n", n ));
           }
         }
       }
           }
         }
       }
@@ -590,7 +591,7 @@ THE SOFTWARE.
 
   Fail:
     BDF_Face_Done( bdfface );
 
   Fail:
     BDF_Face_Done( bdfface );
-    return BDF_Err_Unknown_File_Format;
+    return FT_THROW( Unknown_File_Format );
   }
 
 
   }
 
 
@@ -607,7 +608,7 @@ THE SOFTWARE.
     size->metrics.descender   = -bdffont->font_descent << 6;
     size->metrics.max_advance = bdffont->bbx.width << 6;
 
     size->metrics.descender   = -bdffont->font_descent << 6;
     size->metrics.max_advance = bdffont->bbx.width << 6;
 
-    return BDF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
@@ -618,7 +619,7 @@ THE SOFTWARE.
     FT_Face          face    = size->face;
     FT_Bitmap_Size*  bsize   = face->available_sizes;
     bdf_font_t*      bdffont = ( (BDF_Face)face )->bdffont;
     FT_Face          face    = size->face;
     FT_Bitmap_Size*  bsize   = face->available_sizes;
     bdf_font_t*      bdffont = ( (BDF_Face)face )->bdffont;
-    FT_Error         error   = BDF_Err_Invalid_Pixel_Size;
+    FT_Error         error   = FT_ERR( Invalid_Pixel_Size );
     FT_Long          height;
 
 
     FT_Long          height;
 
 
@@ -629,17 +630,17 @@ THE SOFTWARE.
     {
     case FT_SIZE_REQUEST_TYPE_NOMINAL:
       if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )
     {
     case FT_SIZE_REQUEST_TYPE_NOMINAL:
       if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )
-        error = BDF_Err_Ok;
+        error = FT_Err_Ok;
       break;
 
     case FT_SIZE_REQUEST_TYPE_REAL_DIM:
       if ( height == ( bdffont->font_ascent +
                        bdffont->font_descent ) )
       break;
 
     case FT_SIZE_REQUEST_TYPE_REAL_DIM:
       if ( height == ( bdffont->font_ascent +
                        bdffont->font_descent ) )
-        error = BDF_Err_Ok;
+        error = FT_Err_Ok;
       break;
 
     default:
       break;
 
     default:
-      error = BDF_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
       break;
     }
 
       break;
     }
 
@@ -659,7 +660,7 @@ THE SOFTWARE.
   {
     BDF_Face     bdf    = (BDF_Face)FT_SIZE_FACE( size );
     FT_Face      face   = FT_FACE( bdf );
   {
     BDF_Face     bdf    = (BDF_Face)FT_SIZE_FACE( size );
     FT_Face      face   = FT_FACE( bdf );
-    FT_Error     error  = BDF_Err_Ok;
+    FT_Error     error  = FT_Err_Ok;
     FT_Bitmap*   bitmap = &slot->bitmap;
     bdf_glyph_t  glyph;
     int          bpp    = bdf->bdffont->bpp;
     FT_Bitmap*   bitmap = &slot->bitmap;
     bdf_glyph_t  glyph;
     int          bpp    = bdf->bdffont->bpp;
@@ -669,7 +670,7 @@ THE SOFTWARE.
 
     if ( !face || glyph_index >= (FT_UInt)face->num_glyphs )
     {
 
     if ( !face || glyph_index >= (FT_UInt)face->num_glyphs )
     {
-      error = BDF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
@@ -761,8 +762,8 @@ THE SOFTWARE.
       case BDF_INTEGER:
         if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
         {
       case BDF_INTEGER:
         if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
         {
-          FT_TRACE1(( "bdf_get_bdf_property: " ));
-          FT_TRACE1(( "too large integer 0x%x is truncated\n" ));
+          FT_TRACE1(( "bdf_get_bdf_property:"
+                      " too large integer 0x%x is truncated\n" ));
         }
         aproperty->type      = BDF_PROPERTY_TYPE_INTEGER;
         aproperty->u.integer = (FT_Int32)prop->value.l;
         }
         aproperty->type      = BDF_PROPERTY_TYPE_INTEGER;
         aproperty->u.integer = (FT_Int32)prop->value.l;
@@ -771,8 +772,8 @@ THE SOFTWARE.
       case BDF_CARDINAL:
         if ( prop->value.ul > 0xFFFFFFFFUL )
         {
       case BDF_CARDINAL:
         if ( prop->value.ul > 0xFFFFFFFFUL )
         {
-          FT_TRACE1(( "bdf_get_bdf_property: " ));
-          FT_TRACE1(( "too large cardinal 0x%x is truncated\n" ));
+          FT_TRACE1(( "bdf_get_bdf_property:"
+                      " too large cardinal 0x%x is truncated\n" ));
         }
         aproperty->type       = BDF_PROPERTY_TYPE_CARDINAL;
         aproperty->u.cardinal = (FT_UInt32)prop->value.ul;
         }
         aproperty->type       = BDF_PROPERTY_TYPE_CARDINAL;
         aproperty->u.cardinal = (FT_UInt32)prop->value.ul;
@@ -785,7 +786,7 @@ THE SOFTWARE.
     }
 
   Fail:
     }
 
   Fail:
-    return BDF_Err_Invalid_Argument;
+    return FT_THROW( Invalid_Argument );
   }
 
 
   }
 
 
@@ -847,9 +848,9 @@ THE SOFTWARE.
 
       0,
 
 
       0,
 
-      (FT_Module_Constructor)0,
-      (FT_Module_Destructor) 0,
-      (FT_Module_Requester)  bdf_driver_requester
+      0,                        /* FT_Module_Constructor */
+      0,                        /* FT_Module_Destructor  */
+      bdf_driver_requester
     },
 
     sizeof ( BDF_FaceRec ),
     },
 
     sizeof ( BDF_FaceRec ),
@@ -863,15 +864,11 @@ THE SOFTWARE.
     0,                          /* FT_Slot_InitFunc */
     0,                          /* FT_Slot_DoneFunc */
 
     0,                          /* FT_Slot_InitFunc */
     0,                          /* FT_Slot_DoneFunc */
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    ft_stub_set_char_sizes,
-    ft_stub_set_pixel_sizes,
-#endif
     BDF_Glyph_Load,
 
     BDF_Glyph_Load,
 
-    0,                          /* FT_Face_GetKerningFunc   */
-    0,                          /* FT_Face_AttachFunc       */
-    0,                          /* FT_Face_GetAdvancesFunc  */
+    0,                          /* FT_Face_GetKerningFunc  */
+    0,                          /* FT_Face_AttachFunc      */
+    0,                          /* FT_Face_GetAdvancesFunc */
 
     BDF_Size_Request,
     BDF_Size_Select
 
     BDF_Size_Request,
     BDF_Size_Select
index db7093b..ca0dae5 100644 (file)
@@ -38,7 +38,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
-#endif 
+#endif
 
 
   typedef struct  BDF_encoding_el_
 
 
   typedef struct  BDF_encoding_el_
index b27fa33..ea545ac 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2001, 2002 Francesco Zappa Nardelli
+ * Copyright 2001, 2002, 2012 Francesco Zappa Nardelli
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -33,6 +33,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  BDF_Err_
 #define FT_ERR_BASE    FT_Mod_Err_BDF
 
 #define FT_ERR_PREFIX  BDF_Err_
 #define FT_ERR_BASE    FT_Mod_Err_BDF
 
index 21b8d9d..0b8412d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright 2000 Computing Research Labs, New Mexico State University
 /*
  * Copyright 2000 Computing Research Labs, New Mexico State University
- * Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
+ * Copyright 2001-2013
  *   Francesco Zappa Nardelli
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  *   Francesco Zappa Nardelli
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
                         sizeof ( _bdf_properties[0] );
 
 
                         sizeof ( _bdf_properties[0] );
 
 
+  /* Auto correction messages. */
+#define ACMSG1   "FONT_ASCENT property missing.  " \
+                 "Added `FONT_ASCENT %hd'.\n"
+#define ACMSG2   "FONT_DESCENT property missing.  " \
+                 "Added `FONT_DESCENT %hd'.\n"
+#define ACMSG3   "Font width != actual width.  Old: %hd New: %hd.\n"
+#define ACMSG4   "Font left bearing != actual left bearing.  " \
+                 "Old: %hd New: %hd.\n"
+#define ACMSG5   "Font ascent != actual ascent.  Old: %hd New: %hd.\n"
+#define ACMSG6   "Font descent != actual descent.  Old: %hd New: %hd.\n"
+#define ACMSG7   "Font height != actual height. Old: %hd New: %hd.\n"
+#define ACMSG8   "Glyph scalable width (SWIDTH) adjustments made.\n"
+#define ACMSG9   "SWIDTH field missing at line %ld.  Set automatically.\n"
+#define ACMSG10  "DWIDTH field missing at line %ld.  Set to glyph width.\n"
+#define ACMSG11  "SIZE bits per pixel field adjusted to %hd.\n"
+#define ACMSG12  "Duplicate encoding %ld (%s) changed to unencoded.\n"
+#define ACMSG13  "Glyph %ld extra rows removed.\n"
+#define ACMSG14  "Glyph %ld extra columns removed.\n"
+#define ACMSG15  "Incorrect glyph count: %ld indicated but %ld found.\n"
+#define ACMSG16  "Glyph %ld missing columns padded with zero bits.\n"
+
+  /* Error messages. */
+#define ERRMSG1  "[line %ld] Missing `%s' line.\n"
+#define ERRMSG2  "[line %ld] Font header corrupted or missing fields.\n"
+#define ERRMSG3  "[line %ld] Font glyphs corrupted or missing fields.\n"
+#define ERRMSG4  "[line %ld] BBX too big.\n"
+#define ERRMSG5  "[line %ld] `%s' value too big.\n"
+#define ERRMSG6  "[line %ld] Input line too long.\n"
+#define ERRMSG7  "[line %ld] Font name too long.\n"
+#define ERRMSG8  "[line %ld] Invalid `%s' value.\n"
+#define ERRMSG9  "[line %ld] Invalid keyword.\n"
+
+  /* Debug messages. */
+#define DBGMSG1  "  [%6ld] %s" /* no \n */
+#define DBGMSG2  " (0x%lX)\n"
+
+
   /*************************************************************************/
   /*                                                                       */
   /* Hash table utilities for the properties.                              */
   /*************************************************************************/
   /*                                                                       */
   /* Hash table utilities for the properties.                              */
   {
     hashnode*  obp = ht->table, *bp, *nbp;
     int        i, sz = ht->size;
   {
     hashnode*  obp = ht->table, *bp, *nbp;
     int        i, sz = ht->size;
-    FT_Error   error = BDF_Err_Ok;
+    FT_Error   error = FT_Err_Ok;
 
 
     ht->size <<= 1;
 
 
     ht->size <<= 1;
   hash_init( hashtable*  ht,
              FT_Memory   memory )
   {
   hash_init( hashtable*  ht,
              FT_Memory   memory )
   {
-    int       sz = INITIAL_HT_SIZE;
-    FT_Error  error = BDF_Err_Ok;
+    int       sz    = INITIAL_HT_SIZE;
+    FT_Error  error = FT_Err_Ok;
 
 
     ht->size  = sz;
 
 
     ht->size  = sz;
                hashtable*  ht,
                FT_Memory   memory )
   {
                hashtable*  ht,
                FT_Memory   memory )
   {
-    hashnode  nn, *bp = hash_bucket( key, ht );
-    FT_Error  error = BDF_Err_Ok;
+    hashnode   nn;
+    hashnode*  bp      = hash_bucket( key, ht );
+    FT_Error   error   = FT_Err_Ok;
 
 
     nn = *bp;
 
 
     nn = *bp;
     bdf_font_t*     font;
     bdf_options_t*  opts;
 
     bdf_font_t*     font;
     bdf_options_t*  opts;
 
-    unsigned long   have[2048];
+    unsigned long   have[34816]; /* must be in sync with `nmod' and `umod' */
+                                 /* arrays from `bdf_font_t' structure     */
     _bdf_list_t     list;
 
     FT_Memory       memory;
     _bdf_list_t     list;
 
     FT_Memory       memory;
   _bdf_list_ensure( _bdf_list_t*   list,
                     unsigned long  num_items ) /* same as _bdf_list_t.used */
   {
   _bdf_list_ensure( _bdf_list_t*   list,
                     unsigned long  num_items ) /* same as _bdf_list_t.used */
   {
-    FT_Error  error = BDF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( num_items > list->size )
     {
       unsigned long  oldsize = list->size; /* same as _bdf_list_t.size */
 
 
     if ( num_items > list->size )
     {
       unsigned long  oldsize = list->size; /* same as _bdf_list_t.size */
-      unsigned long  newsize = oldsize + ( oldsize >> 1 ) + 4;
+      unsigned long  newsize = oldsize + ( oldsize >> 1 ) + 5;
       unsigned long  bigsize = (unsigned long)( FT_INT_MAX / sizeof ( char* ) );
       FT_Memory      memory  = list->memory;
 
 
       if ( oldsize == bigsize )
       {
       unsigned long  bigsize = (unsigned long)( FT_INT_MAX / sizeof ( char* ) );
       FT_Memory      memory  = list->memory;
 
 
       if ( oldsize == bigsize )
       {
-        error = BDF_Err_Out_Of_Memory;
+        error = FT_THROW( Out_Of_Memory );
         goto Exit;
       }
       else if ( newsize < oldsize || newsize > bigsize )
         goto Exit;
       }
       else if ( newsize < oldsize || newsize > bigsize )
                   unsigned long  *alen )
   {
     unsigned long  i, j;
                   unsigned long  *alen )
   {
     unsigned long  i, j;
-    char           *fp, *dp;
+    char*          dp;
 
 
     *alen = 0;
 
 
     *alen = 0;
     dp = list->field[0];
     for ( i = j = 0; i < list->used; i++ )
     {
     dp = list->field[0];
     for ( i = j = 0; i < list->used; i++ )
     {
-      fp = list->field[i];
+      char*  fp = list->field[i];
+
+
       while ( *fp )
         dp[j++] = *fp++;
 
       while ( *fp )
         dp[j++] = *fp++;
 
   }
 
 
   }
 
 
+  /* The code below ensures that we have at least 4 + 1 `field' */
+  /* elements in `list' (which are possibly NULL) so that we    */
+  /* don't have to check the number of fields in most cases.    */
+
   static FT_Error
   _bdf_list_split( _bdf_list_t*   list,
                    char*          separators,
   static FT_Error
   _bdf_list_split( _bdf_list_t*   list,
                    char*          separators,
     int       mult, final_empty;
     char      *sp, *ep, *end;
     char      seps[32];
     int       mult, final_empty;
     char      *sp, *ep, *end;
     char      seps[32];
-    FT_Error  error = BDF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     /* Initialize the list. */
     list->used = 0;
 
 
     /* Initialize the list. */
     list->used = 0;
+    if ( list->size )
+    {
+      list->field[0] = (char*)empty;
+      list->field[1] = (char*)empty;
+      list->field[2] = (char*)empty;
+      list->field[3] = (char*)empty;
+      list->field[4] = (char*)empty;
+    }
 
     /* If the line is empty, then simply return. */
     if ( linelen == 0 || line[0] == 0 )
 
     /* If the line is empty, then simply return. */
     if ( linelen == 0 || line[0] == 0 )
     /* this, so an error is signaled.                                 */
     if ( separators == 0 || *separators == 0 )
     {
     /* this, so an error is signaled.                                 */
     if ( separators == 0 || *separators == 0 )
     {
-      error = BDF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
     unsigned long     lineno, buf_size;
     int               refill, hold, to_skip;
     ptrdiff_t         bytes, start, end, cursor, avail;
     unsigned long     lineno, buf_size;
     int               refill, hold, to_skip;
     ptrdiff_t         bytes, start, end, cursor, avail;
-    char*             buf = 0;
+    char*             buf    = 0;
     FT_Memory         memory = stream->memory;
     FT_Memory         memory = stream->memory;
-    FT_Error          error = BDF_Err_Ok;
+    FT_Error          error  = FT_Err_Ok;
 
 
     if ( callback == 0 )
     {
 
 
     if ( callback == 0 )
     {
-      error = BDF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
           if ( buf_size >= 65536UL )  /* limit ourselves to 64KByte */
           {
 
           if ( buf_size >= 65536UL )  /* limit ourselves to 64KByte */
           {
-            error = BDF_Err_Invalid_Argument;
+            FT_ERROR(( "_bdf_readstream: " ERRMSG6, lineno ));
+            error = FT_THROW( Invalid_Argument );
             goto Exit;
           }
 
             goto Exit;
           }
 
         {
           bytes = avail - start;
 
         {
           bytes = avail - start;
 
-          FT_MEM_COPY( buf, buf + start, bytes );
+          FT_MEM_MOVE( buf, buf + start, bytes );
 
           cursor = bytes;
           avail -= bytes;
 
           cursor = bytes;
           avail -= bytes;
       /* XXX: Use encoding independent value for 0x1a */
       if ( buf[start] != '#' && buf[start] != 0x1a && end > start )
       {
       /* XXX: Use encoding independent value for 0x1a */
       if ( buf[start] != '#' && buf[start] != 0x1a && end > start )
       {
-        error = (*cb)( buf + start, end - start, lineno,
+        error = (*cb)( buf + start, (unsigned long)( end - start ), lineno,
                        (void*)&cb, client_data );
         /* Redo if we have encountered CHARS without properties. */
         if ( error == -1 )
                        (void*)&cb, client_data );
         /* Redo if we have encountered CHARS without properties. */
         if ( error == -1 )
-          error = (*cb)( buf + start, end - start, lineno,
+          error = (*cb)( buf + start, (unsigned long)( end - start ), lineno,
                          (void*)&cb, client_data );
         if ( error )
           break;
                          (void*)&cb, client_data );
         if ( error )
           break;
   };
 
 
   };
 
 
-#define isdigok( m, d )  (m[(d) >> 3] & ( 1 << ( (d) & 7 ) ) )
-
-
   /* Routine to convert an ASCII string into an unsigned long integer. */
   static unsigned long
   _bdf_atoul( char*   s,
   /* Routine to convert an ASCII string into an unsigned long integer. */
   static unsigned long
   _bdf_atoul( char*   s,
       s   += 2;
     }
 
       s   += 2;
     }
 
-    for ( v = 0; isdigok( dmap, *s ); s++ )
+    for ( v = 0; sbitset( dmap, *s ); s++ )
       v = v * base + a2i[(int)*s];
 
     if ( end != 0 )
       v = v * base + a2i[(int)*s];
 
     if ( end != 0 )
       s   += 2;
     }
 
       s   += 2;
     }
 
-    for ( v = 0; isdigok( dmap, *s ); s++ )
+    for ( v = 0; sbitset( dmap, *s ); s++ )
       v = v * base + a2i[(int)*s];
 
     if ( end != 0 )
       v = v * base + a2i[(int)*s];
 
     if ( end != 0 )
       s   += 2;
     }
 
       s   += 2;
     }
 
-    for ( v = 0; isdigok( dmap, *s ); s++ )
+    for ( v = 0; sbitset( dmap, *s ); s++ )
       v = (short)( v * base + a2i[(int)*s] );
 
     if ( end != 0 )
       v = (short)( v * base + a2i[(int)*s] );
 
     if ( end != 0 )
     size_t           n;
     bdf_property_t*  p;
     FT_Memory        memory = font->memory;
     size_t           n;
     bdf_property_t*  p;
     FT_Memory        memory = font->memory;
-    FT_Error         error = BDF_Err_Ok;
+    FT_Error         error  = FT_Err_Ok;
 
 
 
 
-    /* First check to see if the property has      */
+    /* First check whether the property has        */
     /* already been added or not.  If it has, then */
     /* simply ignore it.                           */
     if ( hash_lookup( name, &(font->proptbl) ) )
     /* already been added or not.  If it has, then */
     /* simply ignore it.                           */
     if ( hash_lookup( name, &(font->proptbl) ) )
 
     n = ft_strlen( name ) + 1;
     if ( n > FT_ULONG_MAX )
 
     n = ft_strlen( name ) + 1;
     if ( n > FT_ULONG_MAX )
-      return BDF_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( FT_NEW_ARRAY( p->name, n ) )
       goto Exit;
 
     if ( FT_NEW_ARRAY( p->name, n ) )
       goto Exit;
 #define _BDF_GLYPH_HEIGHT_CHECK  0x80000000UL
 
 
 #define _BDF_GLYPH_HEIGHT_CHECK  0x80000000UL
 
 
-  /* Auto correction messages. */
-#define ACMSG1   "FONT_ASCENT property missing.  " \
-                 "Added \"FONT_ASCENT %hd\".\n"
-#define ACMSG2   "FONT_DESCENT property missing.  " \
-                 "Added \"FONT_DESCENT %hd\".\n"
-#define ACMSG3   "Font width != actual width.  Old: %hd New: %hd.\n"
-#define ACMSG4   "Font left bearing != actual left bearing.  " \
-                 "Old: %hd New: %hd.\n"
-#define ACMSG5   "Font ascent != actual ascent.  Old: %hd New: %hd.\n"
-#define ACMSG6   "Font descent != actual descent.  Old: %hd New: %hd.\n"
-#define ACMSG7   "Font height != actual height. Old: %hd New: %hd.\n"
-#define ACMSG8   "Glyph scalable width (SWIDTH) adjustments made.\n"
-#define ACMSG9   "SWIDTH field missing at line %ld.  Set automatically.\n"
-#define ACMSG10  "DWIDTH field missing at line %ld.  Set to glyph width.\n"
-#define ACMSG11  "SIZE bits per pixel field adjusted to %hd.\n"
-#define ACMSG12  "Duplicate encoding %ld (%s) changed to unencoded.\n"
-#define ACMSG13  "Glyph %ld extra rows removed.\n"
-#define ACMSG14  "Glyph %ld extra columns removed.\n"
-#define ACMSG15  "Incorrect glyph count: %ld indicated but %ld found.\n"
-
-  /* Error messages. */
-#define ERRMSG1  "[line %ld] Missing \"%s\" line.\n"
-#define ERRMSG2  "[line %ld] Font header corrupted or missing fields.\n"
-#define ERRMSG3  "[line %ld] Font glyphs corrupted or missing fields.\n"
-#define ERRMSG4  "[line %ld] BBX too big.\n"
-
-
   static FT_Error
   _bdf_add_comment( bdf_font_t*    font,
                     char*          comment,
   static FT_Error
   _bdf_add_comment( bdf_font_t*    font,
                     char*          comment,
   {
     char*      cp;
     FT_Memory  memory = font->memory;
   {
     char*      cp;
     FT_Memory  memory = font->memory;
-    FT_Error   error = BDF_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
 
 
     if ( FT_RENEW_ARRAY( font->comments,
 
 
     if ( FT_RENEW_ARRAY( font->comments,
   /* default specified in the options.                                 */
   static FT_Error
   _bdf_set_default_spacing( bdf_font_t*     font,
   /* default specified in the options.                                 */
   static FT_Error
   _bdf_set_default_spacing( bdf_font_t*     font,
-                            bdf_options_t*  opts )
+                            bdf_options_t*  opts,
+                            unsigned long   lineno )
   {
     size_t       len;
     char         name[256];
     _bdf_list_t  list;
     FT_Memory    memory;
   {
     size_t       len;
     char         name[256];
     _bdf_list_t  list;
     FT_Memory    memory;
-    FT_Error     error = BDF_Err_Ok;
+    FT_Error     error = FT_Err_Ok;
+
+    FT_UNUSED( lineno );        /* only used in debug mode */
 
 
     if ( font == 0 || font->name == 0 || font->name[0] == 0 )
     {
 
 
     if ( font == 0 || font->name == 0 || font->name[0] == 0 )
     {
-      error = BDF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
     /* Limit ourselves to 256 characters in the font name. */
     if ( len >= 256 )
     {
     /* Limit ourselves to 256 characters in the font name. */
     if ( len >= 256 )
     {
-      error = BDF_Err_Invalid_Argument;
+      FT_ERROR(( "_bdf_set_default_spacing: " ERRMSG7, lineno ));
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     FT_MEM_COPY( name, font->name, len );
 
       goto Exit;
     }
 
     FT_MEM_COPY( name, font->name, len );
 
-    error = _bdf_list_split( &list, (char *)"-", name, len );
+    error = _bdf_list_split( &list, (char *)"-", name, (unsigned long)len );
     if ( error )
       goto Fail;
 
     if ( error )
       goto Fail;
 
     ep = line + linelen;
 
     /* Trim the leading whitespace if it exists. */
     ep = line + linelen;
 
     /* Trim the leading whitespace if it exists. */
-    *sp++ = 0;
+    if ( *sp )
+      *sp++ = 0;
     while ( *sp                           &&
             ( *sp == ' ' || *sp == '\t' ) )
       sp++;
     while ( *sp                           &&
             ( *sp == ' ' || *sp == '\t' ) )
       sp++;
 
 
   static FT_Error
 
 
   static FT_Error
-  _bdf_add_property( bdf_font_t*  font,
-                     char*        name,
-                     char*        value )
+  _bdf_add_property( bdf_font_t*    font,
+                     char*          name,
+                     char*          value,
+                     unsigned long  lineno )
   {
     size_t          propid;
     hashnode        hn;
     bdf_property_t  *prop, *fp;
     FT_Memory       memory = font->memory;
   {
     size_t          propid;
     hashnode        hn;
     bdf_property_t  *prop, *fp;
     FT_Memory       memory = font->memory;
-    FT_Error        error = BDF_Err_Ok;
+    FT_Error        error  = FT_Err_Ok;
+
+    FT_UNUSED( lineno );        /* only used in debug mode */
 
 
 
 
-    /* First, check to see if the property already exists in the font. */
+    /* First, check whether the property already exists in the font. */
     if ( ( hn = hash_lookup( name, (hashtable *)font->internal ) ) != 0 )
     {
       /* The property already exists in the font, so simply replace */
     if ( ( hn = hash_lookup( name, (hashtable *)font->internal ) ) != 0 )
     {
       /* The property already exists in the font, so simply replace */
     {
       if ( !fp->value.atom )
       {
     {
       if ( !fp->value.atom )
       {
-        error = BDF_Err_Invalid_File_Format;
+        FT_ERROR(( "_bdf_add_property: " ERRMSG8, lineno, "SPACING" ));
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
     bdf_font_t*        font;
 
     FT_Memory          memory;
     bdf_font_t*        font;
 
     FT_Memory          memory;
-    FT_Error           error = BDF_Err_Ok;
+    FT_Error           error = FT_Err_Ok;
 
     FT_UNUSED( call_data );
     FT_UNUSED( lineno );        /* only used in debug mode */
 
     FT_UNUSED( call_data );
     FT_UNUSED( lineno );        /* only used in debug mode */
       if ( ft_memcmp( line, "CHARS", 5 ) != 0 )
       {
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "CHARS" ));
       if ( ft_memcmp( line, "CHARS", 5 ) != 0 )
       {
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "CHARS" ));
-        error = BDF_Err_Missing_Chars_Field;
+        error = FT_THROW( Missing_Chars_Field );
         goto Exit;
       }
 
         goto Exit;
       }
 
 
       /* Limit ourselves to 1,114,112 glyphs in the font (this is the */
       /* number of code points available in Unicode).                 */
 
       /* Limit ourselves to 1,114,112 glyphs in the font (this is the */
       /* number of code points available in Unicode).                 */
-      if ( p->cnt >= 1114112UL )
+      if ( p->cnt >= 0x110000UL )
       {
       {
-        error = BDF_Err_Invalid_Argument;
+        FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "CHARS" ));
+        error = FT_THROW( Invalid_Argument );
         goto Exit;
       }
 
         goto Exit;
       }
 
       goto Exit;
     }
 
       goto Exit;
     }
 
-    /* Check to see whether a glyph is being scanned but should be */
-    /* ignored because it is an unencoded glyph.                   */
+    /* Check whether a glyph is being scanned but should be */
+    /* ignored because it is an unencoded glyph.            */
     if ( ( p->flags & _BDF_GLYPH )     &&
          p->glyph_enc            == -1 &&
          p->opts->keep_unencoded == 0  )
     if ( ( p->flags & _BDF_GLYPH )     &&
          p->glyph_enc            == -1 &&
          p->opts->keep_unencoded == 0  )
 
       if ( !s )
       {
 
       if ( !s )
       {
-        error = BDF_Err_Invalid_File_Format;
+        FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG8, lineno, "STARTCHAR" ));
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
 
       p->flags |= _BDF_GLYPH;
 
 
       p->flags |= _BDF_GLYPH;
 
+      FT_TRACE4(( DBGMSG1, lineno, s ));
+
       goto Exit;
     }
 
       goto Exit;
     }
 
       {
         /* Missing STARTCHAR field. */
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "STARTCHAR" ));
       {
         /* Missing STARTCHAR field. */
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "STARTCHAR" ));
-        error = BDF_Err_Missing_Startchar_Field;
+        error = FT_THROW( Missing_Startchar_Field );
         goto Exit;
       }
 
         goto Exit;
       }
 
 
       p->glyph_enc = _bdf_atol( p->list.field[1], 0, 10 );
 
 
       p->glyph_enc = _bdf_atol( p->list.field[1], 0, 10 );
 
-      /* Check that the encoding is in the range [0,65536] because        */
-      /* otherwise p->have (a bitmap with static size) overflows.         */
-      if ( (size_t)p->glyph_enc >= sizeof ( p->have ) * 8 )
+      /* Normalize negative encoding values.  The specification only */
+      /* allows -1, but we can be more generous here.                */
+      if ( p->glyph_enc < -1 )
+        p->glyph_enc = -1;
+
+      /* Check for alternative encoding format. */
+      if ( p->glyph_enc == -1 && p->list.used > 2 )
+        p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );
+
+      if ( p->glyph_enc < -1 )
+        p->glyph_enc = -1;
+
+      FT_TRACE4(( DBGMSG2, p->glyph_enc ));
+
+      /* Check that the encoding is in the Unicode range because  */
+      /* otherwise p->have (a bitmap with static size) overflows. */
+      if ( p->glyph_enc > 0                                      &&
+           (size_t)p->glyph_enc >= sizeof ( p->have ) /
+                                   sizeof ( unsigned long ) * 32 )
       {
       {
-        error = BDF_Err_Invalid_File_Format;
+        FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "ENCODING" ));
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
-      /* Check to see whether this encoding has already been encountered. */
-      /* If it has then change it to unencoded so it gets added if        */
-      /* indicated.                                                       */
+      /* Check whether this encoding has already been encountered. */
+      /* If it has then change it to unencoded so it gets added if */
+      /* indicated.                                                */
       if ( p->glyph_enc >= 0 )
       {
         if ( _bdf_glyph_modified( p->have, p->glyph_enc ) )
       if ( p->glyph_enc >= 0 )
       {
         if ( _bdf_glyph_modified( p->have, p->glyph_enc ) )
       }
       else
       {
       }
       else
       {
-        /* Unencoded glyph.  Check to see whether it should */
-        /* be added or not.                                 */
+        /* Unencoded glyph.  Check whether it should */
+        /* be added or not.                          */
         if ( p->opts->keep_unencoded != 0 )
         {
           /* Allocate the next unencoded glyph. */
         if ( p->opts->keep_unencoded != 0 )
         {
           /* Allocate the next unencoded glyph. */
     else
       glyph = font->glyphs + ( font->glyphs_used - 1 );
 
     else
       glyph = font->glyphs + ( font->glyphs_used - 1 );
 
-    /* Check to see whether a bitmap is being constructed. */
+    /* Check whether a bitmap is being constructed. */
     if ( p->flags & _BDF_BITMAP )
     {
       /* If there are more rows than are specified in the glyph metrics, */
     if ( p->flags & _BDF_BITMAP )
     {
       /* If there are more rows than are specified in the glyph metrics, */
       for ( i = 0; i < nibbles; i++ )
       {
         c = line[i];
       for ( i = 0; i < nibbles; i++ )
       {
         c = line[i];
+        if ( !sbitset( hdigits, c ) )
+          break;
         *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] );
         if ( i + 1 < nibbles && ( i & 1 ) )
           *++bp = 0;
       }
 
         *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] );
         if ( i + 1 < nibbles && ( i & 1 ) )
           *++bp = 0;
       }
 
+      /* If any line has not enough columns,            */
+      /* indicate they have been padded with zero bits. */
+      if ( i < nibbles                            &&
+           !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) )
+      {
+        FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG16, glyph->encoding ));
+        p->flags       |= _BDF_GLYPH_WIDTH_CHECK;
+        font->modified  = 1;
+      }
+
       /* Remove possible garbage at the right. */
       mask_index = ( glyph->bbx.width * p->font->bpp ) & 7;
       if ( glyph->bbx.width )
         *bp &= nibble_mask[mask_index];
 
       /* If any line has extra columns, indicate they have been removed. */
       /* Remove possible garbage at the right. */
       mask_index = ( glyph->bbx.width * p->font->bpp ) & 7;
       if ( glyph->bbx.width )
         *bp &= nibble_mask[mask_index];
 
       /* If any line has extra columns, indicate they have been removed. */
-      if ( ( line[nibbles] == '0' || a2i[(int)line[nibbles]] != 0 ) &&
-           !( p->flags & _BDF_GLYPH_WIDTH_CHECK )                   )
+      if ( i == nibbles                           &&
+           sbitset( hdigits, line[nibbles] )      &&
+           !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) )
       {
         FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding ));
         p->flags       |= _BDF_GLYPH_WIDTH_CHECK;
       {
         FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding ));
         p->flags       |= _BDF_GLYPH_WIDTH_CHECK;
     if ( ft_memcmp( line, "SWIDTH", 6 ) == 0 )
     {
       if ( !( p->flags & _BDF_ENCODING ) )
     if ( ft_memcmp( line, "SWIDTH", 6 ) == 0 )
     {
       if ( !( p->flags & _BDF_ENCODING ) )
-      {
-        /* Missing ENCODING field. */
-        FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENCODING" ));
-        error = BDF_Err_Missing_Encoding_Field;
-        goto Exit;
-      }
+        goto Missing_Encoding;
 
       error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
 
       error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
     /* Expect the DWIDTH (scalable width) field next. */
     if ( ft_memcmp( line, "DWIDTH", 6 ) == 0 )
     {
     /* Expect the DWIDTH (scalable width) field next. */
     if ( ft_memcmp( line, "DWIDTH", 6 ) == 0 )
     {
+      if ( !( p->flags & _BDF_ENCODING ) )
+        goto Missing_Encoding;
+
       error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
       error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
     /* Expect the BBX field next. */
     if ( ft_memcmp( line, "BBX", 3 ) == 0 )
     {
     /* Expect the BBX field next. */
     if ( ft_memcmp( line, "BBX", 3 ) == 0 )
     {
+      if ( !( p->flags & _BDF_ENCODING ) )
+        goto Missing_Encoding;
+
       error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
       error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
       if ( error )
         goto Exit;
       {
         /* Missing BBX field. */
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "BBX" ));
       {
         /* Missing BBX field. */
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "BBX" ));
-        error = BDF_Err_Missing_Bbx_Field;
+        error = FT_THROW( Missing_Bbx_Field );
         goto Exit;
       }
 
       /* Allocate enough space for the bitmap. */
         goto Exit;
       }
 
       /* Allocate enough space for the bitmap. */
-      glyph->bpr   = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3;
+      glyph->bpr = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3;
 
       bitmap_size = glyph->bpr * glyph->bbx.height;
 
       bitmap_size = glyph->bpr * glyph->bbx.height;
-      if ( bitmap_size > 0xFFFFU )
+      if ( glyph->bpr > 0xFFFFU || bitmap_size > 0xFFFFU )
       {
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG4, lineno ));
       {
         FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG4, lineno ));
-        error = BDF_Err_Bbx_Too_Big;
+        error = FT_THROW( Bbx_Too_Big );
         goto Exit;
       }
       else
         goto Exit;
       }
       else
       goto Exit;
     }
 
       goto Exit;
     }
 
-    error = BDF_Err_Invalid_File_Format;
+    FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG9, lineno ));
+    error = FT_THROW( Invalid_File_Format );
+    goto Exit;
+
+  Missing_Encoding:
+    /* Missing ENCODING field. */
+    FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENCODING" ));
+    error = FT_THROW( Missing_Encoding_Field );
 
   Exit:
     if ( error && ( p->flags & _BDF_GLYPH ) )
 
   Exit:
     if ( error && ( p->flags & _BDF_GLYPH ) )
     char*              name;
     char*              value;
     char               nbuf[128];
     char*              name;
     char*              value;
     char               nbuf[128];
-    FT_Error           error = BDF_Err_Ok;
+    FT_Error           error = FT_Err_Ok;
 
     FT_UNUSED( lineno );
 
 
     FT_UNUSED( lineno );
 
       {
         p->font->font_ascent = p->font->bbx.ascent;
         ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
       {
         p->font->font_ascent = p->font->bbx.ascent;
         ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
-        error = _bdf_add_property( p->font, (char *)"FONT_ASCENT", nbuf );
+        error = _bdf_add_property( p->font, (char *)"FONT_ASCENT",
+                                   nbuf, lineno );
         if ( error )
           goto Exit;
 
         if ( error )
           goto Exit;
 
       {
         p->font->font_descent = p->font->bbx.descent;
         ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
       {
         p->font->font_descent = p->font->bbx.descent;
         ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
-        error = _bdf_add_property( p->font, (char *)"FONT_DESCENT", nbuf );
+        error = _bdf_add_property( p->font, (char *)"FONT_DESCENT",
+                                   nbuf, lineno );
         if ( error )
           goto Exit;
 
         if ( error )
           goto Exit;
 
       value += 7;
       if ( *value )
         *value++ = 0;
       value += 7;
       if ( *value )
         *value++ = 0;
-      error = _bdf_add_property( p->font, name, value );
+      error = _bdf_add_property( p->font, name, value, lineno );
       if ( error )
         goto Exit;
     }
     else if ( _bdf_is_atom( line, linelen, &name, &value, p->font ) )
     {
       if ( error )
         goto Exit;
     }
     else if ( _bdf_is_atom( line, linelen, &name, &value, p->font ) )
     {
-      error = _bdf_add_property( p->font, name, value );
+      error = _bdf_add_property( p->font, name, value, lineno );
       if ( error )
         goto Exit;
     }
       if ( error )
         goto Exit;
     }
       _bdf_list_shift( &p->list, 1 );
       value = _bdf_list_join( &p->list, ' ', &vlen );
 
       _bdf_list_shift( &p->list, 1 );
       value = _bdf_list_join( &p->list, ' ', &vlen );
 
-      error = _bdf_add_property( p->font, name, value );
+      error = _bdf_add_property( p->font, name, value, lineno );
       if ( error )
         goto Exit;
     }
       if ( error )
         goto Exit;
     }
     char               *s;
 
     FT_Memory          memory = NULL;
     char               *s;
 
     FT_Memory          memory = NULL;
-    FT_Error           error  = BDF_Err_Ok;
+    FT_Error           error  = FT_Err_Ok;
 
     FT_UNUSED( lineno );            /* only used in debug mode */
 
 
     FT_UNUSED( lineno );            /* only used in debug mode */
 
 
       if ( ft_memcmp( line, "STARTFONT", 9 ) != 0 )
       {
 
       if ( ft_memcmp( line, "STARTFONT", 9 ) != 0 )
       {
-        /* No STARTFONT field is a good indication of a problem. */
-        error = BDF_Err_Missing_Startfont_Field;
+        /* we don't emit an error message since this code gets */
+        /* explicitly caught one level higher                  */
+        error = FT_THROW( Missing_Startfont_Field );
         goto Exit;
       }
 
         goto Exit;
       }
 
       {
         /* Missing the FONTBOUNDINGBOX field. */
         FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
       {
         /* Missing the FONTBOUNDINGBOX field. */
         FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
-        error = BDF_Err_Missing_Fontboundingbox_Field;
+        error = FT_THROW( Missing_Fontboundingbox_Field );
         goto Exit;
       }
 
         goto Exit;
       }
 
       p->cnt = p->font->props_size = _bdf_atoul( p->list.field[1], 0, 10 );
 
       if ( FT_NEW_ARRAY( p->font->props, p->cnt ) )
       p->cnt = p->font->props_size = _bdf_atoul( p->list.field[1], 0, 10 );
 
       if ( FT_NEW_ARRAY( p->font->props, p->cnt ) )
+      {
+        p->font->props_size = 0;
         goto Exit;
         goto Exit;
+      }
 
       p->flags |= _BDF_PROPS;
       *next     = _bdf_parse_properties;
 
       p->flags |= _BDF_PROPS;
       *next     = _bdf_parse_properties;
       {
         /* Missing the SIZE field. */
         FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "SIZE" ));
       {
         /* Missing the SIZE field. */
         FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "SIZE" ));
-        error = BDF_Err_Missing_Size_Field;
+        error = FT_THROW( Missing_Size_Field );
         goto Exit;
       }
 
         goto Exit;
       }
 
 
       if ( !s )
       {
 
       if ( !s )
       {
-        error = BDF_Err_Invalid_File_Format;
+        FT_ERROR(( "_bdf_parse_start: " ERRMSG8, lineno, "FONT" ));
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
 
       /* If the font name is an XLFD name, set the spacing to the one in  */
       /* the font name.  If there is no spacing fall back on the default. */
 
       /* If the font name is an XLFD name, set the spacing to the one in  */
       /* the font name.  If there is no spacing fall back on the default. */
-      error = _bdf_set_default_spacing( p->font, p->opts );
+      error = _bdf_set_default_spacing( p->font, p->opts, lineno );
       if ( error )
         goto Exit;
 
       if ( error )
         goto Exit;
 
       {
         /* Missing the FONT field. */
         FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONT" ));
       {
         /* Missing the FONT field. */
         FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONT" ));
-        error = BDF_Err_Missing_Font_Field;
+        error = FT_THROW( Missing_Font_Field );
         goto Exit;
       }
 
         goto Exit;
       }
 
       {
         /* Missing the FONTBOUNDINGBOX field. */
         FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
       {
         /* Missing the FONTBOUNDINGBOX field. */
         FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
-        error = BDF_Err_Missing_Fontboundingbox_Field;
+        error = FT_THROW( Missing_Fontboundingbox_Field );
         goto Exit;
       }
 
         goto Exit;
       }
 
       /* for compiling fonts.                                   */
       p->font->font_ascent = p->font->bbx.ascent;
       ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
       /* for compiling fonts.                                   */
       p->font->font_ascent = p->font->bbx.ascent;
       ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
-      error = _bdf_add_property( p->font, (char *)"FONT_ASCENT", nbuf );
+      error = _bdf_add_property( p->font, (char *)"FONT_ASCENT",
+                                 nbuf, lineno );
       if ( error )
         goto Exit;
       FT_TRACE2(( "_bdf_parse_properties: " ACMSG1, p->font->bbx.ascent ));
 
       p->font->font_descent = p->font->bbx.descent;
       ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
       if ( error )
         goto Exit;
       FT_TRACE2(( "_bdf_parse_properties: " ACMSG1, p->font->bbx.ascent ));
 
       p->font->font_descent = p->font->bbx.descent;
       ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
-      error = _bdf_add_property( p->font, (char *)"FONT_DESCENT", nbuf );
+      error = _bdf_add_property( p->font, (char *)"FONT_DESCENT",
+                                 nbuf, lineno );
       if ( error )
         goto Exit;
       FT_TRACE2(( "_bdf_parse_properties: " ACMSG2, p->font->bbx.descent ));
       if ( error )
         goto Exit;
       FT_TRACE2(( "_bdf_parse_properties: " ACMSG2, p->font->bbx.descent ));
       goto Exit;
     }
 
       goto Exit;
     }
 
-    error = BDF_Err_Invalid_File_Format;
+    FT_ERROR(( "_bdf_parse_start: " ERRMSG9, lineno ));
+    error = FT_THROW( Invalid_File_Format );
 
   Exit:
     return error;
 
   Exit:
     return error;
     _bdf_parse_t   *p     = NULL;
 
     FT_Memory      memory = extmemory;
     _bdf_parse_t   *p     = NULL;
 
     FT_Memory      memory = extmemory;
-    FT_Error       error  = BDF_Err_Ok;
+    FT_Error       error  = FT_Err_Ok;
 
 
     if ( FT_NEW( p ) )
 
 
     if ( FT_NEW( p ) )
 
     if ( p->flags & _BDF_START )
     {
 
     if ( p->flags & _BDF_START )
     {
+      /* The ENDFONT field was never reached or did not exist. */
+      if ( !( p->flags & _BDF_GLYPHS ) )
       {
       {
-        /* The ENDFONT field was never reached or did not exist. */
-        if ( !( p->flags & _BDF_GLYPHS ) )
-        {
-          /* Error happened while parsing header. */
-          FT_ERROR(( "bdf_load_font: " ERRMSG2, lineno ));
-          error = BDF_Err_Corrupted_Font_Header;
-          goto Exit;
-        }
-        else
-        {
-          /* Error happened when parsing glyphs. */
-          FT_ERROR(( "bdf_load_font: " ERRMSG3, lineno ));
-          error = BDF_Err_Corrupted_Font_Glyphs;
-          goto Exit;
-        }
+        /* Error happened while parsing header. */
+        FT_ERROR(( "bdf_load_font: " ERRMSG2, lineno ));
+        error = FT_THROW( Corrupted_Font_Header );
+        goto Exit;
+      }
+      else
+      {
+        /* Error happened when parsing glyphs. */
+        FT_ERROR(( "bdf_load_font: " ERRMSG3, lineno ));
+        error = FT_THROW( Corrupted_Font_Glyphs );
+        goto Exit;
       }
     }
 
       }
     }
 
         p->font->comments[p->font->comments_len] = 0;
       }
     }
         p->font->comments[p->font->comments_len] = 0;
       }
     }
-    else if ( error == BDF_Err_Ok )
-      error = BDF_Err_Invalid_File_Format;
+    else if ( error == FT_Err_Ok )
+      error = FT_THROW( Invalid_File_Format );
 
     *font = p->font;
 
 
     *font = p->font;
 
@@ -1,6 +1,9 @@
-# FreeType 2 src/lzw Jamfile
+# FreeType 2 src/bzip2 Jamfile
 #
 #
-# Copyright 2004, 2006 by
+# Copyright 2010 by
+# Joel Klinghed
+#
+# Based on src/lzw/Jamfile, Copyright 2004, 2006 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -9,8 +12,8 @@
 # indicate that you have read the license and understand and accept it
 # fully.
 
 # indicate that you have read the license and understand and accept it
 # fully.
 
-SubDir  FT2_TOP $(FT2_SRC_DIR) lzw ;
+SubDir  FT2_TOP $(FT2_SRC_DIR) bzip2 ;
 
 
-Library  $(FT2_LIB) : ftlzw.c ;
+Library  $(FT2_LIB) : ftbzip2.c ;
 
 
-# end of src/lzw Jamfile
+# end of src/bzip2 Jamfile
diff --git a/reactos/lib/3rdparty/freetype/src/bzip2/ftbzip2.c b/reactos/lib/3rdparty/freetype/src/bzip2/ftbzip2.c
new file mode 100644 (file)
index 0000000..7494130
--- /dev/null
@@ -0,0 +1,511 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftbzip2.c                                                              */
+/*                                                                         */
+/*    FreeType support for .bz2 compressed files.                          */
+/*                                                                         */
+/*  This optional component relies on libbz2.  It should mainly be used to */
+/*  parse compressed PCF fonts, as found with many X11 server              */
+/*  distributions.                                                         */
+/*                                                                         */
+/*  Copyright 2010, 2012, 2013 by                                          */
+/*  Joel Klinghed.                                                         */
+/*                                                                         */
+/*  Based on src/gzip/ftgzip.c, Copyright 2002 - 2010 by                   */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_MEMORY_H
+#include FT_INTERNAL_STREAM_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_BZIP2_H
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
+
+#include FT_MODULE_ERRORS_H
+
+#undef __FTERRORS_H__
+
+#undef  FT_ERR_PREFIX
+#define FT_ERR_PREFIX  Bzip2_Err_
+#define FT_ERR_BASE    FT_Mod_Err_Bzip2
+
+#include FT_ERRORS_H
+
+
+#ifdef FT_CONFIG_OPTION_USE_BZIP2
+
+#ifdef FT_CONFIG_OPTION_PIC
+#error "bzip2 code does not support PIC yet"
+#endif
+
+#define BZ_NO_STDIO /* Do not need FILE */
+#include <bzlib.h>
+
+
+/***************************************************************************/
+/***************************************************************************/
+/*****                                                                 *****/
+/*****           B Z I P 2   M E M O R Y   M A N A G E M E N T         *****/
+/*****                                                                 *****/
+/***************************************************************************/
+/***************************************************************************/
+
+  /* it is better to use FreeType memory routines instead of raw
+     'malloc/free' */
+
+  typedef void *(* alloc_func)(void*, int, int);
+  typedef void (* free_func)(void*, void*);
+
+  static void*
+  ft_bzip2_alloc( FT_Memory  memory,
+                  int        items,
+                  int        size )
+  {
+    FT_ULong    sz = (FT_ULong)size * items;
+    FT_Error    error;
+    FT_Pointer  p  = NULL;
+
+
+    (void)FT_ALLOC( p, sz );
+    return p;
+  }
+
+
+  static void
+  ft_bzip2_free( FT_Memory  memory,
+                 void*      address )
+  {
+    FT_MEM_FREE( address );
+  }
+
+
+/***************************************************************************/
+/***************************************************************************/
+/*****                                                                 *****/
+/*****              B Z I P 2   F I L E   D E S C R I P T O R          *****/
+/*****                                                                 *****/
+/***************************************************************************/
+/***************************************************************************/
+
+#define FT_BZIP2_BUFFER_SIZE  4096
+
+  typedef struct  FT_BZip2FileRec_
+  {
+    FT_Stream  source;         /* parent/source stream        */
+    FT_Stream  stream;         /* embedding stream            */
+    FT_Memory  memory;         /* memory allocator            */
+    bz_stream  bzstream;       /* bzlib input stream          */
+
+    FT_Byte    input[FT_BZIP2_BUFFER_SIZE];  /* input read buffer  */
+
+    FT_Byte    buffer[FT_BZIP2_BUFFER_SIZE]; /* output buffer      */
+    FT_ULong   pos;                          /* position in output */
+    FT_Byte*   cursor;
+    FT_Byte*   limit;
+
+  } FT_BZip2FileRec, *FT_BZip2File;
+
+
+  /* check and skip .bz2 header - we don't support `transparent' compression */
+  static FT_Error
+  ft_bzip2_check_header( FT_Stream  stream )
+  {
+    FT_Error  error = FT_Err_Ok;
+    FT_Byte   head[4];
+
+
+    if ( FT_STREAM_SEEK( 0 )       ||
+         FT_STREAM_READ( head, 4 ) )
+      goto Exit;
+
+    /* head[0] && head[1] are the magic numbers;    */
+    /* head[2] is the version, and head[3] the blocksize */
+    if ( head[0] != 0x42  ||
+         head[1] != 0x5a  ||
+         head[2] != 0x68  )  /* only support bzip2 (huffman) */
+    {
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
+    }
+
+  Exit:
+    return error;
+  }
+
+
+  static FT_Error
+  ft_bzip2_file_init( FT_BZip2File  zip,
+                      FT_Stream     stream,
+                      FT_Stream     source )
+  {
+    bz_stream*  bzstream = &zip->bzstream;
+    FT_Error    error    = FT_Err_Ok;
+
+
+    zip->stream = stream;
+    zip->source = source;
+    zip->memory = stream->memory;
+
+    zip->limit  = zip->buffer + FT_BZIP2_BUFFER_SIZE;
+    zip->cursor = zip->limit;
+    zip->pos    = 0;
+
+    /* check .bz2 header */
+    {
+      stream = source;
+
+      error = ft_bzip2_check_header( stream );
+      if ( error )
+        goto Exit;
+
+      if ( FT_STREAM_SEEK( 0 ) )
+        goto Exit;
+    }
+
+    /* initialize bzlib */
+    bzstream->bzalloc = (alloc_func)ft_bzip2_alloc;
+    bzstream->bzfree  = (free_func) ft_bzip2_free;
+    bzstream->opaque  = zip->memory;
+
+    bzstream->avail_in = 0;
+    bzstream->next_in  = (char*)zip->buffer;
+
+    if ( BZ2_bzDecompressInit( bzstream, 0, 0 ) != BZ_OK ||
+         bzstream->next_in == NULL                       )
+      error = FT_THROW( Invalid_File_Format );
+
+  Exit:
+    return error;
+  }
+
+
+  static void
+  ft_bzip2_file_done( FT_BZip2File  zip )
+  {
+    bz_stream*  bzstream = &zip->bzstream;
+
+
+    BZ2_bzDecompressEnd( bzstream );
+
+    /* clear the rest */
+    bzstream->bzalloc   = NULL;
+    bzstream->bzfree    = NULL;
+    bzstream->opaque    = NULL;
+    bzstream->next_in   = NULL;
+    bzstream->next_out  = NULL;
+    bzstream->avail_in  = 0;
+    bzstream->avail_out = 0;
+
+    zip->memory = NULL;
+    zip->source = NULL;
+    zip->stream = NULL;
+  }
+
+
+  static FT_Error
+  ft_bzip2_file_reset( FT_BZip2File  zip )
+  {
+    FT_Stream  stream = zip->source;
+    FT_Error   error;
+
+
+    if ( !FT_STREAM_SEEK( 0 ) )
+    {
+      bz_stream*  bzstream = &zip->bzstream;
+
+
+      BZ2_bzDecompressEnd( bzstream );
+
+      bzstream->avail_in  = 0;
+      bzstream->next_in   = (char*)zip->input;
+      bzstream->avail_out = 0;
+      bzstream->next_out  = (char*)zip->buffer;
+
+      zip->limit  = zip->buffer + FT_BZIP2_BUFFER_SIZE;
+      zip->cursor = zip->limit;
+      zip->pos    = 0;
+
+      BZ2_bzDecompressInit( bzstream, 0, 0 );
+    }
+
+    return error;
+  }
+
+
+  static FT_Error
+  ft_bzip2_file_fill_input( FT_BZip2File  zip )
+  {
+    bz_stream*  bzstream = &zip->bzstream;
+    FT_Stream   stream    = zip->source;
+    FT_ULong    size;
+
+
+    if ( stream->read )
+    {
+      size = stream->read( stream, stream->pos, zip->input,
+                           FT_BZIP2_BUFFER_SIZE );
+      if ( size == 0 )
+        return FT_THROW( Invalid_Stream_Operation );
+    }
+    else
+    {
+      size = stream->size - stream->pos;
+      if ( size > FT_BZIP2_BUFFER_SIZE )
+        size = FT_BZIP2_BUFFER_SIZE;
+
+      if ( size == 0 )
+        return FT_THROW( Invalid_Stream_Operation );
+
+      FT_MEM_COPY( zip->input, stream->base + stream->pos, size );
+    }
+    stream->pos += size;
+
+    bzstream->next_in  = (char*)zip->input;
+    bzstream->avail_in = size;
+
+    return FT_Err_Ok;
+  }
+
+
+  static FT_Error
+  ft_bzip2_file_fill_output( FT_BZip2File  zip )
+  {
+    bz_stream*  bzstream = &zip->bzstream;
+    FT_Error    error    = FT_Err_Ok;
+
+
+    zip->cursor         = zip->buffer;
+    bzstream->next_out  = (char*)zip->cursor;
+    bzstream->avail_out = FT_BZIP2_BUFFER_SIZE;
+
+    while ( bzstream->avail_out > 0 )
+    {
+      int  err;
+
+
+      if ( bzstream->avail_in == 0 )
+      {
+        error = ft_bzip2_file_fill_input( zip );
+        if ( error )
+          break;
+      }
+
+      err = BZ2_bzDecompress( bzstream );
+
+      if ( err == BZ_STREAM_END )
+      {
+        zip->limit = (FT_Byte*)bzstream->next_out;
+        if ( zip->limit == zip->cursor )
+          error = FT_THROW( Invalid_Stream_Operation );
+        break;
+      }
+      else if ( err != BZ_OK )
+      {
+        error = FT_THROW( Invalid_Stream_Operation );
+        break;
+      }
+    }
+
+    return error;
+  }
+
+
+  /* fill output buffer; `count' must be <= FT_BZIP2_BUFFER_SIZE */
+  static FT_Error
+  ft_bzip2_file_skip_output( FT_BZip2File  zip,
+                             FT_ULong      count )
+  {
+    FT_Error  error = FT_Err_Ok;
+    FT_ULong  delta;
+
+
+    for (;;)
+    {
+      delta = (FT_ULong)( zip->limit - zip->cursor );
+      if ( delta >= count )
+        delta = count;
+
+      zip->cursor += delta;
+      zip->pos    += delta;
+
+      count -= delta;
+      if ( count == 0 )
+        break;
+
+      error = ft_bzip2_file_fill_output( zip );
+      if ( error )
+        break;
+    }
+
+    return error;
+  }
+
+
+  static FT_ULong
+  ft_bzip2_file_io( FT_BZip2File  zip,
+                    FT_ULong      pos,
+                    FT_Byte*      buffer,
+                    FT_ULong      count )
+  {
+    FT_ULong  result = 0;
+    FT_Error  error;
+
+
+    /* Reset inflate stream if we're seeking backwards.        */
+    /* Yes, that is not too efficient, but it saves memory :-) */
+    if ( pos < zip->pos )
+    {
+      error = ft_bzip2_file_reset( zip );
+      if ( error )
+        goto Exit;
+    }
+
+    /* skip unwanted bytes */
+    if ( pos > zip->pos )
+    {
+      error = ft_bzip2_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );
+      if ( error )
+        goto Exit;
+    }
+
+    if ( count == 0 )
+      goto Exit;
+
+    /* now read the data */
+    for (;;)
+    {
+      FT_ULong  delta;
+
+
+      delta = (FT_ULong)( zip->limit - zip->cursor );
+      if ( delta >= count )
+        delta = count;
+
+      FT_MEM_COPY( buffer, zip->cursor, delta );
+      buffer      += delta;
+      result      += delta;
+      zip->cursor += delta;
+      zip->pos    += delta;
+
+      count -= delta;
+      if ( count == 0 )
+        break;
+
+      error = ft_bzip2_file_fill_output( zip );
+      if ( error )
+        break;
+    }
+
+  Exit:
+    return result;
+  }
+
+
+/***************************************************************************/
+/***************************************************************************/
+/*****                                                                 *****/
+/*****               B Z   E M B E D D I N G   S T R E A M             *****/
+/*****                                                                 *****/
+/***************************************************************************/
+/***************************************************************************/
+
+  static void
+  ft_bzip2_stream_close( FT_Stream  stream )
+  {
+    FT_BZip2File  zip    = (FT_BZip2File)stream->descriptor.pointer;
+    FT_Memory     memory = stream->memory;
+
+
+    if ( zip )
+    {
+      /* finalize bzip file descriptor */
+      ft_bzip2_file_done( zip );
+
+      FT_FREE( zip );
+
+      stream->descriptor.pointer = NULL;
+    }
+  }
+
+
+  static FT_ULong
+  ft_bzip2_stream_io( FT_Stream  stream,
+                      FT_ULong   pos,
+                      FT_Byte*   buffer,
+                      FT_ULong   count )
+  {
+    FT_BZip2File  zip = (FT_BZip2File)stream->descriptor.pointer;
+
+
+    return ft_bzip2_file_io( zip, pos, buffer, count );
+  }
+
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Stream_OpenBzip2( FT_Stream  stream,
+                       FT_Stream  source )
+  {
+    FT_Error      error;
+    FT_Memory     memory = source->memory;
+    FT_BZip2File  zip = NULL;
+
+
+    /*
+     *  check the header right now; this prevents allocating unnecessary
+     *  objects when we don't need them
+     */
+    error = ft_bzip2_check_header( source );
+    if ( error )
+      goto Exit;
+
+    FT_ZERO( stream );
+    stream->memory = memory;
+
+    if ( !FT_QNEW( zip ) )
+    {
+      error = ft_bzip2_file_init( zip, stream, source );
+      if ( error )
+      {
+        FT_FREE( zip );
+        goto Exit;
+      }
+
+      stream->descriptor.pointer = zip;
+    }
+
+    stream->size  = 0x7FFFFFFFL;  /* don't know the real size! */
+    stream->pos   = 0;
+    stream->base  = 0;
+    stream->read  = ft_bzip2_stream_io;
+    stream->close = ft_bzip2_stream_close;
+
+  Exit:
+    return error;
+  }
+
+#else  /* !FT_CONFIG_OPTION_USE_BZIP2 */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Stream_OpenBzip2( FT_Stream  stream,
+                       FT_Stream  source )
+  {
+    FT_UNUSED( stream );
+    FT_UNUSED( source );
+
+    return FT_THROW( Unimplemented_Feature );
+  }
+
+#endif /* !FT_CONFIG_OPTION_USE_BZIP2 */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/bzip2/rules.mk b/reactos/lib/3rdparty/freetype/src/bzip2/rules.mk
new file mode 100644 (file)
index 0000000..0ff2628
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# FreeType 2 BZIP2 support configuration rules
+#
+
+# Copyright 2010 by
+# Joel Klinghed.
+#
+# Based on src/lzw/rules.mk, Copyright 2004-2006 by
+# Albert Chin-A-Young.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+
+# BZIP2 driver directory
+#
+BZIP2_DIR := $(SRC_DIR)/bzip2
+
+
+# compilation flags for the driver
+#
+BZIP2_COMPILE := $(FT_COMPILE)
+
+
+# BZIP2 support sources (i.e., C files)
+#
+BZIP2_DRV_SRC := $(BZIP2_DIR)/ftbzip2.c
+
+# BZIP2 driver object(s)
+#
+#   BZIP2_DRV_OBJ_M is used during `multi' builds
+#   BZIP2_DRV_OBJ_S is used during `single' builds
+#
+BZIP2_DRV_OBJ_M := $(OBJ_DIR)/ftbzip2.$O
+BZIP2_DRV_OBJ_S := $(OBJ_DIR)/ftbzip2.$O
+
+# BZIP2 support source file for single build
+#
+BZIP2_DRV_SRC_S := $(BZIP2_DIR)/ftbzip2.c
+
+
+# BZIP2 support - single object
+#
+$(BZIP2_DRV_OBJ_S): $(BZIP2_DRV_SRC_S) $(BZIP2_DRV_SRC) $(FREETYPE_H) $(BZIP2_DRV_H)
+       $(BZIP2_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BZIP2_DRV_SRC_S))
+
+
+# BZIP2 support - multiple objects
+#
+$(OBJ_DIR)/%.$O: $(BZIP2_DIR)/%.c $(FREETYPE_H) $(BZIP2_DRV_H)
+       $(BZIP2_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
+
+
+# update main driver object lists
+#
+DRV_OBJS_S += $(BZIP2_DRV_OBJ_S)
+DRV_OBJS_M += $(BZIP2_DRV_OBJ_M)
+
+
+# EOF
index 609ff78..84d336d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType basic cache interface (body).                           */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType basic cache interface (body).                           */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2009, 2010 by                  */
+/*  Copyright 2003-2007, 2009-2011, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -17,6 +17,7 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_CACHE_H
 #include "ftcglyph.h"
 #include FT_INTERNAL_DEBUG_H
 #include FT_CACHE_H
 #include "ftcglyph.h"
 #define FT_COMPONENT  trace_cache
 
 
 #define FT_COMPONENT  trace_cache
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  /*
-   *  These structures correspond to the FTC_Font and FTC_ImageDesc types
-   *  that were defined in version 2.1.7.
-   */
-  typedef struct  FTC_OldFontRec_
-  {
-    FTC_FaceID  face_id;
-    FT_UShort   pix_width;
-    FT_UShort   pix_height;
-
-  } FTC_OldFontRec, *FTC_OldFont;
-
-
-  typedef struct  FTC_OldImageDescRec_
-  {
-    FTC_OldFontRec  font;
-    FT_UInt32       flags;
-
-  } FTC_OldImageDescRec, *FTC_OldImageDesc;
-
-
-  /*
-   *  Notice that FTC_OldImageDescRec and FTC_ImageTypeRec are nearly
-   *  identical, bit-wise.  The only difference is that the `width' and
-   *  `height' fields are expressed as 16-bit integers in the old structure,
-   *  and as normal `int' in the new one.
-   *
-   *  We are going to perform a weird hack to detect which structure is
-   *  being passed to the image and sbit caches.  If the new structure's
-   *  `width' is larger than 0x10000, we assume that we are really receiving
-   *  an FTC_OldImageDesc.
-   */
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
   /*
    *  Basic Families
    *
   /*
    *  Basic Families
    *
           }
         }
         else
           }
         }
         else
-          error = FTC_Err_Invalid_Argument;
+          error = FT_THROW( Invalid_Argument );
       }
     }
 
       }
     }
 
   FT_CALLBACK_DEF( FT_Bool )
   ftc_basic_gnode_compare_faceid( FTC_Node    ftcgnode,
                                   FT_Pointer  ftcface_id,
   FT_CALLBACK_DEF( FT_Bool )
   ftc_basic_gnode_compare_faceid( FTC_Node    ftcgnode,
                                   FT_Pointer  ftcface_id,
-                                  FTC_Cache   cache )
+                                  FTC_Cache   cache,
+                                  FT_Bool*    list_changed )
   {
     FTC_GNode        gnode   = (FTC_GNode)ftcgnode;
     FTC_FaceID       face_id = (FTC_FaceID)ftcface_id;
   {
     FTC_GNode        gnode   = (FTC_GNode)ftcgnode;
     FTC_FaceID       face_id = (FTC_FaceID)ftcface_id;
     FT_Bool          result;
 
 
     FT_Bool          result;
 
 
+    if ( list_changed )
+      *list_changed = FALSE;
     result = FT_BOOL( family->attrs.scaler.face_id == face_id );
     if ( result )
     {
     result = FT_BOOL( family->attrs.scaler.face_id == face_id );
     if ( result )
     {
     /* some argument checks are delayed to FTC_Cache_Lookup */
     if ( !aglyph )
     {
     /* some argument checks are delayed to FTC_Cache_Lookup */
     if ( !aglyph )
     {
-      error = FTC_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
     if ( anode )
       *anode  = NULL;
 
     if ( anode )
       *anode  = NULL;
 
-#if defined( FT_CONFIG_OPTION_OLD_INTERNALS ) && ( FT_INT_MAX > 0xFFFFU )
-
-    /*
-     *  This one is a major hack used to detect whether we are passed a
-     *  regular FTC_ImageType handle, or a legacy FTC_OldImageDesc one.
-     */
-    if ( (FT_ULong)type->width >= 0x10000L )
-    {
-      FTC_OldImageDesc  desc = (FTC_OldImageDesc)type;
-
-
-      query.attrs.scaler.face_id = desc->font.face_id;
-      query.attrs.scaler.width   = desc->font.pix_width;
-      query.attrs.scaler.height  = desc->font.pix_height;
-      query.attrs.load_flags     = desc->flags;
-    }
-    else
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
     {
       if ( (FT_ULong)(type->flags - FT_INT_MIN) > FT_UINT_MAX )
       {
     {
       if ( (FT_ULong)(type->flags - FT_INT_MIN) > FT_UINT_MAX )
       {
     /* some argument checks are delayed to FTC_Cache_Lookup */
     if ( !aglyph || !scaler )
     {
     /* some argument checks are delayed to FTC_Cache_Lookup */
     if ( !aglyph || !scaler )
     {
-      error = FTC_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
   }
 
 
   }
 
 
-  
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  /* yet another backwards-legacy structure */
-  typedef struct  FTC_OldImage_Desc_
-  {
-    FTC_FontRec  font;
-    FT_UInt      image_type;
-
-  } FTC_OldImage_Desc;
-
-
-#define FTC_OLD_IMAGE_FORMAT( x )  ( (x) & 7 )
-
-
-#define ftc_old_image_format_bitmap    0x0000
-#define ftc_old_image_format_outline   0x0001
-
-#define ftc_old_image_format_mask      0x000F
-
-#define ftc_old_image_flag_monochrome  0x0010
-#define ftc_old_image_flag_unhinted    0x0020
-#define ftc_old_image_flag_autohinted  0x0040
-#define ftc_old_image_flag_unscaled    0x0080
-#define ftc_old_image_flag_no_sbits    0x0100
-
-  /* monochrome bitmap */
-#define ftc_old_image_mono             ftc_old_image_format_bitmap   | \
-                                       ftc_old_image_flag_monochrome
-
-  /* anti-aliased bitmap */
-#define ftc_old_image_grays            ftc_old_image_format_bitmap
-
-  /* scaled outline */
-#define ftc_old_image_outline          ftc_old_image_format_outline
-
-
-  static void
-  ftc_image_type_from_old_desc( FTC_ImageType       typ,
-                                FTC_OldImage_Desc*  desc )
-  {
-    typ->face_id = desc->font.face_id;
-    typ->width   = desc->font.pix_width;
-    typ->height  = desc->font.pix_height;
-
-    /* convert image type flags to load flags */
-    {
-      FT_UInt  load_flags = FT_LOAD_DEFAULT;
-      FT_UInt  type       = desc->image_type;
-
-
-      /* determine load flags, depending on the font description's */
-      /* image type                                                */
-
-      if ( FTC_OLD_IMAGE_FORMAT( type ) == ftc_old_image_format_bitmap )
-      {
-        if ( type & ftc_old_image_flag_monochrome )
-          load_flags |= FT_LOAD_MONOCHROME;
-
-        /* disable embedded bitmaps loading if necessary */
-        if ( type & ftc_old_image_flag_no_sbits )
-          load_flags |= FT_LOAD_NO_BITMAP;
-      }
-      else
-      {
-        /* we want an outline, don't load embedded bitmaps */
-        load_flags |= FT_LOAD_NO_BITMAP;
-
-        if ( type & ftc_old_image_flag_unscaled )
-          load_flags |= FT_LOAD_NO_SCALE;
-      }
-
-      /* always render glyphs to bitmaps */
-      load_flags |= FT_LOAD_RENDER;
-
-      if ( type & ftc_old_image_flag_unhinted )
-        load_flags |= FT_LOAD_NO_HINTING;
-
-      if ( type & ftc_old_image_flag_autohinted )
-        load_flags |= FT_LOAD_FORCE_AUTOHINT;
-
-      typ->flags = load_flags;
-    }
-  }
-
-
-  FT_EXPORT( FT_Error )
-  FTC_Image_Cache_New( FTC_Manager      manager,
-                       FTC_ImageCache  *acache );
-
-  FT_EXPORT( FT_Error )
-  FTC_Image_Cache_Lookup( FTC_ImageCache      icache,
-                          FTC_OldImage_Desc*  desc,
-                          FT_UInt             gindex,
-                          FT_Glyph           *aglyph );
-
-
-  FT_EXPORT_DEF( FT_Error )
-  FTC_Image_Cache_New( FTC_Manager      manager,
-                       FTC_ImageCache  *acache )
-  {
-    return FTC_ImageCache_New( manager, (FTC_ImageCache*)acache );
-  }
-
-
-
-  FT_EXPORT_DEF( FT_Error )
-  FTC_Image_Cache_Lookup( FTC_ImageCache      icache,
-                          FTC_OldImage_Desc*  desc,
-                          FT_UInt             gindex,
-                          FT_Glyph           *aglyph )
-  {
-    FTC_ImageTypeRec  type0;
-
-
-    if ( !desc )
-      return FTC_Err_Invalid_Argument;
-
-    ftc_image_type_from_old_desc( &type0, desc );
-
-    return FTC_ImageCache_Lookup( (FTC_ImageCache)icache,
-                                   &type0,
-                                   gindex,
-                                   aglyph,
-                                   NULL );
-  }
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
- /*
-  *
-  * basic small bitmap cache
-  *
-  */
-
+  /*
+   *
+   * basic small bitmap cache
+   *
+   */
 
   FT_CALLBACK_TABLE_DEF
   const FTC_SFamilyClassRec  ftc_basic_sbit_family_class =
   {
     {
 
   FT_CALLBACK_TABLE_DEF
   const FTC_SFamilyClassRec  ftc_basic_sbit_family_class =
   {
     {
-      sizeof( FTC_BasicFamilyRec ),
+      sizeof ( FTC_BasicFamilyRec ),
       ftc_basic_family_compare,
       ftc_basic_family_init,
       0,                            /* FTC_MruNode_ResetFunc */
       ftc_basic_family_compare,
       ftc_basic_family_init,
       0,                            /* FTC_MruNode_ResetFunc */
 
     /* other argument checks delayed to FTC_Cache_Lookup */
     if ( !ansbit )
 
     /* other argument checks delayed to FTC_Cache_Lookup */
     if ( !ansbit )
-      return FTC_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     *ansbit = NULL;
 
 
     *ansbit = NULL;
 
-#if defined( FT_CONFIG_OPTION_OLD_INTERNALS ) && ( FT_INT_MAX > 0xFFFFU )
-
-    /*  This one is a major hack used to detect whether we are passed a
-     *  regular FTC_ImageType handle, or a legacy FTC_OldImageDesc one.
-     */
-    if ( (FT_ULong)type->width >= 0x10000L )
-    {
-      FTC_OldImageDesc  desc = (FTC_OldImageDesc)type;
-
-
-      query.attrs.scaler.face_id = desc->font.face_id;
-      query.attrs.scaler.width   = desc->font.pix_width;
-      query.attrs.scaler.height  = desc->font.pix_height;
-      query.attrs.load_flags     = desc->flags;
-    }
-    else
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
     {
       if ( (FT_ULong)(type->flags - FT_INT_MIN) > FT_UINT_MAX )
       {
     {
       if ( (FT_ULong)(type->flags - FT_INT_MIN) > FT_UINT_MAX )
       {
 
     /* other argument checks delayed to FTC_Cache_Lookup */
     if ( !ansbit || !scaler )
 
     /* other argument checks delayed to FTC_Cache_Lookup */
     if ( !ansbit || !scaler )
-        return FTC_Err_Invalid_Argument;
+        return FT_THROW( Invalid_Argument );
 
     *ansbit = NULL;
 
 
     *ansbit = NULL;
 
   }
 
 
   }
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  FT_EXPORT( FT_Error )
-  FTC_SBit_Cache_New( FTC_Manager     manager,
-                      FTC_SBitCache  *acache );
-
-  FT_EXPORT( FT_Error )
-  FTC_SBit_Cache_Lookup( FTC_SBitCache       cache,
-                         FTC_OldImage_Desc*  desc,
-                         FT_UInt             gindex,
-                         FTC_SBit           *ansbit );
-
-
-  FT_EXPORT_DEF( FT_Error )
-  FTC_SBit_Cache_New( FTC_Manager     manager,
-                      FTC_SBitCache  *acache )
-  {
-    return FTC_SBitCache_New( manager, (FTC_SBitCache*)acache );
-  }
-
-
-  FT_EXPORT_DEF( FT_Error )
-  FTC_SBit_Cache_Lookup( FTC_SBitCache       cache,
-                         FTC_OldImage_Desc*  desc,
-                         FT_UInt             gindex,
-                         FTC_SBit           *ansbit )
-  {
-    FTC_ImageTypeRec  type0;
-
-
-    if ( !desc )
-      return FTC_Err_Invalid_Argument;
-
-    ftc_image_type_from_old_desc( &type0, desc );
-
-    return FTC_SBitCache_Lookup( (FTC_SBitCache)cache,
-                                  &type0,
-                                  gindex,
-                                  ansbit,
-                                  NULL );
-  }
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
 /* END */
 /* END */
index a5a915e..f20dd45 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType internal cache interface (body).                        */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType internal cache interface (body).                        */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
+/*  Copyright 2000-2007, 2009-2011, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -32,7 +32,7 @@
 #define FTC_HASH_MIN_LOAD  1
 #define FTC_HASH_SUB_LOAD  ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD )
 
 #define FTC_HASH_MIN_LOAD  1
 #define FTC_HASH_SUB_LOAD  ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD )
 
-/* this one _must_ be a power of 2! */
+  /* this one _must_ be a power of 2! */
 #define FTC_HASH_INITIAL_SIZE  8
 
 
 #define FTC_HASH_INITIAL_SIZE  8
 
 
                     (FTC_MruNode)node );
   }
 
                     (FTC_MruNode)node );
   }
 
+
+  /* get a top bucket for specified hash from cache,
+   * body for FTC_NODE__TOP_FOR_HASH( cache, hash )
+   */
+  FT_LOCAL_DEF( FTC_Node* )
+  ftc_get_top_node_for_hash( FTC_Cache   cache,
+                             FT_PtrDist  hash )
+  {
+    FTC_Node*  pnode;
+    FT_UInt    idx;
+
+
+    idx = (FT_UInt)( hash & cache->mask );
+    if ( idx < cache->p )
+      idx = (FT_UInt)( hash & ( 2 * cache->mask + 1 ) );
+    pnode = cache->buckets + idx;
+    return pnode;
+  }
+
 #endif /* !FTC_INLINE */
 
 
 #endif /* !FTC_INLINE */
 
 
     for (;;)
     {
       FTC_Node  node, *pnode;
     for (;;)
     {
       FTC_Node  node, *pnode;
-      FT_UFast  p      = cache->p;
-      FT_UFast  mask   = cache->mask;
-      FT_UFast  count  = mask + p + 1;    /* number of buckets */
+      FT_UFast  p     = cache->p;
+      FT_UFast  mask  = cache->mask;
+      FT_UFast  count = mask + p + 1;    /* number of buckets */
 
 
       /* do we need to shrink the buckets array? */
 
 
       /* do we need to shrink the buckets array? */
 
 
           /* if we can't expand the array, leave immediately */
 
 
           /* if we can't expand the array, leave immediately */
-          if ( FT_RENEW_ARRAY( cache->buckets, (mask+1)*2, (mask+1)*4 ) )
+          if ( FT_RENEW_ARRAY( cache->buckets,
+                               ( mask + 1 ) * 2, ( mask + 1 ) * 4 ) )
             break;
         }
 
             break;
         }
 
         cache->slack -= FTC_HASH_MAX_LOAD;
         cache->p      = p;
       }
         cache->slack -= FTC_HASH_MAX_LOAD;
         cache->p      = p;
       }
-      else /* the hash table is balanced */
+
+      /* otherwise, the hash table is balanced */
+      else
         break;
     }
   }
         break;
     }
   }
   ftc_node_hash_unlink( FTC_Node   node0,
                         FTC_Cache  cache )
   {
   ftc_node_hash_unlink( FTC_Node   node0,
                         FTC_Cache  cache )
   {
-    FTC_Node  *pnode;
-    FT_UInt    idx;
+    FTC_Node  *pnode = FTC_NODE__TOP_FOR_HASH( cache, node0->hash );
 
 
 
 
-    idx = (FT_UInt)( node0->hash & cache->mask );
-    if ( idx < cache->p )
-      idx = (FT_UInt)( node0->hash & ( 2 * cache->mask + 1 ) );
-
-    pnode = cache->buckets + idx;
-
     for (;;)
     {
       FTC_Node  node = *pnode;
     for (;;)
     {
       FTC_Node  node = *pnode;
   ftc_node_hash_link( FTC_Node   node,
                       FTC_Cache  cache )
   {
   ftc_node_hash_link( FTC_Node   node,
                       FTC_Cache  cache )
   {
-    FTC_Node  *pnode;
-    FT_UInt    idx;
-
+    FTC_Node  *pnode = FTC_NODE__TOP_FOR_HASH( cache, node->hash );
 
 
-    idx = (FT_UInt)( node->hash & cache->mask );
-    if ( idx < cache->p )
-      idx = (FT_UInt)( node->hash & (2 * cache->mask + 1 ) );
-
-    pnode = cache->buckets + idx;
 
     node->link = *pnode;
     *pnode     = node;
 
     node->link = *pnode;
     *pnode     = node;
 
 
   /* remove a node from the cache manager */
 
 
   /* remove a node from the cache manager */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-  FT_BASE_DEF( void )
-#else
   FT_LOCAL_DEF( void )
   FT_LOCAL_DEF( void )
-#endif
   ftc_node_destroy( FTC_Node     node,
                     FTC_Manager  manager )
   {
   ftc_node_destroy( FTC_Node     node,
                     FTC_Manager  manager )
   {
                  FT_PtrDist hash,
                  FTC_Node   node )
   {
                  FT_PtrDist hash,
                  FTC_Node   node )
   {
-    node->hash = hash;
-    node->cache_index = (FT_UInt16) cache->index;
+    node->hash        = hash;
+    node->cache_index = (FT_UInt16)cache->index;
     node->ref_count   = 0;
 
     ftc_node_hash_link( node, cache );
     node->ref_count   = 0;
 
     ftc_node_hash_link( node, cache );
     {
       error = cache->clazz.node_new( &node, query, cache );
     }
     {
       error = cache->clazz.node_new( &node, query, cache );
     }
-    FTC_CACHE_TRYLOOP_END();
+    FTC_CACHE_TRYLOOP_END( NULL );
 
     if ( error )
       node = NULL;
 
     if ( error )
       node = NULL;
                     FT_Pointer  query,
                     FTC_Node   *anode )
   {
                     FT_Pointer  query,
                     FTC_Node   *anode )
   {
-    FT_UFast   idx;
     FTC_Node*  bucket;
     FTC_Node*  pnode;
     FTC_Node   node;
     FTC_Node*  bucket;
     FTC_Node*  pnode;
     FTC_Node   node;
-    FT_Error   error = FTC_Err_Ok;
+    FT_Error   error        = FT_Err_Ok;
+    FT_Bool    list_changed = FALSE;
 
     FTC_Node_CompareFunc  compare = cache->clazz.node_compare;
 
 
     if ( cache == NULL || anode == NULL )
 
     FTC_Node_CompareFunc  compare = cache->clazz.node_compare;
 
 
     if ( cache == NULL || anode == NULL )
-      return FTC_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
 
-    idx = hash & cache->mask;
-    if ( idx < cache->p )
-      idx = hash & ( cache->mask * 2 + 1 );
+    /* Go to the `top' node of the list sharing same masked hash */
+    bucket = pnode = FTC_NODE__TOP_FOR_HASH( cache, hash );
 
 
-    bucket = cache->buckets + idx;
-    pnode  = bucket;
+    /* Lookup a node with exactly same hash and queried properties.  */
+    /* NOTE: _nodcomp() may change the linked list to reduce memory. */
     for (;;)
     {
       node = *pnode;
       if ( node == NULL )
         goto NewNode;
 
     for (;;)
     {
       node = *pnode;
       if ( node == NULL )
         goto NewNode;
 
-      if ( node->hash == hash && compare( node, query, cache ) )
+      if ( node->hash == hash                           &&
+           compare( node, query, cache, &list_changed ) )
         break;
 
       pnode = &node->link;
     }
 
         break;
 
       pnode = &node->link;
     }
 
+    if ( list_changed )
+    {
+      /* Update bucket by modified linked list */
+      bucket = pnode = FTC_NODE__TOP_FOR_HASH( cache, hash );
+
+      /* Update pnode by modified linked list */
+      while ( *pnode != node )
+      {
+        if ( *pnode == NULL )
+        {
+          FT_ERROR(( "FTC_Cache_Lookup: oops!!!  node missing\n" ));
+          goto NewNode;
+        }
+        else
+          pnode = &((*pnode)->link);
+      }
+    }
+
+    /* Reorder the list to move the found node to the `top' */
     if ( node != *bucket )
     {
       *pnode     = node->link;
     if ( node != *bucket )
     {
       *pnode     = node->link;
         ftc_node_mru_up( node, manager );
     }
     *anode = node;
         ftc_node_mru_up( node, manager );
     }
     *anode = node;
+
     return error;
 
   NewNode:
     return error;
 
   NewNode:
     FTC_Node     frees   = NULL;
 
 
     FTC_Node     frees   = NULL;
 
 
-    count = cache->p + cache->mask;
+    count = cache->p + cache->mask + 1;
     for ( i = 0; i < count; i++ )
     {
       FTC_Node*  bucket = cache->buckets + i;
     for ( i = 0; i < count; i++ )
     {
       FTC_Node*  bucket = cache->buckets + i;
       for ( ;; )
       {
         FTC_Node  node = *pnode;
       for ( ;; )
       {
         FTC_Node  node = *pnode;
+        FT_Bool   list_changed = FALSE;
 
 
         if ( node == NULL )
           break;
 
 
 
         if ( node == NULL )
           break;
 
-        if ( cache->clazz.node_remove_faceid( node, face_id, cache ) )
+        if ( cache->clazz.node_remove_faceid( node, face_id,
+                                              cache, &list_changed ) )
         {
           *pnode     = node->link;
           node->link = frees;
         {
           *pnode     = node->link;
           node->link = frees;
index 10830a9..4155f32 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType internal cache interface (specification).                   */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType internal cache interface (specification).                   */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
+/*  Copyright 2000-2007, 2009-2011, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -24,7 +24,7 @@
 
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
 
-#define _FTC_FACE_ID_HASH( i )                              \
+#define _FTC_FACE_ID_HASH( i )                                                \
           ((FT_PtrDist)(( (FT_PtrDist)(i) >> 3 ) ^ ( (FT_PtrDist)(i) << 7 )))
 
   /* handle to cache object */
           ((FT_PtrDist)(( (FT_PtrDist)(i) >> 3 ) ^ ( (FT_PtrDist)(i) << 7 )))
 
   /* handle to cache object */
@@ -72,11 +72,18 @@ FT_BEGIN_HEADER
 #define FTC_NODE__NEXT( x )  FTC_NODE( (x)->mru.next )
 #define FTC_NODE__PREV( x )  FTC_NODE( (x)->mru.prev )
 
 #define FTC_NODE__NEXT( x )  FTC_NODE( (x)->mru.next )
 #define FTC_NODE__PREV( x )  FTC_NODE( (x)->mru.prev )
 
-
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-  FT_BASE( void )
-  ftc_node_destroy( FTC_Node     node,
-                    FTC_Manager  manager );
+#ifdef FTC_INLINE
+#define FTC_NODE__TOP_FOR_HASH( cache, hash )                     \
+        ( ( cache )->buckets +                                    \
+            ( ( ( ( hash ) &   ( cache )->mask ) < ( cache )->p ) \
+              ? ( ( hash ) & ( ( cache )->mask * 2 + 1 ) )        \
+              : ( ( hash ) &   ( cache )->mask ) ) )
+#else
+  FT_LOCAL( FTC_Node* )
+  ftc_get_top_node_for_hash( FTC_Cache   cache,
+                             FT_PtrDist  hash );
+#define FTC_NODE__TOP_FOR_HASH( cache, hash )            \
+        ftc_get_top_node_for_hash( ( cache ), ( hash ) )
 #endif
 
 
 #endif
 
 
@@ -102,7 +109,8 @@ FT_BEGIN_HEADER
   typedef FT_Bool
   (*FTC_Node_CompareFunc)( FTC_Node    node,
                            FT_Pointer  key,
   typedef FT_Bool
   (*FTC_Node_CompareFunc)( FTC_Node    node,
                            FT_Pointer  key,
-                           FTC_Cache   cache );
+                           FTC_Cache   cache,
+                           FT_Bool*    list_changed );
 
 
   typedef void
 
 
   typedef void
@@ -162,7 +170,7 @@ FT_BEGIN_HEADER
   FT_LOCAL( void )
   FTC_Cache_Done( FTC_Cache  cache );
 
   FT_LOCAL( void )
   FTC_Cache_Done( FTC_Cache  cache );
 
-  /* Call this function to lookup the cache.  If no corresponding
+  /* Call this function to look up the cache.  If no corresponding
    * node is found, a new one is automatically created.  This function
    * is capable of flushing the cache adequately to make room for the
    * new cache object.
    * node is found, a new one is automatically created.  This function
    * is capable of flushing the cache adequately to make room for the
    * new cache object.
@@ -184,7 +192,7 @@ FT_BEGIN_HEADER
 
   /* Remove all nodes that relate to a given face_id.  This is useful
    * when un-installing fonts.  Note that if a cache node relates to
 
   /* Remove all nodes that relate to a given face_id.  This is useful
    * when un-installing fonts.  Note that if a cache node relates to
-   * the face_id, but is locked (i.e., has `ref_count > 0'), the node
+   * the face_id but is locked (i.e., has `ref_count > 0'), the node
    * will _not_ be destroyed, but its internal face_id reference will
    * be modified.
    *
    * will _not_ be destroyed, but its internal face_id reference will
    * be modified.
    *
@@ -205,28 +213,49 @@ FT_BEGIN_HEADER
     FTC_Cache             _cache   = FTC_CACHE(cache);                   \
     FT_PtrDist            _hash    = (FT_PtrDist)(hash);                 \
     FTC_Node_CompareFunc  _nodcomp = (FTC_Node_CompareFunc)(nodecmp);    \
     FTC_Cache             _cache   = FTC_CACHE(cache);                   \
     FT_PtrDist            _hash    = (FT_PtrDist)(hash);                 \
     FTC_Node_CompareFunc  _nodcomp = (FTC_Node_CompareFunc)(nodecmp);    \
-    FT_UFast              _idx;                                          \
+    FT_Bool               _list_changed = FALSE;                         \
                                                                          \
                                                                          \
                                                                          \
                                                                          \
-    error = FTC_Err_Ok;                                                  \
+    error = FT_Err_Ok;                                                   \
     node  = NULL;                                                        \
     node  = NULL;                                                        \
-    _idx  = _hash & _cache->mask;                                        \
-    if ( _idx < _cache->p )                                              \
-      _idx = _hash & ( _cache->mask*2 + 1 );                             \
                                                                          \
                                                                          \
-    _bucket = _pnode = _cache->buckets + _idx;                           \
+    /* Go to the `top' node of the list sharing same masked hash */      \
+    _bucket = _pnode = FTC_NODE__TOP_FOR_HASH( _cache, _hash );          \
+                                                                         \
+    /* Look up a node with identical hash and queried properties.    */  \
+    /* NOTE: _nodcomp() may change the linked list to reduce memory. */  \
     for (;;)                                                             \
     {                                                                    \
       _node = *_pnode;                                                   \
       if ( _node == NULL )                                               \
         goto _NewNode;                                                   \
                                                                          \
     for (;;)                                                             \
     {                                                                    \
       _node = *_pnode;                                                   \
       if ( _node == NULL )                                               \
         goto _NewNode;                                                   \
                                                                          \
-      if ( _node->hash == _hash && _nodcomp( _node, query, _cache ) )    \
+      if ( _node->hash == _hash                             &&           \
+           _nodcomp( _node, query, _cache, &_list_changed ) )            \
         break;                                                           \
                                                                          \
       _pnode = &_node->link;                                             \
     }                                                                    \
                                                                          \
         break;                                                           \
                                                                          \
       _pnode = &_node->link;                                             \
     }                                                                    \
                                                                          \
+    if ( _list_changed )                                                 \
+    {                                                                    \
+      /* Update _bucket by possibly modified linked list */              \
+      _bucket = _pnode = FTC_NODE__TOP_FOR_HASH( _cache, _hash );        \
+                                                                         \
+      /* Update _pnode by possibly modified linked list */               \
+      while ( *_pnode != _node )                                         \
+      {                                                                  \
+        if ( *_pnode == NULL )                                           \
+        {                                                                \
+          FT_ERROR(( "FTC_CACHE_LOOKUP_CMP: oops!!! node missing\n" ));  \
+          goto _NewNode;                                                 \
+        }                                                                \
+        else                                                             \
+          _pnode = &((*_pnode)->link);                                   \
+      }                                                                  \
+    }                                                                    \
+                                                                         \
+    /* Reorder the list to move the found node to the `top' */           \
     if ( _node != *_bucket )                                             \
     {                                                                    \
       *_pnode     = _node->link;                                         \
     if ( _node != *_bucket )                                             \
     {                                                                    \
       *_pnode     = _node->link;                                         \
@@ -234,6 +263,7 @@ FT_BEGIN_HEADER
       *_bucket    = _node;                                               \
     }                                                                    \
                                                                          \
       *_bucket    = _node;                                               \
     }                                                                    \
                                                                          \
+    /* Update MRU list */                                                \
     {                                                                    \
       FTC_Manager  _manager = _cache->manager;                           \
       void*        _nl      = &_manager->nodes_list;                     \
     {                                                                    \
       FTC_Manager  _manager = _cache->manager;                           \
       void*        _nl      = &_manager->nodes_list;                     \
@@ -268,7 +298,7 @@ FT_BEGIN_HEADER
    * loop to flush the cache repeatedly in case of memory overflows.
    *
    * It is used when creating a new cache node, or within a lookup
    * loop to flush the cache repeatedly in case of memory overflows.
    *
    * It is used when creating a new cache node, or within a lookup
-   * that needs to allocate data (e.g., the sbit cache lookup).
+   * that needs to allocate data (e.g. the sbit cache lookup).
    *
    * Example:
    *
    *
    * Example:
    *
@@ -290,11 +320,14 @@ FT_BEGIN_HEADER
       FT_UInt  _try_done;
 
 
       FT_UInt  _try_done;
 
 
-#define FTC_CACHE_TRYLOOP_END()                                   \
-      if ( !error || error != FTC_Err_Out_Of_Memory )             \
+#define FTC_CACHE_TRYLOOP_END( list_changed )                     \
+      if ( !error || FT_ERR_NEQ( error, Out_Of_Memory ) )         \
         break;                                                    \
                                                                   \
       _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \
         break;                                                    \
                                                                   \
       _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \
+      if ( _try_done > 0 && ( list_changed ) )                    \
+        *(FT_Bool*)( list_changed ) = TRUE;                       \
+                                                                  \
       if ( _try_done == 0 )                                       \
         break;                                                    \
                                                                   \
       if ( _try_done == 0 )                                       \
         break;                                                    \
                                                                   \
index 4d0818d..9528279 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Callback functions of the caching sub-system (specification only).   */
 /*                                                                         */
 /*                                                                         */
 /*    Callback functions of the caching sub-system (specification only).   */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006 by                                          */
+/*  Copyright 2004-2006, 2011, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   FT_LOCAL( FT_Bool )
   ftc_snode_compare( FTC_Node    snode,
                      FT_Pointer  gquery,
   FT_LOCAL( FT_Bool )
   ftc_snode_compare( FTC_Node    snode,
                      FT_Pointer  gquery,
-                     FTC_Cache   cache );
+                     FTC_Cache   cache,
+                     FT_Bool*    list_changed );
 
 
   FT_LOCAL( FT_Bool )
   ftc_gnode_compare( FTC_Node    gnode,
                      FT_Pointer  gquery,
 
 
   FT_LOCAL( FT_Bool )
   ftc_gnode_compare( FTC_Node    gnode,
                      FT_Pointer  gquery,
-                     FTC_Cache   cache );
+                     FTC_Cache   cache,
+                     FT_Bool*    list_changed );
 
 
   FT_LOCAL( FT_Error )
 
 
   FT_LOCAL( FT_Error )
   FT_LOCAL( void )
   ftc_cache_done( FTC_Cache  cache );
 
   FT_LOCAL( void )
   ftc_cache_done( FTC_Cache  cache );
 
-#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
   FT_LOCAL( void )
   ftc_node_destroy( FTC_Node     node,
                     FTC_Manager  manager );
   FT_LOCAL( void )
   ftc_node_destroy( FTC_Node     node,
                     FTC_Manager  manager );
-#endif
+
 
 #endif /* __FTCCBACK_H__ */
 
 
 #endif /* __FTCCBACK_H__ */
 
index 15060ba..848349b 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    FreeType CharMap cache (body)                                        */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType CharMap cache (body)                                        */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 2000-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -22,6 +21,7 @@
 #include FT_CACHE_H
 #include "ftcmanag.h"
 #include FT_INTERNAL_MEMORY_H
 #include FT_CACHE_H
 #include "ftcmanag.h"
 #include FT_INTERNAL_MEMORY_H
+#include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
 
 #include "ftccback.h"
 #include FT_INTERNAL_DEBUG_H
 
 #include "ftccback.h"
 #define FT_COMPONENT  trace_cache
 
 
 #define FT_COMPONENT  trace_cache
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  typedef enum  FTC_OldCMapType_
-  {
-    FTC_OLD_CMAP_BY_INDEX    = 0,
-    FTC_OLD_CMAP_BY_ENCODING = 1,
-    FTC_OLD_CMAP_BY_ID       = 2
-
-  } FTC_OldCMapType;
-
-
-  typedef struct  FTC_OldCMapIdRec_
-  {
-    FT_UInt  platform;
-    FT_UInt  encoding;
-
-  } FTC_OldCMapIdRec, *FTC_OldCMapId;
-
-
-  typedef struct  FTC_OldCMapDescRec_
-  {
-    FTC_FaceID       face_id;
-    FTC_OldCMapType  type;
-
-    union
-    {
-      FT_UInt           index;
-      FT_Encoding       encoding;
-      FTC_OldCMapIdRec  id;
-
-    } u;
-
-  } FTC_OldCMapDescRec, *FTC_OldCMapDesc;
-
-#endif /* FT_CONFIG_OLD_INTERNALS */
-
-
   /*************************************************************************/
   /*                                                                       */
   /* Each FTC_CMapNode contains a simple array to map a range of character */
   /*************************************************************************/
   /*                                                                       */
   /* Each FTC_CMapNode contains a simple array to map a range of character */
 
   /* if (indices[n] == FTC_CMAP_UNKNOWN), we assume that the corresponding */
   /* glyph indices haven't been queried through FT_Get_Glyph_Index() yet   */
 
   /* if (indices[n] == FTC_CMAP_UNKNOWN), we assume that the corresponding */
   /* glyph indices haven't been queried through FT_Get_Glyph_Index() yet   */
-#define FTC_CMAP_UNKNOWN  ( (FT_UInt16)-1 )
+#define FTC_CMAP_UNKNOWN  (FT_UInt16)~0
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
   FT_CALLBACK_DEF( FT_Bool )
   ftc_cmap_node_compare( FTC_Node    ftcnode,
                          FT_Pointer  ftcquery,
   FT_CALLBACK_DEF( FT_Bool )
   ftc_cmap_node_compare( FTC_Node    ftcnode,
                          FT_Pointer  ftcquery,
-                         FTC_Cache   cache )
+                         FTC_Cache   cache,
+                         FT_Bool*    list_changed )
   {
     FTC_CMapNode   node  = (FTC_CMapNode)ftcnode;
     FTC_CMapQuery  query = (FTC_CMapQuery)ftcquery;
     FT_UNUSED( cache );
 
 
   {
     FTC_CMapNode   node  = (FTC_CMapNode)ftcnode;
     FTC_CMapQuery  query = (FTC_CMapQuery)ftcquery;
     FT_UNUSED( cache );
 
 
+    if ( list_changed )
+      *list_changed = FALSE;
     if ( node->face_id    == query->face_id    &&
          node->cmap_index == query->cmap_index )
     {
     if ( node->face_id    == query->face_id    &&
          node->cmap_index == query->cmap_index )
     {
   FT_CALLBACK_DEF( FT_Bool )
   ftc_cmap_node_remove_faceid( FTC_Node    ftcnode,
                                FT_Pointer  ftcface_id,
   FT_CALLBACK_DEF( FT_Bool )
   ftc_cmap_node_remove_faceid( FTC_Node    ftcnode,
                                FT_Pointer  ftcface_id,
-                               FTC_Cache   cache )
+                               FTC_Cache   cache,
+                               FT_Bool*    list_changed )
   {
     FTC_CMapNode  node    = (FTC_CMapNode)ftcnode;
     FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;
     FT_UNUSED( cache );
 
   {
     FTC_CMapNode  node    = (FTC_CMapNode)ftcnode;
     FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;
     FT_UNUSED( cache );
 
+
+    if ( list_changed )
+      *list_changed = FALSE;
     return FT_BOOL( node->face_id == face_id );
   }
 
     return FT_BOOL( node->face_id == face_id );
   }
 
   }
 
 
   }
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  /*
-   *  Unfortunately, it is not possible to support binary backwards
-   *  compatibility in the cmap cache.  The FTC_CMapCache_Lookup signature
-   *  changes were too deep, and there is no clever hackish way to detect
-   *  what kind of structure we are being passed.
-   *
-   *  On the other hand it seems that no production code is using this
-   *  function on Unix distributions.
-   */
-
-#endif
-
-
   /* documentation is in ftcache.h */
 
   FT_EXPORT_DEF( FT_UInt )
   /* documentation is in ftcache.h */
 
   FT_EXPORT_DEF( FT_UInt )
       return 0;
     }
 
       return 0;
     }
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-    /*
-     * If cmap_index is greater than the maximum number of cachable
-     * charmaps, we assume the request is from a legacy rogue client 
-     * using old internal header. See include/config/ftoption.h.
-     */
-    if ( cmap_index > FT_MAX_CHARMAP_CACHEABLE && !no_cmap_change )
-    {
-      FTC_OldCMapDesc  desc = (FTC_OldCMapDesc) face_id;
-
-
-      char_code     = (FT_UInt32)cmap_index;
-      query.face_id = desc->face_id;
-
-
-      switch ( desc->type )
-      {
-      case FTC_OLD_CMAP_BY_INDEX:
-        query.cmap_index = desc->u.index;
-        query.char_code  = (FT_UInt32)cmap_index;
-        break;
-
-      case FTC_OLD_CMAP_BY_ENCODING:
-        {
-          FT_Face  face;
-
-
-          error = FTC_Manager_LookupFace( cache->manager, desc->face_id,
-                                          &face );
-          if ( error )
-            return 0;
-
-          FT_Select_Charmap( face, desc->u.encoding );
-
-          return FT_Get_Char_Index( face, char_code );
-        }
-
-      default:
-        return 0;
-      }
-    }
-    else
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-    {
-      query.face_id    = face_id;
-      query.cmap_index = (FT_UInt)cmap_index;
-      query.char_code  = char_code;
-    }
+    query.face_id    = face_id;
+    query.cmap_index = (FT_UInt)cmap_index;
+    query.char_code  = char_code;
 
     hash = FTC_CMAP_HASH( face_id, cmap_index, char_code );
 
 
     hash = FTC_CMAP_HASH( face_id, cmap_index, char_code );
 
index 5998d42..0e05570 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Caching sub-system error codes (specification only).                 */
 /*                                                                         */
 /*                                                                         */
 /*    Caching sub-system error codes (specification only).                 */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,6 +30,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  FTC_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Cache
 
 #define FT_ERR_PREFIX  FTC_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Cache
 
index a73e243..441e177 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Glyph Image (FT_Glyph) cache (body).                        */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType Glyph Image (FT_Glyph) cache (body).                        */
 /*                                                                         */
-/*  Copyright 2000-2001, 2003, 2004, 2006, 2009 by                         */
+/*  Copyright 2000-2001, 2003, 2004, 2006, 2009, 2011 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -17,6 +17,7 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_OBJECTS_H
 #include FT_CACHE_H
 #include "ftcglyph.h"
 #include FT_ERRORS_H
 #include FT_CACHE_H
 #include "ftcglyph.h"
 #include FT_ERRORS_H
   FT_LOCAL_DEF( FT_Bool )
   ftc_gnode_compare( FTC_Node    ftcgnode,
                      FT_Pointer  ftcgquery,
   FT_LOCAL_DEF( FT_Bool )
   ftc_gnode_compare( FTC_Node    ftcgnode,
                      FT_Pointer  ftcgquery,
-                     FTC_Cache   cache )
+                     FTC_Cache   cache,
+                     FT_Bool*    list_changed )
   {
     FTC_GNode   gnode  = (FTC_GNode)ftcgnode;
     FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;
     FT_UNUSED( cache );
 
 
   {
     FTC_GNode   gnode  = (FTC_GNode)ftcgnode;
     FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;
     FT_UNUSED( cache );
 
 
+    if ( list_changed )
+      *list_changed = FALSE;
     return FT_BOOL( gnode->family == gquery->family &&
                     gnode->gindex == gquery->gindex );
   }
 
 
     return FT_BOOL( gnode->family == gquery->family &&
                     gnode->gindex == gquery->gindex );
   }
 
 
+#ifdef FTC_INLINE
+
   FT_LOCAL_DEF( FT_Bool )
   FTC_GNode_Compare( FTC_GNode   gnode,
   FT_LOCAL_DEF( FT_Bool )
   FTC_GNode_Compare( FTC_GNode   gnode,
-                     FTC_GQuery  gquery )
+                     FTC_GQuery  gquery,
+                     FTC_Cache   cache,
+                     FT_Bool*    list_changed )
   {
   {
-    return ftc_gnode_compare( FTC_NODE( gnode ), gquery, NULL );
+    return ftc_gnode_compare( FTC_NODE( gnode ), gquery,
+                              cache, list_changed );
   }
 
   }
 
+#endif
 
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
index 2bc5624..5fed19c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType abstract glyph cache (specification).                       */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType abstract glyph cache (specification).                       */
 /*                                                                         */
-/*  Copyright 2000-2001, 2003, 2004, 2006, 2007 by                         */
+/*  Copyright 2000-2001, 2003, 2004, 2006, 2007, 2011 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -180,12 +180,18 @@ FT_BEGIN_HEADER
                   FT_UInt     gindex,  /* glyph index for node */
                   FTC_Family  family );
 
                   FT_UInt     gindex,  /* glyph index for node */
                   FTC_Family  family );
 
+#ifdef FTC_INLINE
+
   /* returns TRUE iff the query's glyph index correspond to the node;  */
   /* this assumes that the `family' and `hash' fields of the query are */
   /* already correctly set                                             */
   FT_LOCAL( FT_Bool )
   FTC_GNode_Compare( FTC_GNode   gnode,
   /* returns TRUE iff the query's glyph index correspond to the node;  */
   /* this assumes that the `family' and `hash' fields of the query are */
   /* already correctly set                                             */
   FT_LOCAL( FT_Bool )
   FTC_GNode_Compare( FTC_GNode   gnode,
-                     FTC_GQuery  gquery );
+                     FTC_GQuery  gquery,
+                     FTC_Cache   cache,
+                     FT_Bool*    list_changed );
+
+#endif
 
   /* call this function to clear a node's family -- this is necessary */
   /* to implement the `node_remove_faceid' cache method correctly     */
 
   /* call this function to clear a node's family -- this is necessary */
   /* to implement the `node_remove_faceid' cache method correctly     */
@@ -307,7 +313,7 @@ FT_BEGIN_HEADER
    FT_BEGIN_STMNT                                                     \
                                                                       \
      error = FTC_GCache_Lookup( FTC_GCACHE( cache ), hash, gindex,    \
    FT_BEGIN_STMNT                                                     \
                                                                       \
      error = FTC_GCache_Lookup( FTC_GCACHE( cache ), hash, gindex,    \
-                                FTC_GQUERY( query ), node );          \
+                                FTC_GQUERY( query ), &node );         \
                                                                       \
    FT_END_STMNT
 
                                                                       \
    FT_END_STMNT
 
index 548ebe9..4eb2c5b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Cache Manager (body).                                       */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType Cache Manager (body).                                       */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by */
+/*  Copyright 2000-2006, 2008-2010, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -28,7 +28,7 @@
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "cache system does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "cache system does not support PIC yet"
-#endif 
+#endif
 
 
 #undef  FT_COMPONENT
 
 
 #undef  FT_COMPONENT
 
 
     if ( asize == NULL )
 
 
     if ( asize == NULL )
-      return FTC_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     *asize = NULL;
 
     if ( !manager )
 
     *asize = NULL;
 
     if ( !manager )
-      return FTC_Err_Invalid_Cache_Handle;
+      return FT_THROW( Invalid_Cache_Handle );
 
 #ifdef FTC_INLINE
 
 
 #ifdef FTC_INLINE
 
 
 
     if ( aface == NULL )
 
 
     if ( aface == NULL )
-      return FTC_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     *aface = NULL;
 
     if ( !manager )
 
     *aface = NULL;
 
     if ( !manager )
-      return FTC_Err_Invalid_Cache_Handle;
+      return FT_THROW( Invalid_Cache_Handle );
 
     /* we break encapsulation for the sake of speed */
 #ifdef FTC_INLINE
 
     /* we break encapsulation for the sake of speed */
 #ifdef FTC_INLINE
 
 
     if ( !library )
 
 
     if ( !library )
-      return FTC_Err_Invalid_Library_Handle;
+      return FT_THROW( Invalid_Library_Handle );
 
     memory = library->memory;
 
 
     memory = library->memory;
 
       FTC_MruList_Reset( &manager->sizes );
       FTC_MruList_Reset( &manager->faces );
     }
       FTC_MruList_Reset( &manager->sizes );
       FTC_MruList_Reset( &manager->faces );
     }
-    /* XXX: FIXME: flush the caches? */
+
+    FTC_Manager_FlushN( manager, manager->num_nodes );
   }
 
 
   }
 
 
     /* check node weights */
     if ( first )
     {
     /* check node weights */
     if ( first )
     {
-      FT_ULong  weight = 0;
+      FT_Offset  weight = 0;
 
 
       node = first;
 
 
       node = first;
                              FTC_CacheClass   clazz,
                              FTC_Cache       *acache )
   {
                              FTC_CacheClass   clazz,
                              FTC_Cache       *acache )
   {
-    FT_Error   error = FTC_Err_Invalid_Argument;
+    FT_Error   error = FT_ERR( Invalid_Argument );
     FTC_Cache  cache = NULL;
 
 
     FTC_Cache  cache = NULL;
 
 
 
       if ( manager->num_caches >= FTC_MAX_CACHES )
       {
 
       if ( manager->num_caches >= FTC_MAX_CACHES )
       {
-        error = FTC_Err_Too_Many_Caches;
+        error = FT_THROW( Too_Many_Caches );
         FT_ERROR(( "FTC_Manager_RegisterCache:"
                    " too many registered caches\n" ));
         goto Exit;
         FT_ERROR(( "FTC_Manager_RegisterCache:"
                    " too many registered caches\n" ));
         goto Exit;
   }
 
 
   }
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
-  FT_EXPORT_DEF( FT_Error )
-  FTC_Manager_Lookup_Face( FTC_Manager  manager,
-                           FTC_FaceID   face_id,
-                           FT_Face     *aface )
-  {
-    return FTC_Manager_LookupFace( manager, face_id, aface );
-  }
-
-
-  FT_EXPORT( FT_Error )
-  FTC_Manager_Lookup_Size( FTC_Manager  manager,
-                           FTC_Font     font,
-                           FT_Face     *aface,
-                           FT_Size     *asize )
-  {
-    FTC_ScalerRec  scaler;
-    FT_Error       error;
-    FT_Size        size;
-    FT_Face        face;
-
-
-    scaler.face_id = font->face_id;
-    scaler.width   = font->pix_width;
-    scaler.height  = font->pix_height;
-    scaler.pixel   = TRUE;
-    scaler.x_res   = 0;
-    scaler.y_res   = 0;
-
-    error = FTC_Manager_LookupSize( manager, &scaler, &size );
-    if ( error )
-    {
-      face = NULL;
-      size = NULL;
-    }
-    else
-      face = size->face;
-
-    if ( aface )
-      *aface = face;
-
-    if ( asize )
-      *asize = size;
-
-    return error;
-  }
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
 /* END */
 /* END */
index 13f26bb..0aec33c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType Cache Manager (specification).                              */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType Cache Manager (specification).                              */
 /*                                                                         */
-/*  Copyright 2000-2001, 2003, 2004, 2006 by                               */
+/*  Copyright 2000-2001, 2003, 2004, 2006, 2010, 2013 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -94,8 +94,8 @@ FT_BEGIN_HEADER
     FT_Memory           memory;
 
     FTC_Node            nodes_list;
     FT_Memory           memory;
 
     FTC_Node            nodes_list;
-    FT_ULong            max_weight;
-    FT_ULong            cur_weight;
+    FT_Offset           max_weight;
+    FT_Offset           cur_weight;
     FT_UInt             num_nodes;
 
     FTC_Cache           caches[FTC_MAX_CACHES];
     FT_UInt             num_nodes;
 
     FTC_Cache           caches[FTC_MAX_CACHES];
index 9944b58..dc8b4cc 100644 (file)
       *plist = NULL;
     }
     else if ( node == first )
       *plist = NULL;
     }
     else if ( node == first )
-        *plist = next;
+      *plist = next;
   }
 
 
   }
 
 
                    FTC_MruNode  *anode )
   {
     FT_Error     error;
                    FTC_MruNode  *anode )
   {
     FT_Error     error;
-    FTC_MruNode  node;
+    FTC_MruNode  node = NULL;
     FT_Memory    memory = list->memory;
 
 
     FT_Memory    memory = list->memory;
 
 
         list->clazz.node_done( node, list->data );
     }
     else if ( FT_ALLOC( node, list->clazz.node_size ) )
         list->clazz.node_done( node, list->data );
     }
     else if ( FT_ALLOC( node, list->clazz.node_size ) )
-        goto Exit;
+      goto Exit;
 
     error = list->clazz.node_init( node, key, list->data );
     if ( error )
       goto Fail;
 
 
     error = list->clazz.node_init( node, key, list->data );
     if ( error )
       goto Fail;
 
-      FTC_MruNode_Prepend( &list->nodes, node );
-      list->num_nodes++;
+    FTC_MruNode_Prepend( &list->nodes, node );
+    list->num_nodes++;
 
   Exit:
     *anode = node;
 
   Exit:
     *anode = node;
 
 
       if ( list->clazz.node_done )
 
 
       if ( list->clazz.node_done )
-       list->clazz.node_done( node, list->data );
+        list->clazz.node_done( node, list->data );
 
       FT_FREE( node );
     }
 
       FT_FREE( node );
     }
index 8c3797f..6fccf11 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Simple MRU list-cache (specification).                               */
 /*                                                                         */
 /*                                                                         */
 /*    Simple MRU list-cache (specification).                               */
 /*                                                                         */
-/*  Copyright 2000-2001, 2003, 2004, 2005, 2006, 2010 by                   */
+/*  Copyright 2000-2001, 2003-2006, 2010, 2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -166,7 +166,7 @@ FT_BEGIN_HEADER
     FTC_MruNode              _first, _node;                                 \
                                                                             \
                                                                             \
     FTC_MruNode              _first, _node;                                 \
                                                                             \
                                                                             \
-    error  = FTC_Err_Ok;                                                    \
+    error  = FT_Err_Ok;                                                     \
     _first = *(_pfirst);                                                    \
     _node  = NULL;                                                          \
                                                                             \
     _first = *(_pfirst);                                                    \
     _node  = NULL;                                                          \
                                                                             \
index 83245af..6df1c19 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType sbits manager (body).                                       */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType sbits manager (body).                                       */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by       */
+/*  Copyright 2000-2006, 2009-2011, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     if ( (FT_UInt)(gindex - gnode->gindex) >= snode->count )
     {
       FT_ERROR(( "ftc_snode_load: invalid glyph index" ));
     if ( (FT_UInt)(gindex - gnode->gindex) >= snode->count )
     {
       FT_ERROR(( "ftc_snode_load: invalid glyph index" ));
-      return FTC_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
     }
 
     sbit  = snode->sbits + ( gindex - gnode->gindex );
     }
 
     sbit  = snode->sbits + ( gindex - gnode->gindex );
     /* we mark unloaded glyphs with `sbit.buffer == 0' */
     /* and `width == 255', `height == 0'               */
     /*                                                 */
     /* we mark unloaded glyphs with `sbit.buffer == 0' */
     /* and `width == 255', `height == 0'               */
     /*                                                 */
-    if ( error && error != FTC_Err_Out_Of_Memory )
+    if ( error && FT_ERR_NEQ( error, Out_Of_Memory ) )
     {
     BadGlyph:
       sbit->width  = 255;
       sbit->height = 0;
       sbit->buffer = NULL;
     {
     BadGlyph:
       sbit->width  = 255;
       sbit->height = 0;
       sbit->buffer = NULL;
-      error        = FTC_Err_Ok;
+      error        = FT_Err_Ok;
       if ( asize )
         *asize = 0;
     }
       if ( asize )
         *asize = 0;
     }
 
     FTC_SFamilyClass  clazz = FTC_CACHE__SFAMILY_CLASS( cache );
     FT_UInt           total;
 
     FTC_SFamilyClass  clazz = FTC_CACHE__SFAMILY_CLASS( cache );
     FT_UInt           total;
+    FT_UInt           node_count;
 
 
     total = clazz->family_get_count( family, cache->manager );
     if ( total == 0 || gindex >= total )
     {
 
 
     total = clazz->family_get_count( family, cache->manager );
     if ( total == 0 || gindex >= total )
     {
-      error = FTC_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
       FTC_GNode_Init( FTC_GNODE( snode ), start, family );
 
       snode->count = count;
       FTC_GNode_Init( FTC_GNODE( snode ), start, family );
 
       snode->count = count;
+      for ( node_count = 0; node_count < count; node_count++ )
+      {
+        snode->sbits[node_count].width = 255;
+      }
 
       error = ftc_snode_load( snode,
                               cache->manager,
 
       error = ftc_snode_load( snode,
                               cache->manager,
   FT_LOCAL_DEF( FT_Bool )
   ftc_snode_compare( FTC_Node    ftcsnode,
                      FT_Pointer  ftcgquery,
   FT_LOCAL_DEF( FT_Bool )
   ftc_snode_compare( FTC_Node    ftcsnode,
                      FT_Pointer  ftcgquery,
-                     FTC_Cache   cache )
+                     FTC_Cache   cache,
+                     FT_Bool*    list_changed )
   {
     FTC_SNode   snode  = (FTC_SNode)ftcsnode;
     FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;
   {
     FTC_SNode   snode  = (FTC_SNode)ftcsnode;
     FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;
     FT_Bool     result;
 
 
     FT_Bool     result;
 
 
+    if (list_changed)
+      *list_changed = FALSE;
     result = FT_BOOL( gnode->family == gquery->family                    &&
                       (FT_UInt)( gindex - gnode->gindex ) < snode->count );
     if ( result )
     result = FT_BOOL( gnode->family == gquery->family                    &&
                       (FT_UInt)( gindex - gnode->gindex ) < snode->count );
     if ( result )
        *
        */
 
        *
        */
 
-      if ( sbit->buffer == NULL && sbit->width != 255 )
+      if ( sbit->buffer == NULL && sbit->width == 255 )
       {
         FT_ULong  size;
         FT_Error  error;
       {
         FT_ULong  size;
         FT_Error  error;
         {
           error = ftc_snode_load( snode, cache->manager, gindex, &size );
         }
         {
           error = ftc_snode_load( snode, cache->manager, gindex, &size );
         }
-        FTC_CACHE_TRYLOOP_END();
+        FTC_CACHE_TRYLOOP_END( list_changed );
 
         ftcsnode->ref_count--;  /* unlock the node */
 
 
         ftcsnode->ref_count--;  /* unlock the node */
 
   }
 
 
   }
 
 
+#ifdef FTC_INLINE
+
   FT_LOCAL_DEF( FT_Bool )
   FTC_SNode_Compare( FTC_SNode   snode,
                      FTC_GQuery  gquery,
   FT_LOCAL_DEF( FT_Bool )
   FTC_SNode_Compare( FTC_SNode   snode,
                      FTC_GQuery  gquery,
-                     FTC_Cache   cache )
+                     FTC_Cache   cache,
+                     FT_Bool*    list_changed )
   {
   {
-    return ftc_snode_compare( FTC_NODE( snode ), gquery, cache );
+    return ftc_snode_compare( FTC_NODE( snode ), gquery,
+                              cache, list_changed );
   }
 
   }
 
+#endif
 
 /* END */
 
 /* END */
index 6261745..df55dca 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    A small-bitmap cache (specification).                                */
 /*                                                                         */
 /*                                                                         */
 /*    A small-bitmap cache (specification).                                */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2006 by                               */
+/*  Copyright 2000-2001, 2002, 2003, 2006, 2011 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -83,10 +83,15 @@ FT_BEGIN_HEADER
 #endif
 
 
 #endif
 
 
+#ifdef FTC_INLINE
+
   FT_LOCAL( FT_Bool )
   FTC_SNode_Compare( FTC_SNode   snode,
                      FTC_GQuery  gquery,
   FT_LOCAL( FT_Bool )
   FTC_SNode_Compare( FTC_SNode   snode,
                      FTC_GQuery  gquery,
-                     FTC_Cache   cache );
+                     FTC_Cache   cache,
+                     FT_Bool*    list_changed);
+
+#endif
 
   /* */
 
 
   /* */
 
diff --git a/reactos/lib/3rdparty/freetype/src/cff/Jamfile b/reactos/lib/3rdparty/freetype/src/cff/Jamfile
deleted file mode 100644 (file)
index 6705d3c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/cff Jamfile
-#
-# Copyright 2001, 2002 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) cff ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = cffdrivr cffgload cffload cffobjs cffparse cffcmap cffpic ;
-  }
-  else
-  {
-    _sources = cff ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/cff Jamfile
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2arrst.c b/reactos/lib/3rdparty/freetype/src/cff/cf2arrst.c
new file mode 100644 (file)
index 0000000..c8d6f13
--- /dev/null
@@ -0,0 +1,241 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2arrst.c                                                             */
+/*                                                                         */
+/*    Adobe's code for Array Stacks (body).                                */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "cf2ft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "cf2glue.h"
+#include "cf2arrst.h"
+
+#include "cf2error.h"
+
+
+  /*
+   * CF2_ArrStack uses an error pointer, to enable shared errors.
+   * Shared errors are necessary when multiple objects allow the program
+   * to continue after detecting errors.  Only the first error should be
+   * recorded.
+   */
+
+  FT_LOCAL_DEF( void )
+  cf2_arrstack_init( CF2_ArrStack  arrstack,
+                     FT_Memory     memory,
+                     FT_Error*     error,
+                     size_t        sizeItem )
+  {
+    FT_ASSERT( arrstack != NULL );
+
+    /* initialize the structure */
+    arrstack->memory    = memory;
+    arrstack->error     = error;
+    arrstack->sizeItem  = sizeItem;
+    arrstack->allocated = 0;
+    arrstack->chunk     = 10;    /* chunks of 10 items */
+    arrstack->count     = 0;
+    arrstack->totalSize = 0;
+    arrstack->ptr       = NULL;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_arrstack_finalize( CF2_ArrStack  arrstack )
+  {
+    FT_Memory  memory = arrstack->memory;     /* for FT_FREE */
+
+
+    FT_ASSERT( arrstack != NULL );
+
+    arrstack->allocated = 0;
+    arrstack->count     = 0;
+    arrstack->totalSize = 0;
+
+    /* free the data buffer */
+    FT_FREE( arrstack->ptr );
+  }
+
+
+  /* allocate or reallocate the buffer size; */
+  /* return false on memory error */
+  static FT_Bool
+  cf2_arrstack_setNumElements( CF2_ArrStack  arrstack,
+                               size_t        numElements )
+  {
+    FT_ASSERT( arrstack != NULL );
+
+    {
+      FT_Error   error  = FT_Err_Ok;        /* for FT_REALLOC */
+      FT_Memory  memory = arrstack->memory; /* for FT_REALLOC */
+
+      FT_Long  newSize = (FT_Long)( numElements * arrstack->sizeItem );
+
+
+      if ( numElements > LONG_MAX / arrstack->sizeItem )
+        goto exit;
+
+
+      FT_ASSERT( newSize > 0 );   /* avoid realloc with zero size */
+
+      if ( !FT_REALLOC( arrstack->ptr, arrstack->totalSize, newSize ) )
+      {
+        arrstack->allocated = numElements;
+        arrstack->totalSize = newSize;
+
+        if ( arrstack->count > numElements )
+        {
+          /* we truncated the list! */
+          CF2_SET_ERROR( arrstack->error, Stack_Overflow );
+          arrstack->count = numElements;
+          return FALSE;
+        }
+
+        return TRUE;     /* success */
+      }
+    }
+
+  exit:
+    /* if there's not already an error, store this one */
+    CF2_SET_ERROR( arrstack->error, Out_Of_Memory );
+
+    return FALSE;
+  }
+
+
+  /* set the count, ensuring allocation is sufficient */
+  FT_LOCAL_DEF( void )
+  cf2_arrstack_setCount( CF2_ArrStack  arrstack,
+                         size_t        numElements )
+  {
+    FT_ASSERT( arrstack != NULL );
+
+    if ( numElements > arrstack->allocated )
+    {
+      /* expand the allocation first */
+      if ( !cf2_arrstack_setNumElements( arrstack, numElements ) )
+        return;
+    }
+
+    arrstack->count = numElements;
+  }
+
+
+  /* clear the count */
+  FT_LOCAL_DEF( void )
+  cf2_arrstack_clear( CF2_ArrStack  arrstack )
+  {
+    FT_ASSERT( arrstack != NULL );
+
+    arrstack->count = 0;
+  }
+
+
+  /* current number of items */
+  FT_LOCAL_DEF( size_t )
+  cf2_arrstack_size( const CF2_ArrStack  arrstack )
+  {
+    FT_ASSERT( arrstack != NULL );
+
+    return arrstack->count;
+  }
+
+
+  FT_LOCAL_DEF( void* )
+  cf2_arrstack_getBuffer( const CF2_ArrStack  arrstack )
+  {
+    FT_ASSERT( arrstack != NULL );
+
+    return arrstack->ptr;
+  }
+
+
+  /* return pointer to the given element */
+  FT_LOCAL_DEF( void* )
+  cf2_arrstack_getPointer( const CF2_ArrStack  arrstack,
+                           size_t              idx )
+  {
+    void*  newPtr;
+
+
+    FT_ASSERT( arrstack != NULL );
+
+    if ( idx >= arrstack->count )
+    {
+      /* overflow */
+      CF2_SET_ERROR( arrstack->error, Stack_Overflow );
+      idx = 0;    /* choose safe default */
+    }
+
+    newPtr = (FT_Byte*)arrstack->ptr + idx * arrstack->sizeItem;
+
+    return newPtr;
+  }
+
+
+  /* push (append) an element at the end of the list;         */
+  /* return false on memory error                             */
+  /* TODO: should there be a length param for extra checking? */
+  FT_LOCAL_DEF( void )
+  cf2_arrstack_push( CF2_ArrStack  arrstack,
+                     const void*   ptr )
+  {
+    FT_ASSERT( arrstack != NULL );
+
+    if ( arrstack->count == arrstack->allocated )
+    {
+      /* grow the buffer by one chunk */
+      if ( !cf2_arrstack_setNumElements(
+             arrstack, arrstack->allocated + arrstack->chunk ) )
+      {
+        /* on error, ignore the push */
+        return;
+      }
+    }
+
+    FT_ASSERT( ptr != NULL );
+
+    {
+      size_t  offset = arrstack->count * arrstack->sizeItem;
+      void*   newPtr = (FT_Byte*)arrstack->ptr + offset;
+
+
+      FT_MEM_COPY( newPtr, ptr, arrstack->sizeItem );
+      arrstack->count += 1;
+    }
+  }
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2arrst.h b/reactos/lib/3rdparty/freetype/src/cff/cf2arrst.h
new file mode 100644 (file)
index 0000000..ff5ad8b
--- /dev/null
@@ -0,0 +1,100 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2arrst.h                                                             */
+/*                                                                         */
+/*    Adobe's code for Array Stacks (specification).                       */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2ARRST_H__
+#define __CF2ARRST_H__
+
+
+#include "cf2error.h"
+
+
+FT_BEGIN_HEADER
+
+
+  /* need to define the struct here (not opaque) so it can be allocated by */
+  /* clients                                                               */
+  typedef struct  CF2_ArrStackRec_
+  {
+    FT_Memory  memory;
+    FT_Error*  error;
+
+    size_t  sizeItem;       /* bytes per element             */
+    size_t  allocated;      /* items allocated               */
+    size_t  chunk;          /* allocation increment in items */
+    size_t  count;          /* number of elements allocated  */
+    size_t  totalSize;      /* total bytes allocated         */
+
+    void*  ptr;             /* ptr to data                   */
+
+  } CF2_ArrStackRec, *CF2_ArrStack;
+
+
+  FT_LOCAL( void )
+  cf2_arrstack_init( CF2_ArrStack  arrstack,
+                     FT_Memory     memory,
+                     FT_Error*     error,
+                     size_t        sizeItem );
+  FT_LOCAL( void )
+  cf2_arrstack_finalize( CF2_ArrStack  arrstack );
+
+  FT_LOCAL( void )
+  cf2_arrstack_setCount( CF2_ArrStack  arrstack,
+                         size_t        numElements );
+  FT_LOCAL( void )
+  cf2_arrstack_clear( CF2_ArrStack  arrstack );
+  FT_LOCAL( size_t )
+  cf2_arrstack_size( const CF2_ArrStack  arrstack );
+
+  FT_LOCAL( void* )
+  cf2_arrstack_getBuffer( const CF2_ArrStack  arrstack );
+  FT_LOCAL( void* )
+  cf2_arrstack_getPointer( const CF2_ArrStack  arrstack,
+                           size_t              idx );
+
+  FT_LOCAL( void )
+  cf2_arrstack_push( CF2_ArrStack  arrstack,
+                     const void*   ptr );
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2ARRST_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2blues.c b/reactos/lib/3rdparty/freetype/src/cff/cf2blues.c
new file mode 100644 (file)
index 0000000..5b34839
--- /dev/null
@@ -0,0 +1,578 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2blues.c                                                             */
+/*                                                                         */
+/*    Adobe's code for handling Blue Zones (body).                         */
+/*                                                                         */
+/*  Copyright 2009-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "cf2ft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "cf2blues.h"
+#include "cf2hints.h"
+#include "cf2font.h"
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_cf2blues
+
+
+  /*
+   * For blue values, the FreeType parser produces an array of integers,
+   * while the Adobe CFF engine produces an array of fixed.
+   * Define a macro to convert FreeType to fixed.
+   */
+#define cf2_blueToFixed( x )  cf2_intToFixed( x )
+
+
+  FT_LOCAL_DEF( void )
+  cf2_blues_init( CF2_Blues  blues,
+                  CF2_Font   font )
+  {
+    /* pointer to parsed font object */
+    CFF_Decoder*  decoder = font->decoder;
+
+    CF2_Fixed  zoneHeight;
+    CF2_Fixed  maxZoneHeight = 0;
+    CF2_Fixed  csUnitsPerPixel;
+
+    size_t  numBlueValues;
+    size_t  numOtherBlues;
+    size_t  numFamilyBlues;
+    size_t  numFamilyOtherBlues;
+
+    FT_Pos*  blueValues;
+    FT_Pos*  otherBlues;
+    FT_Pos*  familyBlues;
+    FT_Pos*  familyOtherBlues;
+
+    size_t     i;
+    CF2_Fixed  emBoxBottom, emBoxTop;
+
+    CF2_Int  unitsPerEm = font->unitsPerEm;
+
+
+    if ( unitsPerEm == 0 )
+      unitsPerEm = 1000;
+
+    FT_ZERO( blues );
+    blues->scale = font->innerTransform.d;
+
+    cf2_getBlueMetrics( decoder,
+                        &blues->blueScale,
+                        &blues->blueShift,
+                        &blues->blueFuzz );
+
+    cf2_getBlueValues( decoder, &numBlueValues, &blueValues );
+    cf2_getOtherBlues( decoder, &numOtherBlues, &otherBlues );
+    cf2_getFamilyBlues( decoder, &numFamilyBlues, &familyBlues );
+    cf2_getFamilyOtherBlues( decoder, &numFamilyOtherBlues, &familyOtherBlues );
+
+    /*
+     * synthetic em box hint heuristic
+     *
+     * Apply this when ideographic dictionary (LanguageGroup 1) has no
+     * real alignment zones.  Adobe tools generate dummy zones at -250 and
+     * 1100 for a 1000 unit em.  Fonts with ICF-based alignment zones
+     * should not enable the heuristic.  When the heuristic is enabled,
+     * the font's blue zones are ignored.
+     *
+     */
+
+    /* get em box from OS/2 typoAscender/Descender                      */
+    /* TODO: FreeType does not parse these metrics.  Skip them for now. */
+#if 0
+    FCM_getHorizontalLineMetrics( &e,
+                                  font->font,
+                                  &ascender,
+                                  &descender,
+                                  &linegap );
+    if ( ascender - descender == unitsPerEm )
+    {
+      emBoxBottom = cf2_intToFixed( descender );
+      emBoxTop    = cf2_intToFixed( ascender );
+    }
+    else
+#endif
+    {
+      emBoxBottom = CF2_ICF_Bottom;
+      emBoxTop    = CF2_ICF_Top;
+    }
+
+    if ( cf2_getLanguageGroup( decoder ) == 1                   &&
+         ( numBlueValues == 0                                 ||
+           ( numBlueValues == 4                             &&
+             cf2_blueToFixed( blueValues[0] ) < emBoxBottom &&
+             cf2_blueToFixed( blueValues[1] ) < emBoxBottom &&
+             cf2_blueToFixed( blueValues[2] ) > emBoxTop    &&
+             cf2_blueToFixed( blueValues[3] ) > emBoxTop    ) ) )
+    {
+      /*
+       * Construct hint edges suitable for synthetic ghost hints at top
+       * and bottom of em box.  +-CF2_MIN_COUNTER allows for unhinted
+       * features above or below the last hinted edge.  This also gives a
+       * net 1 pixel boost to the height of ideographic glyphs.
+       *
+       * Note: Adjust synthetic hints outward by epsilon (0x.0001) to
+       *       avoid interference.  E.g., some fonts have real hints at
+       *       880 and -120.
+       */
+
+      blues->emBoxBottomEdge.csCoord = emBoxBottom - CF2_FIXED_EPSILON;
+      blues->emBoxBottomEdge.dsCoord = cf2_fixedRound(
+                                         FT_MulFix(
+                                           blues->emBoxBottomEdge.csCoord,
+                                           blues->scale ) ) -
+                                       CF2_MIN_COUNTER;
+      blues->emBoxBottomEdge.scale   = blues->scale;
+      blues->emBoxBottomEdge.flags   = CF2_GhostBottom |
+                                       CF2_Locked |
+                                       CF2_Synthetic;
+
+      blues->emBoxTopEdge.csCoord = emBoxTop + CF2_FIXED_EPSILON +
+                                    2 * font->darkenY;
+      blues->emBoxTopEdge.dsCoord = cf2_fixedRound(
+                                      FT_MulFix(
+                                        blues->emBoxTopEdge.csCoord,
+                                        blues->scale ) ) +
+                                    CF2_MIN_COUNTER;
+      blues->emBoxTopEdge.scale   = blues->scale;
+      blues->emBoxTopEdge.flags   = CF2_GhostTop |
+                                    CF2_Locked |
+                                    CF2_Synthetic;
+
+      blues->doEmBoxHints = TRUE;    /* enable the heuristic */
+
+      return;
+    }
+
+    /* copy `BlueValues' and `OtherBlues' to a combined array of top and */
+    /* bottom zones                                                      */
+    for ( i = 0; i < numBlueValues; i += 2 )
+    {
+      blues->zone[blues->count].csBottomEdge =
+        cf2_blueToFixed( blueValues[i] );
+      blues->zone[blues->count].csTopEdge =
+        cf2_blueToFixed( blueValues[i + 1] );
+
+      zoneHeight = blues->zone[blues->count].csTopEdge -
+                   blues->zone[blues->count].csBottomEdge;
+
+      if ( zoneHeight < 0 )
+      {
+        FT_TRACE4(( "cf2_blues_init: ignoring negative zone height\n" ));
+        continue;   /* reject this zone */
+      }
+
+      if ( zoneHeight > maxZoneHeight )
+      {
+        /* take maximum before darkening adjustment      */
+        /* so overshoot suppression point doesn't change */
+        maxZoneHeight = zoneHeight;
+      }
+
+      /* adjust both edges of top zone upward by twice darkening amount */
+      if ( i != 0 )
+      {
+        blues->zone[blues->count].csTopEdge    += 2 * font->darkenY;
+        blues->zone[blues->count].csBottomEdge += 2 * font->darkenY;
+      }
+
+      /* first `BlueValue' is bottom zone; others are top */
+      if ( i == 0 )
+      {
+        blues->zone[blues->count].bottomZone =
+          TRUE;
+        blues->zone[blues->count].csFlatEdge =
+          blues->zone[blues->count].csTopEdge;
+      }
+      else
+      {
+        blues->zone[blues->count].bottomZone =
+          FALSE;
+        blues->zone[blues->count].csFlatEdge =
+          blues->zone[blues->count].csBottomEdge;
+      }
+
+      blues->count += 1;
+    }
+
+    for ( i = 0; i < numOtherBlues; i += 2 )
+    {
+      blues->zone[blues->count].csBottomEdge =
+        cf2_blueToFixed( otherBlues[i] );
+      blues->zone[blues->count].csTopEdge =
+        cf2_blueToFixed( otherBlues[i + 1] );
+
+      zoneHeight = blues->zone[blues->count].csTopEdge -
+                   blues->zone[blues->count].csBottomEdge;
+
+      if ( zoneHeight < 0 )
+      {
+        FT_TRACE4(( "cf2_blues_init: ignoring negative zone height\n" ));
+        continue;   /* reject this zone */
+      }
+
+      if ( zoneHeight > maxZoneHeight )
+      {
+        /* take maximum before darkening adjustment      */
+        /* so overshoot suppression point doesn't change */
+        maxZoneHeight = zoneHeight;
+      }
+
+      /* Note: bottom zones are not adjusted for darkening amount */
+
+      /* all OtherBlues are bottom zone */
+      blues->zone[blues->count].bottomZone =
+        TRUE;
+      blues->zone[blues->count].csFlatEdge =
+        blues->zone[blues->count].csTopEdge;
+
+      blues->count += 1;
+    }
+
+    /* Adjust for FamilyBlues */
+
+    /* Search for the nearest flat edge in `FamilyBlues' or                */
+    /* `FamilyOtherBlues'.  According to the Black Book, any matching edge */
+    /* must be within one device pixel                                     */
+
+    csUnitsPerPixel = FT_DivFix( cf2_intToFixed( 1 ), blues->scale );
+
+    /* loop on all zones in this font */
+    for ( i = 0; i < blues->count; i++ )
+    {
+      size_t     j;
+      CF2_Fixed  minDiff;
+      CF2_Fixed  flatFamilyEdge, diff;
+      /* value for this font */
+      CF2_Fixed  flatEdge = blues->zone[i].csFlatEdge;
+
+
+      if ( blues->zone[i].bottomZone )
+      {
+        /* In a bottom zone, the top edge is the flat edge.             */
+        /* Search `FamilyOtherBlues' for bottom zones; look for closest */
+        /* Family edge that is within the one pixel threshold.          */
+
+        minDiff = CF2_FIXED_MAX;
+
+        for ( j = 0; j < numFamilyOtherBlues; j += 2 )
+        {
+          /* top edge */
+          flatFamilyEdge = cf2_blueToFixed( familyOtherBlues[j + 1] );
+
+          diff = cf2_fixedAbs( flatEdge - flatFamilyEdge );
+
+          if ( diff < minDiff && diff < csUnitsPerPixel )
+          {
+            blues->zone[i].csFlatEdge = flatFamilyEdge;
+            minDiff                   = diff;
+
+            if ( diff == 0 )
+              break;
+          }
+        }
+
+        /* check the first member of FamilyBlues, which is a bottom zone */
+        if ( numFamilyBlues >= 2 )
+        {
+          /* top edge */
+          flatFamilyEdge = cf2_blueToFixed( familyBlues[1] );
+
+          diff = cf2_fixedAbs( flatEdge - flatFamilyEdge );
+
+          if ( diff < minDiff && diff < csUnitsPerPixel )
+            blues->zone[i].csFlatEdge = flatFamilyEdge;
+        }
+      }
+      else
+      {
+        /* In a top zone, the bottom edge is the flat edge.                */
+        /* Search `FamilyBlues' for top zones; skip first zone, which is a */
+        /* bottom zone; look for closest Family edge that is within the    */
+        /* one pixel threshold                                             */
+
+        minDiff = CF2_FIXED_MAX;
+
+        for ( j = 2; j < numFamilyBlues; j += 2 )
+        {
+          /* bottom edge */
+          flatFamilyEdge = cf2_blueToFixed( familyBlues[j] );
+
+          /* adjust edges of top zone upward by twice darkening amount */
+          flatFamilyEdge += 2 * font->darkenY;      /* bottom edge */
+
+          diff = cf2_fixedAbs( flatEdge - flatFamilyEdge );
+
+          if ( diff < minDiff && diff < csUnitsPerPixel )
+          {
+            blues->zone[i].csFlatEdge = flatFamilyEdge;
+            minDiff                   = diff;
+
+            if ( diff == 0 )
+              break;
+          }
+        }
+      }
+    }
+
+    /* TODO: enforce separation of zones, including BlueFuzz */
+
+    /* Adjust BlueScale; similar to AdjustBlueScale() in coretype */
+    /* `bcsetup.c'.                                               */
+
+    if ( maxZoneHeight > 0 )
+    {
+      if ( blues->blueScale > FT_DivFix( cf2_intToFixed( 1 ),
+                                         maxZoneHeight ) )
+      {
+        /* clamp at maximum scale */
+        blues->blueScale = FT_DivFix( cf2_intToFixed( 1 ),
+                                      maxZoneHeight );
+      }
+
+      /*
+       * TODO: Revisit the bug fix for 613448.  The minimum scale
+       *       requirement catches a number of library fonts.  For
+       *       example, with default BlueScale (.039625) and 0.4 minimum,
+       *       the test below catches any font with maxZoneHeight < 10.1.
+       *       There are library fonts ranging from 2 to 10 that get
+       *       caught, including e.g., Eurostile LT Std Medium with
+       *       maxZoneHeight of 6.
+       *
+       */
+#if 0
+      if ( blueScale < .4 / maxZoneHeight )
+      {
+        tetraphilia_assert( 0 );
+        /* clamp at minimum scale, per bug 0613448 fix */
+        blueScale = .4 / maxZoneHeight;
+      }
+#endif
+
+    }
+
+    /*
+     * Suppress overshoot and boost blue zones at small sizes.  Boost
+     * amount varies linearly from 0.5 pixel near 0 to 0 pixel at
+     * blueScale cutoff.
+     * Note: This boost amount is different from the coretype heuristic.
+     *
+     */
+
+    if ( blues->scale < blues->blueScale )
+    {
+      blues->suppressOvershoot = TRUE;
+
+      /* Change rounding threshold for `dsFlatEdge'.                    */
+      /* Note: constant changed from 0.5 to 0.6 to avoid a problem with */
+      /*       10ppem Arial                                             */
+
+      blues->boost = FT_MulFix(
+                       cf2_floatToFixed( .6 ),
+                       ( cf2_intToFixed( 1 ) -
+                         FT_DivFix( blues->scale,
+                                    blues->blueScale ) ) );
+      if ( blues->boost > 0x7FFF )
+      {
+        /* boost must remain less than 0.5, or baseline could go negative */
+        blues->boost = 0x7FFF;
+      }
+    }
+
+    /* boost and darkening have similar effects; don't do both */
+    if ( font->stemDarkened )
+      blues->boost = 0;
+
+    /* set device space alignment for each zone;    */
+    /* apply boost amount before rounding flat edge */
+
+    for ( i = 0; i < blues->count; i++ )
+    {
+      if ( blues->zone[i].bottomZone )
+        blues->zone[i].dsFlatEdge = cf2_fixedRound(
+                                      FT_MulFix(
+                                        blues->zone[i].csFlatEdge,
+                                        blues->scale ) -
+                                      blues->boost );
+      else
+        blues->zone[i].dsFlatEdge = cf2_fixedRound(
+                                      FT_MulFix(
+                                        blues->zone[i].csFlatEdge,
+                                        blues->scale ) +
+                                      blues->boost );
+    }
+  }
+
+
+  /*
+   * Check whether `stemHint' is captured by one of the blue zones.
+   *
+   * Zero, one or both edges may be valid; only valid edges can be
+   * captured.  For compatibility with CoolType, search top and bottom
+   * zones in the same pass (see `BlueLock').  If a hint is captured,
+   * return true and position the edge(s) in one of 3 ways:
+   *
+   *  1) If `BlueScale' suppresses overshoot, position the captured edge
+   *     at the flat edge of the zone.
+   *  2) If overshoot is not suppressed and `BlueShift' requires
+   *     overshoot, position the captured edge a minimum of 1 device pixel
+   *     from the flat edge.
+   *  3) If overshoot is not suppressed or required, position the captured
+   *     edge at the nearest device pixel.
+   *
+   */
+  FT_LOCAL_DEF( FT_Bool )
+  cf2_blues_capture( const CF2_Blues  blues,
+                     CF2_Hint         bottomHintEdge,
+                     CF2_Hint         topHintEdge )
+  {
+    /* TODO: validate? */
+    CF2_Fixed  csFuzz = blues->blueFuzz;
+
+    /* new position of captured edge */
+    CF2_Fixed  dsNew;
+
+    /* amount that hint is moved when positioned */
+    CF2_Fixed  dsMove = 0;
+
+    FT_Bool   captured = FALSE;
+    CF2_UInt  i;
+
+
+    /* assert edge flags are consistent */
+    FT_ASSERT( !cf2_hint_isTop( bottomHintEdge ) &&
+               !cf2_hint_isBottom( topHintEdge ) );
+
+    /* TODO: search once without blue fuzz for compatibility with coretype? */
+    for ( i = 0; i < blues->count; i++ )
+    {
+      if ( blues->zone[i].bottomZone           &&
+           cf2_hint_isBottom( bottomHintEdge ) )
+      {
+        if ( ( blues->zone[i].csBottomEdge - csFuzz ) <=
+               bottomHintEdge->csCoord                   &&
+             bottomHintEdge->csCoord <=
+               ( blues->zone[i].csTopEdge + csFuzz )     )
+        {
+          /* bottom edge captured by bottom zone */
+
+          if ( blues->suppressOvershoot )
+            dsNew = blues->zone[i].dsFlatEdge;
+
+          else if ( ( blues->zone[i].csTopEdge - bottomHintEdge->csCoord ) >=
+                      blues->blueShift )
+          {
+            /* guarantee minimum of 1 pixel overshoot */
+            dsNew = FT_MIN(
+                      cf2_fixedRound( bottomHintEdge->dsCoord ),
+                      blues->zone[i].dsFlatEdge - cf2_intToFixed( 1 ) );
+          }
+
+          else
+          {
+            /* simply round captured edge */
+            dsNew = cf2_fixedRound( bottomHintEdge->dsCoord );
+          }
+
+          dsMove   = dsNew - bottomHintEdge->dsCoord;
+          captured = TRUE;
+
+          break;
+        }
+      }
+
+      if ( !blues->zone[i].bottomZone && cf2_hint_isTop( topHintEdge ) )
+      {
+        if ( ( blues->zone[i].csBottomEdge - csFuzz ) <=
+               topHintEdge->csCoord                      &&
+             topHintEdge->csCoord <=
+               ( blues->zone[i].csTopEdge + csFuzz )     )
+        {
+          /* top edge captured by top zone */
+
+          if ( blues->suppressOvershoot )
+            dsNew = blues->zone[i].dsFlatEdge;
+
+          else if ( ( topHintEdge->csCoord - blues->zone[i].csBottomEdge ) >=
+                      blues->blueShift )
+          {
+            /* guarantee minimum of 1 pixel overshoot */
+            dsNew = FT_MAX(
+                      cf2_fixedRound( topHintEdge->dsCoord ),
+                      blues->zone[i].dsFlatEdge + cf2_intToFixed( 1 ) );
+          }
+
+          else
+          {
+            /* simply round captured edge */
+            dsNew = cf2_fixedRound( topHintEdge->dsCoord );
+          }
+
+          dsMove   = dsNew - topHintEdge->dsCoord;
+          captured = TRUE;
+
+          break;
+        }
+      }
+    }
+
+    if ( captured )
+    {
+      /* move both edges and flag them `locked' */
+      if ( cf2_hint_isValid( bottomHintEdge ) )
+      {
+        bottomHintEdge->dsCoord += dsMove;
+        cf2_hint_lock( bottomHintEdge );
+      }
+
+      if ( cf2_hint_isValid( topHintEdge ) )
+      {
+        topHintEdge->dsCoord += dsMove;
+        cf2_hint_lock( topHintEdge );
+      }
+    }
+
+    return captured;
+  }
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2blues.h b/reactos/lib/3rdparty/freetype/src/cff/cf2blues.h
new file mode 100644 (file)
index 0000000..2f38fca
--- /dev/null
@@ -0,0 +1,185 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2blues.h                                                             */
+/*                                                                         */
+/*    Adobe's code for handling Blue Zones (specification).                */
+/*                                                                         */
+/*  Copyright 2009-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+  /*
+   * A `CF2_Blues' object stores the blue zones (horizontal alignment
+   * zones) of a font.  These are specified in the CFF private dictionary
+   * by `BlueValues', `OtherBlues', `FamilyBlues', and `FamilyOtherBlues'.
+   * Each zone is defined by a top and bottom edge in character space.
+   * Further, each zone is either a top zone or a bottom zone, as recorded
+   * by `bottomZone'.
+   *
+   * The maximum number of `BlueValues' and `FamilyBlues' is 7 each.
+   * However, these are combined to produce a total of 7 zones.
+   * Similarly, the maximum number of `OtherBlues' and `FamilyOtherBlues'
+   * is 5 and these are combined to produce an additional 5 zones.
+   *
+   * Blue zones are used to `capture' hints and force them to a common
+   * alignment point.  This alignment is recorded in device space in
+   * `dsFlatEdge'.  Except for this value, a `CF2_Blues' object could be
+   * constructed independently of scaling.  Construction may occur once
+   * the matrix is known.  Other features implemented in the Capture
+   * method are overshoot suppression, overshoot enforcement, and Blue
+   * Boost.
+   *
+   * Capture is determined by `BlueValues' and `OtherBlues', but the
+   * alignment point may be adjusted to the scaled flat edge of
+   * `FamilyBlues' or `FamilyOtherBlues'.  No alignment is done to the
+   * curved edge of a zone.
+   *
+   */
+
+
+#ifndef __CF2BLUES_H__
+#define __CF2BLUES_H__
+
+
+#include "cf2glue.h"
+
+
+FT_BEGIN_HEADER
+
+
+  /*
+   * `CF2_Hint' is shared by `cf2hints.h' and
+   * `cf2blues.h', but `cf2blues.h' depends on
+   * `cf2hints.h', so define it here.  Note: The typedef is in
+   * `cf2glue.h'.
+   *
+   */
+  enum
+  {
+    CF2_GhostBottom = 0x1,  /* a single bottom edge           */
+    CF2_GhostTop    = 0x2,  /* a single top edge              */
+    CF2_PairBottom  = 0x4,  /* the bottom edge of a stem hint */
+    CF2_PairTop     = 0x8,  /* the top edge of a stem hint    */
+    CF2_Locked      = 0x10, /* this edge has been aligned     */
+                            /* by a blue zone                 */
+    CF2_Synthetic   = 0x20  /* this edge was synthesized      */
+  };
+
+
+  /*
+   * Default value for OS/2 typoAscender/Descender when their difference
+   * is not equal to `unitsPerEm'.  The default is based on -250 and 1100
+   * in `CF2_Blues', assuming 1000 units per em here.
+   *
+   */
+  enum
+  {
+    CF2_ICF_Top    = cf2_intToFixed(  880 ),
+    CF2_ICF_Bottom = cf2_intToFixed( -120 )
+  };
+
+
+  /*
+   * Constant used for hint adjustment and for synthetic em box hint
+   * placement.
+   */
+#define CF2_MIN_COUNTER  cf2_floatToFixed( 0.5 )
+
+
+  /* shared typedef is in cf2glue.h */
+  struct  CF2_HintRec_
+  {
+    CF2_UInt  flags;  /* attributes of the edge            */
+    size_t    index;  /* index in original stem hint array */
+                      /* (if not synthetic)                */
+    CF2_Fixed  csCoord;
+    CF2_Fixed  dsCoord;
+    CF2_Fixed  scale;
+  };
+
+
+  typedef struct  CF2_BlueRec_
+  {
+    CF2_Fixed  csBottomEdge;
+    CF2_Fixed  csTopEdge;
+    CF2_Fixed  csFlatEdge; /* may be from either local or Family zones */
+    CF2_Fixed  dsFlatEdge; /* top edge of bottom zone or bottom edge   */
+                           /* of top zone (rounded)                    */
+    FT_Bool  bottomZone;
+
+  } CF2_BlueRec;
+
+
+  /* max total blue zones is 12 */
+  enum
+  {
+    CF2_MAX_BLUES      = 7,
+    CF2_MAX_OTHERBLUES = 5
+  };
+
+
+  typedef struct  CF2_BluesRec_
+  {
+    CF2_Fixed  scale;
+    CF2_UInt   count;
+    FT_Bool    suppressOvershoot;
+    FT_Bool    doEmBoxHints;
+
+    CF2_Fixed  blueScale;
+    CF2_Fixed  blueShift;
+    CF2_Fixed  blueFuzz;
+
+    CF2_Fixed  boost;
+
+    CF2_HintRec  emBoxTopEdge;
+    CF2_HintRec  emBoxBottomEdge;
+
+    CF2_BlueRec  zone[CF2_MAX_BLUES + CF2_MAX_OTHERBLUES];
+
+  } CF2_BluesRec, *CF2_Blues;
+
+
+  FT_LOCAL( void )
+  cf2_blues_init( CF2_Blues  blues,
+                  CF2_Font   font );
+  FT_LOCAL( FT_Bool )
+  cf2_blues_capture( const CF2_Blues  blues,
+                     CF2_Hint         bottomHintEdge,
+                     CF2_Hint         topHintEdge );
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2BLUES_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2error.c b/reactos/lib/3rdparty/freetype/src/cff/cf2error.c
new file mode 100644 (file)
index 0000000..b5595a3
--- /dev/null
@@ -0,0 +1,52 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2error.c                                                             */
+/*                                                                         */
+/*    Adobe's code for error handling (body).                              */
+/*                                                                         */
+/*  Copyright 2006-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "cf2ft.h"
+#include "cf2error.h"
+
+
+  FT_LOCAL_DEF( void )
+  cf2_setError( FT_Error*  error,
+                FT_Error   value )
+  {
+    if ( error && *error == 0 )
+      *error = value;
+  }
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2error.h b/reactos/lib/3rdparty/freetype/src/cff/cf2error.h
new file mode 100644 (file)
index 0000000..6453ebc
--- /dev/null
@@ -0,0 +1,119 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2error.h                                                             */
+/*                                                                         */
+/*    Adobe's code for error handling (specification).                     */
+/*                                                                         */
+/*  Copyright 2006-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2ERROR_H__
+#define __CF2ERROR_H__
+
+
+#include FT_MODULE_ERRORS_H
+
+#undef __FTERRORS_H__
+
+#undef  FT_ERR_PREFIX
+#define FT_ERR_PREFIX  CF2_Err_
+#define FT_ERR_BASE    FT_Mod_Err_CF2
+
+
+#include FT_ERRORS_H
+#include "cf2ft.h"
+
+
+FT_BEGIN_HEADER
+
+
+  /*
+   * A poor-man error facility.
+   *
+   * This code being written in vanilla C, doesn't have the luxury of a
+   * language-supported exception mechanism such as the one available in
+   * Java.  Instead, we are stuck with using error codes that must be
+   * carefully managed and preserved.  However, it is convenient for us to
+   * model our error mechanism on a Java-like exception mechanism.
+   * When we assign an error code we are thus `throwing' an error.
+   *
+   * The perservation of an error code is done by coding convention.
+   * Upon a function call if the error code is anything other than
+   * `FT_Err_Ok', which is guaranteed to be zero, we
+   * will return without altering that error.  This will allow the
+   * error to propogate and be handled at the appropriate location in
+   * the code.
+   *
+   * This allows a style of code where the error code is initialized
+   * up front and a block of calls are made with the error code only
+   * being checked after the block.  If a new error occurs, the original
+   * error will be preserved and a functional no-op should result in any
+   * subsequent function that has an initial error code not equal to
+   * `FT_Err_Ok'.
+   *
+   * Errors are encoded by calling the `FT_THROW' macro.  For example,
+   *
+   * {
+   *   FT_Error  e;
+   *
+   *
+   *   ...
+   *   e = FT_THROW( Out_Of_Memory );
+   * }
+   *
+   */
+
+
+  /* Set error code to a particular value. */
+  FT_LOCAL( void )
+  cf2_setError( FT_Error*  error,
+                FT_Error   value );
+
+
+  /*
+   * A macro that conditionally sets an error code.
+   *
+   * This macro will first check whether `error' is set;
+   * if not, it will set it to `e'.
+   *
+  */
+#define CF2_SET_ERROR( error, e )              \
+          cf2_setError( error, FT_THROW( e ) )
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2ERROR_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2fixed.h b/reactos/lib/3rdparty/freetype/src/cff/cf2fixed.h
new file mode 100644 (file)
index 0000000..ed1452a
--- /dev/null
@@ -0,0 +1,95 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2fixed.h                                                             */
+/*                                                                         */
+/*    Adobe's code for Fixed Point Mathematics (specification only).       */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2FIXED_H__
+#define __CF2FIXED_H__
+
+
+FT_BEGIN_HEADER
+
+
+  /* rasterizer integer and fixed point arithmetic must be 32-bit */
+
+#define   CF2_Fixed  CF2_F16Dot16
+  typedef FT_Int32   CF2_Frac;   /* 2.30 fixed point */
+
+
+#define CF2_FIXED_MAX      ( (CF2_Fixed)0x7FFFFFFFL )
+#define CF2_FIXED_MIN      ( (CF2_Fixed)0x80000000L )
+#define CF2_FIXED_ONE      0x10000L
+#define CF2_FIXED_EPSILON  0x0001
+
+  /* in C 89, left and right shift of negative numbers is  */
+  /* implementation specific behaviour in the general case */
+
+#define cf2_intToFixed( i )                                    \
+          ( (CF2_Fixed)( (FT_UInt32)(i) << 16 ) )
+#define cf2_fixedToInt( x )                                    \
+          ( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) )
+#define cf2_fixedRound( x )                                    \
+          ( (CF2_Fixed)( ( (x) + 0x8000 ) & 0xFFFF0000L ) )
+#define cf2_floatToFixed( f )                                  \
+          ( (CF2_Fixed)( (f) * 65536.0 + 0.5 ) )
+#define cf2_fixedAbs( x )                                      \
+          ( (x) < 0 ? -(x) : (x) )
+#define cf2_fixedFloor( x )                                    \
+          ( (CF2_Fixed)( (x) & 0xFFFF0000L ) )
+#define cf2_fixedFraction( x )                                 \
+          ( (x) - cf2_fixedFloor( x ) )
+#define cf2_fracToFixed( x )                                   \
+          ( (x) < 0 ? -( ( -(x) + 0x2000 ) >> 14 )             \
+                    :  ( (  (x) + 0x2000 ) >> 14 ) )
+
+
+  /* signed numeric types */
+  typedef enum  CF2_NumberType_
+  {
+    CF2_NumberFixed,    /* 16.16 */
+    CF2_NumberFrac,     /*  2.30 */
+    CF2_NumberInt       /* 32.0  */
+
+  } CF2_NumberType;
+
+
+FT_END_HEADER
+
+
+#endif /*  __CF2FIXED_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2font.c b/reactos/lib/3rdparty/freetype/src/cff/cf2font.c
new file mode 100644 (file)
index 0000000..479d912
--- /dev/null
@@ -0,0 +1,403 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2font.c                                                              */
+/*                                                                         */
+/*    Adobe's code for font instances (body).                              */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "cf2ft.h"
+
+#include "cf2glue.h"
+#include "cf2font.h"
+#include "cf2error.h"
+#include "cf2intrp.h"
+
+
+  /* Compute a stem darkening amount in character space. */
+  static void
+  cf2_computeDarkening( CF2_Fixed   emRatio,
+                        CF2_Fixed   ppem,
+                        CF2_Fixed   stemWidth,
+                        CF2_Fixed*  darkenAmount,
+                        CF2_Fixed   boldenAmount,
+                        FT_Bool     stemDarkened )
+  {
+    /* Internal calculations are done in units per thousand for */
+    /* convenience.                                             */
+    CF2_Fixed  stemWidthPer1000, scaledStem;
+
+
+    *darkenAmount = 0;
+
+    if ( boldenAmount == 0 && !stemDarkened )
+      return;
+
+    /* protect against range problems and divide by zero */
+    if ( emRatio < cf2_floatToFixed( .01 ) )
+      return;
+
+    if ( stemDarkened )
+    {
+      /* convert from true character space to 1000 unit character space; */
+      /* add synthetic emboldening effect                                */
+
+      /* we have to assure that the computation of `scaledStem' */
+      /* and `stemWidthPer1000' don't overflow                  */
+
+      stemWidthPer1000 = FT_MulFix( stemWidth + boldenAmount, emRatio );
+
+      if ( emRatio > CF2_FIXED_ONE                          &&
+           stemWidthPer1000 <= ( stemWidth + boldenAmount ) )
+      {
+        stemWidthPer1000 = 0;                      /* to pacify compiler */
+        scaledStem       = cf2_intToFixed( 2333 );
+      }
+      else
+      {
+        scaledStem = FT_MulFix( stemWidthPer1000, ppem );
+
+        if ( ppem > CF2_FIXED_ONE           &&
+             scaledStem <= stemWidthPer1000 )
+          scaledStem = cf2_intToFixed( 2333 );
+      }
+
+      /*
+       * Total darkening amount is computed in 1000 unit character space
+       * using the modified 5 part curve as Avalon rasterizer.
+       * The darkening amount is smaller for thicker stems.
+       * It becomes zero when the stem is thicker than 2.333 pixels.
+       *
+       * In Avalon rasterizer,
+       *
+       *   darkenAmount = 0.5 pixels   if scaledStem <= 0.5 pixels,
+       *   darkenAmount = 0.333 pixels if 1 <= scaledStem <= 1.667 pixels,
+       *   darkenAmount = 0 pixel      if scaledStem >= 2.333 pixels,
+       *
+       * and piecewise linear in-between.
+       *
+       */
+      if ( scaledStem < cf2_intToFixed( 500 ) )
+        *darkenAmount = FT_DivFix( cf2_intToFixed( 400 ), ppem );
+
+      else if ( scaledStem < cf2_intToFixed( 1000 ) )
+        *darkenAmount = FT_DivFix( cf2_intToFixed( 525 ), ppem ) -
+                          FT_MulFix( stemWidthPer1000,
+                                     cf2_floatToFixed( .25 ) );
+
+      else if ( scaledStem < cf2_intToFixed( 1667 ) )
+        *darkenAmount = FT_DivFix( cf2_intToFixed( 275 ), ppem );
+
+      else if ( scaledStem < cf2_intToFixed( 2333 ) )
+        *darkenAmount = FT_DivFix( cf2_intToFixed( 963 ), ppem ) -
+                          FT_MulFix( stemWidthPer1000,
+                                     cf2_floatToFixed( .413 ) );
+
+      /* use half the amount on each side and convert back to true */
+      /* character space                                           */
+      *darkenAmount = FT_DivFix( *darkenAmount, 2 * emRatio );
+    }
+
+    /* add synthetic emboldening effect in character space */
+    *darkenAmount += boldenAmount / 2;
+  }
+
+
+  /* set up values for the current FontDict and matrix */
+
+  /* caller's transform is adjusted for subpixel positioning */
+  static void
+  cf2_font_setup( CF2_Font           font,
+                  const CF2_Matrix*  transform )
+  {
+    /* pointer to parsed font object */
+    CFF_Decoder*  decoder = font->decoder;
+
+    FT_Bool  needExtraSetup;
+
+    /* character space units */
+    CF2_Fixed  boldenX = font->syntheticEmboldeningAmountX;
+    CF2_Fixed  boldenY = font->syntheticEmboldeningAmountY;
+
+    CF2_Fixed  ppem;
+
+
+    /* clear previous error */
+    font->error = FT_Err_Ok;
+
+    /* if a CID fontDict has changed, we need to recompute some cached */
+    /* data                                                            */
+    needExtraSetup =
+      (FT_Bool)( font->lastSubfont != cf2_getSubfont( decoder ) );
+
+    /* if ppem has changed, we need to recompute some cached data         */
+    /* note: because of CID font matrix concatenation, ppem and transform */
+    /*       do not necessarily track.                                    */
+    ppem = cf2_getPpemY( decoder );
+    if ( font->ppem != ppem )
+    {
+      font->ppem     = ppem;
+      needExtraSetup = TRUE;
+    }
+
+    /* copy hinted flag on each call */
+    font->hinted = (FT_Bool)( font->renderingFlags & CF2_FlagsHinted );
+
+    /* determine if transform has changed;       */
+    /* include Fontmatrix but ignore translation */
+    if ( ft_memcmp( transform,
+                    &font->currentTransform,
+                    4 * sizeof ( CF2_Fixed ) ) != 0 )
+    {
+      /* save `key' information for `cache of one' matrix data; */
+      /* save client transform, without the translation         */
+      font->currentTransform    = *transform;
+      font->currentTransform.tx =
+      font->currentTransform.ty = cf2_intToFixed( 0 );
+
+      /* TODO: FreeType transform is simple scalar; for now, use identity */
+      /*       for outer                                                  */
+      font->innerTransform   = *transform;
+      font->outerTransform.a =
+      font->outerTransform.d = cf2_intToFixed( 1 );
+      font->outerTransform.b =
+      font->outerTransform.c = cf2_intToFixed( 0 );
+
+      needExtraSetup = TRUE;
+    }
+
+    /*
+     * font->darkened is set to true if there is a stem darkening request or
+     * the font is synthetic emboldened.
+     * font->darkened controls whether to adjust blue zones, winding order,
+     * and hinting.
+     *
+     */
+    if ( font->stemDarkened != ( font->renderingFlags & CF2_FlagsDarkened ) )
+    {
+      font->stemDarkened =
+        (FT_Bool)( font->renderingFlags & CF2_FlagsDarkened );
+
+      /* blue zones depend on darkened flag */
+      needExtraSetup = TRUE;
+    }
+
+    /* recompute variables that are dependent on transform or FontDict or */
+    /* darken flag                                                        */
+    if ( needExtraSetup )
+    {
+      /* StdVW is found in the private dictionary;                       */
+      /* recompute darkening amounts whenever private dictionary or      */
+      /* transform change                                                */
+      /* Note: a rendering flag turns darkening on or off, so we want to */
+      /*       store the `on' amounts;                                   */
+      /*       darkening amount is computed in character space           */
+      /* TODO: testing size-dependent darkening here;                    */
+      /*       what to do for rotations?                                 */
+
+      CF2_Fixed  emRatio;
+      CF2_Fixed  stdHW;
+      CF2_Int    unitsPerEm = font->unitsPerEm;
+
+
+      if ( unitsPerEm == 0 )
+        unitsPerEm = 1000;
+
+      ppem = FT_MAX( cf2_intToFixed( 4 ),
+                     font->ppem ); /* use minimum ppem of 4 */
+
+#if 0
+      /* since vstem is measured in the x-direction, we use the `a' member */
+      /* of the fontMatrix                                                 */
+      emRatio = cf2_fixedFracMul( cf2_intToFixed( 1000 ), fontMatrix->a );
+#endif
+
+      /* Freetype does not preserve the fontMatrix when parsing; use */
+      /* unitsPerEm instead.                                         */
+      /* TODO: check precision of this                               */
+      emRatio     = cf2_intToFixed( 1000 ) / unitsPerEm;
+      font->stdVW = cf2_getStdVW( decoder );
+
+      if ( font->stdVW <= 0 )
+        font->stdVW = FT_DivFix( cf2_intToFixed( 75 ), emRatio );
+
+      if ( boldenX > 0 )
+      {
+        /* Ensure that boldenX is at least 1 pixel for synthetic bold font */
+        /* (similar to what Avalon does)                                   */
+        boldenX = FT_MAX( boldenX,
+                          FT_DivFix( cf2_intToFixed( unitsPerEm ), ppem ) );
+
+        /* Synthetic emboldening adds at least 1 pixel to darkenX, while */
+        /* stem darkening adds at most half pixel.  Since the purpose of */
+        /* stem darkening (readability at small sizes) is met with       */
+        /* synthetic emboldening, no need to add stem darkening for a    */
+        /* synthetic bold font.                                          */
+        cf2_computeDarkening( emRatio,
+                              ppem,
+                              font->stdVW,
+                              &font->darkenX,
+                              boldenX,
+                              FALSE );
+      }
+      else
+        cf2_computeDarkening( emRatio,
+                              ppem,
+                              font->stdVW,
+                              &font->darkenX,
+                              0,
+                              font->stemDarkened );
+
+#if 0
+      /* since hstem is measured in the y-direction, we use the `d' member */
+      /* of the fontMatrix                                                 */
+      /* TODO: use the same units per em as above; check this              */
+      emRatio = cf2_fixedFracMul( cf2_intToFixed( 1000 ), fontMatrix->d );
+#endif
+
+      /* set the default stem width, because it must be the same for all */
+      /* family members;                                                 */
+      /* choose a constant for StdHW that depends on font contrast       */
+      stdHW = cf2_getStdHW( decoder );
+
+      if ( stdHW > 0 && font->stdVW > 2 * stdHW )
+        font->stdHW = FT_DivFix( cf2_intToFixed( 75 ), emRatio );
+      else
+      {
+        /* low contrast font gets less hstem darkening */
+        font->stdHW = FT_DivFix( cf2_intToFixed( 110 ), emRatio );
+      }
+
+      cf2_computeDarkening( emRatio,
+                            ppem,
+                            font->stdHW,
+                            &font->darkenY,
+                            boldenY,
+                            font->stemDarkened );
+
+      if ( font->darkenX != 0 || font->darkenY != 0 )
+        font->darkened = TRUE;
+      else
+        font->darkened = FALSE;
+
+      font->reverseWinding = FALSE; /* initial expectation is CCW */
+
+      /* compute blue zones for this instance */
+      cf2_blues_init( &font->blues, font );
+    }
+  }
+
+
+  /* equivalent to AdobeGetOutline */
+  FT_LOCAL_DEF( FT_Error )
+  cf2_getGlyphOutline( CF2_Font           font,
+                       CF2_Buffer         charstring,
+                       const CF2_Matrix*  transform,
+                       CF2_F16Dot16*      glyphWidth )
+  {
+    FT_Error  lastError = FT_Err_Ok;
+
+    FT_Vector  translation;
+
+#if 0
+    FT_Vector  advancePoint;
+#endif
+
+    CF2_Fixed  advWidth = 0;
+    FT_Bool    needWinding;
+
+
+    /* Note: use both integer and fraction for outlines.  This allows bbox */
+    /*       to come out directly.                                         */
+
+    translation.x = transform->tx;
+    translation.y = transform->ty;
+
+    /* set up values based on transform */
+    cf2_font_setup( font, transform );
+    if ( font->error )
+      goto exit;                      /* setup encountered an error */
+
+    /* reset darken direction */
+    font->reverseWinding = FALSE;
+
+    /* winding order only affects darkening */
+    needWinding = font->darkened;
+
+    while ( 1 )
+    {
+      /* reset output buffer */
+      cf2_outline_reset( &font->outline );
+
+      /* build the outline, passing the full translation */
+      cf2_interpT2CharString( font,
+                              charstring,
+                              (CF2_OutlineCallbacks)&font->outline,
+                              &translation,
+                              FALSE,
+                              0,
+                              0,
+                              &advWidth );
+
+      if ( font->error )
+        goto exit;
+
+      if ( !needWinding )
+        break;
+
+      /* check winding order */
+      if ( font->outline.root.windingMomentum >= 0 ) /* CFF is CCW */
+        break;
+
+      /* invert darkening and render again                            */
+      /* TODO: this should be a parameter to getOutline-computeOffset */
+      font->reverseWinding = TRUE;
+
+      needWinding = FALSE;    /* exit after next iteration */
+    }
+
+    /* finish storing client outline */
+    cf2_outline_close( &font->outline );
+
+  exit:
+    /* FreeType just wants the advance width; there is no translation */
+    *glyphWidth = advWidth;
+
+    /* free resources and collect errors from objects we've used */
+    cf2_setError( &font->error, lastError );
+
+    return font->error;
+  }
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2font.h b/reactos/lib/3rdparty/freetype/src/cff/cf2font.h
new file mode 100644 (file)
index 0000000..f9dd1bb
--- /dev/null
@@ -0,0 +1,114 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2font.h                                                              */
+/*                                                                         */
+/*    Adobe's code for font instances (specification).                     */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2FONT_H__
+#define __CF2FONT_H__
+
+
+#include "cf2ft.h"
+#include "cf2blues.h"
+
+
+FT_BEGIN_HEADER
+
+
+#define CF2_OPERAND_STACK_SIZE  48
+#define CF2_MAX_SUBR            10 /* maximum subroutine nesting */
+
+
+  /* typedef is in `cf2glue.h' */
+  struct  CF2_FontRec_
+  {
+    FT_Memory  memory;
+    FT_Error   error;     /* shared error for this instance */
+
+    CF2_RenderingFlags  renderingFlags;
+
+    /* variables that depend on Transform:  */
+    /* the following have zero translation; */
+    /* inner * outer = font * original      */
+
+    CF2_Matrix  currentTransform;  /* original client matrix           */
+    CF2_Matrix  innerTransform;    /* for hinting; erect, scaled       */
+    CF2_Matrix  outerTransform;    /* post hinting; includes rotations */
+    CF2_Fixed   ppem;              /* transform-dependent              */
+
+    CF2_Int  unitsPerEm;
+
+    CF2_Fixed  syntheticEmboldeningAmountX;   /* character space units */
+    CF2_Fixed  syntheticEmboldeningAmountY;   /* character space units */
+
+    /* FreeType related members */
+    CF2_OutlineRec  outline;       /* freetype glyph outline functions */
+    CFF_Decoder*    decoder;
+    CFF_SubFont     lastSubfont;              /* FreeType parsed data; */
+                                              /* top font or subfont   */
+
+    /* these flags can vary from one call to the next */
+    FT_Bool  hinted;
+    FT_Bool  darkened;       /* true if stemDarkened or synthetic bold */
+                             /* i.e. darkenX != 0 || darkenY != 0      */
+    FT_Bool  stemDarkened;
+
+    /* variables that depend on both FontDict and Transform */
+    CF2_Fixed  stdVW;     /* in character space; depends on dict entry */
+    CF2_Fixed  stdHW;     /* in character space; depends on dict entry */
+    CF2_Fixed  darkenX;                    /* character space units    */
+    CF2_Fixed  darkenY;                    /* depends on transform     */
+                                           /* and private dict (StdVW) */
+    FT_Bool  reverseWinding;               /* darken assuming          */
+                                           /* counterclockwise winding */
+
+    CF2_BluesRec  blues;                         /* computed zone data */
+  };
+
+
+  FT_LOCAL( FT_Error )
+  cf2_getGlyphOutline( CF2_Font           font,
+                       CF2_Buffer         charstring,
+                       const CF2_Matrix*  transform,
+                       CF2_F16Dot16*      glyphWidth );
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2FONT_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2ft.c b/reactos/lib/3rdparty/freetype/src/cff/cf2ft.c
new file mode 100644 (file)
index 0000000..c09a024
--- /dev/null
@@ -0,0 +1,639 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2ft.c                                                                */
+/*                                                                         */
+/*    FreeType Glue Component to Adobe's Interpreter (body).               */
+/*                                                                         */
+/*  Copyright 2013 Adobe Systems Incorporated.                             */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "cf2ft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "cf2font.h"
+#include "cf2error.h"
+
+
+#define CF2_MAX_SIZE  cf2_intToFixed( 2000 )    /* max ppem */
+
+
+  /*
+   * This check should avoid most internal overflow cases.  Clients should
+   * generally respond to `Glyph_Too_Big' by getting a glyph outline
+   * at EM size, scaling it and filling it as a graphics operation.
+   *
+   */
+  static FT_Error
+  cf2_checkTransform( const CF2_Matrix*  transform,
+                      CF2_Int            unitsPerEm )
+  {
+    CF2_Fixed  maxScale;
+
+
+    FT_ASSERT( unitsPerEm > 0 );
+
+    FT_ASSERT( transform->a > 0 && transform->d > 0 );
+    FT_ASSERT( transform->b == 0 && transform->c == 0 );
+    FT_ASSERT( transform->tx == 0 && transform->ty == 0 );
+
+    if ( unitsPerEm > 0x7FFF )
+      return FT_THROW( Glyph_Too_Big );
+
+    maxScale = FT_DivFix( CF2_MAX_SIZE, cf2_intToFixed( unitsPerEm ) );
+
+    if ( transform->a > maxScale || transform->d > maxScale )
+      return FT_THROW( Glyph_Too_Big );
+
+    return FT_Err_Ok;
+  }
+
+
+  static void
+  cf2_setGlyphWidth( CF2_Outline  outline,
+                     CF2_Fixed    width )
+  {
+    CFF_Decoder*  decoder = outline->decoder;
+
+
+    FT_ASSERT( decoder );
+
+    decoder->glyph_width = cf2_fixedToInt( width );
+  }
+
+
+  /* Clean up font instance. */
+  static void
+  cf2_free_instance( void*  ptr )
+  {
+    CF2_Font  font = (CF2_Font)ptr;
+
+
+    if ( font )
+    {
+      FT_Memory  memory = font->memory;
+
+
+      (void)memory;
+    }
+  }
+
+
+  /********************************************/
+  /*                                          */
+  /* functions for handling client outline;   */
+  /* FreeType uses coordinates in 26.6 format */
+  /*                                          */
+  /********************************************/
+
+  static void
+  cf2_builder_moveTo( CF2_OutlineCallbacks      callbacks,
+                      const CF2_CallbackParams  params )
+  {
+    /* downcast the object pointer */
+    CF2_Outline   outline = (CF2_Outline)callbacks;
+    CFF_Builder*  builder;
+
+    (void)params;        /* only used in debug mode */
+
+
+    FT_ASSERT( outline && outline->decoder );
+    FT_ASSERT( params->op == CF2_PathOpMoveTo );
+
+    builder = &outline->decoder->builder;
+
+    /* note: two successive moves simply close the contour twice */
+    cff_builder_close_contour( builder );
+    builder->path_begun = 0;
+  }
+
+
+  static void
+  cf2_builder_lineTo( CF2_OutlineCallbacks      callbacks,
+                      const CF2_CallbackParams  params )
+  {
+    /* downcast the object pointer */
+    CF2_Outline   outline = (CF2_Outline)callbacks;
+    CFF_Builder*  builder;
+
+
+    FT_ASSERT( outline && outline->decoder );
+    FT_ASSERT( params->op == CF2_PathOpLineTo );
+
+    builder = &outline->decoder->builder;
+
+    if ( !builder->path_begun )
+    {
+      /* record the move before the line; also check points and set */
+      /* `path_begun'                                               */
+      cff_builder_start_point( builder,
+                               params->pt0.x,
+                               params->pt0.y );
+    }
+
+    /* `cff_builder_add_point1' includes a check_points call for one point */
+    cff_builder_add_point1( builder,
+                            params->pt1.x,
+                            params->pt1.y );
+  }
+
+
+  static void
+  cf2_builder_cubeTo( CF2_OutlineCallbacks      callbacks,
+                      const CF2_CallbackParams  params )
+  {
+    /* downcast the object pointer */
+    CF2_Outline   outline = (CF2_Outline)callbacks;
+    CFF_Builder*  builder;
+
+
+    FT_ASSERT( outline && outline->decoder );
+    FT_ASSERT( params->op == CF2_PathOpCubeTo );
+
+    builder = &outline->decoder->builder;
+
+    if ( !builder->path_begun )
+    {
+      /* record the move before the line; also check points and set */
+      /* `path_begun'                                               */
+      cff_builder_start_point( builder,
+                               params->pt0.x,
+                               params->pt0.y );
+    }
+
+    /* prepare room for 3 points: 2 off-curve, 1 on-curve */
+    cff_check_points( builder, 3 );
+
+    cff_builder_add_point( builder,
+                           params->pt1.x,
+                           params->pt1.y, 0 );
+    cff_builder_add_point( builder,
+                           params->pt2.x,
+                           params->pt2.y, 0 );
+    cff_builder_add_point( builder,
+                           params->pt3.x,
+                           params->pt3.y, 1 );
+  }
+
+
+  static void
+  cf2_outline_init( CF2_Outline  outline,
+                    FT_Memory    memory,
+                    FT_Error*    error )
+  {
+    FT_MEM_ZERO( outline, sizeof ( CF2_OutlineRec ) );
+
+    outline->root.memory = memory;
+    outline->root.error  = error;
+
+    outline->root.moveTo = cf2_builder_moveTo;
+    outline->root.lineTo = cf2_builder_lineTo;
+    outline->root.cubeTo = cf2_builder_cubeTo;
+  }
+
+
+  /* get scaling and hint flag from GlyphSlot */
+  static void
+  cf2_getScaleAndHintFlag( CFF_Decoder*  decoder,
+                           CF2_Fixed*    x_scale,
+                           CF2_Fixed*    y_scale,
+                           FT_Bool*      hinted,
+                           FT_Bool*      scaled )
+  {
+    FT_ASSERT( decoder && decoder->builder.glyph );
+
+    /* note: FreeType scale includes a factor of 64 */
+    *hinted = decoder->builder.glyph->hint;
+    *scaled = decoder->builder.glyph->scaled;
+
+    if ( *hinted )
+    {
+      *x_scale = FT_DivFix( decoder->builder.glyph->x_scale,
+                            cf2_intToFixed( 64 ) );
+      *y_scale = FT_DivFix( decoder->builder.glyph->y_scale,
+                            cf2_intToFixed( 64 ) );
+    }
+    else
+    {
+      /* for unhinted outlines, `cff_slot_load' does the scaling, */
+      /* thus render at `unity' scale                             */
+
+      *x_scale = 0x0400;   /* 1/64 as 16.16 */
+      *y_scale = 0x0400;
+    }
+  }
+
+
+  /* get units per em from `FT_Face' */
+  /* TODO: should handle font matrix concatenation? */
+  static FT_UShort
+  cf2_getUnitsPerEm( CFF_Decoder*  decoder )
+  {
+    FT_ASSERT( decoder && decoder->builder.face );
+    FT_ASSERT( decoder->builder.face->root.units_per_EM );
+
+    return decoder->builder.face->root.units_per_EM;
+  }
+
+
+  /* Main entry point: Render one glyph. */
+  FT_LOCAL_DEF( FT_Error )
+  cf2_decoder_parse_charstrings( CFF_Decoder*  decoder,
+                                 FT_Byte*      charstring_base,
+                                 FT_ULong      charstring_len )
+  {
+    FT_Memory  memory;
+    FT_Error   error = FT_Err_Ok;
+    CF2_Font   font;
+
+
+    FT_ASSERT( decoder && decoder->cff );
+
+    memory = decoder->builder.memory;
+
+    /* CF2 data is saved here across glyphs */
+    font = (CF2_Font)decoder->cff->cf2_instance.data;
+
+    /* on first glyph, allocate instance structure */
+    if ( decoder->cff->cf2_instance.data == NULL )
+    {
+      decoder->cff->cf2_instance.finalizer =
+        (FT_Generic_Finalizer)cf2_free_instance;
+
+      if ( FT_ALLOC( decoder->cff->cf2_instance.data,
+                     sizeof ( CF2_FontRec ) ) )
+        return FT_THROW( Out_Of_Memory );
+
+      font = (CF2_Font)decoder->cff->cf2_instance.data;
+
+      font->memory = memory;
+
+      /* initialize a client outline, to be shared by each glyph rendered */
+      cf2_outline_init( &font->outline, font->memory, &font->error );
+    }
+
+    /* save decoder; it is a stack variable and will be different on each */
+    /* call                                                               */
+    font->decoder         = decoder;
+    font->outline.decoder = decoder;
+
+    {
+      /* build parameters for Adobe engine */
+
+      CFF_Builder*  builder = &decoder->builder;
+      CFF_Driver    driver  = (CFF_Driver)FT_FACE_DRIVER( builder->face );
+
+      /* local error */
+      FT_Error       error2 = FT_Err_Ok;
+      CF2_BufferRec  buf;
+      CF2_Matrix     transform;
+      CF2_F16Dot16   glyphWidth;
+
+      FT_Bool  hinted;
+      FT_Bool  scaled;
+
+
+      /* FreeType has already looked up the GID; convert to         */
+      /* `RegionBuffer', assuming that the input has been validated */
+      FT_ASSERT( charstring_base + charstring_len >= charstring_base );
+
+      FT_ZERO( &buf );
+      buf.start =
+      buf.ptr   = charstring_base;
+      buf.end   = charstring_base + charstring_len;
+
+      FT_ZERO( &transform );
+
+      cf2_getScaleAndHintFlag( decoder,
+                               &transform.a,
+                               &transform.d,
+                               &hinted,
+                               &scaled );
+
+      font->renderingFlags = 0;
+      if ( hinted )
+        font->renderingFlags |= CF2_FlagsHinted;
+      if ( scaled && !driver->no_stem_darkening )
+        font->renderingFlags |= CF2_FlagsDarkened;
+
+      /* now get an outline for this glyph;      */
+      /* also get units per em to validate scale */
+      font->unitsPerEm = (CF2_Int)cf2_getUnitsPerEm( decoder );
+
+      error2 = cf2_checkTransform( &transform, font->unitsPerEm );
+      if ( error2 )
+        return error2;
+
+      error2 = cf2_getGlyphOutline( font, &buf, &transform, &glyphWidth );
+      if ( error2 )
+        return FT_ERR( Invalid_File_Format );
+
+      cf2_setGlyphWidth( &font->outline, glyphWidth );
+
+      return FT_Err_Ok;
+    }
+  }
+
+
+  /* get pointer to current FreeType subfont (based on current glyphID) */
+  FT_LOCAL_DEF( CFF_SubFont )
+  cf2_getSubfont( CFF_Decoder*  decoder )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    return decoder->current_subfont;
+  }
+
+
+  /* get `y_ppem' from `CFF_Size' */
+  FT_LOCAL_DEF( CF2_Fixed )
+  cf2_getPpemY( CFF_Decoder*  decoder )
+  {
+    FT_ASSERT( decoder                          &&
+               decoder->builder.face            &&
+               decoder->builder.face->root.size );
+    FT_ASSERT( decoder->builder.face->root.size->metrics.y_ppem );
+
+    return cf2_intToFixed(
+             decoder->builder.face->root.size->metrics.y_ppem );
+  }
+
+
+  /* get standard stem widths for the current subfont; */
+  /* FreeType stores these as integer font units       */
+  /* (note: variable names seem swapped)               */
+  FT_LOCAL_DEF( CF2_Fixed )
+  cf2_getStdVW( CFF_Decoder*  decoder )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    return cf2_intToFixed(
+             decoder->current_subfont->private_dict.standard_height );
+  }
+
+
+  FT_LOCAL_DEF( CF2_Fixed )
+  cf2_getStdHW( CFF_Decoder*  decoder )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    return cf2_intToFixed(
+             decoder->current_subfont->private_dict.standard_width );
+  }
+
+
+  /* note: FreeType stores 1000 times the actual value for `BlueScale' */
+  FT_LOCAL_DEF( void )
+  cf2_getBlueMetrics( CFF_Decoder*  decoder,
+                      CF2_Fixed*    blueScale,
+                      CF2_Fixed*    blueShift,
+                      CF2_Fixed*    blueFuzz )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    *blueScale = FT_DivFix(
+                   decoder->current_subfont->private_dict.blue_scale,
+                   cf2_intToFixed( 1000 ) );
+    *blueShift = cf2_intToFixed(
+                   decoder->current_subfont->private_dict.blue_shift );
+    *blueFuzz  = cf2_intToFixed(
+                   decoder->current_subfont->private_dict.blue_fuzz );
+  }
+
+
+  /* get blue values counts and arrays; the FreeType parser has validated */
+  /* the counts and verified that each is an even number                  */
+  FT_LOCAL_DEF( void )
+  cf2_getBlueValues( CFF_Decoder*  decoder,
+                     size_t*       count,
+                     FT_Pos*      *data )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    *count = decoder->current_subfont->private_dict.num_blue_values;
+    *data  = (FT_Pos*)
+               &decoder->current_subfont->private_dict.blue_values;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_getOtherBlues( CFF_Decoder*  decoder,
+                     size_t*       count,
+                     FT_Pos*      *data )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    *count = decoder->current_subfont->private_dict.num_other_blues;
+    *data  = (FT_Pos*)
+               &decoder->current_subfont->private_dict.other_blues;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_getFamilyBlues( CFF_Decoder*  decoder,
+                      size_t*       count,
+                      FT_Pos*      *data )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    *count = decoder->current_subfont->private_dict.num_family_blues;
+    *data  = (FT_Pos*)
+               &decoder->current_subfont->private_dict.family_blues;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_getFamilyOtherBlues( CFF_Decoder*  decoder,
+                           size_t*       count,
+                           FT_Pos*      *data )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    *count = decoder->current_subfont->private_dict.num_family_other_blues;
+    *data  = (FT_Pos*)
+               &decoder->current_subfont->private_dict.family_other_blues;
+  }
+
+
+  FT_LOCAL_DEF( CF2_Int )
+  cf2_getLanguageGroup( CFF_Decoder*  decoder )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    return decoder->current_subfont->private_dict.language_group;
+  }
+
+
+  /* convert unbiased subroutine index to `CF2_Buffer' and */
+  /* return 0 on success                                   */
+  FT_LOCAL_DEF( CF2_Int )
+  cf2_initGlobalRegionBuffer( CFF_Decoder*  decoder,
+                              CF2_UInt      idx,
+                              CF2_Buffer    buf )
+  {
+    FT_ASSERT( decoder && decoder->globals );
+
+    FT_ZERO( buf );
+
+    idx += decoder->globals_bias;
+    if ( idx >= decoder->num_globals )
+      return TRUE;     /* error */
+
+    buf->start =
+    buf->ptr   = decoder->globals[idx];
+    buf->end   = decoder->globals[idx + 1];
+
+    return FALSE;      /* success */
+  }
+
+
+  /* convert AdobeStandardEncoding code to CF2_Buffer; */
+  /* used for seac component                           */
+  FT_LOCAL_DEF( FT_Error )
+  cf2_getSeacComponent( CFF_Decoder*  decoder,
+                        CF2_UInt      code,
+                        CF2_Buffer    buf )
+  {
+    CF2_Int   gid;
+    FT_Byte*  charstring;
+    FT_ULong  len;
+    FT_Error  error;
+
+
+    FT_ASSERT( decoder );
+
+    FT_ZERO( buf );
+
+    gid = cff_lookup_glyph_by_stdcharcode( decoder->cff, code );
+    if ( gid < 0 )
+      return FT_THROW( Invalid_Glyph_Format );
+
+    error = cff_get_glyph_data( decoder->builder.face,
+                                gid,
+                                &charstring,
+                                &len );
+    /* TODO: for now, just pass the FreeType error through */
+    if ( error )
+      return error;
+
+    /* assume input has been validated */
+    FT_ASSERT( charstring + len >= charstring );
+
+    buf->start = charstring;
+    buf->end   = charstring + len;
+    buf->ptr   = buf->start;
+
+    return FT_Err_Ok;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_freeSeacComponent( CFF_Decoder*  decoder,
+                         CF2_Buffer    buf )
+  {
+    FT_ASSERT( decoder );
+
+    cff_free_glyph_data( decoder->builder.face,
+                         (FT_Byte**)&buf->start,
+                         (FT_ULong)( buf->end - buf->start ) );
+  }
+
+
+  FT_LOCAL_DEF( CF2_Int )
+  cf2_initLocalRegionBuffer( CFF_Decoder*  decoder,
+                             CF2_UInt      idx,
+                             CF2_Buffer    buf )
+  {
+    FT_ASSERT( decoder && decoder->locals );
+
+    FT_ZERO( buf );
+
+    idx += decoder->locals_bias;
+    if ( idx >= decoder->num_locals )
+      return TRUE;     /* error */
+
+    buf->start =
+    buf->ptr   = decoder->locals[idx];
+    buf->end   = decoder->locals[idx + 1];
+
+    return FALSE;      /* success */
+  }
+
+
+  FT_LOCAL_DEF( CF2_Fixed )
+  cf2_getDefaultWidthX( CFF_Decoder*  decoder )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    return cf2_intToFixed(
+             decoder->current_subfont->private_dict.default_width );
+  }
+
+
+  FT_LOCAL_DEF( CF2_Fixed )
+  cf2_getNominalWidthX( CFF_Decoder*  decoder )
+  {
+    FT_ASSERT( decoder && decoder->current_subfont );
+
+    return cf2_intToFixed(
+             decoder->current_subfont->private_dict.nominal_width );
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_outline_reset( CF2_Outline  outline )
+  {
+    CFF_Decoder*  decoder = outline->decoder;
+
+
+    FT_ASSERT( decoder );
+
+    outline->root.windingMomentum = 0;
+
+    FT_GlyphLoader_Rewind( decoder->builder.loader );
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_outline_close( CF2_Outline  outline )
+  {
+    CFF_Decoder*  decoder = outline->decoder;
+
+
+    FT_ASSERT( decoder );
+
+    cff_builder_close_contour( &decoder->builder );
+
+    FT_GlyphLoader_Add( decoder->builder.loader );
+  }
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2ft.h b/reactos/lib/3rdparty/freetype/src/cff/cf2ft.h
new file mode 100644 (file)
index 0000000..731da3c
--- /dev/null
@@ -0,0 +1,147 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2ft.h                                                                */
+/*                                                                         */
+/*    FreeType Glue Component to Adobe's Interpreter (specification).      */
+/*                                                                         */
+/*  Copyright 2013 Adobe Systems Incorporated.                             */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2FT_H__
+#define __CF2FT_H__
+
+
+#include "cf2types.h"
+
+
+  /* TODO: disable asserts for now */
+#define CF2_NDEBUG
+
+
+#include FT_SYSTEM_H
+
+#include "cf2glue.h"
+#include "cffgload.h"    /* for CFF_Decoder */
+
+
+FT_BEGIN_HEADER
+
+
+  FT_LOCAL( FT_Error )
+  cf2_decoder_parse_charstrings( CFF_Decoder*  decoder,
+                                 FT_Byte*      charstring_base,
+                                 FT_ULong      charstring_len );
+
+  FT_LOCAL( CFF_SubFont )
+  cf2_getSubfont( CFF_Decoder*  decoder );
+
+
+  FT_LOCAL( CF2_Fixed )
+  cf2_getPpemY( CFF_Decoder*  decoder );
+  FT_LOCAL( CF2_Fixed )
+  cf2_getStdVW( CFF_Decoder*  decoder );
+  FT_LOCAL( CF2_Fixed )
+  cf2_getStdHW( CFF_Decoder*  decoder );
+
+  FT_LOCAL( void )
+  cf2_getBlueMetrics( CFF_Decoder*  decoder,
+                      CF2_Fixed*    blueScale,
+                      CF2_Fixed*    blueShift,
+                      CF2_Fixed*    blueFuzz );
+  FT_LOCAL( void )
+  cf2_getBlueValues( CFF_Decoder*  decoder,
+                     size_t*       count,
+                     FT_Pos*      *data );
+  FT_LOCAL( void )
+  cf2_getOtherBlues( CFF_Decoder*  decoder,
+                     size_t*       count,
+                     FT_Pos*      *data );
+  FT_LOCAL( void )
+  cf2_getFamilyBlues( CFF_Decoder*  decoder,
+                      size_t*       count,
+                      FT_Pos*      *data );
+  FT_LOCAL( void )
+  cf2_getFamilyOtherBlues( CFF_Decoder*  decoder,
+                           size_t*       count,
+                           FT_Pos*      *data );
+
+  FT_LOCAL( CF2_Int )
+  cf2_getLanguageGroup( CFF_Decoder*  decoder );
+
+  FT_LOCAL( CF2_Int )
+  cf2_initGlobalRegionBuffer( CFF_Decoder*  decoder,
+                              CF2_UInt      idx,
+                              CF2_Buffer    buf );
+  FT_LOCAL( FT_Error )
+  cf2_getSeacComponent( CFF_Decoder*  decoder,
+                        CF2_UInt      code,
+                        CF2_Buffer    buf );
+  FT_LOCAL( void )
+  cf2_freeSeacComponent( CFF_Decoder*  decoder,
+                         CF2_Buffer    buf );
+  FT_LOCAL( CF2_Int )
+  cf2_initLocalRegionBuffer( CFF_Decoder*  decoder,
+                             CF2_UInt      idx,
+                             CF2_Buffer    buf );
+
+  FT_LOCAL( CF2_Fixed )
+  cf2_getDefaultWidthX( CFF_Decoder*  decoder );
+  FT_LOCAL( CF2_Fixed )
+  cf2_getNominalWidthX( CFF_Decoder*  decoder );
+
+
+  /*
+   * FreeType client outline
+   *
+   * process output from the charstring interpreter
+   */
+  typedef struct  CF2_OutlineRec_
+  {
+    CF2_OutlineCallbacksRec  root;        /* base class must be first */
+    CFF_Decoder*             decoder;
+
+  } CF2_OutlineRec, *CF2_Outline;
+
+
+  FT_LOCAL( void )
+  cf2_outline_reset( CF2_Outline  outline );
+  FT_LOCAL( void )
+  cf2_outline_close( CF2_Outline  outline );
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2FT_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2glue.h b/reactos/lib/3rdparty/freetype/src/cff/cf2glue.h
new file mode 100644 (file)
index 0000000..a24da39
--- /dev/null
@@ -0,0 +1,144 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2glue.h                                                              */
+/*                                                                         */
+/*    Adobe's code for shared stuff (specification only).                  */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2GLUE_H__
+#define __CF2GLUE_H__
+
+
+/* common includes for other modules */
+#include "cf2error.h"
+#include "cf2fixed.h"
+#include "cf2arrst.h"
+#include "cf2read.h"
+
+
+FT_BEGIN_HEADER
+
+
+  /* rendering parameters */
+
+  /* apply hints to rendered glyphs */
+#define CF2_FlagsHinted    1
+  /* for testing */
+#define CF2_FlagsDarkened  2
+
+  /* type for holding the flags */
+  typedef CF2_Int  CF2_RenderingFlags;
+
+
+  /* elements of a glyph outline */
+  typedef enum  CF2_PathOp_
+  {
+    CF2_PathOpMoveTo = 1,     /* change the current point */
+    CF2_PathOpLineTo = 2,     /* line                     */
+    CF2_PathOpQuadTo = 3,     /* quadratic curve          */
+    CF2_PathOpCubeTo = 4      /* cubic curve              */
+
+  } CF2_PathOp;
+
+
+  /* a matrix of fixed point values */
+  typedef struct  CF2_Matrix_
+  {
+    CF2_F16Dot16  a;
+    CF2_F16Dot16  b;
+    CF2_F16Dot16  c;
+    CF2_F16Dot16  d;
+    CF2_F16Dot16  tx;
+    CF2_F16Dot16  ty;
+
+  } CF2_Matrix;
+
+
+  /* these typedefs are needed by more than one header file */
+  /* and gcc compiler doesn't allow redefinition            */
+  typedef struct CF2_FontRec_  CF2_FontRec, *CF2_Font;
+  typedef struct CF2_HintRec_  CF2_HintRec, *CF2_Hint;
+
+
+  /* A common structure for all callback parameters.                       */
+  /*                                                                       */
+  /* Some members may be unused.  For example, `pt0' is not used for       */
+  /* `moveTo' and `pt3' is not used for `quadTo'.  The initial point `pt0' */
+  /* is included for each path element for generality; curve conversions   */
+  /* need it.  The `op' parameter allows one function to handle multiple   */
+  /* element types.                                                        */
+
+  typedef struct  CF2_CallbackParamsRec_
+  {
+    FT_Vector  pt0;
+    FT_Vector  pt1;
+    FT_Vector  pt2;
+    FT_Vector  pt3;
+
+    CF2_Int  op;
+
+  } CF2_CallbackParamsRec, *CF2_CallbackParams;
+
+
+  /* forward reference */
+  typedef struct CF2_OutlineCallbacksRec_  CF2_OutlineCallbacksRec,
+                                           *CF2_OutlineCallbacks;
+
+  /* callback function pointers */
+  typedef void
+  (*CF2_Callback_Type)( CF2_OutlineCallbacks      callbacks,
+                        const CF2_CallbackParams  params );
+
+
+  struct  CF2_OutlineCallbacksRec_
+  {
+    CF2_Callback_Type  moveTo;
+    CF2_Callback_Type  lineTo;
+    CF2_Callback_Type  quadTo;
+    CF2_Callback_Type  cubeTo;
+
+    CF2_Int  windingMomentum;    /* for winding order detection */
+
+    FT_Memory  memory;
+    FT_Error*  error;
+  };
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2GLUE_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2hints.c b/reactos/lib/3rdparty/freetype/src/cff/cf2hints.c
new file mode 100644 (file)
index 0000000..96bd49f
--- /dev/null
@@ -0,0 +1,1734 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2hints.c                                                             */
+/*                                                                         */
+/*    Adobe's code for handling CFF hints (body).                          */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "cf2ft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "cf2glue.h"
+#include "cf2font.h"
+#include "cf2hints.h"
+#include "cf2intrp.h"
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_cf2hints
+
+
+  typedef struct  CF2_HintMoveRec_
+  {
+    size_t     j;          /* index of upper hint map edge   */
+    CF2_Fixed  moveUp;     /* adjustment to optimum position */
+
+  } CF2_HintMoveRec, *CF2_HintMove;
+
+
+  /* Compute angular momentum for winding order detection.  It is called */
+  /* for all lines and curves, but not necessarily in element order.     */
+  static CF2_Int
+  cf2_getWindingMomentum( CF2_Fixed  x1,
+                          CF2_Fixed  y1,
+                          CF2_Fixed  x2,
+                          CF2_Fixed  y2 )
+  {
+    /* cross product of pt1 position from origin with pt2 position from  */
+    /* pt1; we reduce the precision so that the result fits into 32 bits */
+
+    return ( x1 >> 16 ) * ( ( y2 - y1 ) >> 16 ) -
+           ( y1 >> 16 ) * ( ( x2 - x1 ) >> 16 );
+  }
+
+
+  /*
+   * Construct from a StemHint; this is used as a parameter to
+   * `cf2_blues_capture'.
+   * `hintOrigin' is the character space displacement of a seac accent.
+   * Adjust stem hint for darkening here.
+   *
+   */
+  static void
+  cf2_hint_init( CF2_Hint            hint,
+                 const CF2_ArrStack  stemHintArray,
+                 size_t              indexStemHint,
+                 const CF2_Font      font,
+                 CF2_Fixed           hintOrigin,
+                 CF2_Fixed           scale,
+                 FT_Bool             bottom )
+  {
+    CF2_Fixed               width;
+    const CF2_StemHintRec*  stemHint;
+
+
+    FT_ZERO( hint );
+
+    stemHint = (const CF2_StemHintRec*)cf2_arrstack_getPointer(
+                                         stemHintArray,
+                                         indexStemHint );
+
+    width = stemHint->max - stemHint->min;
+
+    if ( width == cf2_intToFixed( -21 ) )
+    {
+      /* ghost bottom */
+
+      if ( bottom )
+      {
+        hint->csCoord = stemHint->max;
+        hint->flags   = CF2_GhostBottom;
+      }
+      else
+        hint->flags = 0;
+    }
+
+    else if ( width == cf2_intToFixed( -20 ) )
+    {
+      /* ghost top */
+
+      if ( bottom )
+        hint->flags = 0;
+      else
+      {
+        hint->csCoord = stemHint->min;
+        hint->flags   = CF2_GhostTop;
+      }
+    }
+
+    else if ( width < 0 )
+    {
+      /* inverted pair */
+
+      /*
+       * Hints with negative widths were produced by an early version of a
+       * non-Adobe font tool.  The Type 2 spec allows edge (ghost) hints
+       * with negative widths, but says
+       *
+       *   All other negative widths have undefined meaning.
+       *
+       * CoolType has a silent workaround that negates the hint width; for
+       * permissive mode, we do the same here.
+       *
+       * Note: Such fonts cannot use ghost hints, but should otherwise work.
+       * Note: Some poor hints in our faux fonts can produce negative
+       *       widths at some blends.  For example, see a light weight of
+       *       `u' in ASerifMM.
+       *
+       */
+      if ( bottom )
+      {
+        hint->csCoord = stemHint->max;
+        hint->flags   = CF2_PairBottom;
+      }
+      else
+      {
+        hint->csCoord = stemHint->min;
+        hint->flags   = CF2_PairTop;
+      }
+    }
+
+    else
+    {
+      /* normal pair */
+
+      if ( bottom )
+      {
+        hint->csCoord = stemHint->min;
+        hint->flags   = CF2_PairBottom;
+      }
+      else
+      {
+        hint->csCoord = stemHint->max;
+        hint->flags   = CF2_PairTop;
+      }
+    }
+
+    /* Now that ghost hints have been detected, adjust this edge for      */
+    /* darkening.  Bottoms are not changed; tops are incremented by twice */
+    /* `darkenY'.                                                         */
+    if ( cf2_hint_isTop( hint ) )
+      hint->csCoord += 2 * font->darkenY;
+
+    hint->csCoord += hintOrigin;
+    hint->scale    = scale;
+    hint->index    = indexStemHint;   /* index in original stem hint array */
+
+    /* if original stem hint has been used, use the same position */
+    if ( hint->flags != 0 && stemHint->used )
+    {
+      if ( cf2_hint_isTop( hint ) )
+        hint->dsCoord = stemHint->maxDS;
+      else
+        hint->dsCoord = stemHint->minDS;
+
+      cf2_hint_lock( hint );
+    }
+    else
+      hint->dsCoord = FT_MulFix( hint->csCoord, scale );
+  }
+
+
+  /* initialize an invalid hint map element */
+  static void
+  cf2_hint_initZero( CF2_Hint  hint )
+  {
+    FT_ZERO( hint );
+  }
+
+
+  FT_LOCAL_DEF( FT_Bool )
+  cf2_hint_isValid( const CF2_Hint  hint )
+  {
+    return (FT_Bool)( hint->flags != 0 );
+  }
+
+
+  static FT_Bool
+  cf2_hint_isPair( const CF2_Hint  hint )
+  {
+    return (FT_Bool)( ( hint->flags                      &
+                        ( CF2_PairBottom | CF2_PairTop ) ) != 0 );
+  }
+
+
+  static FT_Bool
+  cf2_hint_isPairTop( const CF2_Hint  hint )
+  {
+    return (FT_Bool)( ( hint->flags & CF2_PairTop ) != 0 );
+  }
+
+
+  FT_LOCAL_DEF( FT_Bool )
+  cf2_hint_isTop( const CF2_Hint  hint )
+  {
+    return (FT_Bool)( ( hint->flags                    &
+                        ( CF2_PairTop | CF2_GhostTop ) ) != 0 );
+  }
+
+
+  FT_LOCAL_DEF( FT_Bool )
+  cf2_hint_isBottom( const CF2_Hint  hint )
+  {
+    return (FT_Bool)( ( hint->flags                          &
+                        ( CF2_PairBottom | CF2_GhostBottom ) ) != 0 );
+  }
+
+
+  static FT_Bool
+  cf2_hint_isLocked( const CF2_Hint  hint )
+  {
+    return (FT_Bool)( ( hint->flags & CF2_Locked ) != 0 );
+  }
+
+
+  static FT_Bool
+  cf2_hint_isSynthetic( const CF2_Hint  hint )
+  {
+    return (FT_Bool)( ( hint->flags & CF2_Synthetic ) != 0 );
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_hint_lock( CF2_Hint  hint )
+  {
+    hint->flags |= CF2_Locked;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_hintmap_init( CF2_HintMap   hintmap,
+                    CF2_Font      font,
+                    CF2_HintMap   initialMap,
+                    CF2_ArrStack  hintMoves,
+                    CF2_Fixed     scale )
+  {
+    FT_ZERO( hintmap );
+
+    /* copy parameters from font instance */
+    hintmap->hinted         = font->hinted;
+    hintmap->scale          = scale;
+    hintmap->font           = font;
+    hintmap->initialHintMap = initialMap;
+    /* will clear in `cf2_hintmap_adjustHints' */
+    hintmap->hintMoves      = hintMoves;
+  }
+
+
+  static FT_Bool
+  cf2_hintmap_isValid( const CF2_HintMap  hintmap )
+  {
+    return hintmap->isValid;
+  }
+
+
+  /* transform character space coordinate to device space using hint map */
+  static CF2_Fixed
+  cf2_hintmap_map( CF2_HintMap  hintmap,
+                   CF2_Fixed    csCoord )
+  {
+    FT_ASSERT( hintmap->isValid );  /* must call Build before Map */
+    FT_ASSERT( hintmap->lastIndex < CF2_MAX_HINT_EDGES );
+
+    if ( hintmap->count == 0 || ! hintmap->hinted )
+    {
+      /* there are no hints; use uniform scale and zero offset */
+      return FT_MulFix( csCoord, hintmap->scale );
+    }
+    else
+    {
+      /* start linear search from last hit */
+      CF2_UInt  i = hintmap->lastIndex;
+
+
+      /* search up */
+      while ( i < hintmap->count - 1                  &&
+              csCoord >= hintmap->edge[i + 1].csCoord )
+        i += 1;
+
+      /* search down */
+      while ( i > 0 && csCoord < hintmap->edge[i].csCoord )
+        i -= 1;
+
+      hintmap->lastIndex = i;
+
+      if ( i == 0 && csCoord < hintmap->edge[0].csCoord )
+      {
+        /* special case for points below first edge: use uniform scale */
+        return FT_MulFix( csCoord - hintmap->edge[0].csCoord,
+                          hintmap->scale ) +
+                 hintmap->edge[0].dsCoord;
+      }
+      else
+      {
+        /*
+         * Note: entries with duplicate csCoord are allowed.
+         * Use edge[i], the highest entry where csCoord >= entry[i].csCoord
+         */
+        return FT_MulFix( csCoord - hintmap->edge[i].csCoord,
+                          hintmap->edge[i].scale ) +
+                 hintmap->edge[i].dsCoord;
+      }
+    }
+  }
+
+
+  /*
+   * This hinting policy moves a hint pair in device space so that one of
+   * its two edges is on a device pixel boundary (its fractional part is
+   * zero).  `cf2_hintmap_insertHint' guarantees no overlap in CS
+   * space.  Ensure here that there is no overlap in DS.
+   *
+   * In the first pass, edges are adjusted relative to adjacent hints.
+   * Those that are below have already been adjusted.  Those that are
+   * above have not yet been adjusted.  If a hint above blocks an
+   * adjustment to an optimal position, we will try again in a second
+   * pass.  The second pass is top-down.
+   *
+   */
+
+  static void
+  cf2_hintmap_adjustHints( CF2_HintMap  hintmap )
+  {
+    size_t  i, j;
+
+
+    cf2_arrstack_clear( hintmap->hintMoves );      /* working storage */
+
+    /*
+     * First pass is bottom-up (font hint order) without look-ahead.
+     * Locked edges are already adjusted.
+     * Unlocked edges begin with dsCoord from `initialHintMap'.
+     * Save edges that are not optimally adjusted in `hintMoves' array,
+     * and process them in second pass.
+     */
+
+    for ( i = 0; i < hintmap->count; i++ )
+    {
+      FT_Bool  isPair = cf2_hint_isPair( &hintmap->edge[i] );
+
+
+      /* index of upper edge (same value for ghost hint) */
+      j = isPair ? i + 1 : i;
+
+      FT_ASSERT( j < hintmap->count );
+      FT_ASSERT( cf2_hint_isValid( &hintmap->edge[i] ) );
+      FT_ASSERT( cf2_hint_isValid( &hintmap->edge[j] ) );
+      FT_ASSERT( cf2_hint_isLocked( &hintmap->edge[i] ) ==
+                   cf2_hint_isLocked( &hintmap->edge[j] ) );
+
+      if ( !cf2_hint_isLocked( &hintmap->edge[i] ) )
+      {
+        /* hint edge is not locked, we can adjust it */
+        CF2_Fixed  fracDown = cf2_fixedFraction( hintmap->edge[i].dsCoord );
+        CF2_Fixed  fracUp   = cf2_fixedFraction( hintmap->edge[j].dsCoord );
+
+        /* calculate all four possibilities; moves down are negative */
+        CF2_Fixed  downMoveDown = 0 - fracDown;
+        CF2_Fixed  upMoveDown   = 0 - fracUp;
+        CF2_Fixed  downMoveUp   = fracDown == 0
+                                    ? 0
+                                    : cf2_intToFixed( 1 ) - fracDown;
+        CF2_Fixed  upMoveUp     = fracUp == 0
+                                    ? 0
+                                    : cf2_intToFixed( 1 ) - fracUp;
+
+        /* smallest move up */
+        CF2_Fixed  moveUp   = FT_MIN( downMoveUp, upMoveUp );
+        /* smallest move down */
+        CF2_Fixed  moveDown = FT_MAX( downMoveDown, upMoveDown );
+
+        /* final amount to move edge or edge pair */
+        CF2_Fixed  move;
+
+        CF2_Fixed  downMinCounter = CF2_MIN_COUNTER;
+        CF2_Fixed  upMinCounter   = CF2_MIN_COUNTER;
+        FT_Bool    saveEdge       = FALSE;
+
+
+        /* minimum counter constraint doesn't apply when adjacent edges */
+        /* are synthetic                                                */
+        /* TODO: doesn't seem a big effect; for now, reduce the code    */
+#if 0
+        if ( i == 0                                        ||
+             cf2_hint_isSynthetic( &hintmap->edge[i - 1] ) )
+          downMinCounter = 0;
+
+        if ( j >= hintmap->count - 1                       ||
+             cf2_hint_isSynthetic( &hintmap->edge[j + 1] ) )
+          upMinCounter = 0;
+#endif
+
+        /* is there room to move up?                                    */
+        /* there is if we are at top of array or the next edge is at or */
+        /* beyond proposed move up?                                     */
+        if ( j >= hintmap->count - 1                            ||
+             hintmap->edge[j + 1].dsCoord >=
+               hintmap->edge[j].dsCoord + moveUp + upMinCounter )
+        {
+          /* there is room to move up; is there also room to move down? */
+          if ( i == 0                                                 ||
+               hintmap->edge[i - 1].dsCoord <=
+                 hintmap->edge[i].dsCoord + moveDown - downMinCounter )
+          {
+            /* move smaller absolute amount */
+            move = ( -moveDown < moveUp ) ? moveDown : moveUp;  /* optimum */
+          }
+          else
+            move = moveUp;
+        }
+        else
+        {
+          /* is there room to move down? */
+          if ( i == 0                                                 ||
+               hintmap->edge[i - 1].dsCoord <=
+                 hintmap->edge[i].dsCoord + moveDown - downMinCounter )
+          {
+            move     = moveDown;
+            /* true if non-optimum move */
+            saveEdge = (FT_Bool)( moveUp < -moveDown );
+          }
+          else
+          {
+            /* no room to move either way without overlapping or reducing */
+            /* the counter too much                                       */
+            move     = 0;
+            saveEdge = TRUE;
+          }
+        }
+
+        /* Identify non-moves and moves down that aren't optimal, and save */
+        /* them for second pass.                                           */
+        /* Do this only if there is an unlocked edge above (which could    */
+        /* possibly move).                                                 */
+        if ( saveEdge                                    &&
+             j < hintmap->count - 1                      &&
+             !cf2_hint_isLocked( &hintmap->edge[j + 1] ) )
+        {
+          CF2_HintMoveRec  savedMove;
+
+
+          savedMove.j      = j;
+          /* desired adjustment in second pass */
+          savedMove.moveUp = moveUp - move;
+
+          cf2_arrstack_push( hintmap->hintMoves, &savedMove );
+        }
+
+        /* move the edge(s) */
+        hintmap->edge[i].dsCoord += move;
+        if ( isPair )
+          hintmap->edge[j].dsCoord += move;
+      }
+
+      /* assert there are no overlaps in device space */
+      FT_ASSERT( i == 0                                                   ||
+                 hintmap->edge[i - 1].dsCoord <= hintmap->edge[i].dsCoord );
+      FT_ASSERT( i < j                                                ||
+                 hintmap->edge[i].dsCoord <= hintmap->edge[j].dsCoord );
+
+      /* adjust the scales, avoiding divide by zero */
+      if ( i > 0 )
+      {
+        if ( hintmap->edge[i].csCoord != hintmap->edge[i - 1].csCoord )
+          hintmap->edge[i - 1].scale =
+            FT_DivFix(
+              hintmap->edge[i].dsCoord - hintmap->edge[i - 1].dsCoord,
+              hintmap->edge[i].csCoord - hintmap->edge[i - 1].csCoord );
+      }
+
+      if ( isPair )
+      {
+        if ( hintmap->edge[j].csCoord != hintmap->edge[j - 1].csCoord )
+          hintmap->edge[j - 1].scale =
+            FT_DivFix(
+              hintmap->edge[j].dsCoord - hintmap->edge[j - 1].dsCoord,
+              hintmap->edge[j].csCoord - hintmap->edge[j - 1].csCoord );
+
+        i += 1;     /* skip upper edge on next loop */
+      }
+    }
+
+    /* second pass tries to move non-optimal hints up, in case there is */
+    /* room now                                                         */
+    for ( i = cf2_arrstack_size( hintmap->hintMoves ); i > 0; i-- )
+    {
+      CF2_HintMove  hintMove = (CF2_HintMove)
+                      cf2_arrstack_getPointer( hintmap->hintMoves, i - 1 );
+
+
+      j = hintMove->j;
+
+      /* this was tested before the push, above */
+      FT_ASSERT( j < hintmap->count - 1 );
+
+      /* is there room to move up? */
+      if ( hintmap->edge[j + 1].dsCoord >=
+             hintmap->edge[j].dsCoord + hintMove->moveUp + CF2_MIN_COUNTER )
+      {
+        /* there is more room now, move edge up */
+        hintmap->edge[j].dsCoord += hintMove->moveUp;
+
+        if ( cf2_hint_isPair( &hintmap->edge[j] ) )
+        {
+          FT_ASSERT( j > 0 );
+          hintmap->edge[j - 1].dsCoord += hintMove->moveUp;
+        }
+      }
+    }
+  }
+
+
+  /* insert hint edges into map, sorted by csCoord */
+  static void
+  cf2_hintmap_insertHint( CF2_HintMap  hintmap,
+                          CF2_Hint     bottomHintEdge,
+                          CF2_Hint     topHintEdge )
+  {
+    CF2_UInt  indexInsert;
+
+    /* set default values, then check for edge hints */
+    FT_Bool   isPair         = TRUE;
+    CF2_Hint  firstHintEdge  = bottomHintEdge;
+    CF2_Hint  secondHintEdge = topHintEdge;
+
+
+    /* one or none of the input params may be invalid when dealing with */
+    /* edge hints; at least one edge must be valid                      */
+    FT_ASSERT( cf2_hint_isValid( bottomHintEdge ) ||
+               cf2_hint_isValid( topHintEdge )    );
+
+    /* determine how many and which edges to insert */
+    if ( !cf2_hint_isValid( bottomHintEdge ) )
+    {
+      /* insert only the top edge */
+      firstHintEdge = topHintEdge;
+      isPair        = FALSE;
+    }
+    else if ( !cf2_hint_isValid( topHintEdge ) )
+    {
+      /* insert only the bottom edge */
+      isPair = FALSE;
+    }
+
+    /* paired edges must be in proper order */
+    FT_ASSERT( !isPair                                         ||
+               topHintEdge->csCoord >= bottomHintEdge->csCoord );
+
+    /* linear search to find index value of insertion point */
+    indexInsert = 0;
+    for ( ; indexInsert < hintmap->count; indexInsert++ )
+    {
+      if ( hintmap->edge[indexInsert].csCoord > firstHintEdge->csCoord )
+        break;
+    }
+
+    /*
+     * Discard any hints that overlap in character space.  Most often,
+     * this is while building the initial map, but in theory, it can also
+     * occur because of darkening.
+     *
+     */
+    if ( indexInsert < hintmap->count )
+    {
+      /* we are inserting before an existing edge:              */
+      /* verify that a new pair does not straddle the next edge */
+      if ( isPair                                                       &&
+           hintmap->edge[indexInsert].csCoord < secondHintEdge->csCoord )
+        return; /* ignore overlapping stem hint */
+
+      /* verify that we are not inserting between paired edges */
+      if ( cf2_hint_isPairTop( &hintmap->edge[indexInsert] ) )
+        return; /* ignore overlapping stem hint */
+    }
+
+    /* recompute device space locations using initial hint map */
+    if ( cf2_hintmap_isValid( hintmap->initialHintMap ) &&
+         !cf2_hint_isLocked( firstHintEdge )            )
+    {
+      if ( isPair )
+      {
+        /* Use hint map to position the center of stem, and nominal scale */
+        /* to position the two edges.  This preserves the stem width.     */
+        CF2_Fixed  midpoint  = cf2_hintmap_map(
+                                 hintmap->initialHintMap,
+                                 ( secondHintEdge->csCoord +
+                                   firstHintEdge->csCoord ) / 2 );
+        CF2_Fixed  halfWidth = FT_MulFix(
+                                 ( secondHintEdge->csCoord -
+                                   firstHintEdge->csCoord ) / 2,
+                                 hintmap->scale );
+
+
+        firstHintEdge->dsCoord  = midpoint - halfWidth;
+        secondHintEdge->dsCoord = midpoint + halfWidth;
+      }
+      else
+        firstHintEdge->dsCoord = cf2_hintmap_map( hintmap->initialHintMap,
+                                                  firstHintEdge->csCoord );
+    }
+
+    /* discard any hints that overlap in device space; this can occur */
+    /* because locked hints have been moved to align with blue zones  */
+    if ( indexInsert > 0 )
+    {
+      /* we are inserting after an existing edge */
+      if ( firstHintEdge->dsCoord < hintmap->edge[indexInsert - 1].dsCoord )
+        return;
+    }
+
+    if ( indexInsert < hintmap->count )
+    {
+      /* we are inserting before an existing edge */
+      if ( isPair )
+      {
+        if ( secondHintEdge->dsCoord > hintmap->edge[indexInsert].dsCoord )
+          return;
+      }
+      else
+      {
+        if ( firstHintEdge->dsCoord > hintmap->edge[indexInsert].dsCoord )
+          return;
+      }
+    }
+
+    /* make room to insert */
+    {
+      CF2_Int  iSrc = hintmap->count - 1;
+      CF2_Int  iDst = isPair ? hintmap->count + 1 : hintmap->count;
+
+      CF2_Int  count = hintmap->count - indexInsert;
+
+
+      if ( iDst >= CF2_MAX_HINT_EDGES )
+      {
+        FT_TRACE4(( "cf2_hintmap_insertHint: too many hintmaps\n" ));
+        return;
+      }
+
+      while ( count-- )
+        hintmap->edge[iDst--] = hintmap->edge[iSrc--];
+
+      /* insert first edge */
+      hintmap->edge[indexInsert] = *firstHintEdge;         /* copy struct */
+      hintmap->count += 1;
+
+      if ( isPair )
+      {
+        /* insert second edge */
+        hintmap->edge[indexInsert + 1] = *secondHintEdge;  /* copy struct */
+        hintmap->count                += 1;
+      }
+    }
+
+    return;
+  }
+
+
+  /*
+   * Build a map from hints and mask.
+   *
+   * This function may recur one level if `hintmap->initialHintMap' is not yet
+   * valid.
+   * If `initialMap' is true, simply build initial map.
+   *
+   * Synthetic hints are used in two ways.  A hint at zero is inserted, if
+   * needed, in the initial hint map, to prevent translations from
+   * propagating across the origin.  If synthetic em box hints are enabled
+   * for ideographic dictionaries, then they are inserted in all hint
+   * maps, including the initial one.
+   *
+   */
+  FT_LOCAL_DEF( void )
+  cf2_hintmap_build( CF2_HintMap   hintmap,
+                     CF2_ArrStack  hStemHintArray,
+                     CF2_ArrStack  vStemHintArray,
+                     CF2_HintMask  hintMask,
+                     CF2_Fixed     hintOrigin,
+                     FT_Bool       initialMap )
+  {
+    FT_Byte*  maskPtr;
+
+    CF2_Font         font = hintmap->font;
+    CF2_HintMaskRec  tempHintMask;
+
+    size_t   bitCount, i;
+    FT_Byte  maskByte;
+
+
+    /* check whether initial map is constructed */
+    if ( !initialMap && !cf2_hintmap_isValid( hintmap->initialHintMap ) )
+    {
+      /* make recursive call with initialHintMap and temporary mask; */
+      /* temporary mask will get all bits set, below */
+      cf2_hintmask_init( &tempHintMask, hintMask->error );
+      cf2_hintmap_build( hintmap->initialHintMap,
+                         hStemHintArray,
+                         vStemHintArray,
+                         &tempHintMask,
+                         hintOrigin,
+                         TRUE );
+    }
+
+    if ( !cf2_hintmask_isValid( hintMask ) )
+    {
+      /* without a hint mask, assume all hints are active */
+      cf2_hintmask_setAll( hintMask,
+                           cf2_arrstack_size( hStemHintArray ) +
+                             cf2_arrstack_size( vStemHintArray ) );
+    }
+
+    /* begin by clearing the map */
+    hintmap->count     = 0;
+    hintmap->lastIndex = 0;
+
+    /* make a copy of the hint mask so we can modify it */
+    tempHintMask = *hintMask;
+    maskPtr      = cf2_hintmask_getMaskPtr( &tempHintMask );
+
+    /* use the hStem hints only, which are first in the mask */
+    /* TODO: compare this to cffhintmaskGetBitCount */
+    bitCount = cf2_arrstack_size( hStemHintArray );
+
+    /* synthetic embox hints get highest priority */
+    if ( font->blues.doEmBoxHints )
+    {
+      CF2_HintRec  dummy;
+
+
+      cf2_hint_initZero( &dummy );   /* invalid hint map element */
+
+      /* ghost bottom */
+      cf2_hintmap_insertHint( hintmap,
+                              &font->blues.emBoxBottomEdge,
+                              &dummy );
+      /* ghost top */
+      cf2_hintmap_insertHint( hintmap,
+                              &dummy,
+                              &font->blues.emBoxTopEdge );
+    }
+
+    /* insert hints captured by a blue zone or already locked (higher */
+    /* priority)                                                      */
+    for ( i = 0, maskByte = 0x80; i < bitCount; i++ )
+    {
+      if ( maskByte & *maskPtr )
+      {
+        /* expand StemHint into two `CF2_Hint' elements */
+        CF2_HintRec  bottomHintEdge, topHintEdge;
+
+
+        cf2_hint_init( &bottomHintEdge,
+                       hStemHintArray,
+                       i,
+                       font,
+                       hintOrigin,
+                       hintmap->scale,
+                       TRUE /* bottom */ );
+        cf2_hint_init( &topHintEdge,
+                       hStemHintArray,
+                       i,
+                       font,
+                       hintOrigin,
+                       hintmap->scale,
+                       FALSE /* top */ );
+
+        if ( cf2_hint_isLocked( &bottomHintEdge ) ||
+             cf2_hint_isLocked( &topHintEdge )    ||
+             cf2_blues_capture( &font->blues,
+                                &bottomHintEdge,
+                                &topHintEdge )   )
+        {
+          /* insert captured hint into map */
+          cf2_hintmap_insertHint( hintmap, &bottomHintEdge, &topHintEdge );
+
+          *maskPtr &= ~maskByte;      /* turn off the bit for this hint */
+        }
+      }
+
+      if ( ( i & 7 ) == 7 )
+      {
+        /* move to next mask byte */
+        maskPtr++;
+        maskByte = 0x80;
+      }
+      else
+        maskByte >>= 1;
+    }
+
+    /* initial hint map includes only captured hints plus maybe one at 0 */
+
+    /*
+     * TODO: There is a problem here because we are trying to build a
+     *       single hint map containing all captured hints.  It is
+     *       possible for there to be conflicts between captured hints,
+     *       either because of darkening or because the hints are in
+     *       separate hint zones (we are ignoring hint zones for the
+     *       initial map).  An example of the latter is MinionPro-Regular
+     *       v2.030 glyph 883 (Greek Capital Alpha with Psili) at 15ppem.
+     *       A stem hint for the psili conflicts with the top edge hint
+     *       for the base character.  The stem hint gets priority because
+     *       of its sort order.  In glyph 884 (Greek Capital Alpha with
+     *       Psili and Oxia), the top of the base character gets a stem
+     *       hint, and the psili does not.  This creates different initial
+     *       maps for the two glyphs resulting in different renderings of
+     *       the base character.  Will probably defer this either as not
+     *       worth the cost or as a font bug.  I don't think there is any
+     *       good reason for an accent to be captured by an alignment
+     *       zone.  -darnold 2/12/10
+     */
+
+    if ( initialMap )
+    {
+      /* Apply a heuristic that inserts a point for (0,0), unless it's     */
+      /* already covered by a mapping.  This locks the baseline for glyphs */
+      /* that have no baseline hints.                                      */
+
+      if ( hintmap->count == 0                           ||
+           hintmap->edge[0].csCoord > 0                  ||
+           hintmap->edge[hintmap->count - 1].csCoord < 0 )
+      {
+        /* all edges are above 0 or all edges are below 0; */
+        /* construct a locked edge hint at 0               */
+
+        CF2_HintRec  edge, invalid;
+
+
+        cf2_hint_initZero( &edge );
+
+        edge.flags = CF2_GhostBottom |
+                     CF2_Locked      |
+                     CF2_Synthetic;
+        edge.scale = hintmap->scale;
+
+        cf2_hint_initZero( &invalid );
+        cf2_hintmap_insertHint( hintmap, &edge, &invalid );
+      }
+    }
+    else
+    {
+      /* insert remaining hints */
+
+      maskPtr = cf2_hintmask_getMaskPtr( &tempHintMask );
+
+      for ( i = 0, maskByte = 0x80; i < bitCount; i++ )
+      {
+        if ( maskByte & *maskPtr )
+        {
+          CF2_HintRec  bottomHintEdge, topHintEdge;
+
+
+          cf2_hint_init( &bottomHintEdge,
+                         hStemHintArray,
+                         i,
+                         font,
+                         hintOrigin,
+                         hintmap->scale,
+                         TRUE /* bottom */ );
+          cf2_hint_init( &topHintEdge,
+                         hStemHintArray,
+                         i,
+                         font,
+                         hintOrigin,
+                         hintmap->scale,
+                         FALSE /* top */ );
+
+          cf2_hintmap_insertHint( hintmap, &bottomHintEdge, &topHintEdge );
+        }
+
+        if ( ( i & 7 ) == 7 )
+        {
+          /* move to next mask byte */
+          maskPtr++;
+          maskByte = 0x80;
+        }
+        else
+          maskByte >>= 1;
+      }
+    }
+
+    /*
+     * Note: The following line is a convenient place to break when
+     *       debugging hinting.  Examine `hintmap->edge' for the list of
+     *       enabled hints, then step over the call to see the effect of
+     *       adjustment.  We stop here first on the recursive call that
+     *       creates the initial map, and then on each counter group and
+     *       hint zone.
+     */
+
+    /* adjust positions of hint edges that are not locked to blue zones */
+    cf2_hintmap_adjustHints( hintmap );
+
+    /* save the position of all hints that were used in this hint map; */
+    /* if we use them again, we'll locate them in the same position    */
+    if ( !initialMap )
+    {
+      for ( i = 0; i < hintmap->count; i++ )
+      {
+        if ( !cf2_hint_isSynthetic( &hintmap->edge[i] ) )
+        {
+          /* Note: include both valid and invalid edges            */
+          /* Note: top and bottom edges are copied back separately */
+          CF2_StemHint  stemhint = (CF2_StemHint)
+                          cf2_arrstack_getPointer( hStemHintArray,
+                                                   hintmap->edge[i].index );
+
+
+          if ( cf2_hint_isTop( &hintmap->edge[i] ) )
+            stemhint->maxDS = hintmap->edge[i].dsCoord;
+          else
+            stemhint->minDS = hintmap->edge[i].dsCoord;
+
+          stemhint->used = TRUE;
+        }
+      }
+    }
+
+    /* hint map is ready to use */
+    hintmap->isValid = TRUE;
+
+    /* remember this mask has been used */
+    cf2_hintmask_setNew( hintMask, FALSE );
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_glyphpath_init( CF2_GlyphPath         glyphpath,
+                      CF2_Font              font,
+                      CF2_OutlineCallbacks  callbacks,
+                      CF2_Fixed             scaleY,
+                      /* CF2_Fixed  hShift, */
+                      CF2_ArrStack          hStemHintArray,
+                      CF2_ArrStack          vStemHintArray,
+                      CF2_HintMask          hintMask,
+                      CF2_Fixed             hintOriginY,
+                      const CF2_Blues       blues,
+                      const FT_Vector*      fractionalTranslation )
+  {
+    FT_ZERO( glyphpath );
+
+    glyphpath->font      = font;
+    glyphpath->callbacks = callbacks;
+
+    cf2_arrstack_init( &glyphpath->hintMoves,
+                       font->memory,
+                       &font->error,
+                       sizeof ( CF2_HintMoveRec ) );
+
+    cf2_hintmap_init( &glyphpath->initialHintMap,
+                      font,
+                      &glyphpath->initialHintMap,
+                      &glyphpath->hintMoves,
+                      scaleY );
+    cf2_hintmap_init( &glyphpath->firstHintMap,
+                      font,
+                      &glyphpath->initialHintMap,
+                      &glyphpath->hintMoves,
+                      scaleY );
+    cf2_hintmap_init( &glyphpath->hintMap,
+                      font,
+                      &glyphpath->initialHintMap,
+                      &glyphpath->hintMoves,
+                      scaleY );
+
+    glyphpath->scaleX = font->innerTransform.a;
+    glyphpath->scaleC = font->innerTransform.c;
+    glyphpath->scaleY = font->innerTransform.d;
+
+    glyphpath->fractionalTranslation = *fractionalTranslation;
+
+#if 0
+    glyphpath->hShift = hShift;       /* for fauxing */
+#endif
+
+    glyphpath->hStemHintArray = hStemHintArray;
+    glyphpath->vStemHintArray = vStemHintArray;
+    glyphpath->hintMask       = hintMask;      /* ptr to current mask */
+    glyphpath->hintOriginY    = hintOriginY;
+    glyphpath->blues          = blues;
+    glyphpath->darken         = font->darkened; /* TODO: should we make copies? */
+    glyphpath->xOffset        = font->darkenX;
+    glyphpath->yOffset        = font->darkenY;
+    glyphpath->miterLimit     = 2 * FT_MAX(
+                                     cf2_fixedAbs( glyphpath->xOffset ),
+                                     cf2_fixedAbs( glyphpath->yOffset ) );
+
+    /* .1 character space unit */
+    glyphpath->snapThreshold = cf2_floatToFixed( 0.1f );
+
+    glyphpath->moveIsPending = TRUE;
+    glyphpath->pathIsOpen    = FALSE;
+    glyphpath->elemIsQueued  = FALSE;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_glyphpath_finalize( CF2_GlyphPath  glyphpath )
+  {
+    cf2_arrstack_finalize( &glyphpath->hintMoves );
+  }
+
+
+  /*
+   * Hint point in y-direction and apply outerTransform.
+   * Input `current' hint map (which is actually delayed by one element).
+   * Input x,y point in Character Space.
+   * Output x,y point in Device Space, including translation.
+   */
+  static void
+  cf2_glyphpath_hintPoint( CF2_GlyphPath  glyphpath,
+                           CF2_HintMap    hintmap,
+                           FT_Vector*     ppt,
+                           CF2_Fixed      x,
+                           CF2_Fixed      y )
+  {
+    FT_Vector  pt;   /* hinted point in upright DS */
+
+
+    pt.x = FT_MulFix( glyphpath->scaleX, x ) +
+             FT_MulFix( glyphpath->scaleC, y );
+    pt.y = cf2_hintmap_map( hintmap, y );
+
+    ppt->x = FT_MulFix( glyphpath->font->outerTransform.a, pt.x )   +
+               FT_MulFix( glyphpath->font->outerTransform.c, pt.y ) +
+               glyphpath->fractionalTranslation.x;
+    ppt->y = FT_MulFix( glyphpath->font->outerTransform.b, pt.x )   +
+               FT_MulFix( glyphpath->font->outerTransform.d, pt.y ) +
+               glyphpath->fractionalTranslation.y;
+  }
+
+
+  /*
+   * From two line segments, (u1,u2) and (v1,v2), compute a point of
+   * intersection on the corresponding lines.
+   * Return false if no intersection is found, or if the intersection is
+   * too far away from the ends of the line segments, u2 and v1.
+   *
+   */
+  static FT_Bool
+  cf2_glyphpath_computeIntersection( CF2_GlyphPath     glyphpath,
+                                     const FT_Vector*  u1,
+                                     const FT_Vector*  u2,
+                                     const FT_Vector*  v1,
+                                     const FT_Vector*  v2,
+                                     FT_Vector*        intersection )
+  {
+    /*
+     * Let `u' be a zero-based vector from the first segment, `v' from the
+     * second segment.
+     * Let `w 'be the zero-based vector from `u1' to `v1'.
+     * `perp' is the `perpendicular dot product'; see
+     * http://mathworld.wolfram.com/PerpDotProduct.html.
+     * `s' is the parameter for the parametric line for the first segment
+     * (`u').
+     *
+     * See notation in
+     * http://softsurfer.com/Archive/algorithm_0104/algorithm_0104B.htm.
+     * Calculations are done in 16.16, but must handle the squaring of
+     * line lengths in character space.  We scale all vectors by 1/32 to
+     * avoid overflow.  This allows values up to 4095 to be squared.  The
+     * scale factor cancels in the divide.
+     *
+     * TODO: the scale factor could be computed from UnitsPerEm.
+     *
+     */
+
+#define cf2_perp( a, b )                                    \
+          ( FT_MulFix( a.x, b.y ) - FT_MulFix( a.y, b.x ) )
+
+  /* round and divide by 32 */
+#define CF2_CS_SCALE( x )         \
+          ( ( (x) + 0x10 ) >> 5 )
+
+    FT_Vector  u, v, w;      /* scaled vectors */
+    CF2_Fixed  denominator, s;
+
+
+    u.x = CF2_CS_SCALE( u2->x - u1->x );
+    u.y = CF2_CS_SCALE( u2->y - u1->y );
+    v.x = CF2_CS_SCALE( v2->x - v1->x );
+    v.y = CF2_CS_SCALE( v2->y - v1->y );
+    w.x = CF2_CS_SCALE( v1->x - u1->x );
+    w.y = CF2_CS_SCALE( v1->y - u1->y );
+
+    denominator = cf2_perp( u, v );
+
+    if ( denominator == 0 )
+      return FALSE;           /* parallel or coincident lines */
+
+    s = FT_DivFix( cf2_perp( w, v ), denominator );
+
+    intersection->x = u1->x + FT_MulFix( s, u2->x - u1->x );
+    intersection->y = u1->y + FT_MulFix( s, u2->y - u1->y );
+
+    /*
+     * Special case snapping for horizontal and vertical lines.
+     * This cleans up intersections and reduces problems with winding
+     * order detection.
+     * Sample case is sbc cd KozGoPr6N-Medium.otf 20 16685.
+     * Note: these calculations are in character space.
+     *
+     */
+
+    if ( u1->x == u2->x                                                     &&
+         cf2_fixedAbs( intersection->x - u1->x ) < glyphpath->snapThreshold )
+      intersection->x = u1->x;
+    if ( u1->y == u2->y                                                     &&
+         cf2_fixedAbs( intersection->y - u1->y ) < glyphpath->snapThreshold )
+      intersection->y = u1->y;
+
+    if ( v1->x == v2->x                                                     &&
+         cf2_fixedAbs( intersection->x - v1->x ) < glyphpath->snapThreshold )
+      intersection->x = v1->x;
+    if ( v1->y == v2->y                                                     &&
+         cf2_fixedAbs( intersection->y - v1->y ) < glyphpath->snapThreshold )
+      intersection->y = v1->y;
+
+    /* limit the intersection distance from midpoint of u2 and v1 */
+    if ( cf2_fixedAbs( intersection->x - ( u2->x + v1->x ) / 2 ) >
+           glyphpath->miterLimit                                   ||
+         cf2_fixedAbs( intersection->y - ( u2->y + v1->y ) / 2 ) >
+           glyphpath->miterLimit                                   )
+      return FALSE;
+
+    return TRUE;
+  }
+
+
+  /*
+   * Push the cached element (glyphpath->prevElem*) to the outline
+   * consumer.  When a darkening offset is used, the end point of the
+   * cached element may be adjusted to an intersection point or it may be
+   * connected by a line to the current element.  This calculation must
+   * use a HintMap that was valid at the time the element was saved.  For
+   * the first point in a subpath, that is a saved HintMap.  For most
+   * elements, it just means the caller has delayed building a HintMap
+   * from the current HintMask.
+   *
+   * Transform each point with outerTransform and call the outline
+   * callbacks.  This is a general 3x3 transform:
+   *
+   *   x' = a*x + c*y + tx, y' = b*x + d*y + ty
+   *
+   * but it uses 4 elements from CF2_Font and the translation part
+   * from CF2_GlyphPath.
+   *
+   */
+  static void
+  cf2_glyphpath_pushPrevElem( CF2_GlyphPath  glyphpath,
+                              CF2_HintMap    hintmap,
+                              FT_Vector*     nextP0,
+                              FT_Vector      nextP1,
+                              FT_Bool        close )
+  {
+    CF2_CallbackParamsRec  params;
+
+    FT_Vector*  prevP0;
+    FT_Vector*  prevP1;
+
+    FT_Vector  intersection    = { 0, 0 };
+    FT_Bool    useIntersection = FALSE;
+
+
+    FT_ASSERT( glyphpath->prevElemOp == CF2_PathOpLineTo ||
+               glyphpath->prevElemOp == CF2_PathOpCubeTo );
+
+    if ( glyphpath->prevElemOp == CF2_PathOpLineTo )
+    {
+      prevP0 = &glyphpath->prevElemP0;
+      prevP1 = &glyphpath->prevElemP1;
+    }
+    else
+    {
+      prevP0 = &glyphpath->prevElemP2;
+      prevP1 = &glyphpath->prevElemP3;
+    }
+
+    /* optimization: if previous and next elements are offset by the same */
+    /* amount, then there will be no gap, and no need to compute an       */
+    /* intersection.                                                      */
+    if ( prevP1->x != nextP0->x || prevP1->y != nextP0->y )
+    {
+      /* previous element does not join next element:             */
+      /* adjust end point of previous element to the intersection */
+      useIntersection = cf2_glyphpath_computeIntersection( glyphpath,
+                                                           prevP0,
+                                                           prevP1,
+                                                           nextP0,
+                                                           &nextP1,
+                                                           &intersection );
+      if ( useIntersection )
+      {
+        /* modify the last point of the cached element (either line or */
+        /* curve)                                                      */
+        *prevP1 = intersection;
+      }
+    }
+
+    params.pt0 = glyphpath->currentDS;
+
+    switch( glyphpath->prevElemOp )
+    {
+    case CF2_PathOpLineTo:
+      params.op = CF2_PathOpLineTo;
+
+      /* note: pt2 and pt3 are unused */
+      cf2_glyphpath_hintPoint( glyphpath,
+                               hintmap,
+                               &params.pt1,
+                               glyphpath->prevElemP1.x,
+                               glyphpath->prevElemP1.y );
+
+      glyphpath->callbacks->lineTo( glyphpath->callbacks, &params );
+
+      glyphpath->currentDS = params.pt1;
+
+      break;
+
+    case CF2_PathOpCubeTo:
+      params.op = CF2_PathOpCubeTo;
+
+      /* TODO: should we intersect the interior joins (p1-p2 and p2-p3)? */
+      cf2_glyphpath_hintPoint( glyphpath,
+                               hintmap,
+                               &params.pt1,
+                               glyphpath->prevElemP1.x,
+                               glyphpath->prevElemP1.y );
+      cf2_glyphpath_hintPoint( glyphpath,
+                               hintmap,
+                               &params.pt2,
+                               glyphpath->prevElemP2.x,
+                               glyphpath->prevElemP2.y );
+      cf2_glyphpath_hintPoint( glyphpath,
+                               hintmap,
+                               &params.pt3,
+                               glyphpath->prevElemP3.x,
+                               glyphpath->prevElemP3.y );
+
+      glyphpath->callbacks->cubeTo( glyphpath->callbacks, &params );
+
+      glyphpath->currentDS = params.pt3;
+
+      break;
+    }
+
+    if ( !useIntersection || close )
+    {
+      /* insert connecting line between end of previous element and start */
+      /* of current one                                                   */
+      /* note: at the end of a subpath, we might do both, so use `nextP0' */
+      /* before we change it, below                                       */
+
+      cf2_glyphpath_hintPoint( glyphpath,
+                               hintmap,
+                               &params.pt1,
+                               nextP0->x,
+                               nextP0->y );
+
+      if ( params.pt1.x != glyphpath->currentDS.x ||
+           params.pt1.y != glyphpath->currentDS.y )
+      {
+        /* length is nonzero */
+        params.op  = CF2_PathOpLineTo;
+        params.pt0 = glyphpath->currentDS;
+
+        /* note: pt2 and pt3 are unused */
+        glyphpath->callbacks->lineTo( glyphpath->callbacks, &params );
+
+        glyphpath->currentDS = params.pt1;
+      }
+    }
+
+    if ( useIntersection )
+    {
+      /* return intersection point to caller */
+      *nextP0 = intersection;
+    }
+  }
+
+
+  /* push a MoveTo element based on current point and offset of current */
+  /* element                                                            */
+  static void
+  cf2_glyphpath_pushMove( CF2_GlyphPath  glyphpath,
+                          FT_Vector      start )
+  {
+    CF2_CallbackParamsRec  params;
+
+
+    params.op  = CF2_PathOpMoveTo;
+    params.pt0 = glyphpath->currentDS;
+
+    /* Test if move has really happened yet; it would have called */
+    /* `cf2_hintmap_build' to set `isValid'.                   */
+    if ( !cf2_hintmap_isValid( &glyphpath->hintMap ) )
+    {
+      /* we are here iff first subpath is missing a moveto operator: */
+      /* synthesize first moveTo to finish initialization of hintMap */
+      cf2_glyphpath_moveTo( glyphpath,
+                            glyphpath->start.x,
+                            glyphpath->start.y );
+    }
+
+    cf2_glyphpath_hintPoint( glyphpath,
+                             &glyphpath->hintMap,
+                             &params.pt1,
+                             start.x,
+                             start.y );
+
+    /* note: pt2 and pt3 are unused */
+    glyphpath->callbacks->moveTo( glyphpath->callbacks, &params );
+
+    glyphpath->currentDS    = params.pt1;
+    glyphpath->offsetStart0 = start;
+  }
+
+
+  /*
+   * All coordinates are in character space.
+   * On input, (x1, y1) and (x2, y2) give line segment.
+   * On output, (x, y) give offset vector.
+   * We use a piecewise approximation to trig functions.
+   *
+   * TODO: Offset true perpendicular and proper length
+   *       supply the y-translation for hinting here, too,
+   *       that adds yOffset unconditionally to *y.
+   */
+  static void
+  cf2_glyphpath_computeOffset( CF2_GlyphPath  glyphpath,
+                               CF2_Fixed      x1,
+                               CF2_Fixed      y1,
+                               CF2_Fixed      x2,
+                               CF2_Fixed      y2,
+                               CF2_Fixed*     x,
+                               CF2_Fixed*     y )
+  {
+    CF2_Fixed  dx = x2 - x1;
+    CF2_Fixed  dy = y2 - y1;
+
+
+    /* note: negative offsets don't work here; negate deltas to change */
+    /* quadrants, below                                                */
+    if ( glyphpath->font->reverseWinding )
+    {
+      dx = -dx;
+      dy = -dy;
+    }
+
+    *x = *y = 0;
+
+    if ( !glyphpath->darken )
+        return;
+
+    /* add momentum for this path element */
+    glyphpath->callbacks->windingMomentum +=
+      cf2_getWindingMomentum( x1, y1, x2, y2 );
+
+    /* note: allow mixed integer and fixed multiplication here */
+    if ( dx >= 0 )
+    {
+      if ( dy >= 0 )
+      {
+        /* first quadrant, +x +y */
+
+        if ( dx > 2 * dy )
+        {
+          /* +x */
+          *x = 0;
+          *y = 0;
+        }
+        else if ( dy > 2 * dx )
+        {
+          /* +y */
+          *x = glyphpath->xOffset;
+          *y = glyphpath->yOffset;
+        }
+        else
+        {
+          /* +x +y */
+          *x = FT_MulFix( cf2_floatToFixed( 0.7 ),
+                          glyphpath->xOffset );
+          *y = FT_MulFix( cf2_floatToFixed( 1.0 - 0.7 ),
+                          glyphpath->yOffset );
+        }
+      }
+      else
+      {
+        /* fourth quadrant, +x -y */
+
+        if ( dx > -2 * dy )
+        {
+          /* +x */
+          *x = 0;
+          *y = 0;
+        }
+        else if ( -dy > 2 * dx )
+        {
+          /* -y */
+          *x = -glyphpath->xOffset;
+          *y = glyphpath->yOffset;
+        }
+        else
+        {
+          /* +x -y */
+          *x = FT_MulFix( cf2_floatToFixed( -0.7 ),
+                          glyphpath->xOffset );
+          *y = FT_MulFix( cf2_floatToFixed( 1.0 - 0.7 ),
+                          glyphpath->yOffset );
+        }
+      }
+    }
+    else
+    {
+      if ( dy >= 0 )
+      {
+        /* second quadrant, -x +y */
+
+        if ( -dx > 2 * dy )
+        {
+          /* -x */
+          *x = 0;
+          *y = 2 * glyphpath->yOffset;
+        }
+        else if ( dy > -2 * dx )
+        {
+          /* +y */
+          *x = glyphpath->xOffset;
+          *y = glyphpath->yOffset;
+        }
+        else
+        {
+          /* -x +y */
+          *x = FT_MulFix( cf2_floatToFixed( 0.7 ),
+                          glyphpath->xOffset );
+          *y = FT_MulFix( cf2_floatToFixed( 1.0 + 0.7 ),
+                          glyphpath->yOffset );
+        }
+      }
+      else
+      {
+        /* third quadrant, -x -y */
+
+        if ( -dx > -2 * dy )
+        {
+          /* -x */
+          *x = 0;
+          *y = 2 * glyphpath->yOffset;
+        }
+        else if ( -dy > -2 * dx )
+        {
+          /* -y */
+          *x = -glyphpath->xOffset;
+          *y = glyphpath->xOffset;
+        }
+        else
+        {
+          /* -x -y */
+          *x = FT_MulFix( cf2_floatToFixed( -0.7 ),
+                          glyphpath->xOffset );
+          *y = FT_MulFix( cf2_floatToFixed( 1.0 + 0.7 ),
+                          glyphpath->yOffset );
+        }
+      }
+    }
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_glyphpath_moveTo( CF2_GlyphPath  glyphpath,
+                        CF2_Fixed      x,
+                        CF2_Fixed      y )
+  {
+    cf2_glyphpath_closeOpenPath( glyphpath );
+
+    /* save the parameters of the move for later, when we'll know how to */
+    /* offset it;                                                        */
+    /* also save last move point */
+    glyphpath->currentCS.x = glyphpath->start.x = x;
+    glyphpath->currentCS.y = glyphpath->start.y = y;
+
+    glyphpath->moveIsPending = TRUE;
+
+    /* ensure we have a valid map with current mask */
+    if ( !cf2_hintmap_isValid( &glyphpath->hintMap ) ||
+         cf2_hintmask_isNew( glyphpath->hintMask )   )
+      cf2_hintmap_build( &glyphpath->hintMap,
+                         glyphpath->hStemHintArray,
+                         glyphpath->vStemHintArray,
+                         glyphpath->hintMask,
+                         glyphpath->hintOriginY,
+                         FALSE );
+
+    /* save a copy of current HintMap to use when drawing initial point */
+    glyphpath->firstHintMap = glyphpath->hintMap;     /* structure copy */
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_glyphpath_lineTo( CF2_GlyphPath  glyphpath,
+                        CF2_Fixed      x,
+                        CF2_Fixed      y )
+  {
+    CF2_Fixed  xOffset, yOffset;
+    FT_Vector  P0, P1;
+
+
+    /* can't compute offset of zero length line, so ignore them */
+    if ( glyphpath->currentCS.x == x && glyphpath->currentCS.y == y )
+      return;
+
+    cf2_glyphpath_computeOffset( glyphpath,
+                                 glyphpath->currentCS.x,
+                                 glyphpath->currentCS.y,
+                                 x,
+                                 y,
+                                 &xOffset,
+                                 &yOffset );
+
+    /* construct offset points */
+    P0.x = glyphpath->currentCS.x + xOffset;
+    P0.y = glyphpath->currentCS.y + yOffset;
+    P1.x = x + xOffset;
+    P1.y = y + yOffset;
+
+    if ( glyphpath->moveIsPending )
+    {
+      /* emit offset 1st point as MoveTo */
+      cf2_glyphpath_pushMove( glyphpath, P0 );
+
+      glyphpath->moveIsPending = FALSE;  /* adjust state machine */
+      glyphpath->pathIsOpen    = TRUE;
+
+      glyphpath->offsetStart1 = P1;              /* record second point */
+    }
+
+    if ( glyphpath->elemIsQueued )
+    {
+      FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) );
+
+      cf2_glyphpath_pushPrevElem( glyphpath,
+                                  &glyphpath->hintMap,
+                                  &P0,
+                                  P1,
+                                  FALSE );
+    }
+
+    /* queue the current element with offset points */
+    glyphpath->elemIsQueued = TRUE;
+    glyphpath->prevElemOp   = CF2_PathOpLineTo;
+    glyphpath->prevElemP0   = P0;
+    glyphpath->prevElemP1   = P1;
+
+    /* update current map */
+    if ( cf2_hintmask_isNew( glyphpath->hintMask ) )
+      cf2_hintmap_build( &glyphpath->hintMap,
+                         glyphpath->hStemHintArray,
+                         glyphpath->vStemHintArray,
+                         glyphpath->hintMask,
+                         glyphpath->hintOriginY,
+                         FALSE );
+
+    glyphpath->currentCS.x = x;     /* pre-offset current point */
+    glyphpath->currentCS.y = y;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_glyphpath_curveTo( CF2_GlyphPath  glyphpath,
+                         CF2_Fixed      x1,
+                         CF2_Fixed      y1,
+                         CF2_Fixed      x2,
+                         CF2_Fixed      y2,
+                         CF2_Fixed      x3,
+                         CF2_Fixed      y3 )
+  {
+    CF2_Fixed  xOffset1, yOffset1, xOffset3, yOffset3;
+    FT_Vector  P0, P1, P2, P3;
+
+
+    /* TODO: ignore zero length portions of curve?? */
+    cf2_glyphpath_computeOffset( glyphpath,
+                                 glyphpath->currentCS.x,
+                                 glyphpath->currentCS.y,
+                                 x1,
+                                 y1,
+                                 &xOffset1,
+                                 &yOffset1 );
+    cf2_glyphpath_computeOffset( glyphpath,
+                                 x2,
+                                 y2,
+                                 x3,
+                                 y3,
+                                 &xOffset3,
+                                 &yOffset3 );
+
+    /* add momentum from the middle segment */
+    glyphpath->callbacks->windingMomentum +=
+      cf2_getWindingMomentum( x1, y1, x2, y2 );
+
+    /* construct offset points */
+    P0.x = glyphpath->currentCS.x + xOffset1;
+    P0.y = glyphpath->currentCS.y + yOffset1;
+    P1.x = x1 + xOffset1;
+    P1.y = y1 + yOffset1;
+    /* note: preserve angle of final segment by using offset3 at both ends */
+    P2.x = x2 + xOffset3;
+    P2.y = y2 + yOffset3;
+    P3.x = x3 + xOffset3;
+    P3.y = y3 + yOffset3;
+
+    if ( glyphpath->moveIsPending )
+    {
+      /* emit offset 1st point as MoveTo */
+      cf2_glyphpath_pushMove( glyphpath, P0 );
+
+      glyphpath->moveIsPending = FALSE;
+      glyphpath->pathIsOpen    = TRUE;
+
+      glyphpath->offsetStart1 = P1;              /* record second point */
+    }
+
+    if ( glyphpath->elemIsQueued )
+    {
+      FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) );
+
+      cf2_glyphpath_pushPrevElem( glyphpath,
+                                  &glyphpath->hintMap,
+                                  &P0,
+                                  P1,
+                                  FALSE );
+    }
+
+    /* queue the current element with offset points */
+    glyphpath->elemIsQueued = TRUE;
+    glyphpath->prevElemOp   = CF2_PathOpCubeTo;
+    glyphpath->prevElemP0   = P0;
+    glyphpath->prevElemP1   = P1;
+    glyphpath->prevElemP2   = P2;
+    glyphpath->prevElemP3   = P3;
+
+    /* update current map */
+    if ( cf2_hintmask_isNew( glyphpath->hintMask ) )
+      cf2_hintmap_build( &glyphpath->hintMap,
+                         glyphpath->hStemHintArray,
+                         glyphpath->vStemHintArray,
+                         glyphpath->hintMask,
+                         glyphpath->hintOriginY,
+                         FALSE );
+
+    glyphpath->currentCS.x = x3;       /* pre-offset current point */
+    glyphpath->currentCS.y = y3;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_glyphpath_closeOpenPath( CF2_GlyphPath  glyphpath )
+  {
+    if ( glyphpath->pathIsOpen )
+    {
+      FT_ASSERT( cf2_hintmap_isValid( &glyphpath->firstHintMap ) );
+
+      /* since we need to apply an offset to the implicit lineto, we make */
+      /* it explicit here                                                 */
+      cf2_glyphpath_lineTo( glyphpath,
+                            glyphpath->start.x,
+                            glyphpath->start.y );
+
+      /* Draw previous element (the explicit LineTo we just created,      */
+      /* above) and connect it to the start point, but with the offset we */
+      /* saved from the first element.                                    */
+      /* Use the saved HintMap, too. */
+      FT_ASSERT( glyphpath->elemIsQueued );
+
+      cf2_glyphpath_pushPrevElem( glyphpath,
+                                  &glyphpath->firstHintMap,
+                                  &glyphpath->offsetStart0,
+                                  glyphpath->offsetStart1,
+                                  TRUE );
+
+      /* reset state machine */
+      glyphpath->moveIsPending = TRUE;
+      glyphpath->pathIsOpen    = FALSE;
+      glyphpath->elemIsQueued  = FALSE;
+    }
+  }
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2hints.h b/reactos/lib/3rdparty/freetype/src/cff/cf2hints.h
new file mode 100644 (file)
index 0000000..c4fa922
--- /dev/null
@@ -0,0 +1,287 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2hints.h                                                             */
+/*                                                                         */
+/*    Adobe's code for handling CFF hints (body).                          */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2HINTS_H__
+#define __CF2HINTS_H__
+
+
+FT_BEGIN_HEADER
+
+
+  enum
+  {
+    CF2_MAX_HINTS = 96    /* maximum # of hints */
+  };
+
+
+  /*
+   * A HintMask object stores a bit mask that specifies which hints in the
+   * charstring are active at a given time.  Hints in CFF must be declared
+   * at the start, before any drawing operators, with horizontal hints
+   * preceding vertical hints.  The HintMask is ordered the same way, with
+   * horizontal hints immediately followed by vertical hints.  Clients are
+   * responsible for knowing how many of each type are present.
+   *
+   * The maximum total number of hints is 96, as specified by the CFF
+   * specification.
+   *
+   * A HintMask is built 0 or more times while interpreting a charstring, by
+   * the HintMask operator.  There is only one HintMask, but it is built or
+   * rebuilt each time there is a hint substitution (HintMask operator) in
+   * the charstring.  A default HintMask with all bits set is built if there
+   * has been no HintMask operator prior to the first drawing operator.
+   *
+   */
+
+  typedef struct  CF2_HintMaskRec_
+  {
+    FT_Error*  error;
+
+    FT_Bool  isValid;
+    FT_Bool  isNew;
+
+    size_t  bitCount;
+    size_t  byteCount;
+
+    FT_Byte  mask[( CF2_MAX_HINTS + 7 ) / 8];
+
+  } CF2_HintMaskRec, *CF2_HintMask;
+
+
+  typedef struct  CF2_StemHintRec_
+  {
+    FT_Bool  used;     /* DS positions are valid         */
+
+    CF2_Fixed  min;    /* original character space value */
+    CF2_Fixed  max;
+
+    CF2_Fixed  minDS;  /* DS position after first use    */
+    CF2_Fixed  maxDS;
+
+  } CF2_StemHintRec, *CF2_StemHint;
+
+
+  /*
+   * A HintMap object stores a piecewise linear function for mapping
+   * y-coordinates from character space to device space, providing
+   * appropriate pixel alignment to stem edges.
+   *
+   * The map is implemented as an array of `CF2_Hint' elements, each
+   * representing an edge.  When edges are paired, as from stem hints, the
+   * bottom edge must immediately precede the top edge in the array.
+   * Element character space AND device space positions must both increase
+   * monotonically in the array.  `CF2_Hint' elements are also used as
+   * parameters to `cf2_blues_capture'.
+   *
+   * The `cf2_hintmap_build' method must be called before any drawing
+   * operation (beginning with a Move operator) and at each hint
+   * substitution (HintMask operator).
+   *
+   * The `cf2_hintmap_map' method is called to transform y-coordinates at
+   * each drawing operation (move, line, curve).
+   *
+   */
+
+  /* TODO: make this a CF2_ArrStack and add a deep copy method */
+  enum
+  {
+    CF2_MAX_HINT_EDGES = CF2_MAX_HINTS * 2
+  };
+
+
+  typedef struct  CF2_HintMapRec_
+  {
+    CF2_Font  font;
+
+    /* initial map based on blue zones */
+    struct CF2_HintMapRec_*  initialHintMap;
+
+    /* working storage for 2nd pass adjustHints */
+    CF2_ArrStack  hintMoves;
+
+    FT_Bool  isValid;
+    FT_Bool  hinted;
+
+    CF2_Fixed  scale;
+    CF2_UInt   count;
+
+    /* start search from this index */
+    CF2_UInt  lastIndex;
+
+    CF2_HintRec  edge[CF2_MAX_HINT_EDGES]; /* 192 */
+
+  } CF2_HintMapRec, *CF2_HintMap;
+
+
+  FT_LOCAL( FT_Bool )
+  cf2_hint_isValid( const CF2_Hint  hint );
+  FT_LOCAL( FT_Bool )
+  cf2_hint_isTop( const CF2_Hint  hint );
+  FT_LOCAL( FT_Bool )
+  cf2_hint_isBottom( const CF2_Hint  hint );
+  FT_LOCAL( void )
+  cf2_hint_lock( CF2_Hint  hint );
+
+
+  FT_LOCAL( void )
+  cf2_hintmap_init( CF2_HintMap   hintmap,
+                    CF2_Font      font,
+                    CF2_HintMap   initialMap,
+                    CF2_ArrStack  hintMoves,
+                    CF2_Fixed     scale );
+  FT_LOCAL( void )
+  cf2_hintmap_build( CF2_HintMap   hintmap,
+                     CF2_ArrStack  hStemHintArray,
+                     CF2_ArrStack  vStemHintArray,
+                     CF2_HintMask  hintMask,
+                     CF2_Fixed     hintOrigin,
+                     FT_Bool       initialMap );
+
+
+  /*
+   * GlyphPath is a wrapper for drawing operations that scales the
+   * coordinates according to the render matrix and HintMap.  It also tracks
+   * open paths to control ClosePath and to insert MoveTo for broken fonts.
+   *
+   */
+  typedef struct  CF2_GlyphPathRec_
+  {
+    /* TODO: gather some of these into a hinting context */
+
+    CF2_Font              font;           /* font instance    */
+    CF2_OutlineCallbacks  callbacks;      /* outline consumer */
+
+
+    CF2_HintMapRec  hintMap;        /* current hint map            */
+    CF2_HintMapRec  firstHintMap;   /* saved copy                  */
+    CF2_HintMapRec  initialHintMap; /* based on all captured hints */
+
+    CF2_ArrStackRec  hintMoves;  /* list of hint moves for 2nd pass */
+
+    CF2_Fixed  scaleX;         /* matrix a */
+    CF2_Fixed  scaleC;         /* matrix c */
+    CF2_Fixed  scaleY;         /* matrix d */
+
+    FT_Vector  fractionalTranslation;  /* including deviceXScale */
+#if 0
+    CF2_Fixed  hShift;    /* character space horizontal shift */
+                          /* (for fauxing)                    */
+#endif
+
+    FT_Bool  pathIsOpen;     /* true after MoveTo                     */
+    FT_Bool  darken;         /* true if stem darkening                */
+    FT_Bool  moveIsPending;  /* true between MoveTo and offset MoveTo */
+
+    /* references used to call `cf2_hintmap_build', if necessary */
+    CF2_ArrStack         hStemHintArray;
+    CF2_ArrStack         vStemHintArray;
+    CF2_HintMask         hintMask;     /* ptr to the current mask */
+    CF2_Fixed            hintOriginY;  /* copy of current origin  */
+    const CF2_BluesRec*  blues;
+
+    CF2_Fixed  xOffset;        /* character space offsets */
+    CF2_Fixed  yOffset;
+
+    /* character space miter limit threshold */
+    CF2_Fixed  miterLimit;
+    /* vertical/horzizontal snap distance in character space */
+    CF2_Fixed  snapThreshold;
+
+    FT_Vector  offsetStart0;  /* first and second points of first */
+    FT_Vector  offsetStart1;  /* element with offset applied      */
+
+    /* current point, character space, before offset */
+    FT_Vector  currentCS;
+    /* current point, device space */
+    FT_Vector  currentDS;
+    FT_Vector  start;         /* start point of subpath */
+
+    /* the following members constitute the `queue' of one element */
+    FT_Bool  elemIsQueued;
+    CF2_Int  prevElemOp;
+
+    FT_Vector  prevElemP0;
+    FT_Vector  prevElemP1;
+    FT_Vector  prevElemP2;
+    FT_Vector  prevElemP3;
+
+  } CF2_GlyphPathRec, *CF2_GlyphPath;
+
+
+  FT_LOCAL( void )
+  cf2_glyphpath_init( CF2_GlyphPath         glyphpath,
+                      CF2_Font              font,
+                      CF2_OutlineCallbacks  callbacks,
+                      CF2_Fixed             scaleY,
+                      /* CF2_Fixed hShift, */
+                      CF2_ArrStack          hStemHintArray,
+                      CF2_ArrStack          vStemHintArray,
+                      CF2_HintMask          hintMask,
+                      CF2_Fixed             hintOrigin,
+                      const CF2_Blues       blues,
+                      const FT_Vector*      fractionalTranslation );
+  FT_LOCAL( void )
+  cf2_glyphpath_finalize( CF2_GlyphPath  glyphpath );
+
+  FT_LOCAL( void )
+  cf2_glyphpath_moveTo( CF2_GlyphPath  glyphpath,
+                        CF2_Fixed      x,
+                        CF2_Fixed      y );
+  FT_LOCAL( void )
+  cf2_glyphpath_lineTo( CF2_GlyphPath  glyphpath,
+                        CF2_Fixed      x,
+                        CF2_Fixed      y );
+  FT_LOCAL( void )
+  cf2_glyphpath_curveTo( CF2_GlyphPath  glyphpath,
+                         CF2_Fixed      x1,
+                         CF2_Fixed      y1,
+                         CF2_Fixed      x2,
+                         CF2_Fixed      y2,
+                         CF2_Fixed      x3,
+                         CF2_Fixed      y3 );
+  FT_LOCAL( void )
+  cf2_glyphpath_closeOpenPath( CF2_GlyphPath  glyphpath );
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2HINTS_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2intrp.c b/reactos/lib/3rdparty/freetype/src/cff/cf2intrp.c
new file mode 100644 (file)
index 0000000..5610917
--- /dev/null
@@ -0,0 +1,1538 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2intrp.c                                                             */
+/*                                                                         */
+/*    Adobe's CFF Interpreter (body).                                      */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "cf2ft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "cf2glue.h"
+#include "cf2font.h"
+#include "cf2stack.h"
+#include "cf2hints.h"
+
+#include "cf2error.h"
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_cf2interp
+
+
+  /* some operators are not implemented yet */
+#define CF2_FIXME  FT_TRACE4(( "cf2_interpT2CharString:"            \
+                               " operator not implemented yet\n" ))
+
+
+
+  FT_LOCAL_DEF( void )
+  cf2_hintmask_init( CF2_HintMask  hintmask,
+                     FT_Error*     error )
+  {
+    FT_ZERO( hintmask );
+
+    hintmask->error = error;
+  }
+
+
+  FT_LOCAL_DEF( FT_Bool )
+  cf2_hintmask_isValid( const CF2_HintMask  hintmask )
+  {
+    return hintmask->isValid;
+  }
+
+
+  FT_LOCAL_DEF( FT_Bool )
+  cf2_hintmask_isNew( const CF2_HintMask  hintmask )
+  {
+    return hintmask->isNew;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_hintmask_setNew( CF2_HintMask  hintmask,
+                       FT_Bool       val )
+  {
+    hintmask->isNew = val;
+  }
+
+
+  /* clients call `getMaskPtr' in order to iterate */
+  /* through hint mask                             */
+
+  FT_LOCAL_DEF( FT_Byte* )
+  cf2_hintmask_getMaskPtr( CF2_HintMask  hintmask )
+  {
+    return hintmask->mask;
+  }
+
+
+  static size_t
+  cf2_hintmask_setCounts( CF2_HintMask  hintmask,
+                          size_t        bitCount )
+  {
+    if ( bitCount > CF2_MAX_HINTS )
+    {
+      /* total of h and v stems must be <= 96 */
+      CF2_SET_ERROR( hintmask->error, Invalid_Glyph_Format );
+      return 0;
+    }
+
+    hintmask->bitCount  = bitCount;
+    hintmask->byteCount = ( hintmask->bitCount + 7 ) / 8;
+
+    hintmask->isValid = TRUE;
+    hintmask->isNew   = TRUE;
+
+    return bitCount;
+  }
+
+
+  /* consume the hintmask bytes from the charstring, advancing the src */
+  /* pointer                                                           */
+  static void
+  cf2_hintmask_read( CF2_HintMask  hintmask,
+                     CF2_Buffer    charstring,
+                     size_t        bitCount )
+  {
+    size_t  i;
+
+#ifndef CF2_NDEBUG
+    /* these are the bits in the final mask byte that should be zero  */
+    /* Note: this variable is only used in an assert expression below */
+    /* and then only if CF2_NDEBUG is not defined                     */
+    CF2_UInt  mask = ( 1 << ( -(CF2_Int)bitCount & 7 ) ) - 1;
+#endif
+
+
+    /* initialize counts and isValid */
+    if ( cf2_hintmask_setCounts( hintmask, bitCount ) == 0 )
+      return;
+
+    FT_ASSERT( hintmask->byteCount > 0 );
+
+    FT_TRACE4(( " (maskbytes:" ));
+
+    /* set mask and advance interpreter's charstring pointer */
+    for ( i = 0; i < hintmask->byteCount; i++ )
+    {
+      hintmask->mask[i] = (FT_Byte)cf2_buf_readByte( charstring );
+      FT_TRACE4(( " 0x%02X", hintmask->mask[i] ));
+    }
+
+    FT_TRACE4(( ")\n" ));
+
+    /* assert any unused bits in last byte are zero unless there's a prior */
+    /* error                                                               */
+    /* bitCount -> mask, 0 -> 0, 1 -> 7f, 2 -> 3f, ... 6 -> 3, 7 -> 1      */
+#ifndef CF2_NDEBUG
+    FT_ASSERT( ( hintmask->mask[hintmask->byteCount - 1] & mask ) == 0 ||
+               *hintmask->error                                        );
+#endif
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_hintmask_setAll( CF2_HintMask  hintmask,
+                       size_t        bitCount )
+  {
+    size_t    i;
+    CF2_UInt  mask = ( 1 << ( -(CF2_Int)bitCount & 7 ) ) - 1;
+
+
+    /* initialize counts and isValid */
+    if ( cf2_hintmask_setCounts( hintmask, bitCount ) == 0 )
+      return;
+
+    FT_ASSERT( hintmask->byteCount > 0 );
+    FT_ASSERT( hintmask->byteCount <
+                 sizeof ( hintmask->mask ) / sizeof ( hintmask->mask[0] ) );
+
+    /* set mask to all ones */
+    for ( i = 0; i < hintmask->byteCount; i++ )
+      hintmask->mask[i] = 0xFF;
+
+    /* clear unused bits                                              */
+    /* bitCount -> mask, 0 -> 0, 1 -> 7f, 2 -> 3f, ... 6 -> 3, 7 -> 1 */
+    hintmask->mask[hintmask->byteCount - 1] &= ~mask;
+  }
+
+
+  /* Type2 charstring opcodes */
+  enum
+  {
+    cf2_cmdRESERVED_0,   /* 0 */
+    cf2_cmdHSTEM,        /* 1 */
+    cf2_cmdRESERVED_2,   /* 2 */
+    cf2_cmdVSTEM,        /* 3 */
+    cf2_cmdVMOVETO,      /* 4 */
+    cf2_cmdRLINETO,      /* 5 */
+    cf2_cmdHLINETO,      /* 6 */
+    cf2_cmdVLINETO,      /* 7 */
+    cf2_cmdRRCURVETO,    /* 8 */
+    cf2_cmdRESERVED_9,   /* 9 */
+    cf2_cmdCALLSUBR,     /* 10 */
+    cf2_cmdRETURN,       /* 11 */
+    cf2_cmdESC,          /* 12 */
+    cf2_cmdRESERVED_13,  /* 13 */
+    cf2_cmdENDCHAR,      /* 14 */
+    cf2_cmdRESERVED_15,  /* 15 */
+    cf2_cmdRESERVED_16,  /* 16 */
+    cf2_cmdRESERVED_17,  /* 17 */
+    cf2_cmdHSTEMHM,      /* 18 */
+    cf2_cmdHINTMASK,     /* 19 */
+    cf2_cmdCNTRMASK,     /* 20 */
+    cf2_cmdRMOVETO,      /* 21 */
+    cf2_cmdHMOVETO,      /* 22 */
+    cf2_cmdVSTEMHM,      /* 23 */
+    cf2_cmdRCURVELINE,   /* 24 */
+    cf2_cmdRLINECURVE,   /* 25 */
+    cf2_cmdVVCURVETO,    /* 26 */
+    cf2_cmdHHCURVETO,    /* 27 */
+    cf2_cmdEXTENDEDNMBR, /* 28 */
+    cf2_cmdCALLGSUBR,    /* 29 */
+    cf2_cmdVHCURVETO,    /* 30 */
+    cf2_cmdHVCURVETO     /* 31 */
+  };
+
+  enum
+  {
+    cf2_escDOTSECTION,   /* 0 */
+    cf2_escRESERVED_1,   /* 1 */
+    cf2_escRESERVED_2,   /* 2 */
+    cf2_escAND,          /* 3 */
+    cf2_escOR,           /* 4 */
+    cf2_escNOT,          /* 5 */
+    cf2_escRESERVED_6,   /* 6 */
+    cf2_escRESERVED_7,   /* 7 */
+    cf2_escRESERVED_8,   /* 8 */
+    cf2_escABS,          /* 9 */
+    cf2_escADD,          /* 10     like otherADD */
+    cf2_escSUB,          /* 11     like otherSUB */
+    cf2_escDIV,          /* 12 */
+    cf2_escRESERVED_13,  /* 13 */
+    cf2_escNEG,          /* 14 */
+    cf2_escEQ,           /* 15 */
+    cf2_escRESERVED_16,  /* 16 */
+    cf2_escRESERVED_17,  /* 17 */
+    cf2_escDROP,         /* 18 */
+    cf2_escRESERVED_19,  /* 19 */
+    cf2_escPUT,          /* 20     like otherPUT    */
+    cf2_escGET,          /* 21     like otherGET    */
+    cf2_escIFELSE,       /* 22     like otherIFELSE */
+    cf2_escRANDOM,       /* 23     like otherRANDOM */
+    cf2_escMUL,          /* 24     like otherMUL    */
+    cf2_escRESERVED_25,  /* 25 */
+    cf2_escSQRT,         /* 26 */
+    cf2_escDUP,          /* 27     like otherDUP    */
+    cf2_escEXCH,         /* 28     like otherEXCH   */
+    cf2_escINDEX,        /* 29 */
+    cf2_escROLL,         /* 30 */
+    cf2_escRESERVED_31,  /* 31 */
+    cf2_escRESERVED_32,  /* 32 */
+    cf2_escRESERVED_33,  /* 33 */
+    cf2_escHFLEX,        /* 34 */
+    cf2_escFLEX,         /* 35 */
+    cf2_escHFLEX1,       /* 36 */
+    cf2_escFLEX1         /* 37 */
+  };
+
+
+  /* `stemHintArray' does not change once we start drawing the outline. */
+  static void
+  cf2_doStems( const CF2_Font  font,
+               CF2_Stack       opStack,
+               CF2_ArrStack    stemHintArray,
+               CF2_Fixed*      width,
+               FT_Bool*        haveWidth,
+               CF2_Fixed       hintOffset )
+  {
+    CF2_UInt  i;
+    CF2_UInt  count       = cf2_stack_count( opStack );
+    FT_Bool   hasWidthArg = (FT_Bool)( count & 1 );
+
+    /* variable accumulates delta values from operand stack */
+    CF2_Fixed  position = hintOffset;
+
+    if ( hasWidthArg && ! *haveWidth )
+      *width = cf2_stack_getReal( opStack, 0 ) +
+                 cf2_getNominalWidthX( font->decoder );
+
+    if ( font->decoder->width_only )
+      goto exit;
+
+    for ( i = hasWidthArg ? 1 : 0; i < count; i += 2 )
+    {
+      /* construct a CF2_StemHint and push it onto the list */
+      CF2_StemHintRec  stemhint;
+
+
+      stemhint.min  =
+        position   += cf2_stack_getReal( opStack, i );
+      stemhint.max  =
+        position   += cf2_stack_getReal( opStack, i + 1 );
+
+      stemhint.used  = FALSE;
+      stemhint.maxDS =
+      stemhint.minDS = 0;
+
+      cf2_arrstack_push( stemHintArray, &stemhint ); /* defer error check */
+    }
+
+    cf2_stack_clear( opStack );
+
+  exit:
+    /* cf2_doStems must define a width (may be default) */
+    *haveWidth = TRUE;
+  }
+
+
+  static void
+  cf2_doFlex( CF2_Stack       opStack,
+              CF2_Fixed*      curX,
+              CF2_Fixed*      curY,
+              CF2_GlyphPath   glyphPath,
+              const FT_Bool*  readFromStack,
+              FT_Bool         doConditionalLastRead )
+  {
+    CF2_Fixed  vals[14];
+    CF2_UInt   index;
+    FT_Bool    isHFlex;
+    CF2_Int    top, i, j;
+
+
+    vals[0] = *curX;
+    vals[1] = *curY;
+    index   = 0;
+    isHFlex = readFromStack[9] == FALSE;
+    top     = isHFlex ? 9 : 10;
+
+    for ( i = 0; i < top; i++ )
+    {
+      vals[i + 2] = vals[i];
+      if ( readFromStack[i] )
+        vals[i + 2] += cf2_stack_getReal( opStack, index++ );
+    }
+
+    if ( isHFlex )
+      vals[9 + 2] = *curY;
+
+    if ( doConditionalLastRead )
+    {
+      FT_Bool    lastIsX = (FT_Bool)( cf2_fixedAbs( vals[10] - *curX ) >
+                                        cf2_fixedAbs( vals[11] - *curY ) );
+      CF2_Fixed  lastVal = cf2_stack_getReal( opStack, index );
+
+
+      if ( lastIsX )
+      {
+        vals[12] = vals[10] + lastVal;
+        vals[13] = *curY;
+      }
+      else
+      {
+        vals[12] = *curX;
+        vals[13] = vals[11] + lastVal;
+      }
+    }
+    else
+    {
+      if ( readFromStack[10] )
+        vals[12] = vals[10] + cf2_stack_getReal( opStack, index++ );
+      else
+        vals[12] = *curX;
+
+      if ( readFromStack[11] )
+        vals[13] = vals[11] + cf2_stack_getReal( opStack, index );
+      else
+        vals[13] = *curY;
+    }
+
+    for ( j = 0; j < 2; j++ )
+      cf2_glyphpath_curveTo( glyphPath, vals[j * 6 + 2],
+                                        vals[j * 6 + 3],
+                                        vals[j * 6 + 4],
+                                        vals[j * 6 + 5],
+                                        vals[j * 6 + 6],
+                                        vals[j * 6 + 7] );
+
+    cf2_stack_clear( opStack );
+
+    *curX = vals[12];
+    *curY = vals[13];
+  }
+
+
+  /*
+   * `error' is a shared error code used by many objects in this
+   * routine.  Before the code continues from an error, it must check and
+   * record the error in `*error'.  The idea is that this shared
+   * error code will record the first error encountered.  If testing
+   * for an error anyway, the cost of `goto exit' is small, so we do it,
+   * even if continuing would be safe.  In this case, `lastError' is
+   * set, so the testing and storing can be done in one place, at `exit'.
+   *
+   * Continuing after an error is intended for objects which do their own
+   * testing of `*error', e.g., array stack functions.  This allows us to
+   * avoid an extra test after the call.
+   *
+   * Unimplemented opcodes are ignored.
+   *
+   */
+  FT_LOCAL_DEF( void )
+  cf2_interpT2CharString( CF2_Font              font,
+                          CF2_Buffer            buf,
+                          CF2_OutlineCallbacks  callbacks,
+                          const FT_Vector*      translation,
+                          FT_Bool               doingSeac,
+                          CF2_Fixed             curX,
+                          CF2_Fixed             curY,
+                          CF2_Fixed*            width )
+  {
+    /* lastError is used for errors that are immediately tested */
+    FT_Error  lastError = FT_Err_Ok;
+
+    /* pointer to parsed font object */
+    CFF_Decoder*  decoder = font->decoder;
+
+    FT_Error*  error  = &font->error;
+    FT_Memory  memory = font->memory;
+
+    CF2_Fixed  scaleY        = font->innerTransform.d;
+    CF2_Fixed  nominalWidthX = cf2_getNominalWidthX( decoder );
+
+    /* save this for hinting seac accents */
+    CF2_Fixed  hintOriginY = curY;
+
+    CF2_Stack  opStack = NULL;
+    FT_Byte    op1;                       /* first opcode byte */
+
+    /* instruction limit; 20,000,000 matches Avalon */
+    FT_UInt32  instructionLimit = 20000000UL;
+
+    CF2_ArrStackRec  subrStack;
+
+    FT_Bool     haveWidth;
+    CF2_Buffer  charstring = NULL;
+
+    CF2_Int  charstringIndex = -1;       /* initialize to empty */
+
+    /* TODO: placeholders for hint structures */
+
+    /* objects used for hinting */
+    CF2_ArrStackRec  hStemHintArray;
+    CF2_ArrStackRec  vStemHintArray;
+
+    CF2_HintMaskRec   hintMask;
+    CF2_GlyphPathRec  glyphPath;
+
+
+    /* initialize the remaining objects */
+    cf2_arrstack_init( &subrStack,
+                       memory,
+                       error,
+                       sizeof ( CF2_BufferRec ) );
+    cf2_arrstack_init( &hStemHintArray,
+                       memory,
+                       error,
+                       sizeof ( CF2_StemHintRec ) );
+    cf2_arrstack_init( &vStemHintArray,
+                       memory,
+                       error,
+                       sizeof ( CF2_StemHintRec ) );
+
+    /* initialize CF2_StemHint arrays */
+    cf2_hintmask_init( &hintMask, error );
+
+    /* initialize path map to manage drawing operations */
+
+    /* Note: last 4 params are used to handle `MoveToPermissive', which */
+    /*       may need to call `hintMap.Build'                           */
+    /* TODO: MoveToPermissive is gone; are these still needed?          */
+    cf2_glyphpath_init( &glyphPath,
+                        font,
+                        callbacks,
+                        scaleY,
+                        /* hShift, */
+                        &hStemHintArray,
+                        &vStemHintArray,
+                        &hintMask,
+                        hintOriginY,
+                        &font->blues,
+                        translation );
+
+    /*
+     * Initialize state for width parsing.  From the CFF Spec:
+     *
+     *   The first stack-clearing operator, which must be one of hstem,
+     *   hstemhm, vstem, vstemhm, cntrmask, hintmask, hmoveto, vmoveto,
+     *   rmoveto, or endchar, takes an additional argument - the width (as
+     *   described earlier), which may be expressed as zero or one numeric
+     *   argument.
+     *
+     * What we implement here uses the first validly specified width, but
+     * does not detect errors for specifying more than one width.
+     *
+     * If one of the above operators occurs without explicitly specifying
+     * a width, we assume the default width.
+     *
+     */
+    haveWidth = FALSE;
+    *width    = cf2_getDefaultWidthX( decoder );
+
+    /*
+     * Note: at this point, all pointers to resources must be NULL
+     * and all local objects must be initialized.
+     * There must be no branches to exit: above this point.
+     *
+     */
+
+    /* allocate an operand stack */
+    opStack = cf2_stack_init( memory, error );
+    if ( !opStack )
+    {
+      lastError = FT_THROW( Out_Of_Memory );
+      goto exit;
+    }
+
+    /* initialize subroutine stack by placing top level charstring as */
+    /* first element (max depth plus one for the charstring)          */
+    /* Note: Caller owns and must finalize the first charstring.      */
+    /*       Our copy of it does not change that requirement.         */
+    cf2_arrstack_setCount( &subrStack, CF2_MAX_SUBR + 1 );
+
+    charstring  = (CF2_Buffer)cf2_arrstack_getBuffer( &subrStack );
+    *charstring = *buf;    /* structure copy */
+
+    charstringIndex = 0;       /* entry is valid now */
+
+    /* catch errors so far */
+    if ( *error )
+      goto exit;
+
+    /* main interpreter loop */
+    while ( 1 )
+    {
+      if ( cf2_buf_isEnd( charstring ) )
+      {
+        /* If we've reached the end of the charstring, simulate a */
+        /* cf2_cmdRETURN or cf2_cmdENDCHAR.                       */
+        if ( charstringIndex )
+          op1 = cf2_cmdRETURN;  /* end of buffer for subroutine */
+        else
+          op1 = cf2_cmdENDCHAR; /* end of buffer for top level charstring */
+      }
+      else
+        op1 = (FT_Byte)cf2_buf_readByte( charstring );
+
+      /* check for errors once per loop */
+      if ( *error )
+        goto exit;
+
+      instructionLimit--;
+      if ( instructionLimit == 0 )
+      {
+        lastError = FT_THROW( Invalid_Glyph_Format );
+        goto exit;
+      }
+
+      switch( op1 )
+      {
+      case cf2_cmdRESERVED_0:
+      case cf2_cmdRESERVED_2:
+      case cf2_cmdRESERVED_9:
+      case cf2_cmdRESERVED_13:
+      case cf2_cmdRESERVED_15:
+      case cf2_cmdRESERVED_16:
+      case cf2_cmdRESERVED_17:
+        /* we may get here if we have a prior error */
+        FT_TRACE4(( " unknown op (%d)\n", op1 ));
+        break;
+
+      case cf2_cmdHSTEMHM:
+      case cf2_cmdHSTEM:
+        FT_TRACE4(( op1 == cf2_cmdHSTEMHM ? " hstemhm\n" : " hstem\n" ));
+
+        /* never add hints after the mask is computed */
+        if ( cf2_hintmask_isValid( &hintMask ) )
+          FT_TRACE4(( "cf2_interpT2CharString:"
+                      " invalid horizontal hint mask\n" ));
+
+        cf2_doStems( font,
+                     opStack,
+                     &hStemHintArray,
+                     width,
+                     &haveWidth,
+                     0 );
+
+        if ( font->decoder->width_only )
+            goto exit;
+
+        break;
+
+      case cf2_cmdVSTEMHM:
+      case cf2_cmdVSTEM:
+        FT_TRACE4(( op1 == cf2_cmdVSTEMHM ? " vstemhm\n" : " vstem\n" ));
+
+        /* never add hints after the mask is computed */
+        if ( cf2_hintmask_isValid( &hintMask ) )
+          FT_TRACE4(( "cf2_interpT2CharString:"
+                      " invalid vertical hint mask\n" ));
+
+        cf2_doStems( font,
+                     opStack,
+                     &vStemHintArray,
+                     width,
+                     &haveWidth,
+                     0 );
+
+        if ( font->decoder->width_only )
+            goto exit;
+
+        break;
+
+      case cf2_cmdVMOVETO:
+        FT_TRACE4(( " vmoveto\n" ));
+
+        if ( cf2_stack_count( opStack ) > 1 && !haveWidth )
+          *width = cf2_stack_getReal( opStack, 0 ) + nominalWidthX;
+
+        /* width is defined or default after this */
+        haveWidth = TRUE;
+
+        if ( font->decoder->width_only )
+            goto exit;
+
+        curY += cf2_stack_popFixed( opStack );
+
+        cf2_glyphpath_moveTo( &glyphPath, curX, curY );
+
+        break;
+
+      case cf2_cmdRLINETO:
+        {
+          CF2_UInt  index;
+          CF2_UInt  count = cf2_stack_count( opStack );
+
+
+          FT_TRACE4(( " rlineto\n" ));
+
+          for ( index = 0; index < count; index += 2 )
+          {
+            curX += cf2_stack_getReal( opStack, index + 0 );
+            curY += cf2_stack_getReal( opStack, index + 1 );
+
+            cf2_glyphpath_lineTo( &glyphPath, curX, curY );
+          }
+
+          cf2_stack_clear( opStack );
+        }
+        continue; /* no need to clear stack again */
+
+      case cf2_cmdHLINETO:
+      case cf2_cmdVLINETO:
+        {
+          CF2_UInt  index;
+          CF2_UInt  count = cf2_stack_count( opStack );
+
+          FT_Bool  isX = op1 == cf2_cmdHLINETO;
+
+
+          FT_TRACE4(( isX ? " hlineto\n" : " vlineto\n" ));
+
+          for ( index = 0; index < count; index++ )
+          {
+            CF2_Fixed  v = cf2_stack_getReal( opStack, index );
+
+
+            if ( isX )
+              curX += v;
+            else
+              curY += v;
+
+            isX = !isX;
+
+            cf2_glyphpath_lineTo( &glyphPath, curX, curY );
+          }
+
+          cf2_stack_clear( opStack );
+        }
+        continue;
+
+      case cf2_cmdRCURVELINE:
+      case cf2_cmdRRCURVETO:
+        {
+          CF2_UInt  count = cf2_stack_count( opStack );
+          CF2_UInt  index = 0;
+
+
+          FT_TRACE4(( op1 == cf2_cmdRCURVELINE ? " rcurveline\n"
+                                               : " rrcurveto\n" ));
+
+          while ( index + 6 <= count )
+          {
+            CF2_Fixed  x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;
+            CF2_Fixed  y1 = cf2_stack_getReal( opStack, index + 1 ) + curY;
+            CF2_Fixed  x2 = cf2_stack_getReal( opStack, index + 2 ) + x1;
+            CF2_Fixed  y2 = cf2_stack_getReal( opStack, index + 3 ) + y1;
+            CF2_Fixed  x3 = cf2_stack_getReal( opStack, index + 4 ) + x2;
+            CF2_Fixed  y3 = cf2_stack_getReal( opStack, index + 5 ) + y2;
+
+
+            cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
+
+            curX   = x3;
+            curY   = y3;
+            index += 6;
+          }
+
+          if ( op1 == cf2_cmdRCURVELINE )
+          {
+            curX += cf2_stack_getReal( opStack, index + 0 );
+            curY += cf2_stack_getReal( opStack, index + 1 );
+
+            cf2_glyphpath_lineTo( &glyphPath, curX, curY );
+          }
+
+          cf2_stack_clear( opStack );
+        }
+        continue; /* no need to clear stack again */
+
+      case cf2_cmdCALLGSUBR:
+      case cf2_cmdCALLSUBR:
+        {
+          CF2_UInt  subrIndex;
+
+
+          FT_TRACE4(( op1 == cf2_cmdCALLGSUBR ? " callgsubr"
+                                              : " callsubr" ));
+
+          if ( charstringIndex > CF2_MAX_SUBR )
+          {
+            /* max subr plus one for charstring */
+            lastError = FT_THROW( Invalid_Glyph_Format );
+            goto exit;                      /* overflow of stack */
+          }
+
+          /* push our current CFF charstring region on subrStack */
+          charstring = (CF2_Buffer)
+                         cf2_arrstack_getPointer( &subrStack,
+                                                  charstringIndex + 1 );
+
+          /* set up the new CFF region and pointer */
+          subrIndex = cf2_stack_popInt( opStack );
+
+          switch ( op1 )
+          {
+          case cf2_cmdCALLGSUBR:
+            FT_TRACE4(( "(%d)\n", subrIndex + decoder->globals_bias ));
+
+            if ( cf2_initGlobalRegionBuffer( decoder,
+                                             subrIndex,
+                                             charstring ) )
+            {
+              lastError = FT_THROW( Invalid_Glyph_Format );
+              goto exit;  /* subroutine lookup or stream error */
+            }
+            break;
+
+          default:
+            /* cf2_cmdCALLSUBR */
+            FT_TRACE4(( "(%d)\n", subrIndex + decoder->locals_bias ));
+
+            if ( cf2_initLocalRegionBuffer( decoder,
+                                            subrIndex,
+                                            charstring ) )
+            {
+              lastError = FT_THROW( Invalid_Glyph_Format );
+              goto exit;  /* subroutine lookup or stream error */
+            }
+          }
+
+          charstringIndex += 1;       /* entry is valid now */
+        }
+        continue; /* do not clear the stack */
+
+      case cf2_cmdRETURN:
+        FT_TRACE4(( " return\n" ));
+
+        if ( charstringIndex < 1 )
+        {
+          /* Note: cannot return from top charstring */
+          lastError = FT_THROW( Invalid_Glyph_Format );
+          goto exit;                      /* underflow of stack */
+        }
+
+        /* restore position in previous charstring */
+        charstring = (CF2_Buffer)
+                       cf2_arrstack_getPointer( &subrStack,
+                                                --charstringIndex );
+        continue;     /* do not clear the stack */
+
+      case cf2_cmdESC:
+        {
+          FT_Byte  op2 = (FT_Byte)cf2_buf_readByte( charstring );
+
+
+          switch ( op2 )
+          {
+          case cf2_escDOTSECTION:
+            /* something about `flip type of locking' -- ignore it */
+            FT_TRACE4(( " dotsection\n" ));
+
+            break;
+
+          /* TODO: should these operators be supported? */
+          case cf2_escAND: /* in spec */
+            FT_TRACE4(( " and\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escOR: /* in spec */
+            FT_TRACE4(( " or\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escNOT: /* in spec */
+            FT_TRACE4(( " not\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escABS: /* in spec */
+            FT_TRACE4(( " abs\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escADD: /* in spec */
+            FT_TRACE4(( " add\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escSUB: /* in spec */
+            FT_TRACE4(( " sub\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escDIV: /* in spec */
+            FT_TRACE4(( " div\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escNEG: /* in spec */
+            FT_TRACE4(( " neg\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escEQ: /* in spec */
+            FT_TRACE4(( " eq\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escDROP: /* in spec */
+            FT_TRACE4(( " drop\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escPUT: /* in spec */
+            FT_TRACE4(( " put\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escGET: /* in spec */
+            FT_TRACE4(( " get\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escIFELSE: /* in spec */
+            FT_TRACE4(( " ifelse\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escRANDOM: /* in spec */
+            FT_TRACE4(( " random\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escMUL: /* in spec */
+            FT_TRACE4(( " mul\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escSQRT: /* in spec */
+            FT_TRACE4(( " sqrt\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escDUP: /* in spec */
+            FT_TRACE4(( " dup\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escEXCH: /* in spec */
+            FT_TRACE4(( " exch\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escINDEX: /* in spec */
+            FT_TRACE4(( " index\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escROLL: /* in spec */
+            FT_TRACE4(( " roll\n" ));
+
+            CF2_FIXME;
+            break;
+
+          case cf2_escHFLEX:
+            {
+              static const FT_Bool  readFromStack[12] =
+              {
+                TRUE /* dx1 */, FALSE /* dy1 */,
+                TRUE /* dx2 */, TRUE  /* dy2 */,
+                TRUE /* dx3 */, FALSE /* dy3 */,
+                TRUE /* dx4 */, FALSE /* dy4 */,
+                TRUE /* dx5 */, FALSE /* dy5 */,
+                TRUE /* dx6 */, FALSE /* dy6 */
+              };
+
+
+              FT_TRACE4(( " hflex\n" ));
+
+              cf2_doFlex( opStack,
+                          &curX,
+                          &curY,
+                          &glyphPath,
+                          readFromStack,
+                          FALSE /* doConditionalLastRead */ );
+            }
+            continue;
+
+          case cf2_escFLEX:
+            {
+              static const FT_Bool  readFromStack[12] =
+              {
+                TRUE /* dx1 */, TRUE /* dy1 */,
+                TRUE /* dx2 */, TRUE /* dy2 */,
+                TRUE /* dx3 */, TRUE /* dy3 */,
+                TRUE /* dx4 */, TRUE /* dy4 */,
+                TRUE /* dx5 */, TRUE /* dy5 */,
+                TRUE /* dx6 */, TRUE /* dy6 */
+              };
+
+
+              FT_TRACE4(( " flex\n" ));
+
+              cf2_doFlex( opStack,
+                          &curX,
+                          &curY,
+                          &glyphPath,
+                          readFromStack,
+                          FALSE /* doConditionalLastRead */ );
+            }
+            break;      /* TODO: why is this not a continue? */
+
+          case cf2_escHFLEX1:
+            {
+              static const FT_Bool  readFromStack[12] =
+              {
+                TRUE /* dx1 */, TRUE  /* dy1 */,
+                TRUE /* dx2 */, TRUE  /* dy2 */,
+                TRUE /* dx3 */, FALSE /* dy3 */,
+                TRUE /* dx4 */, FALSE /* dy4 */,
+                TRUE /* dx5 */, TRUE  /* dy5 */,
+                TRUE /* dx6 */, FALSE /* dy6 */
+              };
+
+
+              FT_TRACE4(( " hflex1\n" ));
+
+              cf2_doFlex( opStack,
+                          &curX,
+                          &curY,
+                          &glyphPath,
+                          readFromStack,
+                          FALSE /* doConditionalLastRead */ );
+            }
+            continue;
+
+          case cf2_escFLEX1:
+            {
+              static const FT_Bool  readFromStack[12] =
+              {
+                TRUE  /* dx1 */, TRUE  /* dy1 */,
+                TRUE  /* dx2 */, TRUE  /* dy2 */,
+                TRUE  /* dx3 */, TRUE  /* dy3 */,
+                TRUE  /* dx4 */, TRUE  /* dy4 */,
+                TRUE  /* dx5 */, TRUE  /* dy5 */,
+                FALSE /* dx6 */, FALSE /* dy6 */
+              };
+
+
+              FT_TRACE4(( " flex1\n" ));
+
+              cf2_doFlex( opStack,
+                          &curX,
+                          &curY,
+                          &glyphPath,
+                          readFromStack,
+                          TRUE /* doConditionalLastRead */ );
+            }
+            continue;
+
+          case cf2_escRESERVED_1:
+          case cf2_escRESERVED_2:
+          case cf2_escRESERVED_6:
+          case cf2_escRESERVED_7:
+          case cf2_escRESERVED_8:
+          case cf2_escRESERVED_13:
+          case cf2_escRESERVED_16:
+          case cf2_escRESERVED_17:
+          case cf2_escRESERVED_19:
+          case cf2_escRESERVED_25:
+          case cf2_escRESERVED_31:
+          case cf2_escRESERVED_32:
+          case cf2_escRESERVED_33:
+          default:
+            FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+
+          }; /* end of switch statement checking `op2' */
+
+        } /* case cf2_cmdESC */
+        break;
+
+      case cf2_cmdENDCHAR:
+        FT_TRACE4(( " endchar\n" ));
+
+        if ( cf2_stack_count( opStack ) == 1 ||
+             cf2_stack_count( opStack ) == 5 )
+        {
+          if ( !haveWidth )
+            *width = cf2_stack_getReal( opStack, 0 ) + nominalWidthX;
+        }
+
+        /* width is defined or default after this */
+        haveWidth = TRUE;
+
+        if ( font->decoder->width_only )
+            goto exit;
+
+        /* close path if still open */
+        cf2_glyphpath_closeOpenPath( &glyphPath );
+
+        if ( cf2_stack_count( opStack ) > 1 )
+        {
+          /* must be either 4 or 5 --                       */
+          /* this is a (deprecated) implied `seac' operator */
+
+          CF2_UInt       achar;
+          CF2_UInt       bchar;
+          CF2_BufferRec  component;
+          CF2_Fixed      dummyWidth;   /* ignore component width */
+          FT_Error       error2;
+
+
+          if ( doingSeac )
+          {
+            lastError = FT_THROW( Invalid_Glyph_Format );
+            goto exit;      /* nested seac */
+          }
+
+          achar = cf2_stack_popInt( opStack );
+          bchar = cf2_stack_popInt( opStack );
+
+          curY = cf2_stack_popFixed( opStack );
+          curX = cf2_stack_popFixed( opStack );
+
+          error2 = cf2_getSeacComponent( decoder, achar, &component );
+          if ( error2 )
+          {
+             lastError = error2;      /* pass FreeType error through */
+             goto exit;
+          }
+          cf2_interpT2CharString( font,
+                                  &component,
+                                  callbacks,
+                                  translation,
+                                  TRUE,
+                                  curX,
+                                  curY,
+                                  &dummyWidth );
+          cf2_freeSeacComponent( decoder, &component );
+
+          error2 = cf2_getSeacComponent( decoder, bchar, &component );
+          if ( error2 )
+          {
+            lastError = error2;      /* pass FreeType error through */
+            goto exit;
+          }
+          cf2_interpT2CharString( font,
+                                  &component,
+                                  callbacks,
+                                  translation,
+                                  TRUE,
+                                  0,
+                                  0,
+                                  &dummyWidth );
+          cf2_freeSeacComponent( decoder, &component );
+        }
+        goto exit;
+
+      case cf2_cmdCNTRMASK:
+      case cf2_cmdHINTMASK:
+        /* the final \n in the tracing message gets added in      */
+        /* `cf2_hintmask_read' (which also traces the mask bytes) */
+        FT_TRACE4(( op1 == cf2_cmdCNTRMASK ? " cntrmask" : " hintmask" ));
+
+        /* if there are arguments on the stack, there this is an */
+        /* implied cf2_cmdVSTEMHM                                */
+        if ( cf2_stack_count( opStack ) != 0 )
+        {
+          /* never add hints after the mask is computed */
+          if ( cf2_hintmask_isValid( &hintMask ) )
+            FT_TRACE4(( "cf2_interpT2CharString: invalid hint mask\n" ));
+        }
+
+        cf2_doStems( font,
+                     opStack,
+                     &vStemHintArray,
+                     width,
+                     &haveWidth,
+                     0 );
+
+        if ( font->decoder->width_only )
+            goto exit;
+
+        if ( op1 == cf2_cmdHINTMASK )
+        {
+          /* consume the hint mask bytes which follow the operator */
+          cf2_hintmask_read( &hintMask,
+                             charstring,
+                             cf2_arrstack_size( &hStemHintArray ) +
+                               cf2_arrstack_size( &vStemHintArray ) );
+        }
+        else
+        {
+          /*
+           * Consume the counter mask bytes which follow the operator:
+           * Build a temporary hint map, just to place and lock those
+           * stems participating in the counter mask.  These are most
+           * likely the dominant hstems, and are grouped together in a
+           * few counter groups, not necessarily in correspondence
+           * with the hint groups.  This reduces the chances of
+           * conflicts between hstems that are initially placed in
+           * separate hint groups and then brought together.  The
+           * positions are copied back to `hStemHintArray', so we can
+           * discard `counterMask' and `counterHintMap'.
+           *
+           */
+          CF2_HintMapRec   counterHintMap;
+          CF2_HintMaskRec  counterMask;
+
+
+          cf2_hintmap_init( &counterHintMap,
+                            font,
+                            &glyphPath.initialHintMap,
+                            &glyphPath.hintMoves,
+                            scaleY );
+          cf2_hintmask_init( &counterMask, error );
+
+          cf2_hintmask_read( &counterMask,
+                             charstring,
+                             cf2_arrstack_size( &hStemHintArray ) +
+                               cf2_arrstack_size( &vStemHintArray ) );
+          cf2_hintmap_build( &counterHintMap,
+                             &hStemHintArray,
+                             &vStemHintArray,
+                             &counterMask,
+                             0,
+                             FALSE );
+        }
+        break;
+
+      case cf2_cmdRMOVETO:
+        FT_TRACE4(( " rmoveto\n" ));
+
+        if ( cf2_stack_count( opStack ) > 2 && !haveWidth )
+          *width = cf2_stack_getReal( opStack, 0 ) + nominalWidthX;
+
+        /* width is defined or default after this */
+        haveWidth = TRUE;
+
+        if ( font->decoder->width_only )
+            goto exit;
+
+        curY += cf2_stack_popFixed( opStack );
+        curX += cf2_stack_popFixed( opStack );
+
+        cf2_glyphpath_moveTo( &glyphPath, curX, curY );
+
+        break;
+
+      case cf2_cmdHMOVETO:
+        FT_TRACE4(( " hmoveto\n" ));
+
+        if ( cf2_stack_count( opStack ) > 1 && !haveWidth )
+          *width = cf2_stack_getReal( opStack, 0 ) + nominalWidthX;
+
+        /* width is defined or default after this */
+        haveWidth = TRUE;
+
+        if ( font->decoder->width_only )
+            goto exit;
+
+        curX += cf2_stack_popFixed( opStack );
+
+        cf2_glyphpath_moveTo( &glyphPath, curX, curY );
+
+        break;
+
+      case cf2_cmdRLINECURVE:
+        {
+          CF2_UInt  count = cf2_stack_count( opStack );
+          CF2_UInt  index = 0;
+
+
+          FT_TRACE4(( " rlinecurve\n" ));
+
+          while ( index + 6 < count )
+          {
+            curX += cf2_stack_getReal( opStack, index + 0 );
+            curY += cf2_stack_getReal( opStack, index + 1 );
+
+            cf2_glyphpath_lineTo( &glyphPath, curX, curY );
+            index += 2;
+          }
+
+          while ( index < count )
+          {
+            CF2_Fixed  x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;
+            CF2_Fixed  y1 = cf2_stack_getReal( opStack, index + 1 ) + curY;
+            CF2_Fixed  x2 = cf2_stack_getReal( opStack, index + 2 ) + x1;
+            CF2_Fixed  y2 = cf2_stack_getReal( opStack, index + 3 ) + y1;
+            CF2_Fixed  x3 = cf2_stack_getReal( opStack, index + 4 ) + x2;
+            CF2_Fixed  y3 = cf2_stack_getReal( opStack, index + 5 ) + y2;
+
+
+            cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
+
+            curX   = x3;
+            curY   = y3;
+            index += 6;
+          }
+
+          cf2_stack_clear( opStack );
+        }
+        continue; /* no need to clear stack again */
+
+      case cf2_cmdVVCURVETO:
+        {
+          CF2_UInt  count = cf2_stack_count( opStack );
+          CF2_UInt  index = 0;
+
+
+          FT_TRACE4(( " vvcurveto\n" ));
+
+          while ( index < count )
+          {
+            CF2_Fixed  x1, y1, x2, y2, x3, y3;
+
+
+            if ( ( count - index ) & 1 )
+            {
+              x1 = cf2_stack_getReal( opStack, index ) + curX;
+
+              ++index;
+            }
+            else
+              x1 = curX;
+
+            y1 = cf2_stack_getReal( opStack, index + 0 ) + curY;
+            x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;
+            y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;
+            x3 = x2;
+            y3 = cf2_stack_getReal( opStack, index + 3 ) + y2;
+
+            cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
+
+            curX   = x3;
+            curY   = y3;
+            index += 4;
+          }
+
+          cf2_stack_clear( opStack );
+        }
+        continue; /* no need to clear stack again */
+
+      case cf2_cmdHHCURVETO:
+        {
+          CF2_UInt  count = cf2_stack_count( opStack );
+          CF2_UInt  index = 0;
+
+
+          FT_TRACE4(( " hhcurveto\n" ));
+
+          while ( index < count )
+          {
+            CF2_Fixed  x1, y1, x2, y2, x3, y3;
+
+
+            if ( ( count - index ) & 1 )
+            {
+              y1 = cf2_stack_getReal( opStack, index ) + curY;
+
+              ++index;
+            }
+            else
+              y1 = curY;
+
+            x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;
+            x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;
+            y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;
+            x3 = cf2_stack_getReal( opStack, index + 3 ) + x2;
+            y3 = y2;
+
+            cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
+
+            curX   = x3;
+            curY   = y3;
+            index += 4;
+          }
+
+          cf2_stack_clear( opStack );
+        }
+        continue; /* no need to clear stack again */
+
+      case cf2_cmdVHCURVETO:
+      case cf2_cmdHVCURVETO:
+        {
+          CF2_UInt  count = cf2_stack_count( opStack );
+          CF2_UInt  index = 0;
+
+          FT_Bool  alternate = op1 == cf2_cmdHVCURVETO;
+
+
+          FT_TRACE4(( alternate ? " hvcurveto\n" : " vhcurveto\n" ));
+
+          while ( index < count )
+          {
+            CF2_Fixed x1, x2, x3, y1, y2, y3;
+
+
+            if ( alternate )
+            {
+              x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;
+              y1 = curY;
+              x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;
+              y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;
+              y3 = cf2_stack_getReal( opStack, index + 3 ) + y2;
+
+              if ( count - index == 5 )
+              {
+                x3 = cf2_stack_getReal( opStack, index + 4 ) + x2;
+
+                ++index;
+              }
+              else
+                x3 = x2;
+
+              alternate = FALSE;
+            }
+            else
+            {
+              x1 = curX;
+              y1 = cf2_stack_getReal( opStack, index + 0 ) + curY;
+              x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;
+              y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;
+              x3 = cf2_stack_getReal( opStack, index + 3 ) + x2;
+
+              if ( count - index == 5 )
+              {
+                y3 = cf2_stack_getReal( opStack, index + 4 ) + y2;
+
+                ++index;
+              }
+              else
+                y3 = y2;
+
+              alternate = TRUE;
+            }
+
+            cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
+
+            curX   = x3;
+            curY   = y3;
+            index += 4;
+          }
+
+          cf2_stack_clear( opStack );
+        }
+        continue;     /* no need to clear stack again */
+
+      case cf2_cmdEXTENDEDNMBR:
+        {
+          CF2_Int  v;
+
+
+          v = (FT_Short)( ( cf2_buf_readByte( charstring ) << 8 ) |
+                            cf2_buf_readByte( charstring )        );
+
+          FT_TRACE4(( " %d", v ));
+
+          cf2_stack_pushInt( opStack, v );
+        }
+        continue;
+
+      default:
+        /* numbers */
+        {
+          if ( /* op1 >= 32 && */ op1 <= 246 )
+          {
+            CF2_Int  v;
+
+
+            v = op1 - 139;
+
+            FT_TRACE4(( " %d", v ));
+
+            /* -107 .. 107 */
+            cf2_stack_pushInt( opStack, v );
+          }
+
+          else if ( /* op1 >= 247 && */ op1 <= 250 )
+          {
+            CF2_Int  v;
+
+
+            v  = op1;
+            v -= 247;
+            v *= 256;
+            v += cf2_buf_readByte( charstring );
+            v += 108;
+
+            FT_TRACE4(( " %d", v ));
+
+            /* 108 .. 1131 */
+            cf2_stack_pushInt( opStack, v );
+          }
+
+          else if ( /* op1 >= 251 && */ op1 <= 254 )
+          {
+            CF2_Int  v;
+
+
+            v  = op1;
+            v -= 251;
+            v *= 256;
+            v += cf2_buf_readByte( charstring );
+            v  = -v - 108;
+
+            FT_TRACE4(( " %d", v ));
+
+            /* -1131 .. -108 */
+            cf2_stack_pushInt( opStack, v );
+          }
+
+          else /* op1 == 255 */
+          {
+            CF2_Fixed  v;
+
+
+            v = (CF2_Fixed)
+                  ( ( (FT_UInt32)cf2_buf_readByte( charstring ) << 24 ) |
+                    ( (FT_UInt32)cf2_buf_readByte( charstring ) << 16 ) |
+                    ( (FT_UInt32)cf2_buf_readByte( charstring ) <<  8 ) |
+                      (FT_UInt32)cf2_buf_readByte( charstring )         );
+
+            FT_TRACE4(( " %.2f", v / 65536.0 ));
+
+            cf2_stack_pushFixed( opStack, v );
+          }
+        }
+        continue;   /* don't clear stack */
+
+      } /* end of switch statement checking `op1' */
+
+      cf2_stack_clear( opStack );
+
+    } /* end of main interpreter loop */
+
+    /* we get here if the charstring ends without cf2_cmdENDCHAR */
+    FT_TRACE4(( "cf2_interpT2CharString:"
+                "  charstring ends without ENDCHAR\n" ));
+
+  exit:
+    /* check whether last error seen is also the first one */
+    cf2_setError( error, lastError );
+
+    /* free resources from objects we've used */
+    cf2_glyphpath_finalize( &glyphPath );
+    cf2_arrstack_finalize( &vStemHintArray );
+    cf2_arrstack_finalize( &hStemHintArray );
+    cf2_arrstack_finalize( &subrStack );
+    cf2_stack_free( opStack );
+
+    FT_TRACE4(( "\n" ));
+
+    return;
+  }
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2intrp.h b/reactos/lib/3rdparty/freetype/src/cff/cf2intrp.h
new file mode 100644 (file)
index 0000000..b5d8947
--- /dev/null
@@ -0,0 +1,83 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2font.h                                                              */
+/*                                                                         */
+/*    Adobe's CFF Interpreter (specification).                             */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2INTRP_H__
+#define __CF2INTRP_H__
+
+
+#include "cf2ft.h"
+#include "cf2hints.h"
+
+
+FT_BEGIN_HEADER
+
+
+  FT_LOCAL( void )
+  cf2_hintmask_init( CF2_HintMask  hintmask,
+                     FT_Error*     error );
+  FT_LOCAL( FT_Bool )
+  cf2_hintmask_isValid( const CF2_HintMask  hintmask );
+  FT_LOCAL( FT_Bool )
+  cf2_hintmask_isNew( const CF2_HintMask  hintmask );
+  FT_LOCAL( void )
+  cf2_hintmask_setNew( CF2_HintMask  hintmask,
+                       FT_Bool       val );
+  FT_LOCAL( FT_Byte* )
+  cf2_hintmask_getMaskPtr( CF2_HintMask  hintmask );
+  FT_LOCAL( void )
+  cf2_hintmask_setAll( CF2_HintMask  hintmask,
+                       size_t        bitCount );
+
+  FT_LOCAL( void )
+  cf2_interpT2CharString( CF2_Font              font,
+                          CF2_Buffer            charstring,
+                          CF2_OutlineCallbacks  callbacks,
+                          const FT_Vector*      translation,
+                          FT_Bool               doingSeac,
+                          CF2_Fixed             curX,
+                          CF2_Fixed             curY,
+                          CF2_Fixed*            width );
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2INTRP_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2read.c b/reactos/lib/3rdparty/freetype/src/cff/cf2read.c
new file mode 100644 (file)
index 0000000..2b429e3
--- /dev/null
@@ -0,0 +1,112 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2read.c                                                              */
+/*                                                                         */
+/*    Adobe's code for stream handling (body).                             */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "cf2ft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "cf2glue.h"
+
+#include "cf2error.h"
+
+
+  /* Define CF2_IO_FAIL as 1 to enable random errors and random */
+  /* value errors in I/O.                                       */
+#define CF2_IO_FAIL  0
+
+
+#if CF2_IO_FAIL
+
+  /* set the .00 value to a nonzero probability */
+  static int
+  randomError2( void )
+  {
+    /* for region buffer ReadByte (interp) function */
+    return (double)rand() / RAND_MAX < .00;
+  }
+
+  /* set the .00 value to a nonzero probability */
+  static CF2_Int
+  randomValue()
+  {
+    return (double)rand() / RAND_MAX < .00 ? rand() : 0;
+  }
+
+#endif /* CF2_IO_FAIL */
+
+
+  /* Region Buffer                                      */
+  /*                                                    */
+  /* Can be constructed from a copied buffer managed by */
+  /* `FCM_getDatablock'.                                */
+  /* Reads bytes with check for end of buffer.          */
+
+  /* reading past the end of the buffer sets error and returns zero */
+  FT_LOCAL_DEF( CF2_Int )
+  cf2_buf_readByte( CF2_Buffer  buf )
+  {
+    if ( buf->ptr < buf->end )
+    {
+#if CF2_IO_FAIL
+      if ( randomError2() )
+      {
+        CF2_SET_ERROR( buf->error, Invalid_Stream_Operation );
+        return 0;
+      }
+
+      return *(buf->ptr)++ + randomValue();
+#else
+      return *(buf->ptr)++;
+#endif
+    }
+    else
+    {
+      CF2_SET_ERROR( buf->error, Invalid_Stream_Operation );
+      return 0;
+    }
+  }
+
+
+  /* note: end condition can occur without error */
+  FT_LOCAL_DEF( FT_Bool )
+  cf2_buf_isEnd( CF2_Buffer  buf )
+  {
+    return (FT_Bool)( buf->ptr >= buf->end );
+  }
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2read.h b/reactos/lib/3rdparty/freetype/src/cff/cf2read.h
new file mode 100644 (file)
index 0000000..7ef7c8c
--- /dev/null
@@ -0,0 +1,68 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2read.h                                                              */
+/*                                                                         */
+/*    Adobe's code for stream handling (specification).                    */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2READ_H__
+#define __CF2READ_H__
+
+
+FT_BEGIN_HEADER
+
+
+  typedef struct  CF2_BufferRec_
+  {
+    FT_Error*       error;
+    const FT_Byte*  start;
+    const FT_Byte*  end;
+    const FT_Byte*  ptr;
+
+  } CF2_BufferRec, *CF2_Buffer;
+
+
+  FT_LOCAL( CF2_Int )
+  cf2_buf_readByte( CF2_Buffer  buf );
+  FT_LOCAL( FT_Bool )
+  cf2_buf_isEnd( CF2_Buffer  buf );
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2READ_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2stack.c b/reactos/lib/3rdparty/freetype/src/cff/cf2stack.c
new file mode 100644 (file)
index 0000000..8332b5d
--- /dev/null
@@ -0,0 +1,205 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2stack.c                                                             */
+/*                                                                         */
+/*    Adobe's code for emulating a CFF stack (body).                       */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include "cf2ft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "cf2glue.h"
+#include "cf2font.h"
+#include "cf2stack.h"
+
+#include "cf2error.h"
+
+
+  /* Allocate and initialize an instance of CF2_Stack.       */
+  /* Note: This function returns NULL on error (does not set */
+  /* `error').                                               */
+  FT_LOCAL_DEF( CF2_Stack )
+  cf2_stack_init( FT_Memory  memory,
+                  FT_Error*  e )
+  {
+    FT_Error  error = FT_Err_Ok;     /* for FT_QNEW */
+
+    CF2_Stack  stack = NULL;
+
+
+    if ( !FT_QNEW( stack ) )
+    {
+      /* initialize the structure; FT_QNEW zeroes it */
+      stack->memory = memory;
+      stack->error  = e;
+      stack->top    = &stack->buffer[0]; /* empty stack */
+    }
+
+    return stack;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_stack_free( CF2_Stack  stack )
+  {
+    if ( stack )
+    {
+      FT_Memory  memory = stack->memory;
+
+
+      /* free the main structure */
+      FT_FREE( stack );
+    }
+  }
+
+
+  FT_LOCAL_DEF( CF2_UInt )
+  cf2_stack_count( CF2_Stack  stack )
+  {
+    return (CF2_UInt)( stack->top - &stack->buffer[0] );
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_stack_pushInt( CF2_Stack  stack,
+                     CF2_Int    val )
+  {
+    if ( stack->top == &stack->buffer[CF2_OPERAND_STACK_SIZE] )
+    {
+      CF2_SET_ERROR( stack->error, Stack_Overflow );
+      return;     /* stack overflow */
+    }
+
+    stack->top->u.i  = val;
+    stack->top->type = CF2_NumberInt;
+    ++stack->top;
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_stack_pushFixed( CF2_Stack  stack,
+                       CF2_Fixed  val )
+  {
+    if ( stack->top == &stack->buffer[CF2_OPERAND_STACK_SIZE] )
+    {
+      CF2_SET_ERROR( stack->error, Stack_Overflow );
+      return;     /* stack overflow */
+    }
+
+    stack->top->u.r  = val;
+    stack->top->type = CF2_NumberFixed;
+    ++stack->top;
+  }
+
+
+  /* this function is only allowed to pop an integer type */
+  FT_LOCAL_DEF( CF2_Int )
+  cf2_stack_popInt( CF2_Stack  stack )
+  {
+    if ( stack->top == &stack->buffer[0] )
+    {
+      CF2_SET_ERROR( stack->error, Stack_Underflow );
+      return 0;   /* underflow */
+    }
+    if ( stack->top[-1].type != CF2_NumberInt )
+    {
+      CF2_SET_ERROR( stack->error, Syntax_Error );
+      return 0;   /* type mismatch */
+    }
+
+    --stack->top;
+
+    return stack->top->u.i;
+  }
+
+
+  /* Note: type mismatch is silently cast */
+  /* TODO: check this */
+  FT_LOCAL_DEF( CF2_Fixed )
+  cf2_stack_popFixed( CF2_Stack  stack )
+  {
+    if ( stack->top == &stack->buffer[0] )
+    {
+      CF2_SET_ERROR( stack->error, Stack_Underflow );
+      return cf2_intToFixed( 0 );    /* underflow */
+    }
+
+    --stack->top;
+
+    switch ( stack->top->type )
+    {
+    case CF2_NumberInt:
+      return cf2_intToFixed( stack->top->u.i );
+    case CF2_NumberFrac:
+      return cf2_fracToFixed( stack->top->u.f );
+    default:
+      return stack->top->u.r;
+    }
+  }
+
+
+  /* Note: type mismatch is silently cast */
+  /* TODO: check this */
+  FT_LOCAL_DEF( CF2_Fixed )
+  cf2_stack_getReal( CF2_Stack  stack,
+                     CF2_UInt   idx )
+  {
+    FT_ASSERT( cf2_stack_count( stack ) <= CF2_OPERAND_STACK_SIZE );
+
+    if ( idx >= cf2_stack_count( stack ) )
+    {
+      CF2_SET_ERROR( stack->error, Stack_Overflow );
+      return cf2_intToFixed( 0 );    /* bounds error */
+    }
+
+    switch ( stack->buffer[idx].type )
+    {
+    case CF2_NumberInt:
+      return cf2_intToFixed( stack->buffer[idx].u.i );
+    case CF2_NumberFrac:
+      return cf2_fracToFixed( stack->buffer[idx].u.f );
+    default:
+      return stack->buffer[idx].u.r;
+    }
+  }
+
+
+  FT_LOCAL_DEF( void )
+  cf2_stack_clear( CF2_Stack  stack )
+  {
+    stack->top = &stack->buffer[0];
+  }
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2stack.h b/reactos/lib/3rdparty/freetype/src/cff/cf2stack.h
new file mode 100644 (file)
index 0000000..7d6d196
--- /dev/null
@@ -0,0 +1,106 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2stack.h                                                             */
+/*                                                                         */
+/*    Adobe's code for emulating a CFF stack (specification).              */
+/*                                                                         */
+/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2STACK_H__
+#define __CF2STACK_H__
+
+
+FT_BEGIN_HEADER
+
+
+  /* CFF operand stack; specified maximum of 48 or 192 values */
+  typedef struct  CF2_StackNumber_
+  {
+    union
+    {
+      CF2_Fixed  r;      /* 16.16 fixed point */
+      CF2_Frac   f;      /* 2.30 fixed point (for font matrix) */
+      CF2_Int    i;
+    } u;
+
+    CF2_NumberType  type;
+
+  } CF2_StackNumber;
+
+
+  typedef struct  CF2_StackRec_
+  {
+    FT_Memory         memory;
+    FT_Error*         error;
+    CF2_StackNumber   buffer[CF2_OPERAND_STACK_SIZE];
+    CF2_StackNumber*  top;
+
+  } CF2_StackRec, *CF2_Stack;
+
+
+  FT_LOCAL( CF2_Stack )
+  cf2_stack_init( FT_Memory  memory,
+                  FT_Error*  error );
+  FT_LOCAL( void )
+  cf2_stack_free( CF2_Stack  stack );
+
+  FT_LOCAL( CF2_UInt )
+  cf2_stack_count( CF2_Stack  stack );
+
+  FT_LOCAL( void )
+  cf2_stack_pushInt( CF2_Stack  stack,
+                     CF2_Int    val );
+  FT_LOCAL( void )
+  cf2_stack_pushFixed( CF2_Stack  stack,
+                       CF2_Fixed  val );
+
+  FT_LOCAL( CF2_Int )
+  cf2_stack_popInt( CF2_Stack  stack );
+  FT_LOCAL( CF2_Fixed )
+  cf2_stack_popFixed( CF2_Stack  stack );
+
+  FT_LOCAL( CF2_Fixed )
+  cf2_stack_getReal( CF2_Stack  stack,
+                     CF2_UInt   idx );
+
+  FT_LOCAL( void )
+  cf2_stack_clear( CF2_Stack  stack );
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2STACK_H__ */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2types.h b/reactos/lib/3rdparty/freetype/src/cff/cf2types.h
new file mode 100644 (file)
index 0000000..ac6a022
--- /dev/null
@@ -0,0 +1,78 @@
+/***************************************************************************/
+/*                                                                         */
+/*  cf2types.h                                                             */
+/*                                                                         */
+/*    Adobe's code for defining data types (specification only).           */
+/*                                                                         */
+/*  Copyright 2011-2013 Adobe Systems Incorporated.                        */
+/*                                                                         */
+/*  This software, and all works of authorship, whether in source or       */
+/*  object code form as indicated by the copyright notice(s) included      */
+/*  herein (collectively, the "Work") is made available, and may only be   */
+/*  used, modified, and distributed under the FreeType Project License,    */
+/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */
+/*  FreeType Project License, each contributor to the Work hereby grants   */
+/*  to any individual or legal entity exercising permissions granted by    */
+/*  the FreeType Project License and this section (hereafter, "You" or     */
+/*  "Your") a perpetual, worldwide, non-exclusive, no-charge,              */
+/*  royalty-free, irrevocable (except as stated in this section) patent    */
+/*  license to make, have made, use, offer to sell, sell, import, and      */
+/*  otherwise transfer the Work, where such license applies only to those  */
+/*  patent claims licensable by such contributor that are necessarily      */
+/*  infringed by their contribution(s) alone or by combination of their    */
+/*  contribution(s) with the Work to which such contribution(s) was        */
+/*  submitted.  If You institute patent litigation against any entity      */
+/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */
+/*  the Work or a contribution incorporated within the Work constitutes    */
+/*  direct or contributory patent infringement, then any patent licenses   */
+/*  granted to You under this License for that Work shall terminate as of  */
+/*  the date such litigation is filed.                                     */
+/*                                                                         */
+/*  By using, modifying, or distributing the Work you indicate that you    */
+/*  have read and understood the terms and conditions of the               */
+/*  FreeType Project License as well as those provided in this section,    */
+/*  and you accept them fully.                                             */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __CF2TYPES_H__
+#define __CF2TYPES_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+  /*
+   * The data models that we expect to support are as follows:
+   *
+   *   name  char short int long long-long pointer example
+   *  -----------------------------------------------------
+   *   ILP32  8    16    32  32     64*      32    32-bit MacOS, x86
+   *   LLP64  8    16    32  32     64       64    x64
+   *   LP64   8    16    32  64     64       64    64-bit MacOS
+   *
+   *    *) type may be supported by emulation on a 32-bit architecture
+   *
+   */
+
+
+  /* integers at least 32 bits wide */
+#define CF2_UInt  FT_UFast
+#define CF2_Int   FT_Fast
+
+
+  /* fixed-float numbers */
+  typedef FT_Int32  CF2_F16Dot16;
+
+
+FT_END_HEADER
+
+
+#endif /* __CF2TYPES_H__ */
+
+
+/* END */
index fccfd44..c3840b5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType OpenType driver component (body only).                      */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType OpenType driver component (body only).                      */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -19,6 +19,7 @@
 #define FT_MAKE_OPTION_SINGLE_OBJECT
 
 #include <ft2build.h>
 #define FT_MAKE_OPTION_SINGLE_OBJECT
 
 #include <ft2build.h>
+
 #include "cffpic.c"
 #include "cffdrivr.c"
 #include "cffparse.c"
 #include "cffpic.c"
 #include "cffdrivr.c"
 #include "cffparse.c"
 #include "cffgload.c"
 #include "cffcmap.c"
 
 #include "cffgload.c"
 #include "cffcmap.c"
 
+#include "cf2arrst.c"
+#include "cf2blues.c"
+#include "cf2error.c"
+#include "cf2font.c"
+#include "cf2ft.c"
+#include "cf2hints.c"
+#include "cf2intrp.c"
+#include "cf2read.c"
+#include "cf2stack.c"
+
 /* END */
 /* END */
index 1298371..f6e03c6 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CFF character mapping table (cmap) support (body).                   */
 /*                                                                         */
 /*                                                                         */
 /*    CFF character mapping table (cmap) support (body).                   */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2010 by                  */
+/*  Copyright 2002-2007, 2010, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -16,6 +16,8 @@
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
 #include "cffcmap.h"
 #include "cffload.h"
 
 #include "cffcmap.h"
 #include "cffload.h"
 
     /* can't build Unicode map for CID-keyed font */
     /* because we don't know glyph names.         */
     if ( !charset->sids )
     /* can't build Unicode map for CID-keyed font */
     /* because we don't know glyph names.         */
     if ( !charset->sids )
-      return CFF_Err_No_Unicode_Glyph_Name;
+      return FT_THROW( No_Unicode_Glyph_Name );
 
     return psnames->unicodes_init( memory,
                                    unicodes,
 
     return psnames->unicodes_init( memory,
                                    unicodes,
index 39f04ee..c8ca96b 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    OpenType font driver implementation (body).                          */
 /*                                                                         */
 /*                                                                         */
 /*    OpenType font driver implementation (body).                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -38,6 +37,8 @@
 
 #include FT_SERVICE_XFREE86_NAME_H
 #include FT_SERVICE_GLYPH_DICT_H
 
 #include FT_SERVICE_XFREE86_NAME_H
 #include FT_SERVICE_GLYPH_DICT_H
+#include FT_SERVICE_PROPERTIES_H
+#include FT_CFF_DRIVER_H
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
     if ( sfnt )
       kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph );
 
     if ( sfnt )
       kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph );
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    Load_Glyph                                                         */
+  /*    cff_glyph_load                                                     */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A driver method used to load a glyph within a given glyph slot.    */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A driver method used to load a glyph within a given glyph slot.    */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_CALLBACK_DEF( FT_Error )
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_CALLBACK_DEF( FT_Error )
-  Load_Glyph( FT_GlyphSlot  cffslot,        /* CFF_GlyphSlot */
-              FT_Size       cffsize,        /* CFF_Size      */
-              FT_UInt       glyph_index,
-              FT_Int32      load_flags )
+  cff_glyph_load( FT_GlyphSlot  cffslot,      /* CFF_GlyphSlot */
+                  FT_Size       cffsize,      /* CFF_Size      */
+                  FT_UInt       glyph_index,
+                  FT_Int32      load_flags )
   {
     FT_Error       error;
     CFF_GlyphSlot  slot = (CFF_GlyphSlot)cffslot;
   {
     FT_Error       error;
     CFF_GlyphSlot  slot = (CFF_GlyphSlot)cffslot;
 
 
     if ( !slot )
 
 
     if ( !slot )
-      return CFF_Err_Invalid_Slot_Handle;
+      return FT_THROW( Invalid_Slot_Handle );
 
     /* check whether we want a scaled outline or bitmap */
     if ( !size )
 
     /* check whether we want a scaled outline or bitmap */
     if ( !size )
     {
       /* these two objects must have the same parent */
       if ( cffsize->face != cffslot->face )
     {
       /* these two objects must have the same parent */
       if ( cffsize->face != cffslot->face )
-        return CFF_Err_Invalid_Face_Handle;
+        return FT_THROW( Invalid_Face_Handle );
     }
 
     /* now load the glyph outline if necessary */
     }
 
     /* now load the glyph outline if necessary */
                     FT_Fixed*  advances )
   {
     FT_UInt       nn;
                     FT_Fixed*  advances )
   {
     FT_UInt       nn;
-    FT_Error      error = CFF_Err_Ok;
+    FT_Error      error = FT_Err_Ok;
     FT_GlyphSlot  slot  = face->glyph;
 
 
     FT_GlyphSlot  slot  = face->glyph;
 
 
 
     for ( nn = 0; nn < count; nn++ )
     {
 
     for ( nn = 0; nn < count; nn++ )
     {
-      error = Load_Glyph( slot, face->size, start + nn, flags );
+      error = cff_glyph_load( slot, face->size, start + nn, flags );
       if ( error )
         break;
 
       if ( error )
         break;
 
                  " cannot get glyph name from CFF & CEF fonts\n"
                  "                   "
                  " without the `PSNames' module\n" ));
                  " cannot get glyph name from CFF & CEF fonts\n"
                  "                   "
                  " without the `PSNames' module\n" ));
-      error = CFF_Err_Unknown_File_Format;
+      error = FT_THROW( Missing_Module );
       goto Exit;
     }
 
       goto Exit;
     }
 
     if ( gname )
       FT_STRCPYN( buffer, gname, buffer_max );
 
     if ( gname )
       FT_STRCPYN( buffer, gname, buffer_max );
 
-    error = CFF_Err_Ok;
+    error = FT_Err_Ok;
 
   Exit:
     return error;
 
   Exit:
     return error;
   }
 
 
   }
 
 
-  FT_DEFINE_SERVICE_GLYPHDICTREC(cff_service_glyph_dict,
+  FT_DEFINE_SERVICE_GLYPHDICTREC(
+    cff_service_glyph_dict,
     (FT_GlyphDict_GetNameFunc)  cff_get_glyph_name,
     (FT_GlyphDict_NameIndexFunc)cff_get_name_index
   )
     (FT_GlyphDict_GetNameFunc)  cff_get_glyph_name,
     (FT_GlyphDict_NameIndexFunc)cff_get_name_index
   )
                         PS_FontInfoRec*  afont_info )
   {
     CFF_Font  cff   = (CFF_Font)face->extra.data;
                         PS_FontInfoRec*  afont_info )
   {
     CFF_Font  cff   = (CFF_Font)face->extra.data;
-    FT_Error  error = CFF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( cff && cff->font_info == NULL )
     {
       CFF_FontRecDict  dict   = &cff->top_font.font_dict;
 
 
     if ( cff && cff->font_info == NULL )
     {
       CFF_FontRecDict  dict   = &cff->top_font.font_dict;
-      PS_FontInfoRec  *font_info;
+      PS_FontInfoRec  *font_info = NULL;
       FT_Memory        memory = face->root.memory;
 
 
       FT_Memory        memory = face->root.memory;
 
 
   }
 
 
   }
 
 
-  FT_DEFINE_SERVICE_PSINFOREC(cff_service_ps_info,
+  FT_DEFINE_SERVICE_PSINFOREC(
+    cff_service_ps_info,
     (PS_GetFontInfoFunc)   cff_ps_get_font_info,
     (PS_GetFontExtraFunc)  NULL,
     (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names,
     (PS_GetFontInfoFunc)   cff_ps_get_font_info,
     (PS_GetFontExtraFunc)  NULL,
     (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names,
-    (PS_GetFontPrivateFunc)NULL         /* unsupported with CFF fonts */
+    (PS_GetFontPrivateFunc)NULL,        /* unsupported with CFF fonts */
+    (PS_GetFontValueFunc)  NULL         /* not implemented            */
   )
 
 
   )
 
 
   }
 
 
   }
 
 
-  FT_DEFINE_SERVICE_PSFONTNAMEREC(cff_service_ps_name,
+  FT_DEFINE_SERVICE_PSFONTNAMEREC(
+    cff_service_ps_name,
     (FT_PsName_GetFunc)cff_get_ps_name
   )
 
     (FT_PsName_GetFunc)cff_get_ps_name
   )
 
                      TT_CMapInfo  *cmap_info )
   {
     FT_CMap   cmap  = FT_CMAP( charmap );
                      TT_CMapInfo  *cmap_info )
   {
     FT_CMap   cmap  = FT_CMAP( charmap );
-    FT_Error  error = CFF_Err_Ok;
-    FT_Face    face    = FT_CMAP_FACE( cmap );
-    FT_Library library = FT_FACE_LIBRARY( face );
+    FT_Error  error = FT_Err_Ok;
+
+    FT_Face     face    = FT_CMAP_FACE( cmap );
+    FT_Library  library = FT_FACE_LIBRARY( face );
 
 
     cmap_info->language = 0;
     cmap_info->format   = 0;
 
 
 
     cmap_info->language = 0;
     cmap_info->format   = 0;
 
-    if ( cmap->clazz != &FT_CFF_CMAP_ENCODING_CLASS_REC_GET &&
-         cmap->clazz != &FT_CFF_CMAP_UNICODE_CLASS_REC_GET  )
+    if ( cmap->clazz != &CFF_CMAP_ENCODING_CLASS_REC_GET &&
+         cmap->clazz != &CFF_CMAP_UNICODE_CLASS_REC_GET  )
     {
       FT_Module           sfnt    = FT_Get_Module( library, "sfnt" );
       FT_Service_TTCMaps  service =
     {
       FT_Module           sfnt    = FT_Get_Module( library, "sfnt" );
       FT_Service_TTCMaps  service =
   }
 
 
   }
 
 
-  FT_DEFINE_SERVICE_TTCMAPSREC(cff_service_get_cmap_info,
+  FT_DEFINE_SERVICE_TTCMAPSREC(
+    cff_service_get_cmap_info,
     (TT_CMap_Info_GetFunc)cff_get_cmap_info
   )
 
     (TT_CMap_Info_GetFunc)cff_get_cmap_info
   )
 
                const char*  *ordering,
                FT_Int       *supplement )
   {
                const char*  *ordering,
                FT_Int       *supplement )
   {
-    FT_Error  error = CFF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     CFF_Font  cff   = (CFF_Font)face->extra.data;
 
 
     CFF_Font  cff   = (CFF_Font)face->extra.data;
 
 
 
       if ( dict->cid_registry == 0xFFFFU )
       {
 
       if ( dict->cid_registry == 0xFFFFU )
       {
-        error = CFF_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Fail;
       }
 
         goto Fail;
       }
 
                                                     dict->cid_registry );
         *registry = cff->registry;
       }
                                                     dict->cid_registry );
         *registry = cff->registry;
       }
-      
+
       if ( ordering )
       {
         if ( cff->ordering == NULL )
       if ( ordering )
       {
         if ( cff->ordering == NULL )
         *supplement = (FT_Int)dict->cid_supplement;
       }
     }
         *supplement = (FT_Int)dict->cid_supplement;
       }
     }
-      
+
   Fail:
     return error;
   }
   Fail:
     return error;
   }
   cff_get_is_cid( CFF_Face  face,
                   FT_Bool  *is_cid )
   {
   cff_get_is_cid( CFF_Face  face,
                   FT_Bool  *is_cid )
   {
-    FT_Error  error = CFF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     CFF_Font  cff   = (CFF_Font)face->extra.data;
 
 
     CFF_Font  cff   = (CFF_Font)face->extra.data;
 
 
                                 FT_UInt   glyph_index,
                                 FT_UInt  *cid )
   {
                                 FT_UInt   glyph_index,
                                 FT_UInt  *cid )
   {
-    FT_Error  error = CFF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     CFF_Font  cff;
 
 
     CFF_Font  cff;
 
 
 
       if ( dict->cid_registry == 0xFFFFU )
       {
 
       if ( dict->cid_registry == 0xFFFFU )
       {
-        error = CFF_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Fail;
       }
 
       if ( glyph_index > cff->num_glyphs )
       {
         goto Fail;
       }
 
       if ( glyph_index > cff->num_glyphs )
       {
-        error = CFF_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Fail;
       }
 
         goto Fail;
       }
 
   }
 
 
   }
 
 
-  FT_DEFINE_SERVICE_CIDREC(cff_service_cid_info,
+  FT_DEFINE_SERVICE_CIDREC(
+    cff_service_cid_info,
     (FT_CID_GetRegistryOrderingSupplementFunc)cff_get_ros,
     (FT_CID_GetIsInternallyCIDKeyedFunc)      cff_get_is_cid,
     (FT_CID_GetCIDFromGlyphIndexFunc)         cff_get_cid_from_glyph_index
   )
 
 
     (FT_CID_GetRegistryOrderingSupplementFunc)cff_get_ros,
     (FT_CID_GetIsInternallyCIDKeyedFunc)      cff_get_is_cid,
     (FT_CID_GetCIDFromGlyphIndexFunc)         cff_get_cid_from_glyph_index
   )
 
 
+  /*
+   *  PROPERTY SERVICE
+   *
+   */
+  static FT_Error
+  cff_property_set( FT_Module    module,         /* CFF_Driver */
+                    const char*  property_name,
+                    const void*  value )
+  {
+    FT_Error    error  = FT_Err_Ok;
+    CFF_Driver  driver = (CFF_Driver)module;
+
+
+    if ( !ft_strcmp( property_name, "hinting-engine" ) )
+    {
+      FT_UInt*  hinting_engine = (FT_UInt*)value;
+
+
+#ifndef CFF_CONFIG_OPTION_OLD_ENGINE
+      if ( *hinting_engine != FT_CFF_HINTING_ADOBE )
+        error = FT_ERR( Unimplemented_Feature );
+      else
+#endif
+        driver->hinting_engine = *hinting_engine;
+
+      return error;
+    }
+    else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
+    {
+      FT_Bool*  no_stem_darkening = (FT_Bool*)value;
+
+
+      driver->no_stem_darkening = *no_stem_darkening;
+
+      return error;
+    }
+
+    FT_TRACE0(( "cff_property_set: missing property `%s'\n",
+                property_name ));
+    return FT_THROW( Missing_Property );
+  }
+
+
+  static FT_Error
+  cff_property_get( FT_Module    module,         /* CFF_Driver */
+                    const char*  property_name,
+                    const void*  value )
+  {
+    FT_Error    error  = FT_Err_Ok;
+    CFF_Driver  driver = (CFF_Driver)module;
+
+    FT_UInt  hinting_engine    = driver->hinting_engine;
+    FT_Bool  no_stem_darkening = driver->no_stem_darkening;
+
+
+    if ( !ft_strcmp( property_name, "hinting-engine" ) )
+    {
+      FT_UInt*  val = (FT_UInt*)value;
+
+
+      *val = hinting_engine;
+
+      return error;
+    }
+    else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
+    {
+      FT_Bool*  val = (FT_Bool*)value;
+
+
+      *val = no_stem_darkening;
+
+      return error;
+    }
+
+    FT_TRACE0(( "cff_property_get: missing property `%s'\n",
+                property_name ));
+    return FT_THROW( Missing_Property );
+  }
+
+
+  FT_DEFINE_SERVICE_PROPERTIESREC(
+    cff_service_properties,
+    (FT_Properties_SetFunc)cff_property_set,
+    (FT_Properties_GetFunc)cff_property_get )
+
+
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
+
 #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
 #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
-  FT_DEFINE_SERVICEDESCREC6(cff_services,
+  FT_DEFINE_SERVICEDESCREC7(
+    cff_services,
     FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_CFF,
     FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_CFF,
-    FT_SERVICE_ID_POSTSCRIPT_INFO,      &FT_CFF_SERVICE_PS_INFO_GET,
-    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_CFF_SERVICE_PS_NAME_GET,
-    FT_SERVICE_ID_GLYPH_DICT,           &FT_CFF_SERVICE_GLYPH_DICT_GET,
-    FT_SERVICE_ID_TT_CMAP,              &FT_CFF_SERVICE_GET_CMAP_INFO_GET,
-    FT_SERVICE_ID_CID,                  &FT_CFF_SERVICE_CID_INFO_GET
+    FT_SERVICE_ID_POSTSCRIPT_INFO,      &CFF_SERVICE_PS_INFO_GET,
+    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
+    FT_SERVICE_ID_GLYPH_DICT,           &CFF_SERVICE_GLYPH_DICT_GET,
+    FT_SERVICE_ID_TT_CMAP,              &CFF_SERVICE_GET_CMAP_INFO_GET,
+    FT_SERVICE_ID_CID,                  &CFF_SERVICE_CID_INFO_GET,
+    FT_SERVICE_ID_PROPERTIES,           &CFF_SERVICE_PROPERTIES_GET
   )
 #else
   )
 #else
-  FT_DEFINE_SERVICEDESCREC5(cff_services,
+  FT_DEFINE_SERVICEDESCREC6(
+    cff_services,
     FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_CFF,
     FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_CFF,
-    FT_SERVICE_ID_POSTSCRIPT_INFO,      &FT_CFF_SERVICE_PS_INFO_GET,
-    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_CFF_SERVICE_PS_NAME_GET,
-    FT_SERVICE_ID_TT_CMAP,              &FT_CFF_SERVICE_GET_CMAP_INFO_GET,
-    FT_SERVICE_ID_CID,                  &FT_CFF_SERVICE_CID_INFO_GET
+    FT_SERVICE_ID_POSTSCRIPT_INFO,      &CFF_SERVICE_PS_INFO_GET,
+    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
+    FT_SERVICE_ID_TT_CMAP,              &CFF_SERVICE_GET_CMAP_INFO_GET,
+    FT_SERVICE_ID_CID,                  &CFF_SERVICE_CID_INFO_GET,
+    FT_SERVICE_ID_PROPERTIES,           &CFF_SERVICE_PROPERTIES_GET
   )
 #endif
 
   )
 #endif
 
+
   FT_CALLBACK_DEF( FT_Module_Interface )
   cff_get_interface( FT_Module    driver,       /* CFF_Driver */
                      const char*  module_interface )
   {
   FT_CALLBACK_DEF( FT_Module_Interface )
   cff_get_interface( FT_Module    driver,       /* CFF_Driver */
                      const char*  module_interface )
   {
+    FT_Library           library;
     FT_Module            sfnt;
     FT_Module_Interface  result;
 
 
     FT_Module            sfnt;
     FT_Module_Interface  result;
 
 
-    result = ft_service_list_lookup( FT_CFF_SERVICES_GET, module_interface );
+    /* CFF_SERVICES_GET derefers `library' in PIC mode */
+#ifdef FT_CONFIG_OPTION_PIC
+    if ( !driver )
+      return NULL;
+    library = driver->library;
+    if ( !library )
+      return NULL;
+#endif
+
+    result = ft_service_list_lookup( CFF_SERVICES_GET, module_interface );
     if ( result != NULL )
     if ( result != NULL )
-      return  result;
+      return result;
 
 
+    /* `driver' is not yet evaluated in non-PIC mode */
+#ifndef FT_CONFIG_OPTION_PIC
     if ( !driver )
       return NULL;
     if ( !driver )
       return NULL;
+    library = driver->library;
+    if ( !library )
+      return NULL;
+#endif
 
     /* we pass our request to the `sfnt' module */
 
     /* we pass our request to the `sfnt' module */
-    sfnt = FT_Get_Module( driver->library, "sfnt" );
+    sfnt = FT_Get_Module( library, "sfnt" );
 
     return sfnt ? sfnt->clazz->get_interface( sfnt, module_interface ) : 0;
   }
 
     return sfnt ? sfnt->clazz->get_interface( sfnt, module_interface ) : 0;
   }
 #define CFF_SIZE_SELECT 0
 #endif
 
 #define CFF_SIZE_SELECT 0
 #endif
 
-  FT_DEFINE_DRIVER(cff_driver_class,
+  FT_DEFINE_DRIVER(
+    cff_driver_class,
+
       FT_MODULE_FONT_DRIVER       |
       FT_MODULE_DRIVER_SCALABLE   |
       FT_MODULE_DRIVER_HAS_HINTER,
 
       FT_MODULE_FONT_DRIVER       |
       FT_MODULE_DRIVER_SCALABLE   |
       FT_MODULE_DRIVER_HAS_HINTER,
 
-      sizeof( CFF_DriverRec ),
+      sizeof ( CFF_DriverRec ),
       "cff",
       0x10000L,
       0x20000L,
       "cff",
       0x10000L,
       0x20000L,
       cff_get_interface,
 
     /* now the specific driver fields */
       cff_get_interface,
 
     /* now the specific driver fields */
-    sizeof( TT_FaceRec ),
-    sizeof( CFF_SizeRec ),
-    sizeof( CFF_GlyphSlotRec ),
+    sizeof ( TT_FaceRec ),
+    sizeof ( CFF_SizeRec ),
+    sizeof ( CFF_GlyphSlotRec ),
 
     cff_face_init,
     cff_face_done,
 
     cff_face_init,
     cff_face_done,
     cff_slot_init,
     cff_slot_done,
 
     cff_slot_init,
     cff_slot_done,
 
-    ft_stub_set_char_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-    ft_stub_set_pixel_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-    Load_Glyph,
+    cff_glyph_load,
 
     cff_get_kerning,
 
     cff_get_kerning,
-    0,                      /* FT_Face_AttachFunc      */
-    cff_get_advances,       /* FT_Face_GetAdvancesFunc */
+    0,                       /* FT_Face_AttachFunc */
+    cff_get_advances,
 
     cff_size_request,
 
 
     cff_size_request,
 
index 1b2a5c9..801d73e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CFF error codes (specification only).                                */
 /*                                                                         */
 /*                                                                         */
 /*    CFF error codes (specification only).                                */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,6 +29,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  CFF_Err_
 #define FT_ERR_BASE    FT_Mod_Err_CFF
 
 #define FT_ERR_PREFIX  CFF_Err_
 #define FT_ERR_BASE    FT_Mod_Err_CFF
 
index e99ee70..6a8494f 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    OpenType Glyph Loader (body).                                        */
 /*                                                                         */
 /*                                                                         */
 /*    OpenType Glyph Loader (body).                                        */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_SFNT_H
 #include FT_OUTLINE_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_SFNT_H
 #include FT_OUTLINE_H
+#include FT_CFF_DRIVER_H
 
 #include "cffobjs.h"
 #include "cffload.h"
 #include "cffgload.h"
 
 #include "cffobjs.h"
 #include "cffload.h"
 #include "cffgload.h"
+#include "cf2ft.h"      /* for cf2_decoder_parse_charstrings */
 
 #include "cfferrs.h"
 
 
 #include "cfferrs.h"
 
@@ -40,6 +41,8 @@
 #define FT_COMPONENT  trace_cffgload
 
 
 #define FT_COMPONENT  trace_cffgload
 
 
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+
   typedef enum  CFF_Operator_
   {
     cff_op_unknown = 0,
   typedef enum  CFF_Operator_
   {
     cff_op_unknown = 0,
     2  /* setcurrentpoint */
   };
 
     2  /* setcurrentpoint */
   };
 
+#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
+
 
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
     CFF_Builder  *builder = &decoder->builder;
     CFF_Font      cff     = (CFF_Font)builder->face->extra.data;
     CFF_SubFont   sub     = &cff->top_font;
     CFF_Builder  *builder = &decoder->builder;
     CFF_Font      cff     = (CFF_Font)builder->face->extra.data;
     CFF_SubFont   sub     = &cff->top_font;
-    FT_Error      error   = CFF_Err_Ok;
+    FT_Error      error   = FT_Err_Ok;
 
 
     /* manage CID fonts */
 
 
     /* manage CID fonts */
       if ( fd_index >= cff->num_subfonts )
       {
         FT_TRACE4(( "cff_decoder_prepare: invalid CID subfont index\n" ));
       if ( fd_index >= cff->num_subfonts )
       {
         FT_TRACE4(( "cff_decoder_prepare: invalid CID subfont index\n" ));
-        error = CFF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
     decoder->glyph_width   = sub->private_dict.default_width;
     decoder->nominal_width = sub->private_dict.nominal_width;
 
     decoder->glyph_width   = sub->private_dict.default_width;
     decoder->nominal_width = sub->private_dict.nominal_width;
 
+    decoder->current_subfont = sub;     /* for Adobe's CFF handler */
+
   Exit:
     return error;
   }
 
 
   /* check that there is enough space for `count' more points */
   Exit:
     return error;
   }
 
 
   /* check that there is enough space for `count' more points */
-  static FT_Error
-  check_points( CFF_Builder*  builder,
-                FT_Int        count )
+  FT_LOCAL_DEF( FT_Error )
+  cff_check_points( CFF_Builder*  builder,
+                    FT_Int        count )
   {
     return FT_GLYPHLOADER_CHECK_POINTS( builder->loader, count, 0 );
   }
 
 
   /* add a new point, do not check space */
   {
     return FT_GLYPHLOADER_CHECK_POINTS( builder->loader, count, 0 );
   }
 
 
   /* add a new point, do not check space */
-  static void
+  FT_LOCAL_DEF( void )
   cff_builder_add_point( CFF_Builder*  builder,
                          FT_Pos        x,
                          FT_Pos        y,
   cff_builder_add_point( CFF_Builder*  builder,
                          FT_Pos        x,
                          FT_Pos        y,
       FT_Vector*  point   = outline->points + outline->n_points;
       FT_Byte*    control = (FT_Byte*)outline->tags + outline->n_points;
 
       FT_Vector*  point   = outline->points + outline->n_points;
       FT_Byte*    control = (FT_Byte*)outline->tags + outline->n_points;
 
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+      CFF_Driver  driver  = (CFF_Driver)FT_FACE_DRIVER( builder->face );
 
 
-      point->x = x >> 16;
-      point->y = y >> 16;
+
+      if ( driver->hinting_engine == FT_CFF_HINTING_FREETYPE )
+      {
+        point->x = x >> 16;
+        point->y = y >> 16;
+      }
+      else
+#endif
+      {
+        /* cf2_decoder_parse_charstrings uses 16.16 coordinates */
+        point->x = x >> 10;
+        point->y = y >> 10;
+      }
       *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC );
     }
 
       *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC );
     }
 
 
 
   /* check space for a new on-curve point, then add it */
 
 
   /* check space for a new on-curve point, then add it */
-  static FT_Error
+  FT_LOCAL_DEF( FT_Error )
   cff_builder_add_point1( CFF_Builder*  builder,
                           FT_Pos        x,
                           FT_Pos        y )
   cff_builder_add_point1( CFF_Builder*  builder,
                           FT_Pos        x,
                           FT_Pos        y )
     FT_Error  error;
 
 
     FT_Error  error;
 
 
-    error = check_points( builder, 1 );
+    error = cff_check_points( builder, 1 );
     if ( !error )
       cff_builder_add_point( builder, x, y, 1 );
 
     if ( !error )
       cff_builder_add_point( builder, x, y, 1 );
 
     if ( !builder->load_points )
     {
       outline->n_contours++;
     if ( !builder->load_points )
     {
       outline->n_contours++;
-      return CFF_Err_Ok;
+      return FT_Err_Ok;
     }
 
     error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );
     }
 
     error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );
 
 
   /* if a path was begun, add its first on-curve point */
 
 
   /* if a path was begun, add its first on-curve point */
-  static FT_Error
+  FT_LOCAL_DEF( FT_Error )
   cff_builder_start_point( CFF_Builder*  builder,
                            FT_Pos        x,
                            FT_Pos        y )
   {
   cff_builder_start_point( CFF_Builder*  builder,
                            FT_Pos        x,
                            FT_Pos        y )
   {
-    FT_Error  error = CFF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     /* test whether we are building a new contour */
 
 
     /* test whether we are building a new contour */
 
 
   /* close the current contour */
 
 
   /* close the current contour */
-  static void
+  FT_LOCAL_DEF( void )
   cff_builder_close_contour( CFF_Builder*  builder )
   {
     FT_Outline*  outline = builder->current;
   cff_builder_close_contour( CFF_Builder*  builder )
   {
     FT_Outline*  outline = builder->current;
   }
 
 
   }
 
 
-  static FT_Int
+  FT_LOCAL_DEF( FT_Int )
   cff_lookup_glyph_by_stdcharcode( CFF_Font  cff,
                                    FT_Int    charcode )
   {
   cff_lookup_glyph_by_stdcharcode( CFF_Font  cff,
                                    FT_Int    charcode )
   {
   }
 
 
   }
 
 
-  static FT_Error
+  FT_LOCAL_DEF( FT_Error )
   cff_get_glyph_data( TT_Face    face,
                       FT_UInt    glyph_index,
                       FT_Byte**  pointer,
   cff_get_glyph_data( TT_Face    face,
                       FT_UInt    glyph_index,
                       FT_Byte**  pointer,
   }
 
 
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   cff_free_glyph_data( TT_Face    face,
                        FT_Byte**  pointer,
                        FT_ULong   length )
   cff_free_glyph_data( TT_Face    face,
                        FT_Byte**  pointer,
                        FT_ULong   length )
   }
 
 
   }
 
 
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+
   static FT_Error
   cff_operator_seac( CFF_Decoder*  decoder,
                      FT_Pos        asb,
   static FT_Error
   cff_operator_seac( CFF_Decoder*  decoder,
                      FT_Pos        asb,
     if ( decoder->seac )
     {
       FT_ERROR(( "cff_operator_seac: invalid nested seac\n" ));
     if ( decoder->seac )
     {
       FT_ERROR(( "cff_operator_seac: invalid nested seac\n" ));
-      return CFF_Err_Syntax_Error;
+      return FT_THROW( Syntax_Error );
     }
 
     adx += decoder->builder.left_bearing.x;
     }
 
     adx += decoder->builder.left_bearing.x;
     {
       FT_ERROR(( "cff_operator_seac:"
                  " invalid seac character code arguments\n" ));
     {
       FT_ERROR(( "cff_operator_seac:"
                  " invalid seac character code arguments\n" ));
-      return CFF_Err_Syntax_Error;
+      return FT_THROW( Syntax_Error );
     }
 
     /* If we are trying to load a composite glyph, do not load the */
     }
 
     /* If we are trying to load a composite glyph, do not load the */
     limit = zone->limit  = charstring_base + charstring_len;
     ip    = zone->cursor = zone->base;
 
     limit = zone->limit  = charstring_base + charstring_len;
     ip    = zone->cursor = zone->base;
 
-    error = CFF_Err_Ok;
+    error = FT_Err_Ok;
 
     x = builder->pos_x;
     y = builder->pos_y;
 
     x = builder->pos_x;
     y = builder->pos_y;
 
 
         /* this is an operand, push it on the stack */
 
 
         /* this is an operand, push it on the stack */
+
+        /* if we use shifts, all computations are done with unsigned */
+        /* values; the conversion to a signed value is the last step */
         if ( v == 28 )
         {
           if ( ip + 1 >= limit )
             goto Syntax_Error;
         if ( v == 28 )
         {
           if ( ip + 1 >= limit )
             goto Syntax_Error;
-          val = (FT_Short)( ( (FT_Short)ip[0] << 8 ) | ip[1] );
+          val = (FT_Short)( ( (FT_UShort)ip[0] << 8 ) | ip[1] );
           ip += 2;
         }
         else if ( v < 247 )
           ip += 2;
         }
         else if ( v < 247 )
         {
           if ( ip + 3 >= limit )
             goto Syntax_Error;
         {
           if ( ip + 3 >= limit )
             goto Syntax_Error;
-          val = ( (FT_Int32)ip[0] << 24 ) |
-                ( (FT_Int32)ip[1] << 16 ) |
-                ( (FT_Int32)ip[2] <<  8 ) |
-                            ip[3];
+          val = (FT_Int32)( ( (FT_UInt32)ip[0] << 24 ) |
+                            ( (FT_UInt32)ip[1] << 16 ) |
+                            ( (FT_UInt32)ip[2] <<  8 ) |
+                              (FT_UInt32)ip[3]         );
           ip    += 4;
           if ( charstring_type == 2 )
             shift = 0;
           ip    += 4;
           if ( charstring_type == 2 )
             shift = 0;
         if ( decoder->top - stack >= CFF_MAX_OPERANDS )
           goto Stack_Overflow;
 
         if ( decoder->top - stack >= CFF_MAX_OPERANDS )
           goto Stack_Overflow;
 
-        val           <<= shift;
+        val             = (FT_Int32)( (FT_UInt32)val << shift );
         *decoder->top++ = val;
 
 #ifdef FT_DEBUG_LEVEL_TRACE
         if ( !( val & 0xFFFFL ) )
         *decoder->top++ = val;
 
 #ifdef FT_DEBUG_LEVEL_TRACE
         if ( !( val & 0xFFFFL ) )
-          FT_TRACE4(( " %ld", (FT_Int32)( val >> 16 ) ));
+          FT_TRACE4(( " %hd", (FT_Short)( (FT_UInt32)val >> 16 ) ));
         else
           FT_TRACE4(( " %.2f", val / 65536.0 ));
 #endif
         else
           FT_TRACE4(( " %.2f", val / 65536.0 ));
 #endif
               op = cff_op_flex1;
               break;
             default:
               op = cff_op_flex1;
               break;
             default:
-              /* decrement ip for syntax error message */
-              ip--;
+              FT_TRACE4(( " unknown op (12, %d)\n", v ));
+              break;
             }
           }
           break;
             }
           }
           break;
           op = cff_op_hvcurveto;
           break;
         default:
           op = cff_op_hvcurveto;
           break;
         default:
+          FT_TRACE4(( " unknown op (%d)\n", v ));
           break;
         }
 
         if ( op == cff_op_unknown )
           break;
         }
 
         if ( op == cff_op_unknown )
-          goto Syntax_Error;
+          continue;
 
         /* check arguments */
         req_args = cff_argument_counts[op];
 
         /* check arguments */
         req_args = cff_argument_counts[op];
         case cff_op_rlineto:
           FT_TRACE4(( " rlineto\n" ));
 
         case cff_op_rlineto:
           FT_TRACE4(( " rlineto\n" ));
 
-          if ( cff_builder_start_point ( builder, x, y ) ||
-               check_points( builder, num_args / 2 )     )
+          if ( cff_builder_start_point( builder, x, y )  ||
+               cff_check_points( builder, num_args / 2 ) )
             goto Fail;
 
           if ( num_args < 2 )
             goto Fail;
 
           if ( num_args < 2 )
             FT_TRACE4(( op == cff_op_hlineto ? " hlineto\n"
                                              : " vlineto\n" ));
 
             FT_TRACE4(( op == cff_op_hlineto ? " hlineto\n"
                                              : " vlineto\n" ));
 
-            if ( num_args < 1 )
+            if ( num_args < 0 )
               goto Stack_Underflow;
 
               goto Stack_Underflow;
 
-            if ( cff_builder_start_point ( builder, x, y ) ||
-                 check_points( builder, num_args )         )
+            /* there exist subsetted fonts (found in PDFs) */
+            /* which call `hlineto' without arguments      */
+            if ( num_args == 0 )
+              break;
+
+            if ( cff_builder_start_point( builder, x, y ) ||
+                 cff_check_points( builder, num_args )    )
               goto Fail;
 
             args = stack;
               goto Fail;
 
             args = stack;
 
             nargs = num_args - num_args % 6;
 
 
             nargs = num_args - num_args % 6;
 
-            if ( cff_builder_start_point ( builder, x, y ) ||
-                 check_points( builder, nargs / 2 )     )
+            if ( cff_builder_start_point( builder, x, y ) ||
+                 cff_check_points( builder, nargs / 2 )   )
               goto Fail;
 
             args -= nargs;
               goto Fail;
 
             args -= nargs;
               goto Stack_Underflow;
 
             /* if num_args isn't of the form 4n or 4n+1, */
               goto Stack_Underflow;
 
             /* if num_args isn't of the form 4n or 4n+1, */
-            /* we reduce it to 4n+1                      */
+            /* we enforce it by clearing the second bit  */
 
 
-            nargs = num_args - num_args % 4;
-            if ( num_args - nargs > 0 )
-              nargs += 1;
+            nargs = num_args & ~2;
 
             if ( cff_builder_start_point( builder, x, y ) )
               goto Fail;
 
             if ( cff_builder_start_point( builder, x, y ) )
               goto Fail;
               nargs--;
             }
 
               nargs--;
             }
 
-            if ( check_points( builder, 3 * ( nargs / 4 ) ) )
+            if ( cff_check_points( builder, 3 * ( nargs / 4 ) ) )
               goto Fail;
 
             while ( args < decoder->top )
               goto Fail;
 
             while ( args < decoder->top )
               goto Stack_Underflow;
 
             /* if num_args isn't of the form 4n or 4n+1, */
               goto Stack_Underflow;
 
             /* if num_args isn't of the form 4n or 4n+1, */
-            /* we reduce it to 4n+1                      */
+            /* we enforce it by clearing the second bit  */
 
 
-            nargs = num_args - num_args % 4;
-            if ( num_args - nargs > 0 )
-              nargs += 1;
+            nargs = num_args & ~2;
 
             if ( cff_builder_start_point( builder, x, y ) )
               goto Fail;
 
             if ( cff_builder_start_point( builder, x, y ) )
               goto Fail;
               nargs--;
             }
 
               nargs--;
             }
 
-            if ( check_points( builder, 3 * ( nargs / 4 ) ) )
+            if ( cff_check_points( builder, 3 * ( nargs / 4 ) ) )
               goto Fail;
 
             while ( args < decoder->top )
               goto Fail;
 
             while ( args < decoder->top )
               goto Stack_Underflow;
 
             /* if num_args isn't of the form 8n, 8n+1, 8n+4, or 8n+5, */
               goto Stack_Underflow;
 
             /* if num_args isn't of the form 8n, 8n+1, 8n+4, or 8n+5, */
-            /* we reduce it to the largest one which fits             */
+            /* we enforce it by clearing the second bit               */
 
 
-            nargs = num_args - num_args % 4;
-            if ( num_args - nargs > 0 )
-              nargs += 1;
+            nargs = num_args & ~2;
 
             args -= nargs;
 
             args -= nargs;
-            if ( check_points( builder, ( nargs / 4 ) * 3 ) )
+            if ( cff_check_points( builder, ( nargs / 4 ) * 3 ) )
               goto Stack_Underflow;
 
             phase = ( op == cff_op_hvcurveto );
               goto Stack_Underflow;
 
             phase = ( op == cff_op_hvcurveto );
             nargs     = num_args & ~1;
             num_lines = ( nargs - 6 ) / 2;
 
             nargs     = num_args & ~1;
             num_lines = ( nargs - 6 ) / 2;
 
-            if ( cff_builder_start_point( builder, x, y ) ||
-                 check_points( builder, num_lines + 3 )   )
+            if ( cff_builder_start_point( builder, x, y )   ||
+                 cff_check_points( builder, num_lines + 3 ) )
               goto Fail;
 
             args -= nargs;
               goto Fail;
 
             args -= nargs;
             nargs      = nargs - nargs % 6 + 2;
             num_curves = ( nargs - 2 ) / 6;
 
             nargs      = nargs - nargs % 6 + 2;
             num_curves = ( nargs - 2 ) / 6;
 
-            if ( cff_builder_start_point ( builder, x, y ) ||
-                 check_points( builder, num_curves * 3 + 2 ) )
+            if ( cff_builder_start_point( builder, x, y )        ||
+                 cff_check_points( builder, num_curves * 3 + 2 ) )
               goto Fail;
 
             args -= nargs;
               goto Fail;
 
             args -= nargs;
             /* -- make sure we have enough space for the start point if it */
             /* needs to be added                                           */
             if ( cff_builder_start_point( builder, x, y ) ||
             /* -- make sure we have enough space for the start point if it */
             /* needs to be added                                           */
             if ( cff_builder_start_point( builder, x, y ) ||
-                 check_points( builder, 6 )               )
+                 cff_check_points( builder, 6 )           )
               goto Fail;
 
             /* record the starting point's y position for later use */
               goto Fail;
 
             /* record the starting point's y position for later use */
 
             /* adding six more points; 4 control points, 2 on-curve points */
             if ( cff_builder_start_point( builder, x, y ) ||
 
             /* adding six more points; 4 control points, 2 on-curve points */
             if ( cff_builder_start_point( builder, x, y ) ||
-                 check_points( builder, 6 )               )
+                 cff_check_points( builder, 6 )           )
               goto Fail;
 
             /* record the starting point's y-position for later use */
               goto Fail;
 
             /* record the starting point's y-position for later use */
 
             /* adding six more points; 4 control points, 2 on-curve points */
             if ( cff_builder_start_point( builder, x, y ) ||
 
             /* adding six more points; 4 control points, 2 on-curve points */
             if ( cff_builder_start_point( builder, x, y ) ||
-                 check_points( builder, 6 )               )
+                 cff_check_points( builder, 6 )           )
               goto Fail;
 
             /* record the starting point's x, y position for later use */
               goto Fail;
 
             /* record the starting point's x, y position for later use */
             FT_TRACE4(( " flex\n" ));
 
             if ( cff_builder_start_point( builder, x, y ) ||
             FT_TRACE4(( " flex\n" ));
 
             if ( cff_builder_start_point( builder, x, y ) ||
-                 check_points( builder, 6 )               )
+                 cff_check_points( builder, 6 )           )
               goto Fail;
 
             for ( count = 6; count > 0; count-- )
               goto Fail;
 
             for ( count = 6; count > 0; count-- )
             /* Save glyph width so that the subglyphs don't overwrite it. */
             FT_Pos  glyph_width = decoder->glyph_width;
 
             /* Save glyph width so that the subglyphs don't overwrite it. */
             FT_Pos  glyph_width = decoder->glyph_width;
 
+
             error = cff_operator_seac( decoder,
                                        0L, args[-4], args[-3],
                                        (FT_Int)( args[-2] >> 16 ),
             error = cff_operator_seac( decoder,
                                        0L, args[-4], args[-3],
                                        (FT_Int)( args[-2] >> 16 ),
           else
           {
             if ( !error )
           else
           {
             if ( !error )
-              error = CFF_Err_Ok;
+              error = FT_Err_Ok;
 
             cff_builder_close_contour( builder );
 
 
             cff_builder_close_contour( builder );
 
             FT_ERROR(( " %d", ip[0] ));
           FT_ERROR(( "\n" ));
 
             FT_ERROR(( " %d", ip[0] ));
           FT_ERROR(( "\n" ));
 
-          return CFF_Err_Unimplemented_Feature;
+          return FT_THROW( Unimplemented_Feature );
         }
 
         decoder->top = args;
         }
 
         decoder->top = args;
 
   Syntax_Error:
     FT_TRACE4(( "cff_decoder_parse_charstrings: syntax error\n" ));
 
   Syntax_Error:
     FT_TRACE4(( "cff_decoder_parse_charstrings: syntax error\n" ));
-    return CFF_Err_Invalid_File_Format;
+    return FT_THROW( Invalid_File_Format );
 
   Stack_Underflow:
     FT_TRACE4(( "cff_decoder_parse_charstrings: stack underflow\n" ));
 
   Stack_Underflow:
     FT_TRACE4(( "cff_decoder_parse_charstrings: stack underflow\n" ));
-    return CFF_Err_Too_Few_Arguments;
+    return FT_THROW( Too_Few_Arguments );
 
   Stack_Overflow:
     FT_TRACE4(( "cff_decoder_parse_charstrings: stack overflow\n" ));
 
   Stack_Overflow:
     FT_TRACE4(( "cff_decoder_parse_charstrings: stack overflow\n" ));
-    return CFF_Err_Stack_Overflow;
+    return FT_THROW( Stack_Overflow );
   }
 
   }
 
+#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
+
 
   /*************************************************************************/
   /*************************************************************************/
 
   /*************************************************************************/
   /*************************************************************************/
   cff_compute_max_advance( TT_Face  face,
                            FT_Int*  max_advance )
   {
   cff_compute_max_advance( TT_Face  face,
                            FT_Int*  max_advance )
   {
-    FT_Error     error = CFF_Err_Ok;
+    FT_Error     error = FT_Err_Ok;
     CFF_Decoder  decoder;
     FT_Int       glyph_index;
     CFF_Font     cff = (CFF_Font)face->other;
     CFF_Decoder  decoder;
     FT_Int       glyph_index;
     CFF_Font     cff = (CFF_Font)face->other;
       }
 
       /* ignore the error if one has occurred -- skip to next glyph */
       }
 
       /* ignore the error if one has occurred -- skip to next glyph */
-      error = CFF_Err_Ok;
+      error = FT_Err_Ok;
     }
 
     *max_advance = decoder.builder.advance.x;
 
     }
 
     *max_advance = decoder.builder.advance.x;
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     FT_Error     error;
     CFF_Decoder  decoder;
     TT_Face      face = (TT_Face)glyph->root.face;
     FT_Error     error;
     CFF_Decoder  decoder;
     TT_Face      face = (TT_Face)glyph->root.face;
-    FT_Bool      hinting, force_scaling;
+    FT_Bool      hinting, scaled, force_scaling;
     CFF_Font     cff  = (CFF_Font)face->extra.data;
 
     FT_Matrix    font_matrix;
     CFF_Font     cff  = (CFF_Font)face->extra.data;
 
     FT_Matrix    font_matrix;
         glyph_index = cff_charset_cid_to_gindex( &cff->charset,
                                                  glyph_index );
         if ( glyph_index == 0 )
         glyph_index = cff_charset_cid_to_gindex( &cff->charset,
                                                  glyph_index );
         if ( glyph_index == 0 )
-          return CFF_Err_Invalid_Argument;
+          return FT_THROW( Invalid_Argument );
       }
     }
     else if ( glyph_index >= cff->num_glyphs )
       }
     }
     else if ( glyph_index >= cff->num_glyphs )
-      return CFF_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( load_flags & FT_LOAD_NO_RECURSE )
       load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
 
     if ( load_flags & FT_LOAD_NO_RECURSE )
       load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
 
         if ( !error )
         {
 
         if ( !error )
         {
+          FT_Bool    has_vertical_info;
+          FT_UShort  advance;
+          FT_Short   dummy;
+
+
           glyph->root.outline.n_points   = 0;
           glyph->root.outline.n_contours = 0;
 
           glyph->root.outline.n_points   = 0;
           glyph->root.outline.n_contours = 0;
 
             glyph->root.bitmap_left = metrics.horiBearingX;
             glyph->root.bitmap_top  = metrics.horiBearingY;
           }
             glyph->root.bitmap_left = metrics.horiBearingX;
             glyph->root.bitmap_top  = metrics.horiBearingY;
           }
+
+          /* compute linear advance widths */
+
+          ( (SFNT_Service)face->sfnt )->get_metrics( face, 0,
+                                                     glyph_index,
+                                                     &dummy,
+                                                     &advance );
+          glyph->root.linearHoriAdvance = advance;
+
+          has_vertical_info = FT_BOOL(
+                                face->vertical_info                   &&
+                                face->vertical.number_Of_VMetrics > 0 );
+
+          /* get the vertical metrics from the vtmx table if we have one */
+          if ( has_vertical_info )
+          {
+            ( (SFNT_Service)face->sfnt )->get_metrics( face, 1,
+                                                       glyph_index,
+                                                       &dummy,
+                                                       &advance );
+            glyph->root.linearVertAdvance = advance;
+          }
+          else
+          {
+            /* make up vertical ones */
+            if ( face->os2.version != 0xFFFFU )
+              glyph->root.linearVertAdvance = (FT_Pos)
+                ( face->os2.sTypoAscender - face->os2.sTypoDescender );
+            else
+              glyph->root.linearVertAdvance = (FT_Pos)
+                ( face->horizontal.Ascender - face->horizontal.Descender );
+          }
+
           return error;
         }
       }
           return error;
         }
       }
 
     /* return immediately if we only want the embedded bitmaps */
     if ( load_flags & FT_LOAD_SBITS_ONLY )
 
     /* return immediately if we only want the embedded bitmaps */
     if ( load_flags & FT_LOAD_SBITS_ONLY )
-      return CFF_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* if we have a CID subfont, use its matrix (which has already */
     /* been multiplied with the root matrix)                       */
 
     /* if we have a CID subfont, use its matrix (which has already */
     /* been multiplied with the root matrix)                       */
       FT_Byte   fd_index = cff_fd_select_get( &cff->fd_select,
                                               glyph_index );
 
       FT_Byte   fd_index = cff_fd_select_get( &cff->fd_select,
                                               glyph_index );
 
-      if ( fd_index >= cff->num_subfonts ) 
-        fd_index = cff->num_subfonts - 1;
+
+      if ( fd_index >= cff->num_subfonts )
+        fd_index = (FT_Byte)( cff->num_subfonts - 1 );
 
       top_upm = cff->top_font.font_dict.units_per_em;
       sub_upm = cff->subfonts[fd_index]->font_dict.units_per_em;
 
       top_upm = cff->top_font.font_dict.units_per_em;
       sub_upm = cff->subfonts[fd_index]->font_dict.units_per_em;
     glyph->root.outline.n_points   = 0;
     glyph->root.outline.n_contours = 0;
 
     glyph->root.outline.n_points   = 0;
     glyph->root.outline.n_contours = 0;
 
-    hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 &&
-                       ( load_flags & FT_LOAD_NO_HINTING ) == 0 );
+    /* top-level code ensures that FT_LOAD_NO_HINTING is set */
+    /* if FT_LOAD_NO_SCALE is active                         */
+    hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_HINTING ) == 0 );
+    scaled  = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 );
 
 
+    glyph->hint        = hinting;
+    glyph->scaled      = scaled;
     glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;  /* by default */
 
     {
     glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;  /* by default */
 
     {
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+      CFF_Driver  driver = (CFF_Driver)FT_FACE_DRIVER( face );
+#endif
+
+
       FT_Byte*  charstring;
       FT_ULong  charstring_len;
 
       FT_Byte*  charstring;
       FT_ULong  charstring_len;
 
       if ( error )
         goto Glyph_Build_Finished;
 
       if ( error )
         goto Glyph_Build_Finished;
 
-      error = cff_decoder_parse_charstrings( &decoder,
-                                             charstring,
-                                             charstring_len );
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+      /* choose which CFF renderer to use */
+      if ( driver->hinting_engine == FT_CFF_HINTING_FREETYPE )
+        error = cff_decoder_parse_charstrings( &decoder,
+                                               charstring,
+                                               charstring_len );
+      else
+#endif
+      {
+        error = cf2_decoder_parse_charstrings( &decoder,
+                                               charstring,
+                                               charstring_len );
+
+        /* Adobe's engine uses 16.16 numbers everywhere;              */
+        /* as a consequence, glyphs larger than 2000ppem get rejected */
+        if ( FT_ERR_EQ( error, Glyph_Too_Big ) )
+        {
+          /* this time, we retry unhinted and scale up the glyph later on */
+          /* (the engine uses and sets the hardcoded value 0x10000 / 64 = */
+          /* 0x400 for both `x_scale' and `y_scale' in this case)         */
+          hinting       = FALSE;
+          force_scaling = TRUE;
+          glyph->hint   = hinting;
+
+          error = cf2_decoder_parse_charstrings( &decoder,
+                                                 charstring,
+                                                 charstring_len );
+        }
+      }
 
       cff_free_glyph_data( face, &charstring, charstring_len );
 
 
       cff_free_glyph_data( face, &charstring, charstring_len );
 
         glyph->root.linearHoriAdvance           = decoder.glyph_width;
         glyph->root.internal->glyph_transformed = 0;
 
         glyph->root.linearHoriAdvance           = decoder.glyph_width;
         glyph->root.internal->glyph_transformed = 0;
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-        has_vertical_info = FT_BOOL( face->vertical_info                   &&
-                                     face->vertical.number_Of_VMetrics > 0 &&
-                                     face->vertical.long_metrics           );
-#else
         has_vertical_info = FT_BOOL( face->vertical_info                   &&
                                      face->vertical.number_Of_VMetrics > 0 );
         has_vertical_info = FT_BOOL( face->vertical_info                   &&
                                      face->vertical.number_Of_VMetrics > 0 );
-#endif
 
         /* get the vertical metrics from the vtmx table if we have one */
         if ( has_vertical_info )
 
         /* get the vertical metrics from the vtmx table if we have one */
         if ( has_vertical_info )
         if ( has_vertical_info )
           metrics->vertBearingX = metrics->horiBearingX -
                                     metrics->horiAdvance / 2;
         if ( has_vertical_info )
           metrics->vertBearingX = metrics->horiBearingX -
                                     metrics->horiAdvance / 2;
-        else 
+        else
         {
           if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
             ft_synthesize_vertical_metrics( metrics,
         {
           if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
             ft_synthesize_vertical_metrics( metrics,
index 38937be..41df7db 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType Glyph Loader (specification).                               */
 /*                                                                         */
 /*                                                                         */
 /*    OpenType Glyph Loader (specification).                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by       */
+/*  Copyright 1996-2004, 2006-2009, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -106,6 +106,41 @@ FT_BEGIN_HEADER
   } CFF_Builder;
 
 
   } CFF_Builder;
 
 
+  FT_LOCAL( FT_Error )
+  cff_check_points( CFF_Builder*  builder,
+                    FT_Int        count );
+
+  FT_LOCAL( void )
+  cff_builder_add_point( CFF_Builder*  builder,
+                         FT_Pos        x,
+                         FT_Pos        y,
+                         FT_Byte       flag );
+  FT_LOCAL( FT_Error )
+  cff_builder_add_point1( CFF_Builder*  builder,
+                          FT_Pos        x,
+                          FT_Pos        y );
+  FT_LOCAL( FT_Error )
+  cff_builder_start_point( CFF_Builder*  builder,
+                           FT_Pos        x,
+                           FT_Pos        y );
+  FT_LOCAL( void )
+  cff_builder_close_contour( CFF_Builder*  builder );
+
+
+  FT_LOCAL( FT_Int )
+  cff_lookup_glyph_by_stdcharcode( CFF_Font  cff,
+                                   FT_Int    charcode );
+  FT_LOCAL( FT_Error )
+  cff_get_glyph_data( TT_Face    face,
+                      FT_UInt    glyph_index,
+                      FT_Byte**  pointer,
+                      FT_ULong*  length );
+  FT_LOCAL( void )
+  cff_free_glyph_data( TT_Face    face,
+                       FT_Byte**  pointer,
+                       FT_ULong   length );
+
+
   /* execution context charstring zone */
 
   typedef struct  CFF_Decoder_Zone_
   /* execution context charstring zone */
 
   typedef struct  CFF_Decoder_Zone_
@@ -156,6 +191,8 @@ FT_BEGIN_HEADER
 
     FT_Bool            seac;
 
 
     FT_Bool            seac;
 
+    CFF_SubFont        current_subfont; /* for current glyph_index */
+
   } CFF_Decoder;
 
 
   } CFF_Decoder;
 
 
@@ -181,10 +218,12 @@ FT_BEGIN_HEADER
 
 #endif /* 0 */
 
 
 #endif /* 0 */
 
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
   FT_LOCAL( FT_Error )
   cff_decoder_parse_charstrings( CFF_Decoder*  decoder,
                                  FT_Byte*      charstring_base,
                                  FT_ULong      charstring_len );
   FT_LOCAL( FT_Error )
   cff_decoder_parse_charstrings( CFF_Decoder*  decoder,
                                  FT_Byte*      charstring_base,
                                  FT_ULong      charstring_len );
+#endif
 
   FT_LOCAL( FT_Error )
   cff_slot_load( CFF_GlyphSlot  glyph,
 
   FT_LOCAL( FT_Error )
   cff_slot_load( CFF_GlyphSlot  glyph,
index 000cbe3..64b4971 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    OpenType and CFF data/program tables loader (body).                  */
 /*                                                                         */
 /*                                                                         */
 /*    OpenType and CFF data/program tables loader (body).                  */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
       if ( offsize < 1 || offsize > 4 )
       {
 
       if ( offsize < 1 || offsize > 4 )
       {
-        error = CFF_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         goto Exit;
       }
 
         goto Exit;
       }
 
 
       if ( size == 0 )
       {
 
       if ( size == 0 )
       {
-        error = CFF_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         goto Exit;
       }
 
         goto Exit;
       }
 
   static FT_Error
   cff_index_load_offsets( CFF_Index  idx )
   {
   static FT_Error
   cff_index_load_offsets( CFF_Index  idx )
   {
-    FT_Error   error  = CFF_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
     FT_Stream  stream = idx->stream;
     FT_Memory  memory = stream->memory;
 
     FT_Stream  stream = idx->stream;
     FT_Memory  memory = stream->memory;
 
                           FT_Byte***  table,
                           FT_Byte**   pool )
   {
                           FT_Byte***  table,
                           FT_Byte**   pool )
   {
-    FT_Error   error     = CFF_Err_Ok;
+    FT_Error   error     = FT_Err_Ok;
     FT_Memory  memory    = idx->stream->memory;
     FT_Memory  memory    = idx->stream->memory;
-    FT_Byte**  t;
+
+    FT_Byte**  t         = NULL;
     FT_Byte*   new_bytes = NULL;
 
 
     FT_Byte*   new_bytes = NULL;
 
 
                             FT_Byte**  pbytes,
                             FT_ULong*  pbyte_len )
   {
                             FT_Byte**  pbytes,
                             FT_ULong*  pbyte_len )
   {
-    FT_Error  error = CFF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( idx && idx->count > element )
 
 
     if ( idx && idx->count > element )
       }
     }
     else
       }
     }
     else
-      error = CFF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
 
   Exit:
     return error;
 
   Exit:
     return error;
       break;
 
     default:    /* hmm... that's wrong */
       break;
 
     default:    /* hmm... that's wrong */
-      error = CFF_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
     }
 
   Exit:
     }
 
   Exit:
                             FT_UInt      num_glyphs,
                             FT_Memory    memory )
   {
                             FT_UInt      num_glyphs,
                             FT_Memory    memory )
   {
-    FT_Error   error   = CFF_Err_Ok;
+    FT_Error   error   = FT_Err_Ok;
     FT_UInt    i;
     FT_Long    j;
     FT_UShort  max_cid = 0;
     FT_UInt    i;
     FT_Long    j;
     FT_UShort  max_cid = 0;
                     FT_Bool      invert )
   {
     FT_Memory  memory = stream->memory;
                     FT_Bool      invert )
   {
     FT_Memory  memory = stream->memory;
-    FT_Error   error  = CFF_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
     FT_UShort  glyph_sid;
 
 
     FT_UShort  glyph_sid;
 
 
 
       default:
         FT_ERROR(( "cff_charset_load: invalid table format\n" ));
 
       default:
         FT_ERROR(( "cff_charset_load: invalid table format\n" ));
-        error = CFF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
     }
         goto Exit;
       }
     }
         {
           FT_ERROR(( "cff_charset_load: implicit charset larger than\n"
                      "predefined charset (Adobe ISO-Latin)\n" ));
         {
           FT_ERROR(( "cff_charset_load: implicit charset larger than\n"
                      "predefined charset (Adobe ISO-Latin)\n" ));
-          error = CFF_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Exit;
         }
 
           goto Exit;
         }
 
         {
           FT_ERROR(( "cff_charset_load: implicit charset larger than\n"
                      "predefined charset (Adobe Expert)\n" ));
         {
           FT_ERROR(( "cff_charset_load: implicit charset larger than\n"
                      "predefined charset (Adobe Expert)\n" ));
-          error = CFF_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Exit;
         }
 
           goto Exit;
         }
 
         {
           FT_ERROR(( "cff_charset_load: implicit charset larger than\n"
                      "predefined charset (Adobe Expert Subset)\n" ));
         {
           FT_ERROR(( "cff_charset_load: implicit charset larger than\n"
                      "predefined charset (Adobe Expert Subset)\n" ));
-          error = CFF_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Exit;
         }
 
           goto Exit;
         }
 
         break;
 
       default:
         break;
 
       default:
-        error = CFF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
     }
         goto Exit;
       }
     }
                      FT_ULong      base_offset,
                      FT_ULong      offset )
   {
                      FT_ULong      base_offset,
                      FT_ULong      offset )
   {
-    FT_Error   error = CFF_Err_Ok;
+    FT_Error   error = FT_Err_Ok;
     FT_UInt    count;
     FT_UInt    j;
     FT_UShort  glyph_sid;
     FT_UInt    count;
     FT_UInt    j;
     FT_UShort  glyph_sid;
     /* Check for charset->sids.  If we do not have this, we fail. */
     if ( !charset->sids )
     {
     /* Check for charset->sids.  If we do not have this, we fail. */
     if ( !charset->sids )
     {
-      error = CFF_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
       default:
         FT_ERROR(( "cff_encoding_load: invalid table format\n" ));
 
       default:
         FT_ERROR(( "cff_encoding_load: invalid table format\n" ));
-        error = CFF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
 
       default:
         FT_ERROR(( "cff_encoding_load: invalid table format\n" ));
 
       default:
         FT_ERROR(( "cff_encoding_load: invalid table format\n" ));
-        error = CFF_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
     }
         goto Exit;
       }
     }
     /* set defaults */
     FT_MEM_ZERO( top, sizeof ( *top ) );
 
     /* set defaults */
     FT_MEM_ZERO( top, sizeof ( *top ) );
 
-    top->underline_position  = -100L << 16;
+    top->underline_position  = -( 100L << 16 );
     top->underline_thickness = 50L << 16;
     top->charstring_type     = 2;
     top->font_matrix.xx      = 0x10000L;
     top->underline_thickness = 50L << 16;
     top->charstring_type     = 2;
     top->font_matrix.xx      = 0x10000L;
 
     error = cff_index_access_element( idx, font_index, &dict, &dict_len );
     if ( !error )
 
     error = cff_index_access_element( idx, font_index, &dict, &dict_len );
     if ( !error )
+    {
+      FT_TRACE4(( " top dictionary:\n" ));
       error = cff_parser_run( &parser, dict, dict + dict_len );
       error = cff_parser_run( &parser, dict, dict + dict_len );
+    }
 
     cff_index_forget_element( idx, &dict );
 
 
     cff_index_forget_element( idx, &dict );
 
            FT_FRAME_ENTER( font->font_dict.private_size )                 )
         goto Exit;
 
            FT_FRAME_ENTER( font->font_dict.private_size )                 )
         goto Exit;
 
+      FT_TRACE4(( " private dictionary:\n" ));
       error = cff_parser_run( &parser,
                               (FT_Byte*)stream->cursor,
                               (FT_Byte*)stream->limit );
       error = cff_parser_run( &parser,
                               (FT_Byte*)stream->cursor,
                               (FT_Byte*)stream->limit );
     FT_ULong         base_offset;
     CFF_FontRecDict  dict;
     CFF_IndexRec     string_index;
     FT_ULong         base_offset;
     CFF_FontRecDict  dict;
     CFF_IndexRec     string_index;
+    FT_Int           subfont_index;
 
 
     FT_ZERO( font );
 
 
     FT_ZERO( font );
          font->header_size      < 4 ||
          font->absolute_offsize > 4 )
     {
          font->header_size      < 4 ||
          font->absolute_offsize > 4 )
     {
-      FT_TRACE2(( "[not a CFF font header]\n" ));
-      error = CFF_Err_Unknown_File_Format;
+      FT_TRACE2(( "  not a CFF font header\n" ));
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
     font->num_strings = string_index.count;
 
 
     font->num_strings = string_index.count;
 
-    /* well, we don't really forget the `disabled' fonts... */
-    font->num_faces = font->name_index.count;
-    if ( face_index >= (FT_Int)font->num_faces )
+    if ( pure_cff )
+    {
+      /* well, we don't really forget the `disabled' fonts... */
+      subfont_index = face_index;
+
+      if ( subfont_index >= (FT_Int)font->name_index.count )
+      {
+        FT_ERROR(( "cff_font_load:"
+                   " invalid subfont index for pure CFF font (%d)\n",
+                   subfont_index ));
+        error = FT_THROW( Invalid_Argument );
+        goto Exit;
+      }
+
+      font->num_faces = font->name_index.count;
+    }
+    else
     {
     {
-      FT_ERROR(( "cff_font_load: incorrect face index = %d\n",
-                 face_index ));
-      error = CFF_Err_Invalid_Argument;
+      subfont_index = 0;
+
+      if ( font->name_index.count > 1 )
+      {
+        FT_ERROR(( "cff_font_load:"
+                   " invalid CFF font with multiple subfonts\n"
+                   "              "
+                   " in SFNT wrapper\n" ));
+        error = FT_THROW( Invalid_File_Format );
+        goto Exit;
+      }
     }
 
     /* in case of a font format check, simply exit now */
     }
 
     /* in case of a font format check, simply exit now */
       goto Exit;
 
     /* now, parse the top-level font dictionary */
       goto Exit;
 
     /* now, parse the top-level font dictionary */
+    FT_TRACE4(( "parsing top-level\n" ));
     error = cff_subfont_load( &font->top_font,
                               &font->font_dict_index,
     error = cff_subfont_load( &font->top_font,
                               &font->font_dict_index,
-                              face_index,
+                              subfont_index,
                               stream,
                               base_offset,
                               library );
                               stream,
                               base_offset,
                               library );
     if ( dict->cid_registry != 0xFFFFU )
     {
       CFF_IndexRec  fd_index;
     if ( dict->cid_registry != 0xFFFFU )
     {
       CFF_IndexRec  fd_index;
-      CFF_SubFont   sub;
+      CFF_SubFont   sub = NULL;
       FT_UInt       idx;
 
 
       FT_UInt       idx;
 
 
       for ( idx = 0; idx < fd_index.count; idx++ )
       {
         sub = font->subfonts[idx];
       for ( idx = 0; idx < fd_index.count; idx++ )
       {
         sub = font->subfonts[idx];
+        FT_TRACE4(( "parsing subfont %u\n", idx ));
         error = cff_subfont_load( sub, &fd_index, idx,
                                   stream, base_offset, library );
         if ( error )
         error = cff_subfont_load( sub, &fd_index, idx,
                                   stream, base_offset, library );
         if ( error )
     if ( dict->charstrings_offset == 0 )
     {
       FT_ERROR(( "cff_font_load: no charstrings offset\n" ));
     if ( dict->charstrings_offset == 0 )
     {
       FT_ERROR(( "cff_font_load: no charstrings offset\n" ));
-      error = CFF_Err_Unknown_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
     /* get the font name (/CIDFontName for CID-keyed fonts, */
     /* /FontName otherwise)                                 */
 
     /* get the font name (/CIDFontName for CID-keyed fonts, */
     /* /FontName otherwise)                                 */
-    font->font_name = cff_index_get_name( font, face_index );
+    font->font_name = cff_index_get_name( font, subfont_index );
 
   Exit:
     cff_index_done( &string_index );
 
   Exit:
     cff_index_done( &string_index );
     FT_FREE( font->global_subrs );
     FT_FREE( font->strings );
     FT_FREE( font->string_pool );
     FT_FREE( font->global_subrs );
     FT_FREE( font->strings );
     FT_FREE( font->string_pool );
+
+    if ( font->cf2_instance.finalizer )
+    {
+      font->cf2_instance.finalizer( font->cf2_instance.data );
+      FT_FREE( font->cf2_instance.data );
+    }
   }
 
 
   }
 
 
index c755de9..8049619 100644 (file)
@@ -60,7 +60,7 @@ FT_BEGIN_HEADER
 
 
   FT_LOCAL( FT_Error )
 
 
   FT_LOCAL( FT_Error )
-  cff_font_load( FT_Library library, 
+  cff_font_load( FT_Library library,
                  FT_Stream  stream,
                  FT_Int     face_index,
                  CFF_Font   font,
                  FT_Stream  stream,
                  FT_Int     face_index,
                  CFF_Font   font,
index 1cd35c9..dd750d1 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    OpenType objects manager (body).                                     */
 /*                                                                         */
 /*                                                                         */
 /*    OpenType objects manager (body).                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -18,6 +17,7 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_CALC_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_CALC_H
 #include FT_INTERNAL_STREAM_H
 #include FT_TRUETYPE_IDS_H
 #include FT_TRUETYPE_TAGS_H
 #include FT_INTERNAL_SFNT_H
 #include FT_TRUETYPE_IDS_H
 #include FT_TRUETYPE_TAGS_H
 #include FT_INTERNAL_SFNT_H
+#include FT_CFF_DRIVER_H
+
 #include "cffobjs.h"
 #include "cffload.h"
 #include "cffcmap.h"
 #include "cffobjs.h"
 #include "cffload.h"
 #include "cffcmap.h"
-#include "cfferrs.h"
 #include "cffpic.h"
 
 #include "cffpic.h"
 
+#include "cfferrs.h"
+
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
   cff_size_init( FT_Size  cffsize )         /* CFF_Size */
   {
     CFF_Size           size  = (CFF_Size)cffsize;
   cff_size_init( FT_Size  cffsize )         /* CFF_Size */
   {
     CFF_Size           size  = (CFF_Size)cffsize;
-    FT_Error           error = CFF_Err_Ok;
+    FT_Error           error = FT_Err_Ok;
     PSH_Globals_Funcs  funcs = cff_size_get_globals_funcs( size );
 
 
     PSH_Globals_Funcs  funcs = cff_size_get_globals_funcs( size );
 
 
     {
       CFF_Face      face     = (CFF_Face)cffsize->face;
       CFF_Font      font     = (CFF_Font)face->extra.data;
     {
       CFF_Face      face     = (CFF_Face)cffsize->face;
       CFF_Font      font     = (CFF_Font)face->extra.data;
-      CFF_Internal  internal;
+      CFF_Internal  internal = NULL;
 
       PS_PrivateRec  priv;
       FT_Memory      memory = cffsize->face->memory;
 
       PS_PrivateRec  priv;
       FT_Memory      memory = cffsize->face->memory;
       }
     }
 
       }
     }
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
   }
 
 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
       }
     }
 
       }
     }
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
       }
     }
 
       }
     }
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   remove_subset_prefix( FT_String*  name )
   {
     FT_Int32  idx             = 0;
   remove_subset_prefix( FT_String*  name )
   {
     FT_Int32  idx             = 0;
-    FT_Int32  length          = strlen( name ) + 1;
+    FT_Int32  length          = (FT_Int32)strlen( name ) + 1;
     FT_Bool   continue_search = 1;
     FT_Bool   continue_search = 1;
+
 
     while ( continue_search )
     {
 
     while ( continue_search )
     {
         {
           for ( idx = 7; idx < length; idx++ )
             name[idx - 7] = name[idx];
         {
           for ( idx = 7; idx < length; idx++ )
             name[idx - 7] = name[idx];
+          length -= 7;
         }
       }
       else
         }
       }
       else
   }
 
 
   }
 
 
+  /* Remove the style part from the family name (if present). */
+
+  static void
+  remove_style( FT_String*        family_name,
+                const FT_String*  style_name )
+  {
+    FT_Int32  family_name_length, style_name_length;
+
+
+    family_name_length = (FT_Int32)strlen( family_name );
+    style_name_length  = (FT_Int32)strlen( style_name );
+
+    if ( family_name_length > style_name_length )
+    {
+      FT_Int  idx;
+
+
+      for ( idx = 1; idx <= style_name_length; ++idx )
+      {
+        if ( family_name[family_name_length - idx] !=
+             style_name[style_name_length - idx] )
+          break;
+      }
+
+      if ( idx > style_name_length )
+      {
+        /* family_name ends with style_name; remove it */
+        idx = family_name_length - style_name_length - 1;
+
+        /* also remove special characters     */
+        /* between real family name and style */
+        while ( idx > 0                     &&
+                ( family_name[idx] == '-' ||
+                  family_name[idx] == ' ' ||
+                  family_name[idx] == '_' ||
+                  family_name[idx] == '+' ) )
+          --idx;
+
+        if ( idx > 0 )
+          family_name[idx + 1] = '\0';
+      }
+    }
+  }
+
+
   FT_LOCAL_DEF( FT_Error )
   cff_face_init( FT_Stream      stream,
                  FT_Face        cffface,        /* CFF_Face */
   FT_LOCAL_DEF( FT_Error )
   cff_face_init( FT_Stream      stream,
                  FT_Face        cffface,        /* CFF_Face */
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
-    CFF_Face            face = (CFF_Face)cffface;
+    CFF_Face            face        = (CFF_Face)cffface;
     FT_Error            error;
     SFNT_Service        sfnt;
     FT_Service_PsCMaps  psnames;
     PSHinter_Service    pshinter;
     FT_Bool             pure_cff    = 1;
     FT_Bool             sfnt_format = 0;
     FT_Error            error;
     SFNT_Service        sfnt;
     FT_Service_PsCMaps  psnames;
     PSHinter_Service    pshinter;
     FT_Bool             pure_cff    = 1;
     FT_Bool             sfnt_format = 0;
-    FT_Library library = cffface->driver->root.library;
+    FT_Library          library     = cffface->driver->root.library;
 
 
     sfnt = (SFNT_Service)FT_Get_Module_Interface(
              library, "sfnt" );
     if ( !sfnt )
 
 
     sfnt = (SFNT_Service)FT_Get_Module_Interface(
              library, "sfnt" );
     if ( !sfnt )
-      goto Bad_Format;
+    {
+      FT_ERROR(( "cff_face_init: cannot access `sfnt' module\n" ));
+      error = FT_THROW( Missing_Module );
+      goto Exit;
+    }
 
     FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
 
     pshinter = (PSHinter_Service)FT_Get_Module_Interface(
                  library, "pshinter" );
 
 
     FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
 
     pshinter = (PSHinter_Service)FT_Get_Module_Interface(
                  library, "pshinter" );
 
+    FT_TRACE2(( "CFF driver\n" ));
+
     /* create input stream from resource */
     if ( FT_STREAM_SEEK( 0 ) )
       goto Exit;
     /* create input stream from resource */
     if ( FT_STREAM_SEEK( 0 ) )
       goto Exit;
     {
       if ( face->format_tag != TTAG_OTTO )  /* `OTTO'; OpenType/CFF font */
       {
     {
       if ( face->format_tag != TTAG_OTTO )  /* `OTTO'; OpenType/CFF font */
       {
-        FT_TRACE2(( "[not a valid OpenType/CFF font]\n" ));
-        goto Bad_Format;
+        FT_TRACE2(( "  not an OpenType/CFF font\n" ));
+        error = FT_THROW( Unknown_File_Format );
+        goto Exit;
       }
 
       /* if we are performing a simple font format check, exit immediately */
       if ( face_index < 0 )
       }
 
       /* if we are performing a simple font format check, exit immediately */
       if ( face_index < 0 )
-        return CFF_Err_Ok;
-
-      /* UNDOCUMENTED!  A CFF in an SFNT can have only a single font. */
-      if ( face_index > 0 )
-      {
-        FT_ERROR(( "cff_face_init: invalid face index\n" ));
-        error = CFF_Err_Invalid_Argument;
-        goto Exit;
-      }
+        return FT_Err_Ok;
 
       sfnt_format = 1;
 
 
       sfnt_format = 1;
 
         pure_cff = 0;
 
         /* load font directory */
         pure_cff = 0;
 
         /* load font directory */
-        error = sfnt->load_face( stream, face, 0, num_params, params );
+        error = sfnt->load_face( stream, face, face_index,
+                                 num_params, params );
         if ( error )
           goto Exit;
       }
         if ( error )
           goto Exit;
       }
         error = sfnt->load_cmap( face, stream );
         if ( error )
           goto Exit;
         error = sfnt->load_cmap( face, stream );
         if ( error )
           goto Exit;
-
-        /* XXX: we don't load the GPOS table, as OpenType Layout     */
-        /* support will be added later to a layout library on top of */
-        /* FreeType 2                                                */
       }
 
       /* now load the CFF part of the file */
       }
 
       /* now load the CFF part of the file */
       /* rewind to start of file; we are going to load a pure-CFF font */
       if ( FT_STREAM_SEEK( 0 ) )
         goto Exit;
       /* rewind to start of file; we are going to load a pure-CFF font */
       if ( FT_STREAM_SEEK( 0 ) )
         goto Exit;
-      error = CFF_Err_Ok;
+      error = FT_Err_Ok;
     }
 
     /* now load and parse the CFF table in the file */
     {
     }
 
     /* now load and parse the CFF table in the file */
     {
-      CFF_Font         cff;
+      CFF_Font         cff = NULL;
       CFF_FontRecDict  dict;
       FT_Memory        memory = cffface->memory;
       FT_Int32         flags;
       CFF_FontRecDict  dict;
       FT_Memory        memory = cffface->memory;
       FT_Int32         flags;
                    " cannot open CFF & CEF fonts\n"
                    "              "
                    " without the `PSNames' module\n" ));
                    " cannot open CFF & CEF fonts\n"
                    "              "
                    " without the `PSNames' module\n" ));
-        goto Bad_Format;
+        error = FT_THROW( Missing_Module );
+        goto Exit;
+      }
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+      {
+        FT_UInt     idx;
+        FT_String*  s;
+
+
+        FT_TRACE4(( "SIDs\n" ));
+
+        /* dump string index, including default strings for convenience */
+        for ( idx = 0; idx < cff->num_strings + 390; idx++ )
+        {
+          s = cff_index_get_sid_string( cff, idx );
+          if ( s )
+            FT_TRACE4(("  %5d %s\n", idx, s ));
+        }
       }
       }
+#endif /* FT_DEBUG_LEVEL_TRACE */
 
 
-      if ( !dict->units_per_em )
+      if ( !dict->has_font_matrix )
         dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;
 
       /* Normalize the font matrix so that `matrix->xx' is 1; the */
         dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;
 
       /* Normalize the font matrix so that `matrix->xx' is 1; the */
         FT_Fixed    temp;
 
 
         FT_Fixed    temp;
 
 
-        if ( sub->units_per_em )
+        if ( sub->has_font_matrix )
         {
           FT_Long  scaling;
 
 
         {
           FT_Long  scaling;
 
 
-          if ( top->units_per_em > 1 && sub->units_per_em > 1 )
-            scaling = FT_MIN( top->units_per_em, sub->units_per_em );
-          else
-            scaling = 1;
-
-          FT_Matrix_Multiply_Scaled( &top->font_matrix,
-                                     &sub->font_matrix,
-                                     scaling );
-          FT_Vector_Transform_Scaled( &sub->font_offset,
-                                      &top->font_matrix,
-                                      scaling );
-
-          sub->units_per_em = FT_MulDiv( sub->units_per_em,
-                                         top->units_per_em,
-                                         scaling );
+          /* if we have a top-level matrix, */
+          /* concatenate the subfont matrix */
+
+          if ( top->has_font_matrix )
+          {
+            if ( top->units_per_em > 1 && sub->units_per_em > 1 )
+              scaling = FT_MIN( top->units_per_em, sub->units_per_em );
+            else
+              scaling = 1;
+
+            FT_Matrix_Multiply_Scaled( &top->font_matrix,
+                                       &sub->font_matrix,
+                                       scaling );
+            FT_Vector_Transform_Scaled( &sub->font_offset,
+                                        &top->font_matrix,
+                                        scaling );
+
+            sub->units_per_em = FT_MulDiv( sub->units_per_em,
+                                           top->units_per_em,
+                                           scaling );
+          }
         }
         else
         {
         }
         else
         {
         {
           *upm = FT_DivFix( *upm, temp );
 
         {
           *upm = FT_DivFix( *upm, temp );
 
-          /* if *upm is larger than 100*1000 we divide by 1000 --     */
-          /* this can happen if e.g. there is no top-font FontMatrix  */
-          /* and the subfont FontMatrix already contains the complete */
-          /* scaling for the subfont (see section 5.11 of the PLRM)   */
-
-          /* 100 is a heuristic value */
-
-          if ( *upm > 100L * 1000L )
-            *upm = ( *upm + 500 ) / 1000;
-
           matrix->xx = FT_DivFix( matrix->xx, temp );
           matrix->yx = FT_DivFix( matrix->yx, temp );
           matrix->xy = FT_DivFix( matrix->xy, temp );
           matrix->xx = FT_DivFix( matrix->xx, temp );
           matrix->yx = FT_DivFix( matrix->yx, temp );
           matrix->xy = FT_DivFix( matrix->xy, temp );
           char*  family_name = NULL;
 
 
           char*  family_name = NULL;
 
 
-          remove_subset_prefix( cffface->family_name ); 
+          remove_subset_prefix( cffface->family_name );
 
           if ( dict->family_name )
           {
 
           if ( dict->family_name )
           {
                 /* case, the remaining string in `fullp' will be used as */
                 /* the style name.                                       */
                 style_name = cff_strcpy( memory, fullp );
                 /* case, the remaining string in `fullp' will be used as */
                 /* the style name.                                       */
                 style_name = cff_strcpy( memory, fullp );
+
+                /* remove the style part from the family name (if present) */
+                remove_style( cffface->family_name, style_name );
               }
               break;
             }
               }
               break;
             }
         /*                                                                 */
         /* Compute face flags.                                             */
         /*                                                                 */
         /*                                                                 */
         /* Compute face flags.                                             */
         /*                                                                 */
-        flags = (FT_UInt32)( FT_FACE_FLAG_SCALABLE   | /* scalable outlines */
-                             FT_FACE_FLAG_HORIZONTAL | /* horizontal data   */
-                             FT_FACE_FLAG_HINTER );    /* has native hinter */
+        flags = FT_FACE_FLAG_SCALABLE   | /* scalable outlines */
+                FT_FACE_FLAG_HORIZONTAL | /* horizontal data   */
+                FT_FACE_FLAG_HINTER;      /* has native hinter */
 
         if ( sfnt_format )
 
         if ( sfnt_format )
-          flags |= (FT_UInt32)FT_FACE_FLAG_SFNT;
+          flags |= FT_FACE_FLAG_SFNT;
 
         /* fixed width font? */
         if ( dict->is_fixed_pitch )
 
         /* fixed width font? */
         if ( dict->is_fixed_pitch )
-          flags |= (FT_UInt32)FT_FACE_FLAG_FIXED_WIDTH;
+          flags |= FT_FACE_FLAG_FIXED_WIDTH;
 
   /* XXX: WE DO NOT SUPPORT KERNING METRICS IN THE GPOS TABLE FOR NOW */
 #if 0
         /* kerning available? */
         if ( face->kern_pairs )
 
   /* XXX: WE DO NOT SUPPORT KERNING METRICS IN THE GPOS TABLE FOR NOW */
 #if 0
         /* kerning available? */
         if ( face->kern_pairs )
-          flags |= (FT_UInt32)FT_FACE_FLAG_KERNING;
+          flags |= FT_FACE_FLAG_KERNING;
 #endif
 
         cffface->face_flags = flags;
 #endif
 
         cffface->face_flags = flags;
 
         nn = (FT_UInt)cffface->num_charmaps;
 
 
         nn = (FT_UInt)cffface->num_charmaps;
 
-        error = FT_CMap_New( &FT_CFF_CMAP_UNICODE_CLASS_REC_GET, NULL,
+        error = FT_CMap_New( &CFF_CMAP_UNICODE_CLASS_REC_GET, NULL,
                              &cmaprec, NULL );
                              &cmaprec, NULL );
-        if ( error && FT_Err_No_Unicode_Glyph_Name != error )
+        if ( error                                      &&
+             FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
           goto Exit;
         error = FT_Err_Ok;
 
           goto Exit;
         error = FT_Err_Ok;
 
           {
             cmaprec.encoding_id = TT_ADOBE_ID_STANDARD;
             cmaprec.encoding    = FT_ENCODING_ADOBE_STANDARD;
           {
             cmaprec.encoding_id = TT_ADOBE_ID_STANDARD;
             cmaprec.encoding    = FT_ENCODING_ADOBE_STANDARD;
-            clazz               = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET;
+            clazz               = &CFF_CMAP_ENCODING_CLASS_REC_GET;
           }
           else if ( encoding->offset == 1 )
           {
             cmaprec.encoding_id = TT_ADOBE_ID_EXPERT;
             cmaprec.encoding    = FT_ENCODING_ADOBE_EXPERT;
           }
           else if ( encoding->offset == 1 )
           {
             cmaprec.encoding_id = TT_ADOBE_ID_EXPERT;
             cmaprec.encoding    = FT_ENCODING_ADOBE_EXPERT;
-            clazz               = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET;
+            clazz               = &CFF_CMAP_ENCODING_CLASS_REC_GET;
           }
           else
           {
             cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM;
             cmaprec.encoding    = FT_ENCODING_ADOBE_CUSTOM;
           }
           else
           {
             cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM;
             cmaprec.encoding    = FT_ENCODING_ADOBE_CUSTOM;
-            clazz               = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET;
+            clazz               = &CFF_CMAP_ENCODING_CLASS_REC_GET;
           }
 
           error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );
           }
 
           error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );
 
   Exit:
     return error;
 
   Exit:
     return error;
-
-  Bad_Format:
-    error = CFF_Err_Unknown_File_Format;
-    goto Exit;
   }
 
 
   }
 
 
 
 
   FT_LOCAL_DEF( FT_Error )
 
 
   FT_LOCAL_DEF( FT_Error )
-  cff_driver_init( FT_Module  module )
+  cff_driver_init( FT_Module  module )        /* CFF_Driver */
   {
   {
-    FT_UNUSED( module );
+    CFF_Driver  driver = (CFF_Driver)module;
+
+
+    /* set default property values */
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+    driver->hinting_engine    = FT_CFF_HINTING_FREETYPE;
+#else
+    driver->hinting_engine    = FT_CFF_HINTING_ADOBE;
+#endif
+    driver->no_stem_darkening = FALSE;
 
 
-    return CFF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   FT_LOCAL_DEF( void )
   }
 
 
   FT_LOCAL_DEF( void )
-  cff_driver_done( FT_Module  module )
+  cff_driver_done( FT_Module  module )        /* CFF_Driver */
   {
     FT_UNUSED( module );
   }
   {
     FT_UNUSED( module );
   }
index 3c81cee..b375c20 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType objects manager (specification).                            */
 /*                                                                         */
 /*                                                                         */
 /*    OpenType objects manager (specification).                            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by             */
+/*  Copyright 1996-2004, 2006-2008, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -112,12 +112,14 @@ FT_BEGIN_HEADER
 
   /***********************************************************************/
   /*                                                                     */
 
   /***********************************************************************/
   /*                                                                     */
-  /* TrueType driver class.                                              */
+  /* CFF driver class.                                                   */
   /*                                                                     */
   typedef struct  CFF_DriverRec_
   {
     FT_DriverRec  root;
   /*                                                                     */
   typedef struct  CFF_DriverRec_
   {
     FT_DriverRec  root;
-    void*         extension_component;
+
+    FT_UInt  hinting_engine;
+    FT_Bool  no_stem_darkening;
 
   } CFF_DriverRec;
 
 
   } CFF_DriverRec;
 
@@ -167,10 +169,10 @@ FT_BEGIN_HEADER
   /* Driver functions                                                      */
   /*                                                                       */
   FT_LOCAL( FT_Error )
   /* Driver functions                                                      */
   /*                                                                       */
   FT_LOCAL( FT_Error )
-  cff_driver_init( FT_Module  module );
+  cff_driver_init( FT_Module  module );         /* CFF_Driver */
 
   FT_LOCAL( void )
 
   FT_LOCAL( void )
-  cff_driver_done( FT_Module  module );
+  cff_driver_done( FT_Module  module );         /* CFF_Driver */
 
 
 FT_END_HEADER
 
 
 FT_END_HEADER
index 0d11a72..9622212 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CFF token stream parser (body)                                       */
 /*                                                                         */
 /*                                                                         */
 /*    CFF token stream parser (body)                                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2007, 2008, 2009, 2010 by       */
+/*  Copyright 1996-2004, 2007-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -35,8 +35,6 @@
 #define FT_COMPONENT  trace_cffparse
 
 
 #define FT_COMPONENT  trace_cffparse
 
 
-
-
   FT_LOCAL_DEF( void )
   cff_parser_init( CFF_Parser  parser,
                    FT_UInt     code,
   FT_LOCAL_DEF( void )
   cff_parser_init( CFF_Parser  parser,
                    FT_UInt     code,
@@ -67,7 +65,7 @@
       if ( p + 2 > limit )
         goto Bad;
 
       if ( p + 2 > limit )
         goto Bad;
 
-      val = (FT_Short)( ( (FT_Int)p[0] << 8 ) | p[1] );
+      val = (FT_Short)( ( (FT_UShort)p[0] << 8 ) | p[1] );
       p  += 2;
     }
     else if ( v == 29 )
       p  += 2;
     }
     else if ( v == 29 )
       if ( p + 4 > limit )
         goto Bad;
 
       if ( p + 4 > limit )
         goto Bad;
 
-      val = ( (FT_Long)p[0] << 24 ) |
-            ( (FT_Long)p[1] << 16 ) |
-            ( (FT_Long)p[2] <<  8 ) |
-                       p[3];
+      val = (FT_Long)( ( (FT_ULong)p[0] << 24 ) |
+                       ( (FT_ULong)p[1] << 16 ) |
+                       ( (FT_ULong)p[2] <<  8 ) |
+                         (FT_ULong)p[3]         );
       p += 4;
     }
     else if ( v < 247 )
       p += 4;
     }
     else if ( v < 247 )
 
   Bad:
     val = 0;
 
   Bad:
     val = 0;
+    FT_TRACE4(( "!!!END OF DATA:!!!" ));
     goto Exit;
   }
 
     goto Exit;
   }
 
     FT_UInt   phase;
 
     FT_Long   result, number, exponent;
     FT_UInt   phase;
 
     FT_Long   result, number, exponent;
-    FT_Int    sign = 0, exponent_sign = 0;
+    FT_Int    sign = 0, exponent_sign = 0, have_overflow = 0;
     FT_Long   exponent_add, integer_length, fraction_length;
 
 
     FT_Long   exponent_add, integer_length, fraction_length;
 
 
 
         /* Make sure we don't read past the end. */
         if ( p >= limit )
 
         /* Make sure we don't read past the end. */
         if ( p >= limit )
-          goto Exit;
+          goto Bad;
       }
 
       /* Get the nibble. */
       }
 
       /* Get the nibble. */
 
           /* Make sure we don't read past the end. */
           if ( p >= limit )
 
           /* Make sure we don't read past the end. */
           if ( p >= limit )
-            goto Exit;
+            goto Bad;
         }
 
         /* Get the nibble. */
         }
 
         /* Get the nibble. */
 
           /* Make sure we don't read past the end. */
           if ( p >= limit )
 
           /* Make sure we don't read past the end. */
           if ( p >= limit )
-            goto Exit;
+            goto Bad;
         }
 
         /* Get the nibble. */
         }
 
         /* Get the nibble. */
         if ( nib >= 10 )
           break;
 
         if ( nib >= 10 )
           break;
 
-        exponent = exponent * 10 + nib;
-
         /* Arbitrarily limit exponent. */
         if ( exponent > 1000 )
         /* Arbitrarily limit exponent. */
         if ( exponent > 1000 )
-          goto Exit;
+          have_overflow = 1;
+        else
+          exponent = exponent * 10 + nib;
       }
 
       if ( exponent_sign )
         exponent = -exponent;
     }
 
       }
 
       if ( exponent_sign )
         exponent = -exponent;
     }
 
+    if ( !number )
+      goto Exit;
+
+    if ( have_overflow )
+    {
+      if ( exponent_sign )
+        goto Underflow;
+      else
+        goto Overflow;
+    }
+
     /* We don't check `power_ten' and `exponent_add'. */
     exponent += power_ten + exponent_add;
 
     /* We don't check `power_ten' and `exponent_add'. */
     exponent += power_ten + exponent_add;
 
 
             /* Make `scaling' as small as possible. */
             new_fraction_length = FT_MIN( exponent, 5 );
 
             /* Make `scaling' as small as possible. */
             new_fraction_length = FT_MIN( exponent, 5 );
-            exponent           -= new_fraction_length;
             shift               = new_fraction_length - fraction_length;
 
             shift               = new_fraction_length - fraction_length;
 
-            number *= power_tens[shift];
-            if ( number > 0x7FFFL )
+            if ( shift > 0 )
             {
             {
-              number   /= 10;
-              exponent += 1;
+              exponent -= new_fraction_length;
+              number   *= power_tens[shift];
+              if ( number > 0x7FFFL )
+              {
+                number   /= 10;
+                exponent += 1;
+              }
             }
             }
+            else
+              exponent -= fraction_length;
           }
           else
             exponent -= fraction_length;
 
           }
           else
             exponent -= fraction_length;
 
-          result   = number << 16;
+          result   = (FT_Long)( (FT_ULong)number << 16 );
           *scaling = exponent;
         }
       }
           *scaling = exponent;
         }
       }
       integer_length  += exponent;
       fraction_length -= exponent;
 
       integer_length  += exponent;
       fraction_length -= exponent;
 
-      /* Check for overflow and underflow. */
-      if ( FT_ABS( integer_length ) > 5 )
-        goto Exit;
+      if ( integer_length > 5 )
+        goto Overflow;
+      if ( integer_length < -5 )
+        goto Underflow;
 
       /* Remove non-significant digits. */
       if ( integer_length < 0 )
 
       /* Remove non-significant digits. */
       if ( integer_length < 0 )
         number *= power_tens[-fraction_length];
 
         if ( number > 0x7FFFL )
         number *= power_tens[-fraction_length];
 
         if ( number > 0x7FFFL )
-          goto Exit;
+          goto Overflow;
 
 
-        result = number << 16;
+        result = (FT_Long)( (FT_ULong)number << 16 );
       }
     }
 
       }
     }
 
+  Exit:
     if ( sign )
       result = -result;
 
     if ( sign )
       result = -result;
 
-  Exit:
     return result;
     return result;
+
+  Overflow:
+    result = 0x7FFFFFFFL;
+    FT_TRACE4(( "!!!OVERFLOW:!!!" ));
+    goto Exit;
+
+  Underflow:
+    result = 0;
+    FT_TRACE4(( "!!!UNDERFLOW:!!!" ));
+    goto Exit;
+
+  Bad:
+    result = 0;
+    FT_TRACE4(( "!!!END OF DATA:!!!" ));
+    goto Exit;
   }
 
 
   }
 
 
   }
 
 
   }
 
 
+  /* read a floating point number, either integer or real */
+  static FT_Fixed
+  do_fixed( FT_Byte**  d,
+            FT_Long    scaling )
+  {
+    if ( **d == 30 )
+      return cff_parse_real( d[0], d[1], scaling, NULL );
+    else
+    {
+      FT_Long  val = cff_parse_integer( d[0], d[1] );
+
+
+      if ( scaling )
+        val *= power_tens[scaling];
+
+      if ( val > 0x7FFF )
+      {
+        val = 0x7FFFFFFFL;
+        goto Overflow;
+      }
+      else if ( val < -0x7FFF )
+      {
+        val = -0x7FFFFFFFL;
+        goto Overflow;
+      }
+
+      return (FT_Long)( (FT_ULong)val << 16 );
+
+    Overflow:
+      FT_TRACE4(( "!!!OVERFLOW:!!!" ));
+      return val;
+    }
+  }
+
+
   /* read a floating point number, either integer or real */
   static FT_Fixed
   cff_parse_fixed( FT_Byte**  d )
   {
   /* read a floating point number, either integer or real */
   static FT_Fixed
   cff_parse_fixed( FT_Byte**  d )
   {
-    return **d == 30 ? cff_parse_real( d[0], d[1], 0, NULL )
-                     : cff_parse_integer( d[0], d[1] ) << 16;
+    return do_fixed( d, 0 );
   }
 
 
   }
 
 
   cff_parse_fixed_scaled( FT_Byte**  d,
                           FT_Long    scaling )
   {
   cff_parse_fixed_scaled( FT_Byte**  d,
                           FT_Long    scaling )
   {
-    return **d == 30 ? cff_parse_real( d[0], d[1], scaling, NULL )
-                     : ( cff_parse_integer( d[0], d[1] ) *
-                           power_tens[scaling] ) << 16;
+    return do_fixed( d, scaling );
   }
 
 
   }
 
 
       else
       {
         *scaling = 0;
       else
       {
         *scaling = 0;
-        return number << 16;
+        return (FT_Long)( (FT_ULong)number << 16 );
       }
     }
   }
       }
     }
   }
     FT_Vector*       offset = &dict->font_offset;
     FT_ULong*        upm    = &dict->units_per_em;
     FT_Byte**        data   = parser->stack;
     FT_Vector*       offset = &dict->font_offset;
     FT_ULong*        upm    = &dict->units_per_em;
     FT_Byte**        data   = parser->stack;
-    FT_Error         error  = CFF_Err_Stack_Underflow;
+    FT_Error         error  = FT_ERR( Stack_Underflow );
 
 
     if ( parser->top >= parser->stack + 6 )
 
 
     if ( parser->top >= parser->stack + 6 )
       FT_Long  scaling;
 
 
       FT_Long  scaling;
 
 
-      error = CFF_Err_Ok;
+      error = FT_Err_Ok;
+
+      dict->has_font_matrix = TRUE;
 
       /* We expect a well-formed font matrix, this is, the matrix elements */
       /* `xx' and `yy' are of approximately the same magnitude.  To avoid  */
 
       /* We expect a well-formed font matrix, this is, the matrix elements */
       /* `xx' and `yy' are of approximately the same magnitude.  To avoid  */
       if ( scaling < 0 || scaling > 9 )
       {
         /* Return default matrix in case of unlikely values. */
       if ( scaling < 0 || scaling > 9 )
       {
         /* Return default matrix in case of unlikely values. */
+
+        FT_TRACE1(( "cff_parse_font_matrix:"
+                    " strange scaling value for xx element (%d),\n"
+                    "                      "
+                    " using default matrix\n", scaling ));
+
         matrix->xx = 0x10000L;
         matrix->yx = 0;
         matrix->xx = 0x10000L;
         matrix->yx = 0;
-        matrix->yx = 0;
+        matrix->xy = 0;
         matrix->yy = 0x10000L;
         offset->x  = 0;
         offset->y  = 0;
         matrix->yy = 0x10000L;
         offset->x  = 0;
         offset->y  = 0;
       offset->y  = cff_parse_fixed_scaled( data,   scaling );
 
       *upm = power_tens[scaling];
       offset->y  = cff_parse_fixed_scaled( data,   scaling );
 
       *upm = power_tens[scaling];
+
+      FT_TRACE4(( " [%f %f %f %f %f %f]\n",
+                  (double)matrix->xx / *upm / 65536,
+                  (double)matrix->xy / *upm / 65536,
+                  (double)matrix->yx / *upm / 65536,
+                  (double)matrix->yy / *upm / 65536,
+                  (double)offset->x  / *upm / 65536,
+                  (double)offset->y  / *upm / 65536 ));
     }
 
   Exit:
     }
 
   Exit:
     FT_Error         error;
 
 
     FT_Error         error;
 
 
-    error = CFF_Err_Stack_Underflow;
+    error = FT_ERR( Stack_Underflow );
 
     if ( parser->top >= parser->stack + 4 )
     {
 
     if ( parser->top >= parser->stack + 4 )
     {
       bbox->yMin = FT_RoundFix( cff_parse_fixed( data++ ) );
       bbox->xMax = FT_RoundFix( cff_parse_fixed( data++ ) );
       bbox->yMax = FT_RoundFix( cff_parse_fixed( data   ) );
       bbox->yMin = FT_RoundFix( cff_parse_fixed( data++ ) );
       bbox->xMax = FT_RoundFix( cff_parse_fixed( data++ ) );
       bbox->yMax = FT_RoundFix( cff_parse_fixed( data   ) );
-      error = CFF_Err_Ok;
+      error = FT_Err_Ok;
+
+      FT_TRACE4(( " [%d %d %d %d]\n",
+                  bbox->xMin / 65536,
+                  bbox->yMin / 65536,
+                  bbox->xMax / 65536,
+                  bbox->yMax / 65536 ));
     }
 
     return error;
     }
 
     return error;
     FT_Error         error;
 
 
     FT_Error         error;
 
 
-    error = CFF_Err_Stack_Underflow;
+    error = FT_ERR( Stack_Underflow );
 
     if ( parser->top >= parser->stack + 2 )
     {
       dict->private_size   = cff_parse_num( data++ );
       dict->private_offset = cff_parse_num( data   );
 
     if ( parser->top >= parser->stack + 2 )
     {
       dict->private_size   = cff_parse_num( data++ );
       dict->private_offset = cff_parse_num( data   );
-      error = CFF_Err_Ok;
+      FT_TRACE4(( " %lu %lu\n",
+                  dict->private_size, dict->private_offset ));
+
+      error = FT_Err_Ok;
     }
 
     return error;
     }
 
     return error;
     FT_Error         error;
 
 
     FT_Error         error;
 
 
-    error = CFF_Err_Stack_Underflow;
+    error = FT_ERR( Stack_Underflow );
 
     if ( parser->top >= parser->stack + 3 )
     {
 
     if ( parser->top >= parser->stack + 3 )
     {
-      dict->cid_registry   = (FT_UInt)cff_parse_num ( data++ );
-      dict->cid_ordering   = (FT_UInt)cff_parse_num ( data++ );
+      dict->cid_registry = (FT_UInt)cff_parse_num( data++ );
+      dict->cid_ordering = (FT_UInt)cff_parse_num( data++ );
       if ( **data == 30 )
         FT_TRACE1(( "cff_parse_cid_ros: real supplement is rounded\n" ));
       dict->cid_supplement = cff_parse_num( data );
       if ( dict->cid_supplement < 0 )
         FT_TRACE1(( "cff_parse_cid_ros: negative supplement %d is found\n",
                    dict->cid_supplement ));
       if ( **data == 30 )
         FT_TRACE1(( "cff_parse_cid_ros: real supplement is rounded\n" ));
       dict->cid_supplement = cff_parse_num( data );
       if ( dict->cid_supplement < 0 )
         FT_TRACE1(( "cff_parse_cid_ros: negative supplement %d is found\n",
                    dict->cid_supplement ));
-      error = CFF_Err_Ok;
+      error = FT_Err_Ok;
+
+      FT_TRACE4(( " %d %d %d\n",
+                  dict->cid_registry,
+                  dict->cid_ordering,
+                  dict->cid_supplement ));
     }
 
     return error;
   }
 
 
     }
 
     return error;
   }
 
 
-#define CFF_FIELD_NUM( code, name ) \
-          CFF_FIELD( code, name, cff_kind_num )
-#define CFF_FIELD_FIXED( code, name ) \
-          CFF_FIELD( code, name, cff_kind_fixed )
-#define CFF_FIELD_FIXED_1000( code, name ) \
-          CFF_FIELD( code, name, cff_kind_fixed_thousand )
-#define CFF_FIELD_STRING( code, name ) \
-          CFF_FIELD( code, name, cff_kind_string )
-#define CFF_FIELD_BOOL( code, name ) \
-          CFF_FIELD( code, name, cff_kind_bool )
-#define CFF_FIELD_DELTA( code, name, max ) \
-          CFF_FIELD( code, name, cff_kind_delta )
+#define CFF_FIELD_NUM( code, name, id )             \
+          CFF_FIELD( code, name, id, cff_kind_num )
+#define CFF_FIELD_FIXED( code, name, id )             \
+          CFF_FIELD( code, name, id, cff_kind_fixed )
+#define CFF_FIELD_FIXED_1000( code, name, id )                 \
+          CFF_FIELD( code, name, id, cff_kind_fixed_thousand )
+#define CFF_FIELD_STRING( code, name, id )             \
+          CFF_FIELD( code, name, id, cff_kind_string )
+#define CFF_FIELD_BOOL( code, name, id )             \
+          CFF_FIELD( code, name, id, cff_kind_bool )
 
 #define CFFCODE_TOPDICT  0x1000
 #define CFFCODE_PRIVATE  0x2000
 
 
 #define CFFCODE_TOPDICT  0x1000
 #define CFFCODE_PRIVATE  0x2000
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define CFF_FIELD_CALLBACK( code, name ) \
-          {                              \
-            cff_kind_callback,           \
-            code | CFFCODE,              \
-            0, 0,                        \
-            cff_parse_ ## name,          \
-            0, 0                         \
-          },
 
 #undef  CFF_FIELD
 
 #undef  CFF_FIELD
-#define CFF_FIELD( code, name, kind ) \
-          {                          \
-            kind,                    \
-            code | CFFCODE,          \
-            FT_FIELD_OFFSET( name ), \
-            FT_FIELD_SIZE( name ),   \
-            0, 0, 0                  \
+#undef  CFF_FIELD_DELTA
+
+
+#ifndef FT_DEBUG_LEVEL_TRACE
+
+
+#define CFF_FIELD_CALLBACK( code, name, id ) \
+          {                                  \
+            cff_kind_callback,               \
+            code | CFFCODE,                  \
+            0, 0,                            \
+            cff_parse_ ## name,              \
+            0, 0                             \
           },
 
           },
 
-#undef  CFF_FIELD_DELTA
-#define CFF_FIELD_DELTA( code, name, max ) \
-        {                                  \
-          cff_kind_delta,                  \
-          code | CFFCODE,                  \
-          FT_FIELD_OFFSET( name ),         \
-          FT_FIELD_SIZE_DELTA( name ),     \
-          0,                               \
-          max,                             \
-          FT_FIELD_OFFSET( num_ ## name )  \
-        },
+#define CFF_FIELD( code, name, id, kind ) \
+          {                               \
+            kind,                         \
+            code | CFFCODE,               \
+            FT_FIELD_OFFSET( name ),      \
+            FT_FIELD_SIZE( name ),        \
+            0, 0, 0                       \
+          },
+
+#define CFF_FIELD_DELTA( code, name, max, id ) \
+          {                                    \
+            cff_kind_delta,                    \
+            code | CFFCODE,                    \
+            FT_FIELD_OFFSET( name ),           \
+            FT_FIELD_SIZE_DELTA( name ),       \
+            0,                                 \
+            max,                               \
+            FT_FIELD_OFFSET( num_ ## name )    \
+          },
 
   static const CFF_Field_Handler  cff_field_handlers[] =
   {
 
   static const CFF_Field_Handler  cff_field_handlers[] =
   {
   };
 
 
   };
 
 
+#else /* FT_DEBUG_LEVEL_TRACE */
+
+
+
+#define CFF_FIELD_CALLBACK( code, name, id ) \
+          {                                  \
+            cff_kind_callback,               \
+            code | CFFCODE,                  \
+            0, 0,                            \
+            cff_parse_ ## name,              \
+            0, 0,                            \
+            id                               \
+          },
+
+#define CFF_FIELD( code, name, id, kind ) \
+          {                               \
+            kind,                         \
+            code | CFFCODE,               \
+            FT_FIELD_OFFSET( name ),      \
+            FT_FIELD_SIZE( name ),        \
+            0, 0, 0,                      \
+            id                            \
+          },
+
+#define CFF_FIELD_DELTA( code, name, max, id ) \
+          {                                    \
+            cff_kind_delta,                    \
+            code | CFFCODE,                    \
+            FT_FIELD_OFFSET( name ),           \
+            FT_FIELD_SIZE_DELTA( name ),       \
+            0,                                 \
+            max,                               \
+            FT_FIELD_OFFSET( num_ ## name ),   \
+            id                                 \
+          },
+
+  static const CFF_Field_Handler  cff_field_handlers[] =
+  {
+
+#include "cfftoken.h"
+
+    { 0, 0, 0, 0, 0, 0, 0, 0 }
+  };
+
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
+
 #else /* FT_CONFIG_OPTION_PIC */
 
 #else /* FT_CONFIG_OPTION_PIC */
 
-  void FT_Destroy_Class_cff_field_handlers(FT_Library library, CFF_Field_Handler* clazz)
+
+  void
+  FT_Destroy_Class_cff_field_handlers( FT_Library          library,
+                                       CFF_Field_Handler*  clazz )
   {
   {
-    FT_Memory memory = library->memory;
+    FT_Memory  memory = library->memory;
+
+
     if ( clazz )
       FT_FREE( clazz );
   }
 
     if ( clazz )
       FT_FREE( clazz );
   }
 
-  FT_Error FT_Create_Class_cff_field_handlers(FT_Library library, CFF_Field_Handler** output_class)
+
+  FT_Error
+  FT_Create_Class_cff_field_handlers( FT_Library           library,
+                                      CFF_Field_Handler**  output_class )
   {
   {
-    CFF_Field_Handler*  clazz;
-    FT_Error          error;
-    FT_Memory memory = library->memory;
-    int i=0;
+    CFF_Field_Handler*  clazz  = NULL;
+    FT_Error            error;
+    FT_Memory           memory = library->memory;
+
+    int  i = 0;
+
 
 #undef CFF_FIELD
 
 #undef CFF_FIELD
+#define CFF_FIELD( code, name, id, kind ) i++;
 #undef CFF_FIELD_DELTA
 #undef CFF_FIELD_DELTA
+#define CFF_FIELD_DELTA( code, name, max, id ) i++;
 #undef CFF_FIELD_CALLBACK
 #undef CFF_FIELD_CALLBACK
-#define CFF_FIELD_CALLBACK( code, name ) i++;
-#define CFF_FIELD( code, name, kind ) i++;
-#define CFF_FIELD_DELTA( code, name, max ) i++;
+#define CFF_FIELD_CALLBACK( code, name, id ) i++;
 
 #include "cfftoken.h"
 
 #include "cfftoken.h"
-    i++;/*{ 0, 0, 0, 0, 0, 0, 0 }*/
 
 
-    if ( FT_ALLOC( clazz, sizeof(CFF_Field_Handler)*i ) )
+    i++; /* { 0, 0, 0, 0, 0, 0, 0 } */
+
+    if ( FT_ALLOC( clazz, sizeof ( CFF_Field_Handler ) * i ) )
       return error;
 
       return error;
 
-    i=0;
-#undef CFF_FIELD
-#undef CFF_FIELD_DELTA
+    i = 0;
+
+
+#ifndef FT_DEBUG_LEVEL_TRACE
+
+
 #undef CFF_FIELD_CALLBACK
 #undef CFF_FIELD_CALLBACK
+#define CFF_FIELD_CALLBACK( code_, name_, id_ )        \
+          clazz[i].kind         = cff_kind_callback;   \
+          clazz[i].code         = code_ | CFFCODE;     \
+          clazz[i].offset       = 0;                   \
+          clazz[i].size         = 0;                   \
+          clazz[i].reader       = cff_parse_ ## name_; \
+          clazz[i].array_max    = 0;                   \
+          clazz[i].count_offset = 0;                   \
+          i++;
 
 
-#define CFF_FIELD_CALLBACK( code_, name_ )                                   \
-    clazz[i].kind = cff_kind_callback;                                       \
-    clazz[i].code = code_ | CFFCODE;                                         \
-    clazz[i].offset = 0;                                                     \
-    clazz[i].size = 0;                                                       \
-    clazz[i].reader = cff_parse_ ## name_;                                   \
-    clazz[i].array_max = 0;                                                  \
-    clazz[i].count_offset = 0;                                               \
-    i++;
+#undef  CFF_FIELD
+#define CFF_FIELD( code_, name_, id_, kind_ )               \
+          clazz[i].kind         = kind_;                    \
+          clazz[i].code         = code_ | CFFCODE;          \
+          clazz[i].offset       = FT_FIELD_OFFSET( name_ ); \
+          clazz[i].size         = FT_FIELD_SIZE( name_ );   \
+          clazz[i].reader       = 0;                        \
+          clazz[i].array_max    = 0;                        \
+          clazz[i].count_offset = 0;                        \
+          i++;                                              \
+
+#undef  CFF_FIELD_DELTA
+#define CFF_FIELD_DELTA( code_, name_, max_, id_ )                  \
+          clazz[i].kind         = cff_kind_delta;                   \
+          clazz[i].code         = code_ | CFFCODE;                  \
+          clazz[i].offset       = FT_FIELD_OFFSET( name_ );         \
+          clazz[i].size         = FT_FIELD_SIZE_DELTA( name_ );     \
+          clazz[i].reader       = 0;                                \
+          clazz[i].array_max    = max_;                             \
+          clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \
+          i++;
+
+#include "cfftoken.h"
+
+    clazz[i].kind         = 0;
+    clazz[i].code         = 0;
+    clazz[i].offset       = 0;
+    clazz[i].size         = 0;
+    clazz[i].reader       = 0;
+    clazz[i].array_max    = 0;
+    clazz[i].count_offset = 0;
+
+
+#else /* FT_DEBUG_LEVEL_TRACE */
+
+
+#undef CFF_FIELD_CALLBACK
+#define CFF_FIELD_CALLBACK( code_, name_, id_ )        \
+          clazz[i].kind         = cff_kind_callback;   \
+          clazz[i].code         = code_ | CFFCODE;     \
+          clazz[i].offset       = 0;                   \
+          clazz[i].size         = 0;                   \
+          clazz[i].reader       = cff_parse_ ## name_; \
+          clazz[i].array_max    = 0;                   \
+          clazz[i].count_offset = 0;                   \
+          clazz[i].id           = id_;                 \
+          i++;
 
 #undef  CFF_FIELD
 
 #undef  CFF_FIELD
-#define CFF_FIELD( code_, name_, kind_ )                                     \
-    clazz[i].kind = kind_;                                                   \
-    clazz[i].code = code_ | CFFCODE;                                         \
-    clazz[i].offset = FT_FIELD_OFFSET( name_ );                              \
-    clazz[i].size = FT_FIELD_SIZE( name_ );                                  \
-    clazz[i].reader = 0;                                                     \
-    clazz[i].array_max = 0;                                                  \
-    clazz[i].count_offset = 0;                                               \
-    i++;                                                                     \
+#define CFF_FIELD( code_, name_, id_, kind_ )               \
+          clazz[i].kind         = kind_;                    \
+          clazz[i].code         = code_ | CFFCODE;          \
+          clazz[i].offset       = FT_FIELD_OFFSET( name_ ); \
+          clazz[i].size         = FT_FIELD_SIZE( name_ );   \
+          clazz[i].reader       = 0;                        \
+          clazz[i].array_max    = 0;                        \
+          clazz[i].count_offset = 0;                        \
+          clazz[i].id           = id_;                      \
+          i++;                                              \
 
 #undef  CFF_FIELD_DELTA
 
 #undef  CFF_FIELD_DELTA
-#define CFF_FIELD_DELTA( code_, name_, max_ )                                \
-    clazz[i].kind = cff_kind_delta;                                          \
-    clazz[i].code = code_ | CFFCODE;                                         \
-    clazz[i].offset = FT_FIELD_OFFSET( name_ );                              \
-    clazz[i].size = FT_FIELD_SIZE_DELTA( name_ );                            \
-    clazz[i].reader = 0;                                                     \
-    clazz[i].array_max = max_;                                               \
-    clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ );                \
-    i++;
+#define CFF_FIELD_DELTA( code_, name_, max_, id_ )                  \
+          clazz[i].kind         = cff_kind_delta;                   \
+          clazz[i].code         = code_ | CFFCODE;                  \
+          clazz[i].offset       = FT_FIELD_OFFSET( name_ );         \
+          clazz[i].size         = FT_FIELD_SIZE_DELTA( name_ );     \
+          clazz[i].reader       = 0;                                \
+          clazz[i].array_max    = max_;                             \
+          clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \
+          clazz[i].id           = id_;                              \
+          i++;
 
 #include "cfftoken.h"
 
 
 #include "cfftoken.h"
 
-    clazz[i].kind = 0;
-    clazz[i].code = 0;
-    clazz[i].offset = 0;
-    clazz[i].size = 0;
-    clazz[i].reader = 0;
-    clazz[i].array_max = 0;
+    clazz[i].kind         = 0;
+    clazz[i].code         = 0;
+    clazz[i].offset       = 0;
+    clazz[i].size         = 0;
+    clazz[i].reader       = 0;
+    clazz[i].array_max    = 0;
     clazz[i].count_offset = 0;
     clazz[i].count_offset = 0;
+    clazz[i].id           = 0;
+
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
 
     *output_class = clazz;
 
     *output_class = clazz;
-    return CFF_Err_Ok;
+
+    return FT_Err_Ok;
   }
 
 
   }
 
 
                   FT_Byte*    limit )
   {
     FT_Byte*    p       = start;
                   FT_Byte*    limit )
   {
     FT_Byte*    p       = start;
-    FT_Error    error   = CFF_Err_Ok;
+    FT_Error    error   = FT_Err_Ok;
     FT_Library  library = parser->library;
     FT_Library  library = parser->library;
-    FT_UNUSED(library);
+    FT_UNUSED( library );
 
 
     parser->top    = parser->stack;
 
 
     parser->top    = parser->stack;
         }
         code = code | parser->object_code;
 
         }
         code = code | parser->object_code;
 
-        for ( field = FT_CFF_FIELD_HANDLERS_GET; field->kind; field++ )
+        for ( field = CFF_FIELD_HANDLERS_GET; field->kind; field++ )
         {
           if ( field->code == (FT_Int)code )
           {
         {
           if ( field->code == (FT_Int)code )
           {
             FT_Byte*  q = (FT_Byte*)parser->object + field->offset;
 
 
             FT_Byte*  q = (FT_Byte*)parser->object + field->offset;
 
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+            FT_TRACE4(( "  %s", field->id ));
+#endif
+
             /* check that we have enough arguments -- except for */
             /* delta encoded arrays, which can be empty          */
             if ( field->kind != cff_kind_delta && num_args < 1 )
             /* check that we have enough arguments -- except for */
             /* delta encoded arrays, which can be empty          */
             if ( field->kind != cff_kind_delta && num_args < 1 )
               default:  /* for 64-bit systems */
                 *(FT_Long*)q = val;
               }
               default:  /* for 64-bit systems */
                 *(FT_Long*)q = val;
               }
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+              switch ( field->kind )
+              {
+              case cff_kind_bool:
+                FT_TRACE4(( " %s\n", val ? "true" : "false" ));
+                break;
+
+              case cff_kind_string:
+                FT_TRACE4(( " %ld (SID)\n", val ));
+                break;
+
+              case cff_kind_num:
+                FT_TRACE4(( " %ld\n", val ));
+                break;
+
+              case cff_kind_fixed:
+                FT_TRACE4(( " %f\n", (double)val / 65536 ));
+                break;
+
+              case cff_kind_fixed_thousand:
+                FT_TRACE4(( " %f\n", (double)val / 65536 / 1000 ));
+
+              default:
+                ; /* never reached */
+              }
+#endif
+
               break;
 
             case cff_kind_delta:
               break;
 
             case cff_kind_delta:
                 if ( num_args > field->array_max )
                   num_args = field->array_max;
 
                 if ( num_args > field->array_max )
                   num_args = field->array_max;
 
+                FT_TRACE4(( " [" ));
+
                 /* store count */
                 *qcount = (FT_Byte)num_args;
 
                 /* store count */
                 *qcount = (FT_Byte)num_args;
 
                     *(FT_Long*)q = val;
                   }
 
                     *(FT_Long*)q = val;
                   }
 
+                  FT_TRACE4(( " %ld", val ));
+
                   q += field->size;
                   num_args--;
                 }
                   q += field->size;
                   num_args--;
                 }
+
+                FT_TRACE4(( "]\n" ));
               }
               break;
 
               }
               break;
 
     return error;
 
   Stack_Overflow:
     return error;
 
   Stack_Overflow:
-    error = CFF_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_Argument );
     goto Exit;
 
   Stack_Underflow:
     goto Exit;
 
   Stack_Underflow:
-    error = CFF_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_Argument );
     goto Exit;
 
   Syntax_Error:
     goto Exit;
 
   Syntax_Error:
-    error = CFF_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_Argument );
     goto Exit;
   }
 
     goto Exit;
   }
 
index 7e2c00a..61d91ed 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CFF token stream parser (specification)                              */
 /*                                                                         */
 /*                                                                         */
 /*    CFF token stream parser (specification)                              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2003, 2011 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -90,6 +90,10 @@ FT_BEGIN_HEADER
     FT_UInt           array_max;
     FT_UInt           count_offset;
 
     FT_UInt           array_max;
     FT_UInt           count_offset;
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+    const char*       id;
+#endif
+
   } CFF_Field_Handler;
 
 
   } CFF_Field_Handler;
 
 
index 5d01bd4..f22e4f0 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for cff module.      */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for cff module.      */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009, 2010, 2012, 2013 by                                    */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include <ft2build.h>
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include <ft2build.h>
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
+#include "cffcmap.h"
 #include "cffpic.h"
 #include "cffpic.h"
+#include "cfferrs.h"
+
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from cffdrivr.c */
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from cffdrivr.c */
-  FT_Error FT_Create_Class_cff_services( FT_Library, FT_ServiceDescRec**);
-  void FT_Destroy_Class_cff_services( FT_Library, FT_ServiceDescRec*);
-  void FT_Init_Class_cff_service_ps_info( FT_Library, FT_Service_PsInfoRec*);
-  void FT_Init_Class_cff_service_glyph_dict( FT_Library, FT_Service_GlyphDictRec*);
-  void FT_Init_Class_cff_service_ps_name( FT_Library, FT_Service_PsFontNameRec*);
-  void FT_Init_Class_cff_service_get_cmap_info( FT_Library, FT_Service_TTCMapsRec*);
-  void FT_Init_Class_cff_service_cid_info( FT_Library, FT_Service_CIDRec*);
+  FT_Error
+  FT_Create_Class_cff_services( FT_Library           library,
+                                FT_ServiceDescRec**  output_class );
+  void
+  FT_Destroy_Class_cff_services( FT_Library          library,
+                                 FT_ServiceDescRec*  clazz );
+  void
+  FT_Init_Class_cff_service_ps_info( FT_Library             library,
+                                     FT_Service_PsInfoRec*  clazz );
+  void
+  FT_Init_Class_cff_service_glyph_dict( FT_Library                library,
+                                        FT_Service_GlyphDictRec*  clazz );
+  void
+  FT_Init_Class_cff_service_ps_name( FT_Library                 library,
+                                     FT_Service_PsFontNameRec*  clazz );
+  void
+  FT_Init_Class_cff_service_get_cmap_info( FT_Library              library,
+                                           FT_Service_TTCMapsRec*  clazz );
+  void
+  FT_Init_Class_cff_service_cid_info( FT_Library          library,
+                                      FT_Service_CIDRec*  clazz );
 
   /* forward declaration of PIC init functions from cffparse.c */
 
   /* forward declaration of PIC init functions from cffparse.c */
-  FT_Error FT_Create_Class_cff_field_handlers( FT_Library, CFF_Field_Handler**);
-  void FT_Destroy_Class_cff_field_handlers( FT_Library, CFF_Field_Handler*);
+  FT_Error
+  FT_Create_Class_cff_field_handlers( FT_Library           library,
+                                      CFF_Field_Handler**  output_class );
+  void
+  FT_Destroy_Class_cff_field_handlers( FT_Library          library,
+                                       CFF_Field_Handler*  clazz );
 
 
-  /* forward declaration of PIC init functions from cffcmap.c */
-  void FT_Init_Class_cff_cmap_encoding_class_rec( FT_Library, FT_CMap_ClassRec*);
-  void FT_Init_Class_cff_cmap_unicode_class_rec( FT_Library, FT_CMap_ClassRec*);
 
   void
 
   void
-  cff_driver_class_pic_free(  FT_Library library )
+  cff_driver_class_pic_free( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Memory memory = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Memory          memory        = library->memory;
+
+
     if ( pic_container->cff )
     {
     if ( pic_container->cff )
     {
-      CffModulePIC* container = (CffModulePIC*)pic_container->cff;
-      if(container->cff_services)
-        FT_Destroy_Class_cff_services(library, container->cff_services);
+      CffModulePIC*  container = (CffModulePIC*)pic_container->cff;
+
+
+      if ( container->cff_services )
+        FT_Destroy_Class_cff_services( library,
+                                       container->cff_services );
       container->cff_services = NULL;
       container->cff_services = NULL;
-      if(container->cff_field_handlers)
-        FT_Destroy_Class_cff_field_handlers(library, container->cff_field_handlers);
+      if ( container->cff_field_handlers )
+        FT_Destroy_Class_cff_field_handlers(
+          library, container->cff_field_handlers );
       container->cff_field_handlers = NULL;
       FT_FREE( container );
       pic_container->cff = NULL;
       container->cff_field_handlers = NULL;
       FT_FREE( container );
       pic_container->cff = NULL;
@@ -64,8 +88,8 @@
   cff_driver_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
   cff_driver_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Error           error         = CFF_Err_Ok;
-    CffModulePIC*      container;
+    FT_Error           error         = FT_Err_Ok;
+    CffModulePIC*      container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
     FT_Memory          memory        = library->memory;
 
 
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->cff = container;
 
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->cff = container;
 
-    /* initialize pointer table - this is how the module usually expects this data */
-    error = FT_Create_Class_cff_services(library, &container->cff_services);
-    if(error) 
+    /* initialize pointer table -                       */
+    /* this is how the module usually expects this data */
+    error = FT_Create_Class_cff_services( library,
+                                          &container->cff_services );
+    if ( error )
       goto Exit;
       goto Exit;
-    error = FT_Create_Class_cff_field_handlers(library, &container->cff_field_handlers);
-    if(error) 
+
+    error = FT_Create_Class_cff_field_handlers(
+              library, &container->cff_field_handlers );
+    if ( error )
       goto Exit;
       goto Exit;
-    FT_Init_Class_cff_service_ps_info(library, &container->cff_service_ps_info);
-    FT_Init_Class_cff_service_glyph_dict(library, &container->cff_service_glyph_dict);
-    FT_Init_Class_cff_service_ps_name(library, &container->cff_service_ps_name);
-    FT_Init_Class_cff_service_get_cmap_info(library, &container->cff_service_get_cmap_info);
-    FT_Init_Class_cff_service_cid_info(library, &container->cff_service_cid_info);
-    FT_Init_Class_cff_cmap_encoding_class_rec(library, &container->cff_cmap_encoding_class_rec);
-    FT_Init_Class_cff_cmap_unicode_class_rec(library, &container->cff_cmap_unicode_class_rec);
-Exit:
-    if(error)
-      cff_driver_class_pic_free(library);
+
+    FT_Init_Class_cff_service_ps_info(
+      library, &container->cff_service_ps_info );
+    FT_Init_Class_cff_service_glyph_dict(
+      library, &container->cff_service_glyph_dict );
+    FT_Init_Class_cff_service_ps_name(
+      library, &container->cff_service_ps_name );
+    FT_Init_Class_cff_service_get_cmap_info(
+      library, &container->cff_service_get_cmap_info );
+    FT_Init_Class_cff_service_cid_info(
+      library, &container->cff_service_cid_info );
+    FT_Init_Class_cff_cmap_encoding_class_rec(
+      library, &container->cff_cmap_encoding_class_rec );
+    FT_Init_Class_cff_cmap_unicode_class_rec(
+      library, &container->cff_cmap_unicode_class_rec );
+
+  Exit:
+    if ( error )
+      cff_driver_class_pic_free( library );
     return error;
   }
 
     return error;
   }
 
index e29d068..50bab4c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for cff module.      */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for cff module.      */
 /*                                                                         */
-/*  Copyright 2009 by                                                      */
+/*  Copyright 2009, 2012, 2013 by                                          */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #ifndef __CFFPIC_H__
 #define __CFFPIC_H__
 
 #ifndef __CFFPIC_H__
 #define __CFFPIC_H__
 
-  
+
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 #ifndef FT_CONFIG_OPTION_PIC
-#define FT_CFF_SERVICE_PS_INFO_GET         cff_service_ps_info
-#define FT_CFF_SERVICE_GLYPH_DICT_GET      cff_service_glyph_dict
-#define FT_CFF_SERVICE_PS_NAME_GET         cff_service_ps_name
-#define FT_CFF_SERVICE_GET_CMAP_INFO_GET   cff_service_get_cmap_info
-#define FT_CFF_SERVICE_CID_INFO_GET        cff_service_cid_info
-#define FT_CFF_SERVICES_GET                cff_services
-#define FT_CFF_CMAP_ENCODING_CLASS_REC_GET cff_cmap_encoding_class_rec
-#define FT_CFF_CMAP_UNICODE_CLASS_REC_GET  cff_cmap_unicode_class_rec
-#define FT_CFF_FIELD_HANDLERS_GET          cff_field_handlers
+
+#define CFF_SERVICE_PS_INFO_GET          cff_service_ps_info
+#define CFF_SERVICE_GLYPH_DICT_GET       cff_service_glyph_dict
+#define CFF_SERVICE_PS_NAME_GET          cff_service_ps_name
+#define CFF_SERVICE_GET_CMAP_INFO_GET    cff_service_get_cmap_info
+#define CFF_SERVICE_CID_INFO_GET         cff_service_cid_info
+#define CFF_SERVICE_PROPERTIES_GET       cff_service_properties
+#define CFF_SERVICES_GET                 cff_services
+#define CFF_CMAP_ENCODING_CLASS_REC_GET  cff_cmap_encoding_class_rec
+#define CFF_CMAP_UNICODE_CLASS_REC_GET   cff_cmap_unicode_class_rec
+#define CFF_FIELD_HANDLERS_GET           cff_field_handlers
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 
 #else /* FT_CONFIG_OPTION_PIC */
 
@@ -43,30 +46,55 @@ FT_BEGIN_HEADER
 #include FT_SERVICE_POSTSCRIPT_NAME_H
 #include FT_SERVICE_TT_CMAP_H
 #include FT_SERVICE_CID_H
 #include FT_SERVICE_POSTSCRIPT_NAME_H
 #include FT_SERVICE_TT_CMAP_H
 #include FT_SERVICE_CID_H
+#include FT_SERVICE_PROPERTIES_H
 
 
-  typedef struct CffModulePIC_
+
+  typedef struct  CffModulePIC_
   {
   {
-    FT_ServiceDescRec* cff_services;
-    CFF_Field_Handler* cff_field_handlers;
-    FT_Service_PsInfoRec cff_service_ps_info;
-    FT_Service_GlyphDictRec cff_service_glyph_dict;
-    FT_Service_PsFontNameRec cff_service_ps_name;
-    FT_Service_TTCMapsRec  cff_service_get_cmap_info;
-    FT_Service_CIDRec  cff_service_cid_info;
-    FT_CMap_ClassRec cff_cmap_encoding_class_rec;
-    FT_CMap_ClassRec cff_cmap_unicode_class_rec;
+    FT_ServiceDescRec*        cff_services;
+    CFF_Field_Handler*        cff_field_handlers;
+    FT_Service_PsInfoRec      cff_service_ps_info;
+    FT_Service_GlyphDictRec   cff_service_glyph_dict;
+    FT_Service_PsFontNameRec  cff_service_ps_name;
+    FT_Service_TTCMapsRec     cff_service_get_cmap_info;
+    FT_Service_CIDRec         cff_service_cid_info;
+    FT_Service_PropertiesRec  cff_service_properties;
+    FT_CMap_ClassRec          cff_cmap_encoding_class_rec;
+    FT_CMap_ClassRec          cff_cmap_unicode_class_rec;
+
   } CffModulePIC;
 
   } CffModulePIC;
 
-#define GET_PIC(lib)                       ((CffModulePIC*)((lib)->pic_container.cff))
-#define FT_CFF_SERVICE_PS_INFO_GET         (GET_PIC(library)->cff_service_ps_info)
-#define FT_CFF_SERVICE_GLYPH_DICT_GET      (GET_PIC(library)->cff_service_glyph_dict)
-#define FT_CFF_SERVICE_PS_NAME_GET         (GET_PIC(library)->cff_service_ps_name)
-#define FT_CFF_SERVICE_GET_CMAP_INFO_GET   (GET_PIC(library)->cff_service_get_cmap_info)
-#define FT_CFF_SERVICE_CID_INFO_GET        (GET_PIC(library)->cff_service_cid_info)
-#define FT_CFF_SERVICES_GET                (GET_PIC(library)->cff_services)
-#define FT_CFF_CMAP_ENCODING_CLASS_REC_GET (GET_PIC(library)->cff_cmap_encoding_class_rec)
-#define FT_CFF_CMAP_UNICODE_CLASS_REC_GET  (GET_PIC(library)->cff_cmap_unicode_class_rec)
-#define FT_CFF_FIELD_HANDLERS_GET          (GET_PIC(library)->cff_field_handlers)
+
+#define GET_PIC( lib )                                    \
+          ( (CffModulePIC*)( (lib)->pic_container.cff ) )
+
+#define CFF_SERVICE_PS_INFO_GET                       \
+          ( GET_PIC( library )->cff_service_ps_info )
+#define CFF_SERVICE_GLYPH_DICT_GET                       \
+          ( GET_PIC( library )->cff_service_glyph_dict )
+#define CFF_SERVICE_PS_NAME_GET                       \
+          ( GET_PIC( library )->cff_service_ps_name )
+#define CFF_SERVICE_GET_CMAP_INFO_GET                       \
+          ( GET_PIC( library )->cff_service_get_cmap_info )
+#define CFF_SERVICE_CID_INFO_GET                       \
+          ( GET_PIC( library )->cff_service_cid_info )
+#define CFF_SERVICE_PROPERTIES_GET                       \
+          ( GET_PIC( library )->cff_service_properties )
+#define CFF_SERVICES_GET                       \
+          ( GET_PIC( library )->cff_services )
+#define CFF_CMAP_ENCODING_CLASS_REC_GET                       \
+          ( GET_PIC( library )->cff_cmap_encoding_class_rec )
+#define CFF_CMAP_UNICODE_CLASS_REC_GET                       \
+          ( GET_PIC( library )->cff_cmap_unicode_class_rec )
+#define CFF_FIELD_HANDLERS_GET                       \
+          ( GET_PIC( library )->cff_field_handlers )
+
+  /* see cffpic.c for the implementation */
+  void
+  cff_driver_class_pic_free( FT_Library  library );
+
+  FT_Error
+  cff_driver_class_pic_init( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
index 6bb27d5..bcb4276 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CFF token definitions (specification only).                          */
 /*                                                                         */
 /*                                                                         */
 /*    CFF token definitions (specification only).                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2003, 2011 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #undef  CFFCODE
 #define CFFCODE       CFFCODE_TOPDICT
 
 #undef  CFFCODE
 #define CFFCODE       CFFCODE_TOPDICT
 
-  CFF_FIELD_STRING  ( 0,     version )
-  CFF_FIELD_STRING  ( 1,     notice )
-  CFF_FIELD_STRING  ( 0x100, copyright )
-  CFF_FIELD_STRING  ( 2,     full_name )
-  CFF_FIELD_STRING  ( 3,     family_name )
-  CFF_FIELD_STRING  ( 4,     weight )
-  CFF_FIELD_BOOL    ( 0x101, is_fixed_pitch )
-  CFF_FIELD_FIXED   ( 0x102, italic_angle )
-  CFF_FIELD_FIXED   ( 0x103, underline_position )
-  CFF_FIELD_FIXED   ( 0x104, underline_thickness )
-  CFF_FIELD_NUM     ( 0x105, paint_type )
-  CFF_FIELD_NUM     ( 0x106, charstring_type )
-  CFF_FIELD_CALLBACK( 0x107, font_matrix )
-  CFF_FIELD_NUM     ( 13,    unique_id )
-  CFF_FIELD_CALLBACK( 5,     font_bbox )
-  CFF_FIELD_NUM     ( 0x108, stroke_width )
-  CFF_FIELD_NUM     ( 15,    charset_offset )
-  CFF_FIELD_NUM     ( 16,    encoding_offset )
-  CFF_FIELD_NUM     ( 17,    charstrings_offset )
-  CFF_FIELD_CALLBACK( 18,    private_dict )
-  CFF_FIELD_NUM     ( 0x114, synthetic_base )
-  CFF_FIELD_STRING  ( 0x115, embedded_postscript )
+  CFF_FIELD_STRING  ( 0,     version,             "Version" )
+  CFF_FIELD_STRING  ( 1,     notice,              "Notice" )
+  CFF_FIELD_STRING  ( 0x100, copyright,           "Copyright" )
+  CFF_FIELD_STRING  ( 2,     full_name,           "FullName" )
+  CFF_FIELD_STRING  ( 3,     family_name,         "FamilyName" )
+  CFF_FIELD_STRING  ( 4,     weight,              "Weight" )
+  CFF_FIELD_BOOL    ( 0x101, is_fixed_pitch,      "isFixedPitch" )
+  CFF_FIELD_FIXED   ( 0x102, italic_angle,        "ItalicAngle" )
+  CFF_FIELD_FIXED   ( 0x103, underline_position,  "UnderlinePosition" )
+  CFF_FIELD_FIXED   ( 0x104, underline_thickness, "UnderlineThickness" )
+  CFF_FIELD_NUM     ( 0x105, paint_type,          "PaintType" )
+  CFF_FIELD_NUM     ( 0x106, charstring_type,     "CharstringType" )
+  CFF_FIELD_CALLBACK( 0x107, font_matrix,         "FontMatrix" )
+  CFF_FIELD_NUM     ( 13,    unique_id,           "UniqueID" )
+  CFF_FIELD_CALLBACK( 5,     font_bbox,           "FontBBox" )
+  CFF_FIELD_NUM     ( 0x108, stroke_width,        "StrokeWidth" )
+  CFF_FIELD_NUM     ( 15,    charset_offset,      "charset" )
+  CFF_FIELD_NUM     ( 16,    encoding_offset,     "Encoding" )
+  CFF_FIELD_NUM     ( 17,    charstrings_offset,  "CharStrings" )
+  CFF_FIELD_CALLBACK( 18,    private_dict,        "Private" )
+  CFF_FIELD_NUM     ( 0x114, synthetic_base,      "SyntheticBase" )
+  CFF_FIELD_STRING  ( 0x115, embedded_postscript, "PostScript" )
 
 #if 0
 
 #if 0
-  CFF_FIELD_STRING  ( 0x116, base_font_name )
-  CFF_FIELD_DELTA   ( 0x117, base_font_blend, 16 )
-  CFF_FIELD_CALLBACK( 0x118, multiple_master )
-  CFF_FIELD_CALLBACK( 0x119, blend_axis_types )
+  CFF_FIELD_STRING  ( 0x116, base_font_name,      "BaseFontName" )
+  CFF_FIELD_DELTA   ( 0x117, base_font_blend, 16, "BaseFontBlend" )
+  CFF_FIELD_CALLBACK( 0x118, multiple_master,     "MultipleMaster" )
+  CFF_FIELD_CALLBACK( 0x119, blend_axis_types,    "BlendAxisTypes" )
 #endif
 
 #endif
 
-  CFF_FIELD_CALLBACK( 0x11E, cid_ros )
-  CFF_FIELD_NUM     ( 0x11F, cid_font_version )
-  CFF_FIELD_NUM     ( 0x120, cid_font_revision )
-  CFF_FIELD_NUM     ( 0x121, cid_font_type )
-  CFF_FIELD_NUM     ( 0x122, cid_count )
-  CFF_FIELD_NUM     ( 0x123, cid_uid_base )
-  CFF_FIELD_NUM     ( 0x124, cid_fd_array_offset )
-  CFF_FIELD_NUM     ( 0x125, cid_fd_select_offset )
-  CFF_FIELD_STRING  ( 0x126, cid_font_name )
+  CFF_FIELD_CALLBACK( 0x11E, cid_ros,              "ROS" )
+  CFF_FIELD_NUM     ( 0x11F, cid_font_version,     "CIDFontVersion" )
+  CFF_FIELD_NUM     ( 0x120, cid_font_revision,    "CIDFontRevision" )
+  CFF_FIELD_NUM     ( 0x121, cid_font_type,        "CIDFontType" )
+  CFF_FIELD_NUM     ( 0x122, cid_count,            "CIDCount" )
+  CFF_FIELD_NUM     ( 0x123, cid_uid_base,         "UIDBase" )
+  CFF_FIELD_NUM     ( 0x124, cid_fd_array_offset,  "FDArray" )
+  CFF_FIELD_NUM     ( 0x125, cid_fd_select_offset, "FDSelect" )
+  CFF_FIELD_STRING  ( 0x126, cid_font_name,        "FontName" )
 
 #if 0
 
 #if 0
-  CFF_FIELD_NUM     ( 0x127, chameleon )
+  CFF_FIELD_NUM     ( 0x127, chameleon, "Chameleon" )
 #endif
 
 
 #endif
 
 
 #undef  CFFCODE
 #define CFFCODE       CFFCODE_PRIVATE
 
 #undef  CFFCODE
 #define CFFCODE       CFFCODE_PRIVATE
 
-  CFF_FIELD_DELTA     ( 6,     blue_values, 14 )
-  CFF_FIELD_DELTA     ( 7,     other_blues, 10 )
-  CFF_FIELD_DELTA     ( 8,     family_blues, 14 )
-  CFF_FIELD_DELTA     ( 9,     family_other_blues, 10 )
-  CFF_FIELD_FIXED_1000( 0x109, blue_scale )
-  CFF_FIELD_NUM       ( 0x10A, blue_shift )
-  CFF_FIELD_NUM       ( 0x10B, blue_fuzz )
-  CFF_FIELD_NUM       ( 10,    standard_width )
-  CFF_FIELD_NUM       ( 11,    standard_height )
-  CFF_FIELD_DELTA     ( 0x10C, snap_widths, 13 )
-  CFF_FIELD_DELTA     ( 0x10D, snap_heights, 13 )
-  CFF_FIELD_BOOL      ( 0x10E, force_bold )
-  CFF_FIELD_FIXED     ( 0x10F, force_bold_threshold )
-  CFF_FIELD_NUM       ( 0x110, lenIV )
-  CFF_FIELD_NUM       ( 0x111, language_group )
-  CFF_FIELD_FIXED     ( 0x112, expansion_factor )
-  CFF_FIELD_NUM       ( 0x113, initial_random_seed )
-  CFF_FIELD_NUM       ( 19,    local_subrs_offset )
-  CFF_FIELD_NUM       ( 20,    default_width )
-  CFF_FIELD_NUM       ( 21,    nominal_width )
+  CFF_FIELD_DELTA     ( 6,     blue_values, 14,        "BlueValues" )
+  CFF_FIELD_DELTA     ( 7,     other_blues, 10,        "OtherBlues" )
+  CFF_FIELD_DELTA     ( 8,     family_blues, 14,       "FamilyBlues" )
+  CFF_FIELD_DELTA     ( 9,     family_other_blues, 10, "FamilyOtherBlues" )
+  CFF_FIELD_FIXED_1000( 0x109, blue_scale,             "BlueScale" )
+  CFF_FIELD_NUM       ( 0x10A, blue_shift,             "BlueShift" )
+  CFF_FIELD_NUM       ( 0x10B, blue_fuzz,              "BlueFuzz" )
+  CFF_FIELD_NUM       ( 10,    standard_width,         "StdHW" )
+  CFF_FIELD_NUM       ( 11,    standard_height,        "StdVW" )
+  CFF_FIELD_DELTA     ( 0x10C, snap_widths, 13,        "StemSnapH" )
+  CFF_FIELD_DELTA     ( 0x10D, snap_heights, 13,       "StemSnapV" )
+  CFF_FIELD_BOOL      ( 0x10E, force_bold,             "ForceBold" )
+  CFF_FIELD_FIXED     ( 0x10F, force_bold_threshold,   "ForceBoldThreshold" )
+  CFF_FIELD_NUM       ( 0x110, lenIV,                  "lenIV" )
+  CFF_FIELD_NUM       ( 0x111, language_group,         "LanguageGroup" )
+  CFF_FIELD_FIXED     ( 0x112, expansion_factor,       "ExpansionFactor" )
+  CFF_FIELD_NUM       ( 0x113, initial_random_seed,    "initialRandomSeed" )
+  CFF_FIELD_NUM       ( 19,    local_subrs_offset,     "Subrs" )
+  CFF_FIELD_NUM       ( 20,    default_width,          "defaultWidthX" )
+  CFF_FIELD_NUM       ( 21,    nominal_width,          "nominalWidthX" )
 
 
 /* END */
 
 
 /* END */
index d405357..8727446 100644 (file)
@@ -5,7 +5,7 @@
 /*    Basic OpenType/CFF type definitions and interface (specification     */
 /*    only).                                                               */
 /*                                                                         */
 /*    Basic OpenType/CFF type definitions and interface (specification     */
 /*    only).                                                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2006, 2007, 2008, 2010 by             */
+/*  Copyright 1996-2003, 2006-2008, 2010-2011, 2013 by                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -117,6 +117,7 @@ FT_BEGIN_HEADER
     FT_Int     paint_type;
     FT_Int     charstring_type;
     FT_Matrix  font_matrix;
     FT_Int     paint_type;
     FT_Int     charstring_type;
     FT_Matrix  font_matrix;
+    FT_Bool    has_font_matrix;
     FT_ULong   units_per_em;  /* temporarily used as scaling value also */
     FT_Vector  font_offset;
     FT_ULong   unique_id;
     FT_ULong   units_per_em;  /* temporarily used as scaling value also */
     FT_Vector  font_offset;
     FT_ULong   unique_id;
@@ -212,8 +213,7 @@ FT_BEGIN_HEADER
   } CFF_SubFontRec, *CFF_SubFont;
 
 
   } CFF_SubFontRec, *CFF_SubFont;
 
 
-  /* maximum number of sub-fonts in a CID-keyed file */
-#define CFF_MAX_CID_FONTS  32
+#define CFF_MAX_CID_FONTS  256
 
 
   typedef struct  CFF_FontRec_
 
 
   typedef struct  CFF_FontRec_
@@ -269,7 +269,10 @@ FT_BEGIN_HEADER
     /* since version 2.3.6 */
     FT_String*       registry;
     FT_String*       ordering;
     /* since version 2.3.6 */
     FT_String*       registry;
     FT_String*       ordering;
-      
+
+    /* since version 2.4.12 */
+    FT_Generic       cf2_instance;
+
   } CFF_FontRec, *CFF_Font;
 
 
   } CFF_FontRec, *CFF_Font;
 
 
index 4100c80..13115c2 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
 #
 
 
-# Copyright 1996-2000, 2001, 2003 by
+# Copyright 1996-2001, 2003, 2011, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -23,19 +23,33 @@ CFF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CFF_DIR))
 
 # CFF driver sources (i.e., C files)
 #
 
 # CFF driver sources (i.e., C files)
 #
-CFF_DRV_SRC := $(CFF_DIR)/cffobjs.c  \
-               $(CFF_DIR)/cffload.c  \
+CFF_DRV_SRC := $(CFF_DIR)/cffcmap.c  \
+               $(CFF_DIR)/cffdrivr.c \
                $(CFF_DIR)/cffgload.c \
                $(CFF_DIR)/cffgload.c \
+               $(CFF_DIR)/cffload.c  \
+               $(CFF_DIR)/cffobjs.c  \
                $(CFF_DIR)/cffparse.c \
                $(CFF_DIR)/cffparse.c \
-               $(CFF_DIR)/cffcmap.c  \
-               $(CFF_DIR)/cffdrivr.c
+               $(CFF_DIR)/cffpic.c   \
+               $(CFF_DIR)/cf2arrst.c \
+               $(CFF_DIR)/cf2blues.c \
+               $(CFF_DIR)/cf2error.c \
+               $(CFF_DIR)/cf2font.c  \
+               $(CFF_DIR)/cf2ft.c    \
+               $(CFF_DIR)/cf2hints.c \
+               $(CFF_DIR)/cf2intrp.c \
+               $(CFF_DIR)/cf2read.c  \
+               $(CFF_DIR)/cf2stack.c
+
 
 # CFF driver headers
 #
 CFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \
 
 # CFF driver headers
 #
 CFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \
+             $(CFF_DIR)/cfferrs.h   \
              $(CFF_DIR)/cfftoken.h  \
              $(CFF_DIR)/cfftypes.h  \
              $(CFF_DIR)/cfftoken.h  \
              $(CFF_DIR)/cfftypes.h  \
-             $(CFF_DIR)/cfferrs.h
+             $(CFF_DIR)/cf2fixed.h  \
+             $(CFF_DIR)/cf2glue.h   \
+             $(CFF_DIR)/cf2types.h
 
 
 # CFF driver object(s)
 
 
 # CFF driver object(s)
diff --git a/reactos/lib/3rdparty/freetype/src/cid/Jamfile b/reactos/lib/3rdparty/freetype/src/cid/Jamfile
deleted file mode 100644 (file)
index ebeaed5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/cid Jamfile
-#
-# Copyright 2001 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) cid ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = cidobjs cidload cidgload cidriver cidparse ;
-  }
-  else
-  {
-    _sources = type1cid ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/cid Jamfile
index 01813e1..ef13155 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID error codes (specification only).                                */
 /*                                                                         */
 /*                                                                         */
 /*    CID error codes (specification only).                                */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,6 +29,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  CID_Err_
 #define FT_ERR_BASE    FT_Mod_Err_CID
 
 #define FT_ERR_PREFIX  CID_Err_
 #define FT_ERR_BASE    FT_Mod_Err_CID
 
index 81742d1..a1a8658 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID-keyed Type1 Glyph Loader (body).                                 */
 /*                                                                         */
 /*                                                                         */
 /*    CID-keyed Type1 Glyph Loader (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
+/*  Copyright 1996-2007, 2009, 2010, 2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -46,7 +46,7 @@
     FT_Byte*       p;
     FT_UInt        fd_select;
     FT_Stream      stream       = face->cid_stream;
     FT_Byte*       p;
     FT_UInt        fd_select;
     FT_Stream      stream       = face->cid_stream;
-    FT_Error       error        = CID_Err_Ok;
+    FT_Error       error        = FT_Err_Ok;
     FT_Byte*       charstring   = 0;
     FT_Memory      memory       = face->root.memory;
     FT_ULong       glyph_length = 0;
     FT_Byte*       charstring   = 0;
     FT_Memory      memory       = face->root.memory;
     FT_ULong       glyph_length = 0;
 
       if ( fd_select >= (FT_UInt)cid->num_dicts )
       {
 
       if ( fd_select >= (FT_UInt)cid->num_dicts )
       {
-        error = CID_Err_Invalid_Offset;
+        error = FT_THROW( Invalid_Offset );
         goto Exit;
       }
       if ( glyph_length == 0 )
         goto Exit;
       }
       if ( glyph_length == 0 )
 
     psaux->t1_decoder_funcs->done( &decoder );
 
 
     psaux->t1_decoder_funcs->done( &decoder );
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
 
     if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
     {
 
     if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
     {
-      error = CID_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
       metrics->horiBearingX = cbox.xMin;
       metrics->horiBearingY = cbox.yMax;
 
       metrics->horiBearingX = cbox.xMin;
       metrics->horiBearingY = cbox.yMax;
 
-      if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) 
+      if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
       {
         /* make up vertical ones */
         ft_synthesize_vertical_metrics( metrics,
       {
         /* make up vertical ones */
         ft_synthesize_vertical_metrics( metrics,
index 3bb3594..f2a18ea 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID-keyed Type1 font loader (body).                                  */
 /*                                                                         */
 /*                                                                         */
 /*    CID-keyed Type1 font loader (body).                                  */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2009 by             */
+/*  Copyright 1996-2006, 2009, 2011-2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -42,7 +42,7 @@
   cid_get_offset( FT_Byte*  *start,
                   FT_Byte    offsize )
   {
   cid_get_offset( FT_Byte*  *start,
                   FT_Byte    offsize )
   {
-    FT_Long   result;
+    FT_ULong  result;
     FT_Byte*  p = *start;
 
 
     FT_Byte*  p = *start;
 
 
@@ -53,7 +53,7 @@
     }
 
     *start = p;
     }
 
     *start = p;
-    return result;
+    return (FT_Long)result;
   }
 
 
   }
 
 
         CID_FaceDict  dict;
 
 
         CID_FaceDict  dict;
 
 
-        if ( parser->num_dict < 0 )
+        if ( parser->num_dict < 0 || parser->num_dict >= cid->num_dicts )
         {
           FT_ERROR(( "cid_load_keyword: invalid use of `%s'\n",
                      keyword->ident ));
         {
           FT_ERROR(( "cid_load_keyword: invalid use of `%s'\n",
                      keyword->ident ));
-          error = CID_Err_Syntax_Error;
+          error = FT_THROW( Syntax_Error );
           goto Exit;
         }
 
           goto Exit;
         }
 
 
 
   FT_CALLBACK_DEF( FT_Error )
 
 
   FT_CALLBACK_DEF( FT_Error )
-  parse_font_matrix( CID_Face     face,
-                     CID_Parser*  parser )
+  cid_parse_font_matrix( CID_Face     face,
+                         CID_Parser*  parser )
   {
     FT_Matrix*    matrix;
     FT_Vector*    offset;
   {
     FT_Matrix*    matrix;
     FT_Vector*    offset;
     FT_Fixed      temp_scale;
 
 
     FT_Fixed      temp_scale;
 
 
-    if ( parser->num_dict >= 0 )
+    if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
     {
       dict   = face->cid.font_dicts + parser->num_dict;
       matrix = &dict->font_matrix;
     {
       dict   = face->cid.font_dicts + parser->num_dict;
       matrix = &dict->font_matrix;
 
       temp_scale = FT_ABS( temp[3] );
 
 
       temp_scale = FT_ABS( temp[3] );
 
-      /* Set units per EM based on FontMatrix values.  We set the value to */
-      /* `1000/temp_scale', because temp_scale was already multiplied by   */
-      /* 1000 (in `t1_tofixed', from psobjs.c).                            */
-      root->units_per_EM = (FT_UShort)( FT_DivFix( 0x10000L,
-                                        FT_DivFix( temp_scale, 1000 ) ) );
+      /* Set Units per EM based on FontMatrix values.  We set the value to */
+      /* 1000 / temp_scale, because temp_scale was already multiplied by   */
+      /* 1000 (in t1_tofixed, from psobjs.c).                              */
+
+      root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
 
       /* we need to scale the values by 1.0/temp[3] */
       if ( temp_scale != 0x10000L )
 
       /* we need to scale the values by 1.0/temp[3] */
       if ( temp_scale != 0x10000L )
       offset->y  = temp[5] >> 16;
     }
 
       offset->y  = temp[5] >> 16;
     }
 
-    return CID_Err_Ok;      /* this is a callback function; */
+    return FT_Err_Ok;      /* this is a callback function; */
                             /* we must return an error code */
   }
 
                             /* we must return an error code */
   }
 
   {
     CID_FaceInfo  cid    = &face->cid;
     FT_Memory     memory = face->root.memory;
   {
     CID_FaceInfo  cid    = &face->cid;
     FT_Memory     memory = face->root.memory;
-    FT_Error      error  = CID_Err_Ok;
+    FT_Error      error  = FT_Err_Ok;
     FT_Long       num_dicts;
 
 
     FT_Long       num_dicts;
 
 
     CID_FaceDict  dict;
 
 
     CID_FaceDict  dict;
 
 
-    if ( parser->num_dict >= 0 )
+    if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
     {
       dict = face->cid.font_dicts + parser->num_dict;
 
     {
       dict = face->cid.font_dicts + parser->num_dict;
 
       dict->private_dict.expansion_factor = dict->expansion_factor;
     }
 
       dict->private_dict.expansion_factor = dict->expansion_factor;
     }
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
 #include "cidtoken.h"
 
     T1_FIELD_CALLBACK( "FDArray",         parse_fd_array, 0 )
 #include "cidtoken.h"
 
     T1_FIELD_CALLBACK( "FDArray",         parse_fd_array, 0 )
-    T1_FIELD_CALLBACK( "FontMatrix",      parse_font_matrix, 0 )
+    T1_FIELD_CALLBACK( "FontMatrix",      cid_parse_font_matrix, 0 )
     T1_FIELD_CALLBACK( "ExpansionFactor", parse_expansion_factor, 0 )
 
     { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 }
     T1_FIELD_CALLBACK( "ExpansionFactor", parse_expansion_factor, 0 )
 
     { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 }
 
     parser->root.cursor = base;
     parser->root.limit  = base + size;
 
     parser->root.cursor = base;
     parser->root.limit  = base + size;
-    parser->root.error  = CID_Err_Ok;
+    parser->root.error  = FT_Err_Ok;
 
     {
       FT_Byte*  cur   = base;
 
     {
       FT_Byte*  cur   = base;
       FT_Byte*      p;
 
 
       FT_Byte*      p;
 
 
+      /* Check for possible overflow. */
+      if ( num_subrs == FT_UINT_MAX )
+      {
+        error = FT_THROW( Syntax_Error );
+        goto Fail;
+      }
+
       /* reallocate offsets array if needed */
       if ( num_subrs + 1 > max_offsets )
       {
         FT_UInt  new_max = FT_PAD_CEIL( num_subrs + 1, 4 );
 
 
       /* reallocate offsets array if needed */
       if ( num_subrs + 1 > max_offsets )
       {
         FT_UInt  new_max = FT_PAD_CEIL( num_subrs + 1, 4 );
 
 
+        if ( new_max <= max_offsets )
+        {
+          error = FT_THROW( Syntax_Error );
+          goto Fail;
+        }
+
         if ( FT_RENEW_ARRAY( offsets, max_offsets, new_max ) )
           goto Fail;
 
         if ( FT_RENEW_ARRAY( offsets, max_offsets, new_max ) )
           goto Fail;
 
 
       FT_FRAME_EXIT();
 
 
       FT_FRAME_EXIT();
 
+      /* offsets must be ordered */
+      for ( count = 1; count <= num_subrs; count++ )
+        if ( offsets[count - 1] > offsets[count] )
+          goto Fail;
+
       /* now, compute the size of subrs charstrings, */
       /* allocate, and read them                     */
       data_len = offsets[num_subrs] - offsets[0];
       /* now, compute the size of subrs charstrings, */
       /* allocate, and read them                     */
       data_len = offsets[num_subrs] - offsets[0];
 
 
   static void
 
 
   static void
-  t1_init_loader( CID_Loader*  loader,
-                  CID_Face     face )
+  cid_init_loader( CID_Loader*  loader,
+                   CID_Face     face )
   {
     FT_UNUSED( face );
 
   {
     FT_UNUSED( face );
 
   }
 
 
   }
 
 
-  static void
-  t1_done_loader( CID_Loader*  loader )
+  static  void
+  cid_done_loader( CID_Loader*  loader )
   {
     CID_Parser*  parser = &loader->parser;
 
   {
     CID_Parser*  parser = &loader->parser;
 
 
         if ( size == 0 )
         {
 
         if ( size == 0 )
         {
-          error = CID_Err_Syntax_Error;
+          error = FT_THROW( Syntax_Error );
           goto Exit;
         }
 
           goto Exit;
         }
 
       }
       else
       {
       }
       else
       {
-        error = CID_Err_Syntax_Error;
+        error = FT_THROW( Syntax_Error );
         goto Exit;
       }
 
         goto Exit;
       }
 
       p++;
     }
 
       p++;
     }
 
-    error = CID_Err_Ok;
+    error = FT_Err_Ok;
 
   Exit:
     return error;
 
   Exit:
     return error;
     FT_Error     error;
 
 
     FT_Error     error;
 
 
-    t1_init_loader( &loader, face );
+    cid_init_loader( &loader, face );
 
     parser = &loader.parser;
     error = cid_parser_new( parser, face->root.stream, face->root.memory,
 
     parser = &loader.parser;
     error = cid_parser_new( parser, face->root.stream, face->root.memory,
     error = cid_read_subrs( face );
 
   Exit:
     error = cid_read_subrs( face );
 
   Exit:
-    t1_done_loader( &loader );
+    cid_done_loader( &loader );
     return error;
   }
 
     return error;
   }
 
index eb82168..46555e2 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID objects manager (body).                                          */
 /*                                                                         */
 /*                                                                         */
 /*    CID objects manager (body).                                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by       */
+/*  Copyright 1996-2006, 2008, 2010-2011, 2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   cid_size_init( FT_Size  cidsize )     /* CID_Size */
   {
     CID_Size           size  = (CID_Size)cidsize;
   cid_size_init( FT_Size  cidsize )     /* CID_Size */
   {
     CID_Size           size  = (CID_Size)cidsize;
-    FT_Error           error = CID_Err_Ok;
+    FT_Error           error = FT_Err_Ok;
     PSH_Globals_Funcs  funcs = cid_size_get_globals_funcs( size );
 
 
     PSH_Globals_Funcs  funcs = cid_size_get_globals_funcs( size );
 
 
                         size->metrics.y_scale,
                         0, 0 );
 
                         size->metrics.y_scale,
                         0, 0 );
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
       psaux = (PSAux_Service)FT_Get_Module_Interface(
                 FT_FACE_LIBRARY( face ), "psaux" );
 
       psaux = (PSAux_Service)FT_Get_Module_Interface(
                 FT_FACE_LIBRARY( face ), "psaux" );
 
+      if ( !psaux )
+      {
+        FT_ERROR(( "cid_face_init: cannot access `psaux' module\n" ));
+        error = FT_THROW( Missing_Module );
+        goto Exit;
+      }
+
       face->psaux = psaux;
     }
 
       face->psaux = psaux;
     }
 
       face->pshinter = pshinter;
     }
 
       face->pshinter = pshinter;
     }
 
+    FT_TRACE2(( "CID driver\n" ));
+
     /* open the tokenizer; this will also check the font format */
     if ( FT_STREAM_SEEK( 0 ) )
       goto Exit;
     /* open the tokenizer; this will also check the font format */
     if ( FT_STREAM_SEEK( 0 ) )
       goto Exit;
     if ( face_index != 0 )
     {
       FT_ERROR(( "cid_face_init: invalid face index\n" ));
     if ( face_index != 0 )
     {
       FT_ERROR(( "cid_face_init: invalid face index\n" ));
-      error = CID_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
   {
     FT_UNUSED( driver );
 
   {
     FT_UNUSED( driver );
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
index efed618..53df315 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID-keyed Type1 parser (body).                                       */
 /*                                                                         */
 /*                                                                         */
 /*    CID-keyed Type1 parser (body).                                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by       */
+/*  Copyright 1996-2007, 2009, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -73,8 +73,8 @@
     if ( ft_strncmp( (char *)stream->cursor,
                      "%!PS-Adobe-3.0 Resource-CIDFont", 31 ) )
     {
     if ( ft_strncmp( (char *)stream->cursor,
                      "%!PS-Adobe-3.0 Resource-CIDFont", 31 ) )
     {
-      FT_TRACE2(( "[not a valid CID-keyed font]\n" ));
-      error = CID_Err_Unknown_File_Format;
+      FT_TRACE2(( "  not a CID-keyed font\n" ));
+      error = FT_THROW( Unknown_File_Format );
     }
 
     FT_FRAME_EXIT();
     }
 
     FT_FRAME_EXIT();
@@ -99,7 +99,7 @@
         if ( stream_len == 0 )
         {
           FT_TRACE2(( "cid_parser_new: no `StartData' keyword found\n" ));
         if ( stream_len == 0 )
         {
           FT_TRACE2(( "cid_parser_new: no `StartData' keyword found\n" ));
-          error = CID_Err_Unknown_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Exit;
         }
 
           goto Exit;
         }
 
           if ( p[0] == 'S' && ft_strncmp( (char*)p, "StartData", 9 ) == 0 )
           {
             /* save offset of binary data after `StartData' */
           if ( p[0] == 'S' && ft_strncmp( (char*)p, "StartData", 9 ) == 0 )
           {
             /* save offset of binary data after `StartData' */
-            offset += p - buffer + 10;
+            offset += (FT_ULong)( p - buffer + 10 );
             goto Found;
           }
           else if ( p[1] == 's' && ft_strncmp( (char*)p, "/sfnts", 6 ) == 0 )
           {
             goto Found;
           }
           else if ( p[1] == 's' && ft_strncmp( (char*)p, "/sfnts", 6 ) == 0 )
           {
-            offset += p - buffer + 7;
+            offset += (FT_ULong)( p - buffer + 7 );
             goto Found;
           }
         }
             goto Found;
           }
         }
       else if ( cur[1] == 's' && ft_strncmp( (char*)cur, "/sfnts", 6 ) == 0 )
       {
         FT_TRACE2(( "cid_parser_new: cannot handle Type 11 fonts\n" ));
       else if ( cur[1] == 's' && ft_strncmp( (char*)cur, "/sfnts", 6 ) == 0 )
       {
         FT_TRACE2(( "cid_parser_new: cannot handle Type 11 fonts\n" ));
-        error = CID_Err_Unknown_File_Format;
+        error = FT_THROW( Unknown_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
index 3a2d225..6132a27 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID driver interface (body).                                         */
 /*                                                                         */
 /*                                                                         */
 /*    CID driver interface (body).                                         */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by             */
+/*  Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -74,7 +74,7 @@
   {
     *afont_info = ((CID_Face)face)->cid.font_info;
 
   {
     *afont_info = ((CID_Face)face)->cid.font_info;
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
   static FT_Error
   }
 
   static FT_Error
@@ -83,7 +83,7 @@
   {
     *afont_extra = ((CID_Face)face)->font_extra;
 
   {
     *afont_extra = ((CID_Face)face)->font_extra;
 
-    return CID_Err_Ok;
+    return FT_Err_Ok;
   }
 
   static const FT_Service_PsInfoRec  cid_service_ps_info =
   }
 
   static const FT_Service_PsInfoRec  cid_service_ps_info =
@@ -91,7 +91,8 @@
     (PS_GetFontInfoFunc)   cid_ps_get_font_info,
     (PS_GetFontExtraFunc)  cid_ps_get_font_extra,
     (PS_HasGlyphNamesFunc) NULL,        /* unsupported with CID fonts */
     (PS_GetFontInfoFunc)   cid_ps_get_font_info,
     (PS_GetFontExtraFunc)  cid_ps_get_font_extra,
     (PS_HasGlyphNamesFunc) NULL,        /* unsupported with CID fonts */
-    (PS_GetFontPrivateFunc)NULL         /* unsupported                */
+    (PS_GetFontPrivateFunc)NULL,        /* unsupported                */
+    (PS_GetFontValueFunc)  NULL         /* not implemented            */
   };
 
 
   };
 
 
 
     if ( registry )
       *registry = cid->registry;
 
     if ( registry )
       *registry = cid->registry;
-      
+
     if ( ordering )
       *ordering = cid->ordering;
 
     if ( supplement )
       *supplement = cid->supplement;
     if ( ordering )
       *ordering = cid->ordering;
 
     if ( supplement )
       *supplement = cid->supplement;
-      
-    return CID_Err_Ok;
+
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   cid_get_is_cid( CID_Face  face,
                   FT_Bool  *is_cid )
   {
   cid_get_is_cid( CID_Face  face,
                   FT_Bool  *is_cid )
   {
-    FT_Error  error = CID_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_UNUSED( face );
 
 
     FT_UNUSED( face );
 
 
                                 FT_UInt   glyph_index,
                                 FT_UInt  *cid )
   {
                                 FT_UInt   glyph_index,
                                 FT_UInt  *cid )
   {
-    FT_Error  error = CID_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_UNUSED( face );
 
 
     FT_UNUSED( face );
 
 
       FT_MODULE_DRIVER_SCALABLE   |
       FT_MODULE_DRIVER_HAS_HINTER,
 
       FT_MODULE_DRIVER_SCALABLE   |
       FT_MODULE_DRIVER_HAS_HINTER,
 
-      sizeof( FT_DriverRec ),
+      sizeof ( FT_DriverRec ),
       "t1cid",   /* module name           */
       0x10000L,  /* version 1.0 of driver */
       0x20000L,  /* requires FreeType 2.0 */
       "t1cid",   /* module name           */
       0x10000L,  /* version 1.0 of driver */
       0x20000L,  /* requires FreeType 2.0 */
     },
 
     /* then the other font drivers fields */
     },
 
     /* then the other font drivers fields */
-    sizeof( CID_FaceRec ),
-    sizeof( CID_SizeRec ),
-    sizeof( CID_GlyphSlotRec ),
+    sizeof ( CID_FaceRec ),
+    sizeof ( CID_SizeRec ),
+    sizeof ( CID_GlyphSlotRec ),
 
     cid_face_init,
     cid_face_done,
 
     cid_face_init,
     cid_face_done,
     cid_slot_init,
     cid_slot_done,
 
     cid_slot_init,
     cid_slot_done,
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    ft_stub_set_char_sizes,
-    ft_stub_set_pixel_sizes,
-#endif
-
     cid_slot_load_glyph,
 
     0,                      /* FT_Face_GetKerningFunc  */
     cid_slot_load_glyph,
 
     0,                      /* FT_Face_GetKerningFunc  */
index c7f424b..3c45e06 100644 (file)
@@ -28,7 +28,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
-#endif 
+#endif
 
 
   FT_CALLBACK_TABLE
 
 
   FT_CALLBACK_TABLE
diff --git a/reactos/lib/3rdparty/freetype/src/gxvalid/Jamfile b/reactos/lib/3rdparty/freetype/src/gxvalid/Jamfile
deleted file mode 100644 (file)
index 88049a6..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# FreeType 2 src/gxvalid Jamfile
-#
-# Copyright 2005 by
-# suzuki toshiya, Masatake YAMATO and Red Hat K.K.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) gxvalid ;
-
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = gxvcommn gxvfeat  gxvbsln  gxvtrak  gxvopbd  gxvprop
-               gxvmort  gxvmort0 gxvmort1 gxvmort2 gxvmort4 gxvmort5
-               gxvmorx  gxvmorx0 gxvmorx1 gxvmorx2 gxvmorx4 gxvmorx5
-               gxvlcar  gxvkern  gxvmod   gxvjust  ;
-  }
-  else
-  {
-    _sources = gxvalid ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/gxvalid Jamfile
index 211f972..2ac80be 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueTypeGX/AAT common tables validation (body).                      */
 /*                                                                         */
 /*                                                                         */
 /*    TrueTypeGX/AAT common tables validation (body).                      */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2009, 2010                                       */
+/*  Copyright 2004, 2005, 2009, 2010, 2013                                 */
 /*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
                   binSrchHeader->unitSize, binSrchHeader->nUnits,
                   searchRange, entrySelector, rangeShift ));
 
                   binSrchHeader->unitSize, binSrchHeader->nUnits,
                   searchRange, entrySelector, rangeShift ));
 
-      if ( valid->root->level >= FT_VALIDATE_PARANOID )
-        FT_INVALID_DATA;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
     }
   }
 
     }
   }
 
       {
         GXV_TRACE(( "too short, glyphs %d - %d are missing\n",
                     i, valid->face->num_glyphs ));
       {
         GXV_TRACE(( "too short, glyphs %d - %d are missing\n",
                     i, valid->face->num_glyphs ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_GLYPH_ID;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
         break;
       }
 
         break;
       }
 
         GXV_TRACE(( "reverse ordered segment specification:"
                     " lastGlyph[%d]=%d < lastGlyph[%d]=%d\n",
                     unit, lastGlyph, unit - 1 , gid ));
         GXV_TRACE(( "reverse ordered segment specification:"
                     " lastGlyph[%d]=%d < lastGlyph[%d]=%d\n",
                     unit, lastGlyph, unit - 1 , gid ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_GLYPH_ID;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
       }
 
       if ( lastGlyph < firstGlyph )
       }
 
       if ( lastGlyph < firstGlyph )
         GXV_TRACE(( "reverse ordered range specification at unit %d:",
                     " lastGlyph %d < firstGlyph %d ",
                     unit, lastGlyph, firstGlyph ));
         GXV_TRACE(( "reverse ordered range specification at unit %d:",
                     " lastGlyph %d < firstGlyph %d ",
                     unit, lastGlyph, firstGlyph ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_GLYPH_ID;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
 
         if ( valid->root->level == FT_VALIDATE_TIGHT )
           continue;     /* ftxvalidator silently skips such an entry */
 
         if ( valid->root->level == FT_VALIDATE_TIGHT )
           continue;     /* ftxvalidator silently skips such an entry */
         GXV_TRACE(( "reverse ordered segment specification:"
                     " lastGlyph[%d]=%d < lastGlyph[%d]=%d\n",
                     unit, lastGlyph, unit - 1 , gid ));
         GXV_TRACE(( "reverse ordered segment specification:"
                     " lastGlyph[%d]=%d < lastGlyph[%d]=%d\n",
                     unit, lastGlyph, unit - 1 , gid ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_GLYPH_ID;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
       }
 
       if ( lastGlyph < firstGlyph )
       }
 
       if ( lastGlyph < firstGlyph )
         GXV_TRACE(( "reverse ordered range specification at unit %d:",
                     " lastGlyph %d < firstGlyph %d ",
                     unit, lastGlyph, firstGlyph ));
         GXV_TRACE(( "reverse ordered range specification at unit %d:",
                     " lastGlyph %d < firstGlyph %d ",
                     unit, lastGlyph, firstGlyph ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_GLYPH_ID;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
 
         if ( valid->root->level == FT_VALIDATE_TIGHT )
           continue; /* ftxvalidator silently skips such an entry */
 
         if ( valid->root->level == FT_VALIDATE_TIGHT )
           continue; /* ftxvalidator silently skips such an entry */
       {
         GXV_TRACE(( "current gid 0x%04x < previous gid 0x%04x\n",
                     glyph, prev_glyph ));
       {
         GXV_TRACE(( "current gid 0x%04x < previous gid 0x%04x\n",
                     glyph, prev_glyph ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_GLYPH_ID;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
       }
       prev_glyph = glyph;
 
       }
       prev_glyph = glyph;
 
     {
       GXV_TRACE(( " gxv_glyphid_check() gid overflow: num_glyphs %d < %d\n",
                   face->num_glyphs, gid ));
     {
       GXV_TRACE(( " gxv_glyphid_check() gid overflow: num_glyphs %d < %d\n",
                   face->num_glyphs, gid ));
-      if ( valid->root->level >= FT_VALIDATE_PARANOID )
-        FT_INVALID_GLYPH_ID;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
     }
 
     return 0;
     }
 
     return 0;
     nnames = FT_Get_Sfnt_Name_Count( valid->face );
     for ( i = 0; i < nnames; i++ )
     {
     nnames = FT_Get_Sfnt_Name_Count( valid->face );
     for ( i = 0; i < nnames; i++ )
     {
-      if ( FT_Get_Sfnt_Name( valid->face, i, &name ) != GXV_Err_Ok )
+      if ( FT_Get_Sfnt_Name( valid->face, i, &name ) != FT_Err_Ok )
         continue ;
 
       if ( name.name_id == name_index )
         continue ;
 
       if ( name.name_id == name_index )
 
     if ( ( maxEntry + 1 ) * entrySize > *length_p )
     {
 
     if ( ( maxEntry + 1 ) * entrySize > *length_p )
     {
-      if ( valid->root->level >= FT_VALIDATE_PARANOID )
-        FT_INVALID_TOO_SHORT;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_TOO_SHORT );
 
       /* ftxvalidator and FontValidator both warn and continue */
       maxEntry = (FT_Byte)( *length_p / entrySize - 1 );
 
       /* ftxvalidator and FontValidator both warn and continue */
       maxEntry = (FT_Byte)( *length_p / entrySize - 1 );
       {
         GXV_TRACE(( " newState offset 0x%04x is out of stateArray\n",
                     newState ));
       {
         GXV_TRACE(( " newState offset 0x%04x is out of stateArray\n",
                     newState ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_OFFSET;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
         continue;
       }
 
         continue;
       }
 
       {
         GXV_TRACE(( " newState offset 0x%04x is not aligned to %d-classes\n",
                     newState,  1 + maxClassID ));
       {
         GXV_TRACE(( " newState offset 0x%04x is not aligned to %d-classes\n",
                     newState,  1 + maxClassID ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_OFFSET;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
         continue;
       }
 
         continue;
       }
 
         break;
 
       default:
         break;
 
       default:
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_FORMAT;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
         goto Exit;
       }
 
         goto Exit;
       }
 
     l[1] = stateArray_length_p;
     l[2] = entryTable_length_p;
 
     l[1] = stateArray_length_p;
     l[2] = entryTable_length_p;
 
-    gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid );
+    gxv_set_length_by_ulong_offset( o, l, buff, 3, table_size, valid );
   }
 
 
   }
 
 
       {
         GXV_TRACE(( "  newState index 0x%04x points out of stateArray\n",
                     newState_idx ));
       {
         GXV_TRACE(( "  newState index 0x%04x points out of stateArray\n",
                     newState_idx ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_OFFSET;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
       }
 
       state = (FT_UShort)( newState_idx / ( 1 + maxClassID ) );
       }
 
       state = (FT_UShort)( newState_idx / ( 1 + maxClassID ) );
         FT_TRACE4(( "-> new state = %d (supposed)\n"
                     "but newState index 0x%04x is not aligned to %d-classes\n",
                     state, newState_idx,  1 + maxClassID ));
         FT_TRACE4(( "-> new state = %d (supposed)\n"
                     "but newState index 0x%04x is not aligned to %d-classes\n",
                     state, newState_idx,  1 + maxClassID ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_OFFSET;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
       }
 
       switch ( GXV_GLYPHOFFSET_FMT( xstatetable ) )
       }
 
       switch ( GXV_GLYPHOFFSET_FMT( xstatetable ) )
         break;
 
       default:
         break;
 
       default:
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_FORMAT;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
         goto Exit;
       }
 
         goto Exit;
       }
 
                         const FT_String*  name,
                         GXV_odtect_Range  odtect )
   {
                         const FT_String*  name,
                         GXV_odtect_Range  odtect )
   {
-    odtect->range[ odtect->nRanges ].start  = start;
-    odtect->range[ odtect->nRanges ].length = length;
-    odtect->range[ odtect->nRanges ].name   = (FT_String*)name;
+    odtect->range[odtect->nRanges].start  = start;
+    odtect->range[odtect->nRanges].length = length;
+    odtect->range[odtect->nRanges].name   = (FT_String*)name;
     odtect->nRanges++;
   }
 
     odtect->nRanges++;
   }
 
index 404c07f..1ff87e4 100644 (file)
@@ -4,7 +4,8 @@
 /*                                                                         */
 /*    TrueTypeGX/AAT common tables validation (specification).             */
 /*                                                                         */
 /*                                                                         */
 /*    TrueTypeGX/AAT common tables validation (specification).             */
 /*                                                                         */
-/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/*  Copyright 2004, 2005, 2012                                             */
+/*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
 
 
+  /* some variables are not evaluated or only used in trace */
+
+#ifdef  FT_DEBUG_LEVEL_TRACE
+#define GXV_LOAD_TRACE_VARS
+#else
+#undef  GXV_LOAD_TRACE_VARS
+#endif
+
+#undef GXV_LOAD_UNUSED_VARS /* debug purpose */
+
+#define IS_PARANOID_VALIDATION          ( valid->root->level >= FT_VALIDATE_PARANOID )
+#define GXV_SET_ERR_IF_PARANOID( err )  { if ( IS_PARANOID_VALIDATION ) ( err ); }
+
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
@@ -234,6 +248,9 @@ FT_BEGIN_HEADER
     GXV_Lookup_Fmt4_Transit_Func    lookupfmt4_trans;
     FT_Bytes                        lookuptbl_head;
 
     GXV_Lookup_Fmt4_Transit_Func    lookupfmt4_trans;
     FT_Bytes                        lookuptbl_head;
 
+    FT_UShort  min_gid;
+    FT_UShort  max_gid;
+
     GXV_StateTable_ValidatorRec     statetable;
     GXV_XStateTable_ValidatorRec    xstatetable;
 
     GXV_StateTable_ValidatorRec     statetable;
     GXV_XStateTable_ValidatorRec    xstatetable;
 
@@ -300,7 +317,7 @@ FT_BEGIN_HEADER
 #define GXV_32BIT_ALIGNMENT_VALIDATE( a ) \
           FT_BEGIN_STMNT                  \
             {                             \
 #define GXV_32BIT_ALIGNMENT_VALIDATE( a ) \
           FT_BEGIN_STMNT                  \
             {                             \
-              if ( 0 != ( (a) % 4 ) )     \
+              if ( (a) & 3 )              \
                 FT_INVALID_OFFSET ;       \
             }                             \
           FT_END_STMNT
                 FT_INVALID_OFFSET ;       \
             }                             \
           FT_END_STMNT
index 0196199..c573b72 100644 (file)
@@ -4,7 +4,8 @@
 /*                                                                         */
 /*    TrueTypeGX/AAT validation module error codes (specification only).   */
 /*                                                                         */
 /*                                                                         */
 /*    TrueTypeGX/AAT validation module error codes (specification only).   */
 /*                                                                         */
-/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/*  Copyright 2004, 2005, 2012-2013                                        */
+/*    by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  GXV_Err_
 #define FT_ERR_PREFIX  GXV_Err_
-#define FT_ERR_BASE    FT_Mod_Err_GXV
-
-#define FT_KEEP_ERR_PREFIX
+#define FT_ERR_BASE    FT_Mod_Err_GXvalid
 
 #include FT_ERRORS_H
 
 
 #include FT_ERRORS_H
 
index 002fec6..6f75650 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueTypeGX/AAT feat table validation (body).                         */
 /*                                                                         */
 /*                                                                         */
 /*    TrueTypeGX/AAT feat table validation (body).                         */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2008 by                                          */
+/*  Copyright 2004, 2005, 2008, 2012 by                                    */
 /*  suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
@@ -92,8 +92,7 @@
     {
       GXV_TRACE(( "feature number %d is out of range %d\n",
                   feature, gxv_feat_registry_length ));
     {
       GXV_TRACE(( "feature number %d is out of range %d\n",
                   feature, gxv_feat_registry_length ));
-      if ( valid->root->level == FT_VALIDATE_PARANOID )
-        FT_INVALID_DATA;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
       goto Exit;
     }
 
       goto Exit;
     }
 
     {
       GXV_TRACE(( "feature number %d is in defined range but doesn't exist\n",
                   feature ));
     {
       GXV_TRACE(( "feature number %d is in defined range but doesn't exist\n",
                   feature ));
-      if ( valid->root->level == FT_VALIDATE_PARANOID )
-        FT_INVALID_DATA;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
       goto Exit;
     }
 
       goto Exit;
     }
 
     setting = FT_NEXT_USHORT( p );
 
     /* If we have exclusive setting, the setting should be odd. */
     setting = FT_NEXT_USHORT( p );
 
     /* If we have exclusive setting, the setting should be odd. */
-    if ( exclusive && ( setting % 2 ) == 0 )
+    if ( exclusive && ( setting & 1 ) == 0 )
       FT_INVALID_DATA;
 
     gxv_feat_name_index_validate( p, limit, valid );
       FT_INVALID_DATA;
 
     gxv_feat_name_index_validate( p, limit, valid );
     if ( settingTable < reserved_size )
       FT_INVALID_OFFSET;
 
     if ( settingTable < reserved_size )
       FT_INVALID_OFFSET;
 
-    if ( valid->root->level == FT_VALIDATE_PARANOID   &&
-         ( featureFlags & GXV_FEAT_MASK_UNUSED ) == 0 )
-      FT_INVALID_DATA;
+    if ( ( featureFlags & GXV_FEAT_MASK_UNUSED ) == 0 )
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
 
     exclusive = FT_BOOL( featureFlags & GXV_FEAT_MASK_EXCLUSIVE_SETTINGS );
     if ( exclusive )
 
     exclusive = FT_BOOL( featureFlags & GXV_FEAT_MASK_EXCLUSIVE_SETTINGS );
     if ( exclusive )
     {
       gxv_feat_setting_validate( p, limit, exclusive, valid );
 
     {
       gxv_feat_setting_validate( p, limit, exclusive, valid );
 
-      if ( valid->root->level == FT_VALIDATE_PARANOID       &&
-           (FT_Int)GXV_FEAT_DATA( setting ) <= last_setting )
-        FT_INVALID_FORMAT;
+      if ( (FT_Int)GXV_FEAT_DATA( setting ) <= last_setting )
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
 
       last_setting = (FT_Int)GXV_FEAT_DATA( setting );
       /* setting + nameIndex */
 
       last_setting = (FT_Int)GXV_FEAT_DATA( setting );
       /* setting + nameIndex */
     featureNameCount = FT_NEXT_USHORT( p );
     GXV_TRACE(( " (featureNameCount = %d)\n", featureNameCount ));
 
     featureNameCount = FT_NEXT_USHORT( p );
     GXV_TRACE(( " (featureNameCount = %d)\n", featureNameCount ));
 
-    if ( valid->root->level != FT_VALIDATE_PARANOID )
-      p += 6;                   /* skip (none) and (none) */
+    if ( !( IS_PARANOID_VALIDATION ) )
+      p += 6; /* skip (none) and (none) */
     else
     {
       if ( FT_NEXT_USHORT( p ) != 0 )
     else
     {
       if ( FT_NEXT_USHORT( p ) != 0 )
     {
       gxv_feat_name_validate( p, limit, valid );
 
     {
       gxv_feat_name_validate( p, limit, valid );
 
-      if ( valid->root->level == FT_VALIDATE_PARANOID       &&
-           (FT_Int)GXV_FEAT_DATA( feature ) <= last_feature )
-        FT_INVALID_FORMAT;
+      if ( (FT_Int)GXV_FEAT_DATA( feature ) <= last_feature )
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
 
       last_feature = GXV_FEAT_DATA( feature );
       p += 2 + 2 + 4 + 2 + 2;
 
       last_feature = GXV_FEAT_DATA( feature );
       p += 2 + 2 + 4 + 2 + 2;
index e14f946..7816e0b 100644 (file)
 #define  GXV_JUST_DATA( a )  GXV_TABLE_DATA( just, a )
 
 
 #define  GXV_JUST_DATA( a )  GXV_TABLE_DATA( just, a )
 
 
+  /* GX just table does not define their subset of GID */
+  static void
+  gxv_just_check_max_gid( FT_UShort         gid,
+                          const FT_String*  msg_tag,
+                          GXV_Validator     valid )
+  {
+    if ( gid < valid->face->num_glyphs )
+      return;
+
+    GXV_TRACE(( "just table includes too large %s"
+                " GID=%d > %d (in maxp)\n",
+                msg_tag, gid, valid->face->num_glyphs ));
+    GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
+  }
+
+
   static void
   gxv_just_wdp_entry_validate( FT_Bytes       table,
                                FT_Bytes       limit,
   static void
   gxv_just_wdp_entry_validate( FT_Bytes       table,
                                FT_Bytes       limit,
   {
     FT_Bytes   p = table;
     FT_ULong   justClass;
   {
     FT_Bytes   p = table;
     FT_ULong   justClass;
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_Fixed   beforeGrowLimit;
     FT_Fixed   beforeShrinkGrowLimit;
     FT_Fixed   afterGrowLimit;
     FT_Fixed   afterShrinkGrowLimit;
     FT_UShort  growFlags;
     FT_UShort  shrinkFlags;
     FT_Fixed   beforeGrowLimit;
     FT_Fixed   beforeShrinkGrowLimit;
     FT_Fixed   afterGrowLimit;
     FT_Fixed   afterShrinkGrowLimit;
     FT_UShort  growFlags;
     FT_UShort  shrinkFlags;
+#endif
 
 
     GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 + 4 + 2 + 2 );
     justClass             = FT_NEXT_ULONG( p );
 
 
     GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 + 4 + 2 + 2 );
     justClass             = FT_NEXT_ULONG( p );
+#ifndef GXV_LOAD_UNUSED_VARS
+    p += 4 + 4 + 4 + 4 + 2 + 2;
+#else
     beforeGrowLimit       = FT_NEXT_ULONG( p );
     beforeShrinkGrowLimit = FT_NEXT_ULONG( p );
     afterGrowLimit        = FT_NEXT_ULONG( p );
     afterShrinkGrowLimit  = FT_NEXT_ULONG( p );
     growFlags             = FT_NEXT_USHORT( p );
     shrinkFlags           = FT_NEXT_USHORT( p );
     beforeGrowLimit       = FT_NEXT_ULONG( p );
     beforeShrinkGrowLimit = FT_NEXT_ULONG( p );
     afterGrowLimit        = FT_NEXT_ULONG( p );
     afterShrinkGrowLimit  = FT_NEXT_ULONG( p );
     growFlags             = FT_NEXT_USHORT( p );
     shrinkFlags           = FT_NEXT_USHORT( p );
+#endif
 
 
-    /* TODO: decode flags for human readability */
+    /* According to Apple spec, only 7bits in justClass is used */
+    if ( ( justClass & 0xFFFFFF80 ) != 0 )
+    {
+      GXV_TRACE(( "just table includes non-zero value"
+                  " in unused justClass higher bits"
+                  " of WidthDeltaPair" ));
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
+    }
 
     valid->subtable_length = p - table;
   }
 
     valid->subtable_length = p - table;
   }
 
     FT_Fixed   lowerLimit;
     FT_Fixed   upperLimit;
 
     FT_Fixed   lowerLimit;
     FT_Fixed   upperLimit;
-
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  order;
     FT_UShort  order;
+#endif
     FT_UShort  decomposedCount;
 
     FT_UInt    i;
     FT_UShort  decomposedCount;
 
     FT_UInt    i;
     GXV_LIMIT_CHECK( 4 + 4 + 2 + 2 );
     lowerLimit      = FT_NEXT_ULONG( p );
     upperLimit      = FT_NEXT_ULONG( p );
     GXV_LIMIT_CHECK( 4 + 4 + 2 + 2 );
     lowerLimit      = FT_NEXT_ULONG( p );
     upperLimit      = FT_NEXT_ULONG( p );
+#ifdef GXV_LOAD_UNUSED_VARS
     order           = FT_NEXT_USHORT( p );
     order           = FT_NEXT_USHORT( p );
+#else
+    p += 2;
+#endif
     decomposedCount = FT_NEXT_USHORT( p );
 
     decomposedCount = FT_NEXT_USHORT( p );
 
+    if ( lowerLimit >= upperLimit )
+    {
+      GXV_TRACE(( "just table includes invalid range spec:"
+                  " lowerLimit(%d) > upperLimit(%d)\n"     ));
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
+    }
+
     for ( i = 0; i < decomposedCount; i++ )
     {
       FT_UShort glyphs;
     for ( i = 0; i < decomposedCount; i++ )
     {
       FT_UShort glyphs;
 
       GXV_LIMIT_CHECK( 2 );
       glyphs = FT_NEXT_USHORT( p );
 
       GXV_LIMIT_CHECK( 2 );
       glyphs = FT_NEXT_USHORT( p );
+      gxv_just_check_max_gid( glyphs, "type0:glyphs", valid );
     }
 
     valid->subtable_length = p - table;
     }
 
     valid->subtable_length = p - table;
     GXV_LIMIT_CHECK( 2 );
     addGlyph = FT_NEXT_USHORT( p );
 
     GXV_LIMIT_CHECK( 2 );
     addGlyph = FT_NEXT_USHORT( p );
 
+    gxv_just_check_max_gid( addGlyph, "type1:addGlyph", valid );
+
     valid->subtable_length = p - table;
   }
 
     valid->subtable_length = p - table;
   }
 
                                         GXV_Validator  valid )
   {
     FT_Bytes   p = table;
                                         GXV_Validator  valid )
   {
     FT_Bytes   p = table;
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_Fixed   substThreshhold; /* Apple misspelled "Threshhold" */
     FT_Fixed   substThreshhold; /* Apple misspelled "Threshhold" */
+#endif
     FT_UShort  addGlyph;
     FT_UShort  substGlyph;
 
 
     GXV_LIMIT_CHECK( 4 + 2 + 2 );
     FT_UShort  addGlyph;
     FT_UShort  substGlyph;
 
 
     GXV_LIMIT_CHECK( 4 + 2 + 2 );
+#ifdef GXV_LOAD_UNUSED_VARS
     substThreshhold = FT_NEXT_ULONG( p );
     substThreshhold = FT_NEXT_ULONG( p );
+#else
+    p += 4;
+#endif
     addGlyph        = FT_NEXT_USHORT( p );
     substGlyph      = FT_NEXT_USHORT( p );
 
     addGlyph        = FT_NEXT_USHORT( p );
     substGlyph      = FT_NEXT_USHORT( p );
 
+    if ( addGlyph != 0xFFFF )
+      gxv_just_check_max_gid( addGlyph, "type2:addGlyph", valid );
+
+    gxv_just_check_max_gid( substGlyph, "type2:substGlyph", valid );
+
     valid->subtable_length = p - table;
   }
 
     valid->subtable_length = p - table;
   }
 
     maximumLimit   = FT_NEXT_ULONG( p );
 
     valid->subtable_length = p - table;
     maximumLimit   = FT_NEXT_ULONG( p );
 
     valid->subtable_length = p - table;
+
+    if ( variantsAxis != 0x64756374 ) /* 'duct' */
+      GXV_TRACE(( "variantsAxis 0x%08x is non default value",
+                   variantsAxis ));
+
+    if ( minimumLimit > noStretchValue )
+      GXV_TRACE(( "type4:minimumLimit 0x%08x > noStretchValue 0x%08x\n",
+                  minimumLimit, noStretchValue ));
+    else if ( noStretchValue > maximumLimit )
+      GXV_TRACE(( "type4:noStretchValue 0x%08x > maximumLimit 0x%08x\n",
+                  noStretchValue, maximumLimit ));
+    else if ( !IS_PARANOID_VALIDATION )
+      return;
+
+    FT_INVALID_DATA;
   }
 
 
   }
 
 
     flags = FT_NEXT_USHORT( p );
     glyph = FT_NEXT_USHORT( p );
 
     flags = FT_NEXT_USHORT( p );
     glyph = FT_NEXT_USHORT( p );
 
+    if ( flags )
+      GXV_TRACE(( "type5: nonzero value 0x%04x in unused flags\n",
+                   flags ));
+    gxv_just_check_max_gid( glyph, "type5:glyph", valid );
+
     valid->subtable_length = p - table;
   }
 
     valid->subtable_length = p - table;
   }
 
     actionType   = FT_NEXT_USHORT( p );
     actionLength = FT_NEXT_ULONG( p );
 
     actionType   = FT_NEXT_USHORT( p );
     actionLength = FT_NEXT_ULONG( p );
 
+    /* actionClass is related with justClass using 7bit only */
+    if ( ( actionClass & 0xFF80 ) != 0 )
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
+
     if ( actionType == 0 )
       gxv_just_actSubrecord_type0_validate( p, limit, valid );
     else if ( actionType == 1 )
     if ( actionType == 0 )
       gxv_just_actSubrecord_type0_validate( p, limit, valid );
     else if ( actionType == 1 )
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
+#ifdef GXV_LOAD_UNUSED_VARS
+    /* TODO: validate markClass & currentClass */
     FT_UShort  setMark;
     FT_UShort  dontAdvance;
     FT_UShort  markClass;
     FT_UShort  currentClass;
     FT_UShort  setMark;
     FT_UShort  dontAdvance;
     FT_UShort  markClass;
     FT_UShort  currentClass;
+#endif
 
     FT_UNUSED( state );
     FT_UNUSED( glyphOffset_p );
 
     FT_UNUSED( state );
     FT_UNUSED( glyphOffset_p );
     FT_UNUSED( limit );
     FT_UNUSED( valid );
 
     FT_UNUSED( limit );
     FT_UNUSED( valid );
 
-
+#ifndef GXV_LOAD_UNUSED_VARS
+    FT_UNUSED( flags );
+#else
     setMark      = (FT_UShort)( ( flags >> 15 ) & 1    );
     dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1    );
     markClass    = (FT_UShort)( ( flags >> 7  ) & 0x7F );
     currentClass = (FT_UShort)(   flags         & 0x7F );
     setMark      = (FT_UShort)( ( flags >> 15 ) & 1    );
     dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1    );
     markClass    = (FT_UShort)( ( flags >> 7  ) & 0x7F );
     currentClass = (FT_UShort)(   flags         & 0x7F );
-
-    /* TODO: validate markClass & currentClass */
+#endif
   }
 
 
   }
 
 
     coverage        = FT_NEXT_USHORT( p );
     subFeatureFlags = FT_NEXT_ULONG( p );
 
     coverage        = FT_NEXT_USHORT( p );
     subFeatureFlags = FT_NEXT_ULONG( p );
 
-    GXV_TRACE(( "  justClassTable: coverage = 0x%04x (%s)",
-                coverage,
-                ( 0x4000 & coverage ) == 0 ? "ascending" : "descending" ));
+    GXV_TRACE(( "  justClassTable: coverage = 0x%04x (%s) ", coverage ));
+    if ( ( coverage & 0x4000 ) == 0  )
+      GXV_TRACE(( "ascending\n" ));
+    else
+      GXV_TRACE(( "descending\n" ));
+
+    if ( subFeatureFlags )
+      GXV_TRACE(( "  justClassTable: nonzero value (0x%08x)"
+                  " in unused subFeatureFlags\n", subFeatureFlags ));
 
     valid->statetable.optdata               = NULL;
     valid->statetable.optdata_load_func     = NULL;
 
     valid->statetable.optdata               = NULL;
     valid->statetable.optdata_load_func     = NULL;
   {
     FT_Bytes           p     = table;
     FT_Bytes           limit = 0;
   {
     FT_Bytes           p     = table;
     FT_Bytes           limit = 0;
-    FT_Offset          table_size;
 
     GXV_ValidatorRec   validrec;
     GXV_Validator      valid = &validrec;
 
     GXV_ValidatorRec   validrec;
     GXV_Validator      valid = &validrec;
     GXV_INIT;
 
     limit      = valid->root->limit;
     GXV_INIT;
 
     limit      = valid->root->limit;
-    table_size = limit - table;
 
     GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 );
     version     = FT_NEXT_ULONG( p );
 
     GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 );
     version     = FT_NEXT_ULONG( p );
index 2137db8..557c5f1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueTypeGX/AAT kern table validation (body).                         */
 /*                                                                         */
 /*                                                                         */
 /*    TrueTypeGX/AAT kern table validation (body).                         */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2007                                       */
+/*  Copyright 2004-2007, 2013                                              */
 /*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
     {
       FT_UShort  gid_left;
       FT_UShort  gid_right;
     {
       FT_UShort  gid_left;
       FT_UShort  gid_right;
+#ifdef GXV_LOAD_UNUSED_VARS
       FT_Short   kernValue;
       FT_Short   kernValue;
+#endif
 
 
       /* left */
 
 
       /* left */
         FT_INVALID_DATA;
 
       /* skip the kern value */
         FT_INVALID_DATA;
 
       /* skip the kern value */
+#ifdef GXV_LOAD_UNUSED_VARS
       kernValue = FT_NEXT_SHORT( p );
       kernValue = FT_NEXT_SHORT( p );
+#else
+      p += 2;
+#endif
     }
 
     GXV_EXIT;
     }
 
     GXV_EXIT;
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  push;
     FT_UShort  dontAdvance;
     FT_UShort  push;
     FT_UShort  dontAdvance;
+#endif
     FT_UShort  valueOffset;
     FT_UShort  valueOffset;
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  kernAction;
     FT_UShort  kernValue;
     FT_UShort  kernAction;
     FT_UShort  kernValue;
+#endif
 
     FT_UNUSED( state );
     FT_UNUSED( glyphOffset_p );
 
 
 
     FT_UNUSED( state );
     FT_UNUSED( glyphOffset_p );
 
 
+#ifdef GXV_LOAD_UNUSED_VARS
     push        = (FT_UShort)( ( flags >> 15 ) & 1      );
     dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1      );
     push        = (FT_UShort)( ( flags >> 15 ) & 1      );
     dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1      );
+#endif
     valueOffset = (FT_UShort)(   flags         & 0x3FFF );
 
     {
     valueOffset = (FT_UShort)(   flags         & 0x3FFF );
 
     {
       limit = table + vt_rec->valueTable + vt_rec->valueTable_length;
 
       GXV_LIMIT_CHECK( 2 + 2 );
       limit = table + vt_rec->valueTable + vt_rec->valueTable_length;
 
       GXV_LIMIT_CHECK( 2 + 2 );
+#ifdef GXV_LOAD_UNUSED_VARS
       kernAction = FT_NEXT_USHORT( p );
       kernValue  = FT_NEXT_USHORT( p );
       kernAction = FT_NEXT_USHORT( p );
       kernValue  = FT_NEXT_USHORT( p );
+#endif
     }
   }
 
     }
   }
 
     {
       GXV_TRACE(( "maxGID=%d, but glyphCount=%d\n",
                   valid->face->num_glyphs, glyphCount ));
     {
       GXV_TRACE(( "maxGID=%d, but glyphCount=%d\n",
                   valid->face->num_glyphs, glyphCount ));
-      if ( valid->root->level >= FT_VALIDATE_PARANOID )
-        FT_INVALID_GLYPH_ID;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
     }
 
     }
 
+    if ( flags != 0 )
+      GXV_TRACE(( "kern subtable fmt3 has nonzero value"
+                  " (%d) in unused flag\n", flags ));
     /*
      * just skip kernValue[kernValueCount]
      */
     /*
      * just skip kernValue[kernValueCount]
      */
                                         GXV_Validator  valid )
   {
     /* new Apple-dialect */
                                         GXV_Validator  valid )
   {
     /* new Apple-dialect */
+#ifdef GXV_LOAD_TRACE_VARS
     FT_Bool  kernVertical;
     FT_Bool  kernCrossStream;
     FT_Bool  kernVariation;
     FT_Bool  kernVertical;
     FT_Bool  kernCrossStream;
     FT_Bool  kernVariation;
+#endif
 
     FT_UNUSED( valid );
 
 
     /* reserved bits = 0 */
     if ( coverage & 0x1FFC )
 
     FT_UNUSED( valid );
 
 
     /* reserved bits = 0 */
     if ( coverage & 0x1FFC )
-      return 0;
+      return FALSE;
 
 
+#ifdef GXV_LOAD_TRACE_VARS
     kernVertical    = FT_BOOL( ( coverage >> 15 ) & 1 );
     kernCrossStream = FT_BOOL( ( coverage >> 14 ) & 1 );
     kernVariation   = FT_BOOL( ( coverage >> 13 ) & 1 );
     kernVertical    = FT_BOOL( ( coverage >> 15 ) & 1 );
     kernCrossStream = FT_BOOL( ( coverage >> 14 ) & 1 );
     kernVariation   = FT_BOOL( ( coverage >> 13 ) & 1 );
+#endif
 
     *format = (FT_UShort)( coverage & 0x0003 );
 
 
     *format = (FT_UShort)( coverage & 0x0003 );
 
 
     GXV_TRACE(( "kerning values in Apple format subtable are ignored\n" ));
 
 
     GXV_TRACE(( "kerning values in Apple format subtable are ignored\n" ));
 
-    return 1;
+    return TRUE;
   }
 
 
   }
 
 
                                             GXV_Validator  valid )
   {
     /* classic Apple-dialect */
                                             GXV_Validator  valid )
   {
     /* classic Apple-dialect */
+#ifdef GXV_LOAD_TRACE_VARS
     FT_Bool  horizontal;
     FT_Bool  cross_stream;
     FT_Bool  horizontal;
     FT_Bool  cross_stream;
+#endif
 
 
     /* check expected flags, but don't check if MS-dialect is impossible */
     if ( !( coverage & 0xFD00 ) && KERN_ALLOWS_MS( valid ) )
 
 
     /* check expected flags, but don't check if MS-dialect is impossible */
     if ( !( coverage & 0xFD00 ) && KERN_ALLOWS_MS( valid ) )
-      return 0;
+      return FALSE;
 
     /* reserved bits = 0 */
     if ( coverage & 0x02FC )
 
     /* reserved bits = 0 */
     if ( coverage & 0x02FC )
-      return 0;
+      return FALSE;
 
 
+#ifdef GXV_LOAD_TRACE_VARS
     horizontal   = FT_BOOL( ( coverage >> 15 ) & 1 );
     cross_stream = FT_BOOL( ( coverage >> 13 ) & 1 );
     horizontal   = FT_BOOL( ( coverage >> 15 ) & 1 );
     cross_stream = FT_BOOL( ( coverage >> 13 ) & 1 );
+#endif
 
     *format = (FT_UShort)( coverage & 0x0003 );
 
 
     *format = (FT_UShort)( coverage & 0x0003 );
 
 
     /* format 1 requires GX State Machine, too new for classic */
     if ( *format == 1 )
 
     /* format 1 requires GX State Machine, too new for classic */
     if ( *format == 1 )
-      return 0;
+      return FALSE;
 
     GXV_TRACE(( "kerning values in Apple format subtable are ignored\n" ));
 
 
     GXV_TRACE(( "kerning values in Apple format subtable are ignored\n" ));
 
-    return 1;
+    return TRUE;
   }
 
 
   }
 
 
                                                 GXV_Validator  valid )
   {
     /* classic Microsoft-dialect */
                                                 GXV_Validator  valid )
   {
     /* classic Microsoft-dialect */
+#ifdef GXV_LOAD_TRACE_VARS
     FT_Bool  horizontal;
     FT_Bool  minimum;
     FT_Bool  cross_stream;
     FT_Bool  override;
     FT_Bool  horizontal;
     FT_Bool  minimum;
     FT_Bool  cross_stream;
     FT_Bool  override;
+#endif
 
     FT_UNUSED( valid );
 
 
     /* reserved bits = 0 */
     if ( coverage & 0xFDF0 )
 
     FT_UNUSED( valid );
 
 
     /* reserved bits = 0 */
     if ( coverage & 0xFDF0 )
-      return 0;
+      return FALSE;
 
 
+#ifdef GXV_LOAD_TRACE_VARS
     horizontal   = FT_BOOL(   coverage        & 1 );
     minimum      = FT_BOOL( ( coverage >> 1 ) & 1 );
     cross_stream = FT_BOOL( ( coverage >> 2 ) & 1 );
     override     = FT_BOOL( ( coverage >> 3 ) & 1 );
     horizontal   = FT_BOOL(   coverage        & 1 );
     minimum      = FT_BOOL( ( coverage >> 1 ) & 1 );
     cross_stream = FT_BOOL( ( coverage >> 2 ) & 1 );
     override     = FT_BOOL( ( coverage >> 3 ) & 1 );
+#endif
 
     *format = (FT_UShort)( ( coverage >> 8 ) & 0x0003 );
 
 
     *format = (FT_UShort)( ( coverage >> 8 ) & 0x0003 );
 
       GXV_TRACE((
         "kerning values in Microsoft format 2 subtable are ignored\n" ));
 
       GXV_TRACE((
         "kerning values in Microsoft format 2 subtable are ignored\n" ));
 
-    return 1;
+    return TRUE;
   }
 
 
   }
 
 
                               GXV_Validator  valid )
   {
     FT_Bytes   p = table;
                               GXV_Validator  valid )
   {
     FT_Bytes   p = table;
+#ifdef GXV_LOAD_TRACE_VARS
     FT_UShort  version = 0;    /* MS only: subtable version, unused */
     FT_UShort  version = 0;    /* MS only: subtable version, unused */
+#endif
     FT_ULong   length;         /* MS: 16bit, Apple: 32bit*/
     FT_UShort  coverage;
     FT_ULong   length;         /* MS: 16bit, Apple: 32bit*/
     FT_UShort  coverage;
+#ifdef GXV_LOAD_TRACE_VARS
     FT_UShort  tupleIndex = 0; /* Apple only */
     FT_UShort  tupleIndex = 0; /* Apple only */
+#endif
     FT_UShort  u16[2];
     FT_UShort  format = 255;   /* subtable format */
 
     FT_UShort  u16[2];
     FT_UShort  format = 255;   /* subtable format */
 
     switch ( gxv_kern_coverage_validate( coverage, &format, valid ) )
     {
     case KERN_DIALECT_MS:
     switch ( gxv_kern_coverage_validate( coverage, &format, valid ) )
     {
     case KERN_DIALECT_MS:
+#ifdef GXV_LOAD_TRACE_VARS
       version    = u16[0];
       version    = u16[0];
+#endif
       length     = u16[1];
       length     = u16[1];
+#ifdef GXV_LOAD_TRACE_VARS
       tupleIndex = 0;
       tupleIndex = 0;
+#endif
       GXV_TRACE(( "Subtable version = %d\n", version ));
       GXV_TRACE(( "Subtable length = %d\n", length ));
       break;
 
     case KERN_DIALECT_APPLE:
       GXV_TRACE(( "Subtable version = %d\n", version ));
       GXV_TRACE(( "Subtable length = %d\n", length ));
       break;
 
     case KERN_DIALECT_APPLE:
+#ifdef GXV_LOAD_TRACE_VARS
       version    = 0;
       version    = 0;
+#endif
       length     = ( u16[0] << 16 ) + u16[1];
       length     = ( u16[0] << 16 ) + u16[1];
+#ifdef GXV_LOAD_TRACE_VARS
       tupleIndex = 0;
       tupleIndex = 0;
+#endif
       GXV_TRACE(( "Subtable length = %d\n", length ));
 
       if ( KERN_IS_NEW( valid ) )
       {
         GXV_LIMIT_CHECK( 2 );
       GXV_TRACE(( "Subtable length = %d\n", length ));
 
       if ( KERN_IS_NEW( valid ) )
       {
         GXV_LIMIT_CHECK( 2 );
+#ifdef GXV_LOAD_TRACE_VARS
         tupleIndex = FT_NEXT_USHORT( p );
         tupleIndex = FT_NEXT_USHORT( p );
+#else
+        p += 2;
+#endif
         GXV_TRACE(( "Subtable tupleIndex = %d\n", tupleIndex ));
       }
       break;
         GXV_TRACE(( "Subtable tupleIndex = %d\n", tupleIndex ));
       }
       break;
index b2b16b1..278d476 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType's TrueTypeGX/AAT validation module implementation (body).   */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType's TrueTypeGX/AAT validation module implementation (body).   */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006                                             */
+/*  Copyright 2004-2006, 2013                                              */
 /*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
@@ -58,8 +58,8 @@
 
 
     error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len );
 
 
     error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len );
-    if ( error == GXV_Err_Table_Missing )
-      return GXV_Err_Ok;
+    if ( FT_ERR_EQ( error, Table_Missing ) )
+      return FT_Err_Ok;
     if ( error )
       goto Exit;
 
     if ( error )
       goto Exit;
 
   {
     FT_Memory volatile        memory = FT_FACE_MEMORY( face );
 
   {
     FT_Memory volatile        memory = FT_FACE_MEMORY( face );
 
-    FT_Error                  error = GXV_Err_Ok;
+    FT_Error                  error = FT_Err_Ok;
     FT_ValidatorRec volatile  valid;
 
     FT_UInt  i;
     FT_ValidatorRec volatile  valid;
 
     FT_UInt  i;
     /* without volatile on `error' GCC 4.1.1. emits:                         */
     /*  warning: variable 'error' might be clobbered by 'longjmp' or 'vfork' */
     /* this warning seems spurious but ---                                   */
     /* without volatile on `error' GCC 4.1.1. emits:                         */
     /*  warning: variable 'error' might be clobbered by 'longjmp' or 'vfork' */
     /* this warning seems spurious but ---                                   */
-    FT_Error volatile         error = GXV_Err_Ok;
+    FT_Error volatile         error;
     FT_ValidatorRec volatile  valid;
 
 
     FT_ValidatorRec volatile  valid;
 
 
   const FT_Module_Class  gxv_module_class =
   {
     0,
   const FT_Module_Class  gxv_module_class =
   {
     0,
-    sizeof( FT_ModuleRec ),
+    sizeof ( FT_ModuleRec ),
     "gxvalid",
     0x10000L,
     0x20000L,
     "gxvalid",
     0x10000L,
     0x20000L,
index d912a8f..22732ba 100644 (file)
@@ -36,7 +36,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
-#endif 
+#endif
 
 
   FT_EXPORT_VAR( const FT_Module_Class )  gxv_module_class;
 
 
   FT_EXPORT_VAR( const FT_Module_Class )  gxv_module_class;
index 0aa0663..5356e67 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueTypeGX/AAT mort table validation (body).                         */
 /*                                                                         */
 /*                                                                         */
 /*    TrueTypeGX/AAT mort table validation (body).                         */
 /*                                                                         */
-/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */
+/*  Copyright 2005, 2013 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
       GXV_TRACE(( "featureType %d is out of registered range, "
                   "setting %d is unchecked\n",
                   f->featureType, f->featureSetting ));
       GXV_TRACE(( "featureType %d is out of registered range, "
                   "setting %d is unchecked\n",
                   f->featureType, f->featureSetting ));
-      if ( valid->root->level >= FT_VALIDATE_PARANOID )
-        FT_INVALID_DATA;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
     }
     else if ( !gxv_feat_registry[f->featureType].existence )
     {
       GXV_TRACE(( "featureType %d is within registered area "
                   "but undefined, setting %d is unchecked\n",
                   f->featureType, f->featureSetting ));
     }
     else if ( !gxv_feat_registry[f->featureType].existence )
     {
       GXV_TRACE(( "featureType %d is within registered area "
                   "but undefined, setting %d is unchecked\n",
                   f->featureType, f->featureSetting ));
-      if ( valid->root->level >= FT_VALIDATE_PARANOID )
-        FT_INVALID_DATA;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
     }
     else
     {
     }
     else
     {
@@ -74,8 +72,7 @@
       if ( f->featureSetting > nSettings_max )
       {
         GXV_TRACE(( "out of defined range %d", nSettings_max ));
       if ( f->featureSetting > nSettings_max )
       {
         GXV_TRACE(( "out of defined range %d", nSettings_max ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_DATA;
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
       }
       GXV_TRACE(( "\n" ));
     }
       }
       GXV_TRACE(( "\n" ));
     }
 
     };
 
 
     };
 
-    GXV_Validate_Func  func;
-    FT_UShort          i;
+    FT_UShort  i;
 
 
     GXV_NAME_ENTER( "subtables in a chain" );
 
     for ( i = 0; i < nSubtables; i++ )
     {
 
 
     GXV_NAME_ENTER( "subtables in a chain" );
 
     for ( i = 0; i < nSubtables; i++ )
     {
+      GXV_Validate_Func  func;
+
       FT_UShort  length;
       FT_UShort  coverage;
       FT_UShort  length;
       FT_UShort  coverage;
+#ifdef GXV_LOAD_UNUSED_VARS
       FT_ULong   subFeatureFlags;
       FT_ULong   subFeatureFlags;
+#endif
       FT_UInt    type;
       FT_UInt    rest;
 
       FT_UInt    type;
       FT_UInt    rest;
 
       GXV_LIMIT_CHECK( 2 + 2 + 4 );
       length          = FT_NEXT_USHORT( p );
       coverage        = FT_NEXT_USHORT( p );
       GXV_LIMIT_CHECK( 2 + 2 + 4 );
       length          = FT_NEXT_USHORT( p );
       coverage        = FT_NEXT_USHORT( p );
+#ifdef GXV_LOAD_UNUSED_VARS
       subFeatureFlags = FT_NEXT_ULONG( p );
       subFeatureFlags = FT_NEXT_ULONG( p );
+#else
+      p += 4;
+#endif
 
       GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n",
                   i + 1, nSubtables, length ));
 
       GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n",
                   i + 1, nSubtables, length ));
       func( p, p + rest, valid );
 
       p += rest;
       func( p, p + rest, valid );
 
       p += rest;
+      /* TODO: validate subFeatureFlags */
     }
 
     valid->subtable_length = p - table;
     }
 
     valid->subtable_length = p - table;
                            GXV_Validator  valid )
   {
     FT_Bytes   p = table;
                            GXV_Validator  valid )
   {
     FT_Bytes   p = table;
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_ULong   defaultFlags;
     FT_ULong   defaultFlags;
+#endif
     FT_ULong   chainLength;
     FT_UShort  nFeatureFlags;
     FT_UShort  nSubtables;
     FT_ULong   chainLength;
     FT_UShort  nFeatureFlags;
     FT_UShort  nSubtables;
     GXV_NAME_ENTER( "mort chain header" );
 
     GXV_LIMIT_CHECK( 4 + 4 + 2 + 2 );
     GXV_NAME_ENTER( "mort chain header" );
 
     GXV_LIMIT_CHECK( 4 + 4 + 2 + 2 );
+#ifdef GXV_LOAD_UNUSED_VARS
     defaultFlags  = FT_NEXT_ULONG( p );
     defaultFlags  = FT_NEXT_ULONG( p );
+#else
+    p += 4;
+#endif
     chainLength   = FT_NEXT_ULONG( p );
     nFeatureFlags = FT_NEXT_USHORT( p );
     nSubtables    = FT_NEXT_USHORT( p );
     chainLength   = FT_NEXT_ULONG( p );
     nFeatureFlags = FT_NEXT_USHORT( p );
     nSubtables    = FT_NEXT_USHORT( p );
     gxv_mort_subtables_validate( p, table + chainLength, nSubtables, valid );
     valid->subtable_length = chainLength;
 
     gxv_mort_subtables_validate( p, table + chainLength, nSubtables, valid );
     valid->subtable_length = chainLength;
 
+    /* TODO: validate defaultFlags */
     GXV_EXIT;
   }
 
     GXV_EXIT;
   }
 
index 0453062..b136ced 100644 (file)
     GXV_TRACE(( " %02d", verb ));
     GXV_TRACE(( " %s\n", GXV_Mort_IndicScript_Msg[verb] ));
 
     GXV_TRACE(( " %02d", verb ));
     GXV_TRACE(( " %s\n", GXV_Mort_IndicScript_Msg[verb] ));
 
+    if ( markFirst > 0 && markLast > 0 )
+    {
+      GXV_TRACE(( "  [odd] a glyph is marked as the first and last"
+                  "  in Indic rearrangement\n" ));
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
+    }
+
+    if ( markFirst > 0 && dontAdvance > 0 )
+    {
+      GXV_TRACE(( "  [odd] the first glyph is marked as dontAdvance"
+                  " in Indic rearrangement\n" ));
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
+    }
+
     if ( 0 < reserved )
     {
       GXV_TRACE(( " non-zero bits found in reserved range\n" ));
     if ( 0 < reserved )
     {
       GXV_TRACE(( " non-zero bits found in reserved range\n" ));
-      FT_INVALID_DATA;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
     }
     else
       GXV_TRACE(( "\n" ));
     }
     else
       GXV_TRACE(( "\n" ));
index 696d850..1c17a5d 100644 (file)
   {
     FT_UShort  substTable;
     FT_UShort  substTable_limit;
   {
     FT_UShort  substTable;
     FT_UShort  substTable_limit;
-    FT_UShort  min_gid;
-    FT_UShort  max_gid;
 
     FT_UNUSED( tag );
     FT_UNUSED( state );
 
     FT_UNUSED( tag );
     FT_UNUSED( state );
                    ((GXV_mort_subtable_type1_StateOptRec *)
                     (valid->statetable.optdata))->substitutionTable_length );
 
                    ((GXV_mort_subtable_type1_StateOptRec *)
                     (valid->statetable.optdata))->substitutionTable_length );
 
-    min_gid = (FT_UShort)( ( substTable       - wordOffset * 2 ) / 2 );
-    max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 );
-    max_gid = (FT_UShort)( FT_MAX( max_gid, valid->face->num_glyphs ) );
+    valid->min_gid = (FT_UShort)( ( substTable       - wordOffset * 2 ) / 2 );
+    valid->max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 );
+    valid->max_gid = (FT_UShort)( FT_MAX( valid->max_gid,
+                                          valid->face->num_glyphs ) );
 
     /* XXX: check range? */
 
 
     /* XXX: check range? */
 
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  setMark;
     FT_UShort  dontAdvance;
     FT_UShort  setMark;
     FT_UShort  dontAdvance;
+#endif
     FT_UShort  reserved;
     FT_Short   markOffset;
     FT_Short   currentOffset;
     FT_UShort  reserved;
     FT_Short   markOffset;
     FT_Short   currentOffset;
     FT_UNUSED( limit );
 
 
     FT_UNUSED( limit );
 
 
+#ifdef GXV_LOAD_UNUSED_VARS
     setMark       = (FT_UShort)(   flags >> 15            );
     dontAdvance   = (FT_UShort)( ( flags >> 14 ) & 1      );
     setMark       = (FT_UShort)(   flags >> 15            );
     dontAdvance   = (FT_UShort)( ( flags >> 14 ) & 1      );
+#endif
     reserved      = (FT_Short)(    flags         & 0x3FFF );
 
     markOffset    = (FT_Short)( glyphOffset_p->ul >> 16 );
     reserved      = (FT_Short)(    flags         & 0x3FFF );
 
     markOffset    = (FT_Short)( glyphOffset_p->ul >> 16 );
     if ( 0 < reserved )
     {
       GXV_TRACE(( " non-zero bits found in reserved range\n" ));
     if ( 0 < reserved )
     {
       GXV_TRACE(( " non-zero bits found in reserved range\n" ));
-      if ( valid->root->level >= FT_VALIDATE_PARANOID )
-        FT_INVALID_DATA;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
     }
 
     gxv_mort_subtable_type1_offset_to_subst_validate( markOffset,
     }
 
     gxv_mort_subtable_type1_offset_to_subst_validate( markOffset,
       if ( dst_gid >= 0xFFFFU )
         continue;
 
       if ( dst_gid >= 0xFFFFU )
         continue;
 
-      if ( dst_gid > valid->face->num_glyphs )
+      if ( dst_gid < valid->min_gid || valid->max_gid < dst_gid )
       {
       {
-        GXV_TRACE(( "substTable include too large gid[%d]=%d >"
-                    " max defined gid #%d\n",
-                    i, dst_gid, valid->face->num_glyphs ));
-        if ( valid->root->level >= FT_VALIDATE_PARANOID )
-          FT_INVALID_GLYPH_ID;
+        GXV_TRACE(( "substTable include a strange gid[%d]=%d >"
+                    " out of define range (%d..%d)\n",
+                    i, dst_gid, valid->min_gid, valid->max_gid ));
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
       }
     }
 
       }
     }
 
index 6f77cf3..9e08fb7 100644 (file)
                   ligActionOffset, lat_base - p ));
 
       /* FontValidator, ftxvalidator, ftxdumperfuser warn but continue */
                   ligActionOffset, lat_base - p ));
 
       /* FontValidator, ftxvalidator, ftxdumperfuser warn but continue */
-      if ( valid->root->level >= FT_VALIDATE_PARANOID )
-        FT_INVALID_OFFSET;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
     }
     else if ( lat_limit < p )
     {
     }
     else if ( lat_limit < p )
     {
                   ligActionOffset, p - lat_limit ));
 
       /* FontValidator, ftxvalidator, ftxdumperfuser warn but continue */
                   ligActionOffset, p - lat_limit ));
 
       /* FontValidator, ftxvalidator, ftxdumperfuser warn but continue */
-      if ( valid->root->level >= FT_VALIDATE_PARANOID )
-        FT_INVALID_OFFSET;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
     }
     else
     {
       /* validate entry in ligActionTable */
       FT_ULong   lig_action;
     }
     else
     {
       /* validate entry in ligActionTable */
       FT_ULong   lig_action;
+#ifdef GXV_LOAD_UNUSED_VARS
       FT_UShort  last;
       FT_UShort  store;
       FT_UShort  last;
       FT_UShort  store;
+#endif
       FT_ULong   offset;
 
 
       lig_action = FT_NEXT_ULONG( p );
       FT_ULong   offset;
 
 
       lig_action = FT_NEXT_ULONG( p );
+#ifdef GXV_LOAD_UNUSED_VARS
       last   = (FT_UShort)( ( lig_action >> 31 ) & 1 );
       store  = (FT_UShort)( ( lig_action >> 30 ) & 1 );
       last   = (FT_UShort)( ( lig_action >> 31 ) & 1 );
       store  = (FT_UShort)( ( lig_action >> 30 ) & 1 );
+#endif
 
 
+      /* Apple spec defines this offset as a word offset */
       offset = lig_action & 0x3FFFFFFFUL;
       offset = lig_action & 0x3FFFFFFFUL;
+      if ( offset * 2 < optdata->ligatureTable )
+      {
+        GXV_TRACE(( "too short offset 0x%08x:"
+                    " 2 x offset < ligatureTable (%d byte rewind)\n",
+                     offset, optdata->ligatureTable - offset * 2 ));
+
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
+      } else if ( offset * 2 >
+                  optdata->ligatureTable + optdata->ligatureTable_length )
+      {
+        GXV_TRACE(( "too long offset 0x%08x:"
+                    " 2 x offset > ligatureTable + ligatureTable_length"
+                    " (%d byte overrun)\n",
+                     offset,
+                     optdata->ligatureTable + optdata->ligatureTable_length
+                     - offset * 2 ));
+
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
+      }
     }
   }
 
     }
   }
 
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort setComponent;
     FT_UShort dontAdvance;
     FT_UShort setComponent;
     FT_UShort dontAdvance;
+#endif
     FT_UShort offset;
 
     FT_UNUSED( state );
     FT_UShort offset;
 
     FT_UNUSED( state );
     FT_UNUSED( limit );
 
 
     FT_UNUSED( limit );
 
 
+#ifdef GXV_LOAD_UNUSED_VARS
     setComponent = (FT_UShort)( ( flags >> 15 ) & 1 );
     dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1 );
     setComponent = (FT_UShort)( ( flags >> 15 ) & 1 );
     dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1 );
+#endif
 
     offset = (FT_UShort)( flags & 0x3FFFU );
 
 
     offset = (FT_UShort)( flags & 0x3FFFU );
 
 
         GXV_LIMIT_CHECK( 2 );
         lig_gid = FT_NEXT_USHORT( p );
 
         GXV_LIMIT_CHECK( 2 );
         lig_gid = FT_NEXT_USHORT( p );
+
+        if ( valid->face->num_glyphs < lig_gid )
+          GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
       }
     }
     GXV_EXIT;
       }
     }
     GXV_EXIT;
index ec0bcb6..32cfb03 100644 (file)
          offset < optdata->entryTable + *(optdata->entryTable_length_p) )
       GXV_TRACE(( " offset runs into EntryTable" ));
 
          offset < optdata->entryTable + *(optdata->entryTable_length_p) )
       GXV_TRACE(( " offset runs into EntryTable" ));
 
+#ifndef GXV_LOAD_TRACE_VARS
+    GXV_LIMIT_CHECK( count * 2 );
+#else
     while ( p < table + offset + ( count * 2 ) )
     {
       FT_UShort insert_glyphID;
     while ( p < table + offset + ( count * 2 ) )
     {
       FT_UShort insert_glyphID;
       insert_glyphID = FT_NEXT_USHORT( p );
       GXV_TRACE(( " 0x%04x", insert_glyphID ));
     }
       insert_glyphID = FT_NEXT_USHORT( p );
       GXV_TRACE(( " 0x%04x", insert_glyphID ));
     }
-
     GXV_TRACE(( "\n" ));
     GXV_TRACE(( "\n" ));
+#endif
   }
 
 
   }
 
 
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_Bool    setMark;
     FT_Bool    dontAdvance;
     FT_Bool    currentIsKashidaLike;
     FT_Bool    markedIsKashidaLike;
     FT_Bool    currentInsertBefore;
     FT_Bool    markedInsertBefore;
     FT_Bool    setMark;
     FT_Bool    dontAdvance;
     FT_Bool    currentIsKashidaLike;
     FT_Bool    markedIsKashidaLike;
     FT_Bool    currentInsertBefore;
     FT_Bool    markedInsertBefore;
+#endif
     FT_Byte    currentInsertCount;
     FT_Byte    markedInsertCount;
     FT_UShort  currentInsertList;
     FT_Byte    currentInsertCount;
     FT_Byte    markedInsertCount;
     FT_UShort  currentInsertList;
     FT_UNUSED( state );
 
 
     FT_UNUSED( state );
 
 
+#ifdef GXV_LOAD_UNUSED_VARS
     setMark              = FT_BOOL( ( flags >> 15 ) & 1 );
     dontAdvance          = FT_BOOL( ( flags >> 14 ) & 1 );
     currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 );
     markedIsKashidaLike  = FT_BOOL( ( flags >> 12 ) & 1 );
     currentInsertBefore  = FT_BOOL( ( flags >> 11 ) & 1 );
     markedInsertBefore   = FT_BOOL( ( flags >> 10 ) & 1 );
     setMark              = FT_BOOL( ( flags >> 15 ) & 1 );
     dontAdvance          = FT_BOOL( ( flags >> 14 ) & 1 );
     currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 );
     markedIsKashidaLike  = FT_BOOL( ( flags >> 12 ) & 1 );
     currentInsertBefore  = FT_BOOL( ( flags >> 11 ) & 1 );
     markedInsertBefore   = FT_BOOL( ( flags >> 10 ) & 1 );
+#endif
 
     currentInsertCount   = (FT_Byte)( ( flags >> 5 ) & 0x1F   );
     markedInsertCount    = (FT_Byte)(   flags        & 0x001F );
 
     currentInsertCount   = (FT_Byte)( ( flags >> 5 ) & 0x1F   );
     markedInsertCount    = (FT_Byte)(   flags        & 0x001F );
index f8ba5b9..5ae04d3 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueTypeGX/AAT morx table validation (body).                         */
 /*                                                                         */
 /*                                                                         */
 /*    TrueTypeGX/AAT morx table validation (body).                         */
 /*                                                                         */
-/*  Copyright 2005, 2008 by                                                */
+/*  Copyright 2005, 2008, 2013 by                                          */
 /*  suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
@@ -57,8 +57,6 @@
 
     };
 
 
     };
 
-    GXV_Validate_Func  func;
-
     FT_UShort  i;
 
 
     FT_UShort  i;
 
 
 
     for ( i = 0; i < nSubtables; i++ )
     {
 
     for ( i = 0; i < nSubtables; i++ )
     {
+      GXV_Validate_Func  func;
+
       FT_ULong  length;
       FT_ULong  coverage;
       FT_ULong  length;
       FT_ULong  coverage;
+#ifdef GXV_LOAD_UNUSED_VARS
       FT_ULong  subFeatureFlags;
       FT_ULong  subFeatureFlags;
+#endif
       FT_ULong  type;
       FT_ULong  rest;
 
       FT_ULong  type;
       FT_ULong  rest;
 
       GXV_LIMIT_CHECK( 4 + 4 + 4 );
       length          = FT_NEXT_ULONG( p );
       coverage        = FT_NEXT_ULONG( p );
       GXV_LIMIT_CHECK( 4 + 4 + 4 );
       length          = FT_NEXT_ULONG( p );
       coverage        = FT_NEXT_ULONG( p );
+#ifdef GXV_LOAD_UNUSED_VARS
       subFeatureFlags = FT_NEXT_ULONG( p );
       subFeatureFlags = FT_NEXT_ULONG( p );
+#else
+      p += 4;
+#endif
 
       GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n",
                   i + 1, nSubtables, length ));
 
       GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n",
                   i + 1, nSubtables, length ));
 
       func( p, p + rest, valid );
 
 
       func( p, p + rest, valid );
 
+      /* TODO: subFeatureFlags should be unique in a table? */
       p += rest;
     }
 
       p += rest;
     }
 
                            GXV_Validator  valid )
   {
     FT_Bytes  p = table;
                            GXV_Validator  valid )
   {
     FT_Bytes  p = table;
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_ULong  defaultFlags;
     FT_ULong  defaultFlags;
+#endif
     FT_ULong  chainLength;
     FT_ULong  nFeatureFlags;
     FT_ULong  nSubtables;
     FT_ULong  chainLength;
     FT_ULong  nFeatureFlags;
     FT_ULong  nSubtables;
     GXV_NAME_ENTER( "morx chain header" );
 
     GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );
     GXV_NAME_ENTER( "morx chain header" );
 
     GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );
+#ifdef GXV_LOAD_UNUSED_VARS
     defaultFlags  = FT_NEXT_ULONG( p );
     defaultFlags  = FT_NEXT_ULONG( p );
+#else
+    p += 4;
+#endif
     chainLength   = FT_NEXT_ULONG( p );
     nFeatureFlags = FT_NEXT_ULONG( p );
     nSubtables    = FT_NEXT_ULONG( p );
     chainLength   = FT_NEXT_ULONG( p );
     nFeatureFlags = FT_NEXT_ULONG( p );
     nSubtables    = FT_NEXT_ULONG( p );
 
     valid->subtable_length = chainLength;
 
 
     valid->subtable_length = chainLength;
 
+    /* TODO: defaultFlags should be compared with the flags in tables */
+
     GXV_EXIT;
   }
 
     GXV_EXIT;
   }
 
index 0159c5a..6a736c1 100644 (file)
     FT_Bytes                         limit,
     GXV_Validator                    valid )
   {
     FT_Bytes                         limit,
     GXV_Validator                    valid )
   {
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  markFirst;
     FT_UShort  dontAdvance;
     FT_UShort  markLast;
     FT_UShort  markFirst;
     FT_UShort  dontAdvance;
     FT_UShort  markLast;
+#endif
     FT_UShort  reserved;
     FT_UShort  reserved;
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  verb;
     FT_UShort  verb;
+#endif
 
     FT_UNUSED( state );
     FT_UNUSED( glyphOffset_p );
 
     FT_UNUSED( state );
     FT_UNUSED( glyphOffset_p );
     FT_UNUSED( limit );
 
 
     FT_UNUSED( limit );
 
 
+#ifdef GXV_LOAD_UNUSED_VARS
     markFirst   = (FT_UShort)( ( flags >> 15 ) & 1 );
     dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
     markLast    = (FT_UShort)( ( flags >> 13 ) & 1 );
     markFirst   = (FT_UShort)( ( flags >> 15 ) & 1 );
     dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
     markLast    = (FT_UShort)( ( flags >> 13 ) & 1 );
+#endif
 
     reserved = (FT_UShort)( flags & 0x1FF0 );
 
     reserved = (FT_UShort)( flags & 0x1FF0 );
+#ifdef GXV_LOAD_UNUSED_VARS
     verb     = (FT_UShort)( flags & 0x000F );
     verb     = (FT_UShort)( flags & 0x000F );
+#endif
 
     if ( 0 < reserved )
     {
 
     if ( 0 < reserved )
     {
index e1c162f..ce0009a 100644 (file)
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
+#ifdef GXV_LOAD_TRACE_VARS
     FT_UShort  setMark;
     FT_UShort  dontAdvance;
     FT_UShort  setMark;
     FT_UShort  dontAdvance;
+#endif
     FT_UShort  reserved;
     FT_Short   markIndex;
     FT_Short   currentIndex;
     FT_UShort  reserved;
     FT_Short   markIndex;
     FT_Short   currentIndex;
     FT_UNUSED( limit );
 
 
     FT_UNUSED( limit );
 
 
+#ifdef GXV_LOAD_TRACE_VARS
     setMark      = (FT_UShort)( ( flags >> 15 ) & 1 );
     dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1 );
     setMark      = (FT_UShort)( ( flags >> 15 ) & 1 );
     dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1 );
+#endif
 
     reserved = (FT_UShort)( flags & 0x3FFF );
 
 
     reserved = (FT_UShort)( flags & 0x3FFF );
 
     if ( 0 < reserved )
     {
       GXV_TRACE(( " non-zero bits found in reserved range\n" ));
     if ( 0 < reserved )
     {
       GXV_TRACE(( " non-zero bits found in reserved range\n" ));
-      if ( valid->root->level >= FT_VALIDATE_PARANOID )
-        FT_INVALID_DATA;
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
     }
 
     GXV_TRACE(( "markIndex = %d, currentIndex = %d\n",
     }
 
     GXV_TRACE(( "markIndex = %d, currentIndex = %d\n",
index b4bb335..9d2b0bc 100644 (file)
     {
       /* validate entry in ligActionTable */
       FT_ULong   lig_action;
     {
       /* validate entry in ligActionTable */
       FT_ULong   lig_action;
+#ifdef GXV_LOAD_UNUSED_VARS
       FT_UShort  last;
       FT_UShort  store;
       FT_UShort  last;
       FT_UShort  store;
+#endif
       FT_ULong   offset;
       FT_ULong   offset;
+      FT_Long    gid_limit;
 
 
       lig_action = FT_NEXT_ULONG( p );
 
 
       lig_action = FT_NEXT_ULONG( p );
+#ifdef GXV_LOAD_UNUSED_VARS
       last       = (FT_UShort)( ( lig_action >> 31 ) & 1 );
       store      = (FT_UShort)( ( lig_action >> 30 ) & 1 );
       last       = (FT_UShort)( ( lig_action >> 31 ) & 1 );
       store      = (FT_UShort)( ( lig_action >> 30 ) & 1 );
+#endif
 
       offset = lig_action & 0x3FFFFFFFUL;
 
       offset = lig_action & 0x3FFFFFFFUL;
+
+      /* this offset is 30-bit signed value to add to GID */
+      /* it is different from the location offset in mort */
+      if ( ( offset & 0x3FFF0000UL ) == 0x3FFF0000UL )
+      { /* negative offset */
+        gid_limit = valid->face->num_glyphs - ( offset & 0x0000FFFFUL );
+        if ( gid_limit > 0 )
+          return;
+
+        GXV_TRACE(( "ligature action table includes"
+                    " too negative offset moving all GID"
+                    " below defined range: 0x%04x\n",
+                    offset & 0xFFFFU ));
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
+      }
+      else if ( ( offset & 0x3FFF0000UL ) == 0x0000000UL )
+      { /* positive offset */
+        if ( (FT_Long)offset < valid->face->num_glyphs )
+          return;
+
+        GXV_TRACE(( "ligature action table includes"
+                    " too large offset moving all GID"
+                    " over defined range: 0x%04x\n",
+                    offset & 0xFFFFU ));
+        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
+      }
+
+      GXV_TRACE(( "ligature action table includes"
+                  " invalid offset to add to 16-bit GID:"
+                  " 0x%08x\n", offset ));
+      GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
     }
   }
 
     }
   }
 
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_UShort  setComponent;
     FT_UShort  dontAdvance;
     FT_UShort  performAction;
     FT_UShort  setComponent;
     FT_UShort  dontAdvance;
     FT_UShort  performAction;
+#endif
     FT_UShort  reserved;
     FT_UShort  ligActionIndex;
 
     FT_UShort  reserved;
     FT_UShort  ligActionIndex;
 
     FT_UNUSED( limit );
 
 
     FT_UNUSED( limit );
 
 
+#ifdef GXV_LOAD_UNUSED_VARS
     setComponent   = (FT_UShort)( ( flags >> 15 ) & 1 );
     dontAdvance    = (FT_UShort)( ( flags >> 14 ) & 1 );
     performAction  = (FT_UShort)( ( flags >> 13 ) & 1 );
     setComponent   = (FT_UShort)( ( flags >> 15 ) & 1 );
     dontAdvance    = (FT_UShort)( ( flags >> 14 ) & 1 );
     performAction  = (FT_UShort)( ( flags >> 13 ) & 1 );
+#endif
 
     reserved       = (FT_UShort)( flags & 0x1FFF );
     ligActionIndex = glyphOffset_p->u;
 
     reserved       = (FT_UShort)( flags & 0x1FFF );
     ligActionIndex = glyphOffset_p->u;
 
         GXV_LIMIT_CHECK( 2 );
         lig_gid = FT_NEXT_USHORT( p );
 
         GXV_LIMIT_CHECK( 2 );
         lig_gid = FT_NEXT_USHORT( p );
+        if ( lig_gid < valid->face->num_glyphs )
+          GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
       }
     }
 
       }
     }
 
index 5e3a164..d8cf700 100644 (file)
     FT_Bytes p = table + table_index * 2;
 
 
     FT_Bytes p = table + table_index * 2;
 
 
+#ifndef GXV_LOAD_TRACE_VARS
+    GXV_LIMIT_CHECK( count * 2 );
+#else
     while ( p < table + count * 2 + table_index * 2 )
     {
       FT_UShort  insert_glyphID;
     while ( p < table + count * 2 + table_index * 2 )
     {
       FT_UShort  insert_glyphID;
     }
 
     GXV_TRACE(( "\n" ));
     }
 
     GXV_TRACE(( "\n" ));
+#endif
   }
 
 
   }
 
 
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
     FT_Bytes                        limit,
     GXV_Validator                   valid )
   {
+#ifdef GXV_LOAD_UNUSED_VARS
     FT_Bool    setMark;
     FT_Bool    dontAdvance;
     FT_Bool    currentIsKashidaLike;
     FT_Bool    markedIsKashidaLike;
     FT_Bool    currentInsertBefore;
     FT_Bool    markedInsertBefore;
     FT_Bool    setMark;
     FT_Bool    dontAdvance;
     FT_Bool    currentIsKashidaLike;
     FT_Bool    markedIsKashidaLike;
     FT_Bool    currentInsertBefore;
     FT_Bool    markedInsertBefore;
+#endif
     FT_Byte    currentInsertCount;
     FT_Byte    markedInsertCount;
     FT_Byte    currentInsertList;
     FT_Byte    currentInsertCount;
     FT_Byte    markedInsertCount;
     FT_Byte    currentInsertList;
     FT_UNUSED( state );
 
 
     FT_UNUSED( state );
 
 
+#ifdef GXV_LOAD_UNUSED_VARS
     setMark              = FT_BOOL( ( flags >> 15 ) & 1 );
     dontAdvance          = FT_BOOL( ( flags >> 14 ) & 1 );
     currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 );
     markedIsKashidaLike  = FT_BOOL( ( flags >> 12 ) & 1 );
     currentInsertBefore  = FT_BOOL( ( flags >> 11 ) & 1 );
     markedInsertBefore   = FT_BOOL( ( flags >> 10 ) & 1 );
     setMark              = FT_BOOL( ( flags >> 15 ) & 1 );
     dontAdvance          = FT_BOOL( ( flags >> 14 ) & 1 );
     currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 );
     markedIsKashidaLike  = FT_BOOL( ( flags >> 12 ) & 1 );
     currentInsertBefore  = FT_BOOL( ( flags >> 11 ) & 1 );
     markedInsertBefore   = FT_BOOL( ( flags >> 10 ) & 1 );
+#endif
 
     currentInsertCount = (FT_Byte)( ( flags >> 5 ) & 0x1F   );
     markedInsertCount  = (FT_Byte)(   flags        & 0x001F );
 
     currentInsertCount = (FT_Byte)( ( flags >> 5 ) & 0x1F   );
     markedInsertCount  = (FT_Byte)(   flags        & 0x001F );
index 66c3ab7..0be2133 100644 (file)
 
     if ( glyph->advance.x != (FT_Pos)0 ||
          glyph->advance.y != (FT_Pos)0 )
 
     if ( glyph->advance.x != (FT_Pos)0 ||
          glyph->advance.y != (FT_Pos)0 )
+    {
+      GXV_TRACE(( "  found non-zero advance in zero-advance glyph\n" ));
       FT_INVALID_DATA;
       FT_INVALID_DATA;
+    }
 
     GXV_EXIT;
   }
 
     GXV_EXIT;
   }
 
       offset = (FT_UShort)( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET );
       if ( offset == 0 )
 
       offset = (FT_UShort)( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET );
       if ( offset == 0 )
-        FT_INVALID_DATA;
+      {
+        GXV_TRACE(( "  found zero offset to property\n" ));
+        FT_INVALID_OFFSET;
+      }
 
       complement = (char)( offset >> 8 );
       if ( complement & 0x08 )
 
       complement = (char)( offset >> 8 );
       if ( complement & 0x08 )
 
         /* The gid for complement must be greater than 0 */
         if ( glyph <= complement )
 
         /* The gid for complement must be greater than 0 */
         if ( glyph <= complement )
+        {
+          GXV_TRACE(( "  found non-positive glyph complement\n" ));
           FT_INVALID_DATA;
           FT_INVALID_DATA;
+        }
       }
       else
       {
       }
       else
       {
     if ( property & GXV_PROP_ATTACHING_TO_RIGHT )
     {
       if ( GXV_PROP_DATA( version ) == 0x00010000UL )
     if ( property & GXV_PROP_ATTACHING_TO_RIGHT )
     {
       if ( GXV_PROP_DATA( version ) == 0x00010000UL )
+      {
+        GXV_TRACE(( "  found older version (1.0) in new version table\n" ));
         FT_INVALID_DATA;
         FT_INVALID_DATA;
+      }
     }
 
     if ( property & GXV_PROP_RESERVED )
     }
 
     if ( property & GXV_PROP_RESERVED )
+    {
+      GXV_TRACE(( "  found non-zero bits in reserved bits\n" ));
       FT_INVALID_DATA;
       FT_INVALID_DATA;
+    }
 
     if ( ( property & GXV_PROP_DIRECTIONALITY_CLASS ) > 11 )
     {
       /* TODO: Too restricted. Use the validation level. */
       if ( GXV_PROP_DATA( version ) == 0x00010000UL ||
            GXV_PROP_DATA( version ) == 0x00020000UL )
 
     if ( ( property & GXV_PROP_DIRECTIONALITY_CLASS ) > 11 )
     {
       /* TODO: Too restricted. Use the validation level. */
       if ( GXV_PROP_DATA( version ) == 0x00010000UL ||
            GXV_PROP_DATA( version ) == 0x00020000UL )
+      {
+        GXV_TRACE(( "  found too old version in directionality class\n" ));
         FT_INVALID_DATA;
         FT_INVALID_DATA;
+      }
     }
   }
 
     }
   }
 
 
     /* XXX: check range? */
     offset = (FT_UShort)( base_value_p->u +
 
     /* XXX: check range? */
     offset = (FT_UShort)( base_value_p->u +
-                          relative_gindex * sizeof( FT_UShort ) );
+                          relative_gindex * sizeof ( FT_UShort ) );
     p      = valid->lookuptbl_head + offset;
     limit  = lookuptbl_limit;
 
     p      = valid->lookuptbl_head + offset;
     limit  = lookuptbl_limit;
 
     format      = FT_NEXT_USHORT( p );
     defaultProp = FT_NEXT_USHORT( p );
 
     format      = FT_NEXT_USHORT( p );
     defaultProp = FT_NEXT_USHORT( p );
 
+    GXV_TRACE(( "  version 0x%08x\n", version ));
+    GXV_TRACE(( "  format  0x%04x\n", format ));
+    GXV_TRACE(( "  defaultProp  0x%04x\n", defaultProp ));
+
     /* only versions 1.0, 2.0, 3.0 are defined (1996) */
     if ( version != 0x00010000UL &&
          version != 0x00020000UL &&
          version != 0x00030000UL )
     /* only versions 1.0, 2.0, 3.0 are defined (1996) */
     if ( version != 0x00010000UL &&
          version != 0x00020000UL &&
          version != 0x00030000UL )
+    {
+      GXV_TRACE(( "  found unknown version\n" ));
       FT_INVALID_FORMAT;
       FT_INVALID_FORMAT;
+    }
 
 
     /* only formats 0x0000, 0x0001 are defined (1996) */
     if ( format > 1 )
 
 
     /* only formats 0x0000, 0x0001 are defined (1996) */
     if ( format > 1 )
+    {
+      GXV_TRACE(( "  found unknown format\n" ));
       FT_INVALID_FORMAT;
       FT_INVALID_FORMAT;
+    }
 
     gxv_prop_property_validate( defaultProp, 0, valid );
 
 
     gxv_prop_property_validate( defaultProp, 0, valid );
 
index df3fd15..11fbd7c 100644 (file)
   {
     FT_Bytes   p = table;
 
   {
     FT_Bytes   p = table;
 
-    FT_Fixed   track;
+    FT_Fixed   track, t;
     FT_UShort  nameIndex;
     FT_UShort  offset;
     FT_UShort  nameIndex;
     FT_UShort  offset;
-    FT_UShort  i;
+    FT_UShort  i, j;
 
 
     GXV_NAME_ENTER( "trackTable" );
 
 
     GXV_NAME_ENTER( "trackTable" );
     GXV_TRAK_DATA( trackValueOffset_min ) = 0xFFFFU;
     GXV_TRAK_DATA( trackValueOffset_max ) = 0x0000;
 
     GXV_TRAK_DATA( trackValueOffset_min ) = 0xFFFFU;
     GXV_TRAK_DATA( trackValueOffset_max ) = 0x0000;
 
+    GXV_LIMIT_CHECK( nTracks * ( 4 + 2 + 2 ) );
+
     for ( i = 0; i < nTracks; i ++ )
     {
     for ( i = 0; i < nTracks; i ++ )
     {
-      GXV_LIMIT_CHECK( 4 + 2 + 2 );
+      p = table + i * ( 4 + 2 + 2 );
       track     = FT_NEXT_LONG( p );
       nameIndex = FT_NEXT_USHORT( p );
       offset    = FT_NEXT_USHORT( p );
       track     = FT_NEXT_LONG( p );
       nameIndex = FT_NEXT_USHORT( p );
       offset    = FT_NEXT_USHORT( p );
         GXV_TRAK_DATA( trackValueOffset_max ) = offset;
 
       gxv_sfntName_validate( nameIndex, 256, 32767, valid );
         GXV_TRAK_DATA( trackValueOffset_max ) = offset;
 
       gxv_sfntName_validate( nameIndex, 256, 32767, valid );
+
+      for ( j = i; j < nTracks; j ++ )
+      {
+         p = table + j * ( 4 + 2 + 2 );
+         t = FT_NEXT_LONG( p );
+         if ( t == track )
+           GXV_TRACE(( "duplicated entries found for track value 0x%x\n",
+                        track ));
+      }
     }
 
     valid->subtable_length = p - table;
     }
 
     valid->subtable_length = p - table;
   {
     FT_Bytes          p = table;
     FT_Bytes          limit = 0;
   {
     FT_Bytes          p = table;
     FT_Bytes          limit = 0;
-    FT_Offset         table_size;
 
     GXV_ValidatorRec  validrec;
     GXV_Validator     valid = &validrec;
 
     GXV_ValidatorRec  validrec;
     GXV_Validator     valid = &validrec;
     valid->face       = face;
 
     limit      = valid->root->limit;
     valid->face       = face;
 
     limit      = valid->root->limit;
-    table_size = limit - table;
 
     FT_TRACE3(( "validating `trak' table\n" ));
     GXV_INIT;
 
     FT_TRACE3(( "validating `trak' table\n" ));
     GXV_INIT;
index e914e56..f267558 100644 (file)
@@ -8,7 +8,7 @@
 /*  parse compressed PCF fonts, as found with many X11 server              */
 /*  distributions.                                                         */
 /*                                                                         */
 /*  parse compressed PCF fonts, as found with many X11 server              */
 /*  distributions.                                                         */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2009, 2010 by                  */
+/*  Copyright 2002-2006, 2009-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -32,6 +32,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  Gzip_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Gzip
 
 #define FT_ERR_PREFIX  Gzip_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Gzip
 
@@ -42,7 +43,7 @@
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "gzip code does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "gzip code does not support PIC yet"
-#endif 
+#endif
 
 #ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB
 
 
 #ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB
 
 #undef  SLOW
 #define SLOW  1  /* we can't use asm-optimized sources here! */
 
 #undef  SLOW
 #define SLOW  1  /* we can't use asm-optimized sources here! */
 
+#if defined( _MSC_VER )      /* Visual C++ (and Intel C++)   */
+  /* We disable the warning `conversion from XXX to YYY,     */
+  /* possible loss of data' in order to compile cleanly with */
+  /* the maximum level of warnings: zlib is non-FreeType     */
+  /* code.                                                   */
+#pragma warning( push )
+#pragma warning( disable : 4244 )
+#endif /* _MSC_VER */
+
   /* Urgh.  `inflate_mask' must not be declared twice -- C++ doesn't like
      this.  We temporarily disable it and load all necessary header files. */
 #define NO_INFLATE_MASK
   /* Urgh.  `inflate_mask' must not be declared twice -- C++ doesn't like
      this.  We temporarily disable it and load all necessary header files. */
 #define NO_INFLATE_MASK
 #include "inflate.c"
 #include "adler32.c"
 
 #include "inflate.c"
 #include "adler32.c"
 
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
+
 #endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */
 
 
 #endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */
 
 
          head[2] != Z_DEFLATED        ||
         (head[3] & FT_GZIP_RESERVED)  )
     {
          head[2] != Z_DEFLATED        ||
         (head[3] & FT_GZIP_RESERVED)  )
     {
-      error = Gzip_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
                      FT_Stream    source )
   {
     z_stream*  zstream = &zip->zstream;
                      FT_Stream    source )
   {
     z_stream*  zstream = &zip->zstream;
-    FT_Error   error   = Gzip_Err_Ok;
+    FT_Error   error   = FT_Err_Ok;
 
 
     zip->stream = stream;
 
 
     zip->stream = stream;
 
     if ( inflateInit2( zstream, -MAX_WBITS ) != Z_OK ||
          zstream->next_in == NULL                     )
 
     if ( inflateInit2( zstream, -MAX_WBITS ) != Z_OK ||
          zstream->next_in == NULL                     )
-      error = Gzip_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
 
   Exit:
     return error;
 
   Exit:
     return error;
       size = stream->read( stream, stream->pos, zip->input,
                            FT_GZIP_BUFFER_SIZE );
       if ( size == 0 )
       size = stream->read( stream, stream->pos, zip->input,
                            FT_GZIP_BUFFER_SIZE );
       if ( size == 0 )
-        return Gzip_Err_Invalid_Stream_Operation;
+        return FT_THROW( Invalid_Stream_Operation );
     }
     else
     {
     }
     else
     {
         size = FT_GZIP_BUFFER_SIZE;
 
       if ( size == 0 )
         size = FT_GZIP_BUFFER_SIZE;
 
       if ( size == 0 )
-        return Gzip_Err_Invalid_Stream_Operation;
+        return FT_THROW( Invalid_Stream_Operation );
 
       FT_MEM_COPY( zip->input, stream->base + stream->pos, size );
     }
 
       FT_MEM_COPY( zip->input, stream->base + stream->pos, size );
     }
     zstream->next_in  = zip->input;
     zstream->avail_in = size;
 
     zstream->next_in  = zip->input;
     zstream->avail_in = size;
 
-    return Gzip_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   ft_gzip_file_fill_output( FT_GZipFile  zip )
   {
     z_stream*  zstream = &zip->zstream;
   ft_gzip_file_fill_output( FT_GZipFile  zip )
   {
     z_stream*  zstream = &zip->zstream;
-    FT_Error   error   = Gzip_Err_Ok;
+    FT_Error   error   = FT_Err_Ok;
 
 
     zip->cursor        = zip->buffer;
 
 
     zip->cursor        = zip->buffer;
       {
         zip->limit = zstream->next_out;
         if ( zip->limit == zip->cursor )
       {
         zip->limit = zstream->next_out;
         if ( zip->limit == zip->cursor )
-          error = Gzip_Err_Invalid_Stream_Operation;
+          error = FT_THROW( Invalid_Stream_Operation );
         break;
       }
       else if ( err != Z_OK )
       {
         break;
       }
       else if ( err != Z_OK )
       {
-        error = Gzip_Err_Invalid_Stream_Operation;
+        error = FT_THROW( Invalid_Stream_Operation );
         break;
       }
     }
         break;
       }
     }
   ft_gzip_file_skip_output( FT_GZipFile  zip,
                             FT_ULong     count )
   {
   ft_gzip_file_skip_output( FT_GZipFile  zip,
                             FT_ULong     count )
   {
-    FT_Error  error = Gzip_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_ULong  delta;
 
 
     FT_ULong  delta;
 
 
     old_pos = stream->pos;
     if ( !FT_Stream_Seek( stream, stream->size - 4 ) )
     {
     old_pos = stream->pos;
     if ( !FT_Stream_Seek( stream, stream->size - 4 ) )
     {
-      result = (FT_ULong)FT_Stream_ReadLong( stream, &error );
+      result = FT_Stream_ReadULong( stream, &error );
       if ( error )
         result = 0;
 
       if ( error )
         result = 0;
 
   {
     FT_Error     error;
     FT_Memory    memory = source->memory;
   {
     FT_Error     error;
     FT_Memory    memory = source->memory;
-    FT_GZipFile  zip;
+    FT_GZipFile  zip = NULL;
 
 
     /*
 
 
     /*
 
       if ( zip_size != 0 && zip_size < 40 * 1024 )
       {
 
       if ( zip_size != 0 && zip_size < 40 * 1024 )
       {
-        FT_Byte*  zip_buff;
+        FT_Byte*  zip_buff = NULL;
 
 
         if ( !FT_ALLOC( zip_buff, zip_size ) )
 
 
         if ( !FT_ALLOC( zip_buff, zip_size ) )
           ft_gzip_file_io( zip, 0, NULL, 0 );
           FT_FREE( zip_buff );
         }
           ft_gzip_file_io( zip, 0, NULL, 0 );
           FT_FREE( zip_buff );
         }
-        error = Gzip_Err_Ok;
+        error = FT_Err_Ok;
       }
     }
 
       }
     }
 
     FT_UNUSED( stream );
     FT_UNUSED( source );
 
     FT_UNUSED( stream );
     FT_UNUSED( source );
 
-    return Gzip_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 #endif /* !FT_CONFIG_OPTION_USE_ZLIB */
   }
 
 #endif /* !FT_CONFIG_OPTION_USE_ZLIB */
index 0b798fe..82e6c00 100644 (file)
@@ -8,7 +8,7 @@
 /*  be used to parse compressed PCF fonts, as found with many X11 server   */
 /*  distributions.                                                         */
 /*                                                                         */
 /*  be used to parse compressed PCF fonts, as found with many X11 server   */
 /*  distributions.                                                         */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2009, 2010 by                              */
+/*  Copyright 2004-2006, 2009, 2010, 2012, 2013 by                         */
 /*  Albert Chin-A-Young.                                                   */
 /*                                                                         */
 /*  Based on code in src/gzip/ftgzip.c, Copyright 2004 by                  */
 /*  Albert Chin-A-Young.                                                   */
 /*                                                                         */
 /*  Based on code in src/gzip/ftgzip.c, Copyright 2004 by                  */
@@ -34,6 +34,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  LZW_Err_
 #define FT_ERR_BASE    FT_Mod_Err_LZW
 
 #define FT_ERR_PREFIX  LZW_Err_
 #define FT_ERR_BASE    FT_Mod_Err_LZW
 
@@ -44,7 +45,7 @@
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "lzw code does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "lzw code does not support PIC yet"
-#endif 
+#endif
 
 #include "ftzopen.h"
 
 
 #include "ftzopen.h"
 
@@ -97,7 +98,7 @@
     /* head[0] && head[1] are the magic numbers */
     if ( head[0] != 0x1f ||
          head[1] != 0x9d )
     /* head[0] && head[1] are the magic numbers */
     if ( head[0] != 0x1f ||
          head[1] != 0x9d )
-      error = LZW_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
 
   Exit:
     return error;
 
   Exit:
     return error;
                     FT_Stream   source )
   {
     FT_LzwState  lzw   = &zip->lzw;
                     FT_Stream   source )
   {
     FT_LzwState  lzw   = &zip->lzw;
-    FT_Error     error = LZW_Err_Ok;
+    FT_Error     error;
 
 
     zip->stream = stream;
 
 
     zip->stream = stream;
   {
     FT_LzwState  lzw = &zip->lzw;
     FT_ULong     count;
   {
     FT_LzwState  lzw = &zip->lzw;
     FT_ULong     count;
-    FT_Error     error = LZW_Err_Ok;
+    FT_Error     error = FT_Err_Ok;
 
 
     zip->cursor = zip->buffer;
 
 
     zip->cursor = zip->buffer;
     zip->limit = zip->cursor + count;
 
     if ( count == 0 )
     zip->limit = zip->cursor + count;
 
     if ( count == 0 )
-      error = LZW_Err_Invalid_Stream_Operation;
+      error = FT_THROW( Invalid_Stream_Operation );
 
     return error;
   }
 
     return error;
   }
   ft_lzw_file_skip_output( FT_LZWFile  zip,
                            FT_ULong    count )
   {
   ft_lzw_file_skip_output( FT_LZWFile  zip,
                            FT_ULong    count )
   {
-    FT_Error  error = LZW_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     /* first, we skip what we can from the output buffer */
 
 
     /* first, we skip what we can from the output buffer */
       if ( numread < delta )
       {
         /* not enough bytes */
       if ( numread < delta )
       {
         /* not enough bytes */
-        error = LZW_Err_Invalid_Stream_Operation;
+        error = FT_THROW( Invalid_Stream_Operation );
         break;
       }
 
         break;
       }
 
   {
     FT_Error    error;
     FT_Memory   memory = source->memory;
   {
     FT_Error    error;
     FT_Memory   memory = source->memory;
-    FT_LZWFile  zip;
+    FT_LZWFile  zip = NULL;
 
 
     /*
 
 
     /*
     FT_UNUSED( stream );
     FT_UNUSED( source );
 
     FT_UNUSED( stream );
     FT_UNUSED( source );
 
-    return LZW_Err_Unimplemented_Feature;
+    return FT_THROW( Unimplemented_Feature );
   }
 
 
   }
 
 
index 8bc65c8..d7a6457 100644 (file)
@@ -8,7 +8,7 @@
 /*  be used to parse compressed PCF fonts, as found with many X11 server   */
 /*  distributions.                                                         */
 /*                                                                         */
 /*  be used to parse compressed PCF fonts, as found with many X11 server   */
 /*  distributions.                                                         */
 /*                                                                         */
-/*  Copyright 2005, 2006, 2007, 2009 by David Turner.                      */
+/*  Copyright 2005-2007, 2009, 2011 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      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
         old_size     = 0;
       }
 
         old_size     = 0;
       }
 
+      /* requirement of the character stack larger than 1<<LZW_MAX_BITS */
+      /* implies bug in the decompression code                          */
+      if ( new_size > ( 1 << LZW_MAX_BITS ) )
+      {
+        new_size = 1 << LZW_MAX_BITS;
+        if ( new_size == old_size )
+          return -1;
+      }
+
       if ( FT_RENEW_ARRAY( state->stack, old_size, new_size ) )
         return -1;
 
       if ( FT_RENEW_ARRAY( state->stack, old_size, new_size ) )
         return -1;
 
                            : state->max_free + 1;
 
         c = ft_lzwstate_get_code( state );
                            : state->max_free + 1;
 
         c = ft_lzwstate_get_code( state );
-        if ( c < 0 )
+        if ( c < 0 || c > 255 )
           goto Eof;
 
         old_code = old_char = (FT_UInt)c;
           goto Eof;
 
         old_code = old_char = (FT_UInt)c;
           /* why not LZW_FIRST-256 ? */
           state->free_ent  = ( LZW_FIRST - 1 ) - 256;
           state->buf_clear = 1;
           /* why not LZW_FIRST-256 ? */
           state->free_ent  = ( LZW_FIRST - 1 ) - 256;
           state->buf_clear = 1;
-          c = ft_lzwstate_get_code( state );
-          if ( c < 0 )
-            goto Eof;
 
 
-          code = (FT_UInt)c;
+          /* not quite right, but at least more predictable */
+          old_code = 0;
+          old_char = 0;
+
+          goto NextCode;
         }
 
         in_code = code; /* save code for later */
         }
 
         in_code = code; /* save code for later */
           /* special case for KwKwKwK */
           if ( code - 256U >= state->free_ent )
           {
           /* special case for KwKwKwK */
           if ( code - 256U >= state->free_ent )
           {
+            /* corrupted LZW stream */
+            if ( code - 256U > state->free_ent )
+              goto Eof;
+
             FTLZW_STACK_PUSH( old_char );
             code = old_code;
           }
             FTLZW_STACK_PUSH( old_char );
             code = old_code;
           }
diff --git a/reactos/lib/3rdparty/freetype/src/otvalid/Jamfile b/reactos/lib/3rdparty/freetype/src/otvalid/Jamfile
deleted file mode 100644 (file)
index b457143..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/otvalid Jamfile
-#
-# Copyright 2004 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) otvalid ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = otvbase otvcommn otvgdef otvgpos otvgsub otvjstf otvmod otvmath ;
-  }
-  else
-  {
-    _sources = otvalid ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/otvalid Jamfile
index 041b538..b6f00c9 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType validation module error codes (specification only).         */
 /*                                                                         */
 /*                                                                         */
 /*    OpenType validation module error codes (specification only).         */
 /*                                                                         */
-/*  Copyright 2004, 2005 by                                                */
+/*  Copyright 2004, 2005, 2012, 2013 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  OTV_Err_
 #define FT_ERR_BASE    FT_Mod_Err_OTvalid
 
 #define FT_ERR_PREFIX  OTV_Err_
 #define FT_ERR_BASE    FT_Mod_Err_OTvalid
 
-#define FT_KEEP_ERR_PREFIX
-
 #include FT_ERRORS_H
 
 #endif /* __OTVERROR_H__ */
 #include FT_ERRORS_H
 
 #endif /* __OTVERROR_H__ */
index 620e452..37c6e86 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType's OpenType validation module implementation (body).         */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType's OpenType validation module implementation (body).         */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2007, 2008 by                              */
+/*  Copyright 2004-2008, 2013 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -49,8 +49,8 @@
 
 
     error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len );
 
 
     error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len );
-    if ( error == OTV_Err_Table_Missing )
-      return OTV_Err_Ok;
+    if ( FT_ERR_EQ( error, Table_Missing ) )
+      return FT_Err_Ok;
     if ( error )
       goto Exit;
 
     if ( error )
       goto Exit;
 
@@ -73,7 +73,7 @@
                 FT_Bytes          *ot_gsub,
                 FT_Bytes          *ot_jstf )
   {
                 FT_Bytes          *ot_gsub,
                 FT_Bytes          *ot_jstf )
   {
-    FT_Error                  error = OTV_Err_Ok;
+    FT_Error                  error = FT_Err_Ok;
     FT_Byte* volatile         base;
     FT_Byte* volatile         gdef;
     FT_Byte* volatile         gpos;
     FT_Byte* volatile         base;
     FT_Byte* volatile         gdef;
     FT_Byte* volatile         gpos;
   const FT_Module_Class  otv_module_class =
   {
     0,
   const FT_Module_Class  otv_module_class =
   {
     0,
-    sizeof( FT_ModuleRec ),
+    sizeof ( FT_ModuleRec ),
     "otvalid",
     0x10000L,
     0x20000L,
     "otvalid",
     0x10000L,
     0x20000L,
index 573b2a0..f7e1550 100644 (file)
@@ -29,7 +29,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
-#endif 
+#endif
 
 
   FT_EXPORT_VAR( const FT_Module_Class )  otv_module_class;
 
 
   FT_EXPORT_VAR( const FT_Module_Class )  otv_module_class;
diff --git a/reactos/lib/3rdparty/freetype/src/pcf/Jamfile b/reactos/lib/3rdparty/freetype/src/pcf/Jamfile
deleted file mode 100644 (file)
index 752fcac..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/pcf Jamfile
-#
-# Copyright 2001, 2003 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) pcf ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = pcfdrivr pcfread pcfutil ;
-  }
-  else
-  {
-    _sources = pcf ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/pcf Jamfile
index cc1480b..10eff15 100644 (file)
@@ -31,29 +31,11 @@ on linux/alpha.
 Encodings
 *********
 
 Encodings
 *********
 
-The variety of encodings that accompanies pcf fonts appears to encompass the
-small set defined in freetype.h.  On the other hand, each pcf font defines
-two properties that specify encoding and registry.
+Use `FT_Get_BDF_Charset_ID' to access the encoding and registry.
 
 
-I decided to make these two properties directly accessible, leaving to the
-client application the work of interpreting them.  For instance:
-
-  #include "pcftypes.h"  /* include/freetype/internal/pcftypes.h */
-
-  FT_Face     face;
-  PCF_Public_Face  pcfface;
-
-  FT_New_Face( library,..., &face );
-
-  pcfface = (PCF_Public_Face)face;
-
-  if ((pcfface->charset_registry == "ISO10646") &&
-        (pcfface->charset_encoding) == "1")) [..]
-
-Thus the driver always export `ft_encoding_none' as
-face->charmap.encoding.  FT_Get_Char_Index() behavior is unmodified, that
-is, it converts the ULong value given as argument into the corresponding
-glyph number.
+The driver always exports `ft_encoding_none' as face->charmap.encoding.
+FT_Get_Char_Index() behavior is unmodified, that is, it converts the ULong
+value given as argument into the corresponding glyph number.
 
 
 Known problems
 
 
 Known problems
index 1cd56c1..af0ffc3 100644 (file)
@@ -2,7 +2,7 @@
 
   FreeType font driver for pcf fonts
 
 
   FreeType font driver for pcf fonts
 
-  Copyright (C) 2000, 2001, 2002, 2003, 2006 by
+  Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -136,8 +136,8 @@ FT_BEGIN_HEADER
   {
     FT_FaceRec     root;
 
   {
     FT_FaceRec     root;
 
-    FT_StreamRec   gzip_stream;
-    FT_Stream      gzip_source;
+    FT_StreamRec   comp_stream;
+    FT_Stream      comp_source;
 
     char*          charset_encoding;
     char*          charset_registry;
 
     char*          charset_encoding;
     char*          charset_registry;
index 6c0aa0f..df25a64 100644 (file)
@@ -2,7 +2,7 @@
 
     FreeType font driver for pcf files
 
 
     FreeType font driver for pcf files
 
-    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by
+    Copyright (C) 2000-2004, 2006-2011, 2013 by
     Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
     Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,9 +32,10 @@ THE SOFTWARE.
 #include FT_INTERNAL_OBJECTS_H
 #include FT_GZIP_H
 #include FT_LZW_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_GZIP_H
 #include FT_LZW_H
+#include FT_BZIP2_H
 #include FT_ERRORS_H
 #include FT_BDF_H
 #include FT_ERRORS_H
 #include FT_BDF_H
-#include FT_TRUETYPE_IDS_H 
+#include FT_TRUETYPE_IDS_H
 
 #include "pcf.h"
 #include "pcfdrivr.h"
 
 #include "pcf.h"
 #include "pcfdrivr.h"
@@ -82,7 +83,7 @@ THE SOFTWARE.
     cmap->num_encodings = (FT_UInt)face->nencodings;
     cmap->encodings     = face->encodings;
 
     cmap->num_encodings = (FT_UInt)face->nencodings;
     cmap->encodings     = face->encodings;
 
-    return PCF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
@@ -246,13 +247,11 @@ THE SOFTWARE.
     FT_FREE( face->charset_encoding );
     FT_FREE( face->charset_registry );
 
     FT_FREE( face->charset_encoding );
     FT_FREE( face->charset_registry );
 
-    FT_TRACE4(( "PCF_Face_Done: done face\n" ));
-
-    /* close gzip/LZW stream if any */
-    if ( pcfface->stream == &face->gzip_stream )
+    /* close compressed stream if any */
+    if ( pcfface->stream == &face->comp_stream )
     {
     {
-      FT_Stream_Close( &face->gzip_stream );
-      pcfface->stream = face->gzip_source;
+      FT_Stream_Close( &face->comp_stream );
+      pcfface->stream = face->comp_source;
     }
   }
 
     }
   }
 
@@ -265,20 +264,23 @@ THE SOFTWARE.
                  FT_Parameter*  params )
   {
     PCF_Face  face  = (PCF_Face)pcfface;
                  FT_Parameter*  params )
   {
     PCF_Face  face  = (PCF_Face)pcfface;
-    FT_Error  error = PCF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
     FT_UNUSED( num_params );
     FT_UNUSED( params );
     FT_UNUSED( face_index );
 
 
 
     FT_UNUSED( num_params );
     FT_UNUSED( params );
     FT_UNUSED( face_index );
 
 
+    FT_TRACE2(( "PCF driver\n" ));
+
     error = pcf_load_font( stream, face );
     if ( error )
     {
       PCF_Face_Done( pcfface );
 
     error = pcf_load_font( stream, face );
     if ( error )
     {
       PCF_Face_Done( pcfface );
 
-#if defined( FT_CONFIG_OPTION_USE_ZLIB ) || \
-    defined( FT_CONFIG_OPTION_USE_LZW )
+#if defined( FT_CONFIG_OPTION_USE_ZLIB )  || \
+    defined( FT_CONFIG_OPTION_USE_LZW )   || \
+    defined( FT_CONFIG_OPTION_USE_BZIP2 )
 
 #ifdef FT_CONFIG_OPTION_USE_ZLIB
       {
 
 #ifdef FT_CONFIG_OPTION_USE_ZLIB
       {
@@ -286,8 +288,8 @@ THE SOFTWARE.
 
 
         /* this didn't work, try gzip support! */
 
 
         /* this didn't work, try gzip support! */
-        error2 = FT_Stream_OpenGzip( &face->gzip_stream, stream );
-        if ( FT_ERROR_BASE( error2 ) == FT_Err_Unimplemented_Feature )
+        error2 = FT_Stream_OpenGzip( &face->comp_stream, stream );
+        if ( FT_ERR_EQ( error2, Unimplemented_Feature ) )
           goto Fail;
 
         error = error2;
           goto Fail;
 
         error = error2;
@@ -301,19 +303,34 @@ THE SOFTWARE.
 
 
         /* this didn't work, try LZW support! */
 
 
         /* this didn't work, try LZW support! */
-        error3 = FT_Stream_OpenLZW( &face->gzip_stream, stream );
-        if ( FT_ERROR_BASE( error3 ) == FT_Err_Unimplemented_Feature )
+        error3 = FT_Stream_OpenLZW( &face->comp_stream, stream );
+        if ( FT_ERR_EQ( error3, Unimplemented_Feature ) )
           goto Fail;
 
         error = error3;
       }
 #endif /* FT_CONFIG_OPTION_USE_LZW */
 
           goto Fail;
 
         error = error3;
       }
 #endif /* FT_CONFIG_OPTION_USE_LZW */
 
+#ifdef FT_CONFIG_OPTION_USE_BZIP2
+      if ( error )
+      {
+        FT_Error  error4;
+
+
+        /* this didn't work, try Bzip2 support! */
+        error4 = FT_Stream_OpenBzip2( &face->comp_stream, stream );
+        if ( FT_ERR_EQ( error4, Unimplemented_Feature ) )
+          goto Fail;
+
+        error = error4;
+      }
+#endif /* FT_CONFIG_OPTION_USE_BZIP2 */
+
       if ( error )
         goto Fail;
 
       if ( error )
         goto Fail;
 
-      face->gzip_source = stream;
-      pcfface->stream   = &face->gzip_stream;
+      face->comp_source = stream;
+      pcfface->stream   = &face->comp_stream;
 
       stream = pcfface->stream;
 
 
       stream = pcfface->stream;
 
@@ -321,7 +338,9 @@ THE SOFTWARE.
       if ( error )
         goto Fail;
 
       if ( error )
         goto Fail;
 
-#else /* !(FT_CONFIG_OPTION_USE_ZLIB || FT_CONFIG_OPTION_USE_LZW) */
+#else /* !(FT_CONFIG_OPTION_USE_ZLIB ||
+           FT_CONFIG_OPTION_USE_LZW ||
+           FT_CONFIG_OPTION_USE_BZIP2) */
 
       goto Fail;
 
 
       goto Fail;
 
@@ -385,9 +404,9 @@ THE SOFTWARE.
     return error;
 
   Fail:
     return error;
 
   Fail:
-    FT_TRACE2(( "[not a valid PCF file]\n" ));
+    FT_TRACE2(( "  not a PCF file\n" ));
     PCF_Face_Done( pcfface );
     PCF_Face_Done( pcfface );
-    error = PCF_Err_Unknown_File_Format;  /* error */
+    error = FT_THROW( Unknown_File_Format );  /* error */
     goto Exit;
   }
 
     goto Exit;
   }
 
@@ -405,7 +424,7 @@ THE SOFTWARE.
     size->metrics.descender   = -accel->fontDescent << 6;
     size->metrics.max_advance =  accel->maxbounds.characterWidth << 6;
 
     size->metrics.descender   = -accel->fontDescent << 6;
     size->metrics.max_advance =  accel->maxbounds.characterWidth << 6;
 
-    return PCF_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
@@ -415,7 +434,7 @@ THE SOFTWARE.
   {
     PCF_Face         face  = (PCF_Face)size->face;
     FT_Bitmap_Size*  bsize = size->face->available_sizes;
   {
     PCF_Face         face  = (PCF_Face)size->face;
     FT_Bitmap_Size*  bsize = size->face->available_sizes;
-    FT_Error         error = PCF_Err_Invalid_Pixel_Size;
+    FT_Error         error = FT_ERR( Invalid_Pixel_Size );
     FT_Long          height;
 
 
     FT_Long          height;
 
 
@@ -426,17 +445,17 @@ THE SOFTWARE.
     {
     case FT_SIZE_REQUEST_TYPE_NOMINAL:
       if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )
     {
     case FT_SIZE_REQUEST_TYPE_NOMINAL:
       if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )
-        error = PCF_Err_Ok;
+        error = FT_Err_Ok;
       break;
 
     case FT_SIZE_REQUEST_TYPE_REAL_DIM:
       if ( height == ( face->accel.fontAscent +
                        face->accel.fontDescent ) )
       break;
 
     case FT_SIZE_REQUEST_TYPE_REAL_DIM:
       if ( height == ( face->accel.fontAscent +
                        face->accel.fontDescent ) )
-        error = PCF_Err_Ok;
+        error = FT_Err_Ok;
       break;
 
     default:
       break;
 
     default:
-      error = PCF_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
       break;
     }
 
       break;
     }
 
@@ -455,7 +474,7 @@ THE SOFTWARE.
   {
     PCF_Face    face   = (PCF_Face)FT_SIZE_FACE( size );
     FT_Stream   stream;
   {
     PCF_Face    face   = (PCF_Face)FT_SIZE_FACE( size );
     FT_Stream   stream;
-    FT_Error    error  = PCF_Err_Ok;
+    FT_Error    error  = FT_Err_Ok;
     FT_Bitmap*  bitmap = &slot->bitmap;
     PCF_Metric  metric;
     FT_Offset   bytes;
     FT_Bitmap*  bitmap = &slot->bitmap;
     PCF_Metric  metric;
     FT_Offset   bytes;
@@ -467,7 +486,7 @@ THE SOFTWARE.
 
     if ( !face || glyph_index >= (FT_UInt)face->root.num_glyphs )
     {
 
     if ( !face || glyph_index >= (FT_UInt)face->root.num_glyphs )
     {
-      error = PCF_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
@@ -507,13 +526,13 @@ THE SOFTWARE.
       break;
 
     default:
       break;
 
     default:
-      return PCF_Err_Invalid_File_Format;
+      return FT_THROW( Invalid_File_Format );
     }
 
     /* XXX: to do: are there cases that need repadding the bitmap? */
     bytes = bitmap->pitch * bitmap->rows;
 
     }
 
     /* XXX: to do: are there cases that need repadding the bitmap? */
     bytes = bitmap->pitch * bitmap->rows;
 
-    error = ft_glyphslot_alloc_bitmap( slot, bytes );
+    error = ft_glyphslot_alloc_bitmap( slot, (FT_ULong)bytes );
     if ( error )
       goto Exit;
 
     if ( error )
       goto Exit;
 
@@ -603,7 +622,7 @@ THE SOFTWARE.
       return 0;
     }
 
       return 0;
     }
 
-    return PCF_Err_Invalid_Argument;
+    return FT_THROW( Invalid_Argument );
   }
 
 
   }
 
 
@@ -664,8 +683,8 @@ THE SOFTWARE.
 
       0,
 
 
       0,
 
-      0,
-      0,
+      0,                    /* FT_Module_Constructor */
+      0,                    /* FT_Module_Destructor  */
       pcf_driver_requester
     },
 
       pcf_driver_requester
     },
 
@@ -680,10 +699,6 @@ THE SOFTWARE.
     0,                      /* FT_Slot_InitFunc */
     0,                      /* FT_Slot_DoneFunc */
 
     0,                      /* FT_Slot_InitFunc */
     0,                      /* FT_Slot_DoneFunc */
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    ft_stub_set_char_sizes,
-    ft_stub_set_pixel_sizes,
-#endif
     PCF_Glyph_Load,
 
     0,                      /* FT_Face_GetKerningFunc  */
     PCF_Glyph_Load,
 
     0,                      /* FT_Face_GetKerningFunc  */
index a81d730..5461495 100644 (file)
@@ -35,7 +35,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
-#endif 
+#endif
 
   FT_EXPORT_VAR( const FT_Driver_ClassRec )  pcf_driver_class;
 
 
   FT_EXPORT_VAR( const FT_Driver_ClassRec )  pcf_driver_class;
 
index d75c067..e51fff8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PCF error codes (specification only).                                */
 /*                                                                         */
 /*                                                                         */
 /*    PCF error codes (specification only).                                */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,6 +29,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  PCF_Err_
 #define FT_ERR_BASE    FT_Mod_Err_PCF
 
 #define FT_ERR_PREFIX  PCF_Err_
 #define FT_ERR_BASE    FT_Mod_Err_PCF
 
index f732623..3c1bb7d 100644 (file)
@@ -2,8 +2,7 @@
 
     FreeType font driver for pcf fonts
 
 
     FreeType font driver for pcf fonts
 
-  Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-            2010 by
+  Copyright 2000-2010, 2012, 2013 by
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -93,21 +92,21 @@ THE SOFTWARE.
     PCF_Toc    toc = &face->toc;
     PCF_Table  tables;
 
     PCF_Toc    toc = &face->toc;
     PCF_Table  tables;
 
-    FT_Memory  memory = FT_FACE(face)->memory;
+    FT_Memory  memory = FT_FACE( face )->memory;
     FT_UInt    n;
 
 
     if ( FT_STREAM_SEEK ( 0 )                          ||
          FT_STREAM_READ_FIELDS ( pcf_toc_header, toc ) )
     FT_UInt    n;
 
 
     if ( FT_STREAM_SEEK ( 0 )                          ||
          FT_STREAM_READ_FIELDS ( pcf_toc_header, toc ) )
-      return PCF_Err_Cannot_Open_Resource;
+      return FT_THROW( Cannot_Open_Resource );
 
     if ( toc->version != PCF_FILE_VERSION                 ||
          toc->count   >  FT_ARRAY_MAX( face->toc.tables ) ||
          toc->count   == 0                                )
 
     if ( toc->version != PCF_FILE_VERSION                 ||
          toc->count   >  FT_ARRAY_MAX( face->toc.tables ) ||
          toc->count   == 0                                )
-      return PCF_Err_Invalid_File_Format;
+      return FT_THROW( Invalid_File_Format );
 
     if ( FT_NEW_ARRAY( face->toc.tables, toc->count ) )
 
     if ( FT_NEW_ARRAY( face->toc.tables, toc->count ) )
-      return PCF_Err_Out_Of_Memory;
+      return FT_THROW( Out_Of_Memory );
 
     tables = face->toc.tables;
     for ( n = 0; n < toc->count; n++ )
 
     tables = face->toc.tables;
     for ( n = 0; n < toc->count; n++ )
@@ -145,7 +144,7 @@ THE SOFTWARE.
 
         if ( ( tables[i].size   > tables[i + 1].offset )                  ||
              ( tables[i].offset > tables[i + 1].offset - tables[i].size ) )
 
         if ( ( tables[i].size   > tables[i + 1].offset )                  ||
              ( tables[i].offset > tables[i + 1].offset - tables[i].size ) )
-          return PCF_Err_Invalid_Offset;
+          return FT_THROW( Invalid_Offset );
       }
 
       if ( !have_change )
       }
 
       if ( !have_change )
@@ -182,7 +181,7 @@ THE SOFTWARE.
 
 #endif
 
 
 #endif
 
-    return PCF_Err_Ok;
+    return FT_Err_Ok;
 
   Exit:
     FT_FREE( face->toc.tables );
 
   Exit:
     FT_FREE( face->toc.tables );
@@ -249,7 +248,7 @@ THE SOFTWARE.
                   FT_ULong    format,
                   PCF_Metric  metric )
   {
                   FT_ULong    format,
                   PCF_Metric  metric )
   {
-    FT_Error  error = PCF_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
 
 
     if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
@@ -295,7 +294,7 @@ THE SOFTWARE.
                           FT_ULong  *aformat,
                           FT_ULong  *asize )
   {
                           FT_ULong  *aformat,
                           FT_ULong  *asize )
   {
-    FT_Error  error = PCF_Err_Invalid_File_Format;
+    FT_Error  error = FT_ERR( Invalid_File_Format );
     FT_ULong  i;
 
 
     FT_ULong  i;
 
 
@@ -304,20 +303,20 @@ THE SOFTWARE.
       {
         if ( stream->pos > tables[i].offset )
         {
       {
         if ( stream->pos > tables[i].offset )
         {
-          error = PCF_Err_Invalid_Stream_Skip;
+          error = FT_THROW( Invalid_Stream_Skip );
           goto Fail;
         }
 
         if ( FT_STREAM_SKIP( tables[i].offset - stream->pos ) )
         {
           goto Fail;
         }
 
         if ( FT_STREAM_SKIP( tables[i].offset - stream->pos ) )
         {
-          error = PCF_Err_Invalid_Stream_Skip;
+          error = FT_THROW( Invalid_Stream_Skip );
           goto Fail;
         }
 
         *asize   = tables[i].size;
         *aformat = tables[i].format;
 
           goto Fail;
         }
 
         *asize   = tables[i].size;
         *aformat = tables[i].format;
 
-        return PCF_Err_Ok;
+        return FT_Err_Ok;
       }
 
   Fail:
       }
 
   Fail:
@@ -399,11 +398,11 @@ THE SOFTWARE.
                       PCF_Face   face )
   {
     PCF_ParseProperty  props      = 0;
                       PCF_Face   face )
   {
     PCF_ParseProperty  props      = 0;
-    PCF_Property       properties;
+    PCF_Property       properties = NULL;
     FT_ULong           nprops, i;
     FT_ULong           format, size;
     FT_Error           error;
     FT_ULong           nprops, i;
     FT_ULong           format, size;
     FT_Error           error;
-    FT_Memory          memory     = FT_FACE(face)->memory;
+    FT_Memory          memory     = FT_FACE( face )->memory;
     FT_ULong           string_size;
     FT_String*         strings    = 0;
 
     FT_ULong           string_size;
     FT_String*         strings    = 0;
 
@@ -442,7 +441,7 @@ THE SOFTWARE.
     /* rough estimate */
     if ( nprops > size / PCF_PROPERTY_SIZE )
     {
     /* rough estimate */
     if ( nprops > size / PCF_PROPERTY_SIZE )
     {
-      error = PCF_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
       goto Bail;
     }
 
       goto Bail;
     }
 
@@ -475,7 +474,7 @@ THE SOFTWARE.
       i = 4 - ( nprops & 3 );
       if ( FT_STREAM_SKIP( i ) )
       {
       i = 4 - ( nprops & 3 );
       if ( FT_STREAM_SKIP( i ) )
       {
-        error = PCF_Err_Invalid_Stream_Skip;
+        error = FT_THROW( Invalid_Stream_Skip );
         goto Bail;
       }
     }
         goto Bail;
       }
     }
@@ -492,11 +491,12 @@ THE SOFTWARE.
     /* rough estimate */
     if ( string_size > size - nprops * PCF_PROPERTY_SIZE )
     {
     /* rough estimate */
     if ( string_size > size - nprops * PCF_PROPERTY_SIZE )
     {
-      error = PCF_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
       goto Bail;
     }
 
       goto Bail;
     }
 
-    if ( FT_NEW_ARRAY( strings, string_size ) )
+    /* allocate one more byte so that we have a final null byte */
+    if ( FT_NEW_ARRAY( strings, string_size + 1 ) )
       goto Bail;
 
     error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size );
       goto Bail;
 
     error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size );
@@ -516,7 +516,7 @@ THE SOFTWARE.
       if ( ( name_offset < 0 )                     ||
            ( (FT_ULong)name_offset > string_size ) )
       {
       if ( ( name_offset < 0 )                     ||
            ( (FT_ULong)name_offset > string_size ) )
       {
-        error = PCF_Err_Invalid_Offset;
+        error = FT_THROW( Invalid_Offset );
         goto Bail;
       }
 
         goto Bail;
       }
 
@@ -535,7 +535,7 @@ THE SOFTWARE.
         if ( ( value_offset < 0 )                     ||
              ( (FT_ULong)value_offset > string_size ) )
         {
         if ( ( value_offset < 0 )                     ||
              ( (FT_ULong)value_offset > string_size ) )
         {
-          error = PCF_Err_Invalid_Offset;
+          error = FT_THROW( Invalid_Offset );
           goto Bail;
         }
 
           goto Bail;
         }
 
@@ -552,7 +552,7 @@ THE SOFTWARE.
       }
     }
 
       }
     }
 
-    error = PCF_Err_Ok;
+    error = FT_Err_Ok;
 
   Bail:
     FT_FREE( props );
 
   Bail:
     FT_FREE( props );
@@ -566,10 +566,10 @@ THE SOFTWARE.
   pcf_get_metrics( FT_Stream  stream,
                    PCF_Face   face )
   {
   pcf_get_metrics( FT_Stream  stream,
                    PCF_Face   face )
   {
-    FT_Error    error    = PCF_Err_Ok;
-    FT_Memory   memory   = FT_FACE(face)->memory;
+    FT_Error    error;
+    FT_Memory   memory  = FT_FACE( face )->memory;
     FT_ULong    format, size;
     FT_ULong    format, size;
-    PCF_Metric  metrics  = 0;
+    PCF_Metric  metrics = 0;
     FT_ULong    nmetrics, i;
 
 
     FT_ULong    nmetrics, i;
 
 
@@ -587,7 +587,7 @@ THE SOFTWARE.
 
     if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT )     &&
          !PCF_FORMAT_MATCH( format, PCF_COMPRESSED_METRICS ) )
 
     if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT )     &&
          !PCF_FORMAT_MATCH( format, PCF_COMPRESSED_METRICS ) )
-      return PCF_Err_Invalid_File_Format;
+      return FT_THROW( Invalid_File_Format );
 
     if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
     {
 
     if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
     {
@@ -604,12 +604,12 @@ THE SOFTWARE.
         (void)FT_READ_USHORT_LE( nmetrics );
     }
     if ( error )
         (void)FT_READ_USHORT_LE( nmetrics );
     }
     if ( error )
-      return PCF_Err_Invalid_File_Format;
+      return FT_THROW( Invalid_File_Format );
 
     face->nmetrics = nmetrics;
 
     if ( !nmetrics )
 
     face->nmetrics = nmetrics;
 
     if ( !nmetrics )
-      return PCF_Err_Invalid_Table;
+      return FT_THROW( Invalid_Table );
 
     FT_TRACE4(( "pcf_get_metrics:\n" ));
 
 
     FT_TRACE4(( "pcf_get_metrics:\n" ));
 
@@ -619,16 +619,16 @@ THE SOFTWARE.
     if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
     {
       if ( nmetrics > size / PCF_METRIC_SIZE )
     if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
     {
       if ( nmetrics > size / PCF_METRIC_SIZE )
-        return PCF_Err_Invalid_Table;
+        return FT_THROW( Invalid_Table );
     }
     else
     {
       if ( nmetrics > size / PCF_COMPRESSED_METRIC_SIZE )
     }
     else
     {
       if ( nmetrics > size / PCF_COMPRESSED_METRIC_SIZE )
-        return PCF_Err_Invalid_Table;
+        return FT_THROW( Invalid_Table );
     }
 
     if ( FT_NEW_ARRAY( face->metrics, nmetrics ) )
     }
 
     if ( FT_NEW_ARRAY( face->metrics, nmetrics ) )
-      return PCF_Err_Out_Of_Memory;
+      return FT_THROW( Out_Of_Memory );
 
     metrics = face->metrics;
     for ( i = 0; i < nmetrics; i++ )
 
     metrics = face->metrics;
     for ( i = 0; i < nmetrics; i++ )
@@ -663,9 +663,9 @@ THE SOFTWARE.
   pcf_get_bitmaps( FT_Stream  stream,
                    PCF_Face   face )
   {
   pcf_get_bitmaps( FT_Stream  stream,
                    PCF_Face   face )
   {
-    FT_Error   error  = PCF_Err_Ok;
-    FT_Memory  memory = FT_FACE(face)->memory;
-    FT_Long*   offsets;
+    FT_Error   error;
+    FT_Memory  memory  = FT_FACE( face )->memory;
+    FT_Long*   offsets = NULL;
     FT_Long    bitmapSizes[GLYPHPADOPTIONS];
     FT_ULong   format, size;
     FT_ULong   nbitmaps, i, sizebitmaps = 0;
     FT_Long    bitmapSizes[GLYPHPADOPTIONS];
     FT_ULong   format, size;
     FT_ULong   nbitmaps, i, sizebitmaps = 0;
@@ -693,7 +693,7 @@ THE SOFTWARE.
     FT_Stream_ExitFrame( stream );
 
     if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
     FT_Stream_ExitFrame( stream );
 
     if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
-      return PCF_Err_Invalid_File_Format;
+      return FT_THROW( Invalid_File_Format );
 
     FT_TRACE4(( "pcf_get_bitmaps:\n" ));
 
 
     FT_TRACE4(( "pcf_get_bitmaps:\n" ));
 
@@ -701,7 +701,7 @@ THE SOFTWARE.
 
     /* XXX: PCF_Face->nmetrics is singed FT_Long, see pcf.h */
     if ( face->nmetrics < 0 || nbitmaps != ( FT_ULong )face->nmetrics )
 
     /* XXX: PCF_Face->nmetrics is singed FT_Long, see pcf.h */
     if ( face->nmetrics < 0 || nbitmaps != ( FT_ULong )face->nmetrics )
-      return PCF_Err_Invalid_File_Format;
+      return FT_THROW( Invalid_File_Format );
 
     if ( FT_NEW_ARRAY( offsets, nbitmaps ) )
       return error;
 
     if ( FT_NEW_ARRAY( offsets, nbitmaps ) )
       return error;
@@ -765,14 +765,14 @@ THE SOFTWARE.
   pcf_get_encodings( FT_Stream  stream,
                      PCF_Face   face )
   {
   pcf_get_encodings( FT_Stream  stream,
                      PCF_Face   face )
   {
-    FT_Error      error  = PCF_Err_Ok;
-    FT_Memory     memory = FT_FACE(face)->memory;
+    FT_Error      error;
+    FT_Memory     memory = FT_FACE( face )->memory;
     FT_ULong      format, size;
     int           firstCol, lastCol;
     int           firstRow, lastRow;
     int           nencoding, encodingOffset;
     FT_ULong      format, size;
     int           firstCol, lastCol;
     int           firstRow, lastRow;
     int           nencoding, encodingOffset;
-    int           i, j;
-    PCF_Encoding  tmpEncoding, encoding = 0;
+    int           i, j, k;
+    PCF_Encoding  encoding = NULL;
 
 
     error = pcf_seek_to_table_type( stream,
 
 
     error = pcf_seek_to_table_type( stream,
@@ -810,7 +810,7 @@ THE SOFTWARE.
     FT_Stream_ExitFrame( stream );
 
     if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
     FT_Stream_ExitFrame( stream );
 
     if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
-      return PCF_Err_Invalid_File_Format;
+      return FT_THROW( Invalid_File_Format );
 
     FT_TRACE4(( "pdf_get_encodings:\n" ));
 
 
     FT_TRACE4(( "pdf_get_encodings:\n" ));
 
@@ -819,56 +819,47 @@ THE SOFTWARE.
 
     nencoding = ( lastCol - firstCol + 1 ) * ( lastRow - firstRow + 1 );
 
 
     nencoding = ( lastCol - firstCol + 1 ) * ( lastRow - firstRow + 1 );
 
-    if ( FT_NEW_ARRAY( tmpEncoding, nencoding ) )
-      return PCF_Err_Out_Of_Memory;
+    if ( FT_NEW_ARRAY( encoding, nencoding ) )
+      return FT_THROW( Out_Of_Memory );
 
     error = FT_Stream_EnterFrame( stream, 2 * nencoding );
     if ( error )
       goto Bail;
 
 
     error = FT_Stream_EnterFrame( stream, 2 * nencoding );
     if ( error )
       goto Bail;
 
-    for ( i = 0, j = 0 ; i < nencoding; i++ )
+    k = 0;
+    for ( i = firstRow; i <= lastRow; i++ )
     {
     {
-      if ( PCF_BYTE_ORDER( format ) == MSBFirst )
-        encodingOffset = FT_GET_SHORT();
-      else
-        encodingOffset = FT_GET_SHORT_LE();
-
-      if ( encodingOffset != -1 )
+      for ( j = firstCol; j <= lastCol; j++ )
       {
       {
-        tmpEncoding[j].enc = ( ( ( i / ( lastCol - firstCol + 1 ) ) +
-                                 firstRow ) * 256 ) +
-                               ( ( i % ( lastCol - firstCol + 1 ) ) +
-                                 firstCol );
+        if ( PCF_BYTE_ORDER( format ) == MSBFirst )
+          encodingOffset = FT_GET_SHORT();
+        else
+          encodingOffset = FT_GET_SHORT_LE();
 
 
-        tmpEncoding[j].glyph = (FT_Short)encodingOffset;
+        if ( encodingOffset != -1 )
+        {
+          encoding[k].enc   = i * 256 + j;
+          encoding[k].glyph = (FT_Short)encodingOffset;
 
 
-        FT_TRACE5(( "  code %d (0x%04X): idx %d\n",
-                    tmpEncoding[j].enc, tmpEncoding[j].enc,
-                    tmpEncoding[j].glyph ));
+          FT_TRACE5(( "  code %d (0x%04X): idx %d\n",
+                      encoding[k].enc, encoding[k].enc, encoding[k].glyph ));
 
 
-        j++;
+          k++;
+        }
       }
     }
     FT_Stream_ExitFrame( stream );
 
       }
     }
     FT_Stream_ExitFrame( stream );
 
-    if ( FT_NEW_ARRAY( encoding, j ) )
+    if ( FT_RENEW_ARRAY( encoding, nencoding, k ) )
       goto Bail;
 
       goto Bail;
 
-    for ( i = 0; i < j; i++ )
-    {
-      encoding[i].enc   = tmpEncoding[i].enc;
-      encoding[i].glyph = tmpEncoding[i].glyph;
-    }
-
-    face->nencodings = j;
+    face->nencodings = k;
     face->encodings  = encoding;
     face->encodings  = encoding;
-    FT_FREE( tmpEncoding );
 
     return error;
 
   Bail:
     FT_FREE( encoding );
 
     return error;
 
   Bail:
     FT_FREE( encoding );
-    FT_FREE( tmpEncoding );
     return error;
   }
 
     return error;
   }
 
@@ -923,7 +914,7 @@ THE SOFTWARE.
                  FT_ULong   type )
   {
     FT_ULong   format, size;
                  FT_ULong   type )
   {
     FT_ULong   format, size;
-    FT_Error   error = PCF_Err_Ok;
+    FT_Error   error;
     PCF_Accel  accel = &face->accel;
 
 
     PCF_Accel  accel = &face->accel;
 
 
@@ -994,7 +985,7 @@ THE SOFTWARE.
   static FT_Error
   pcf_interpret_style( PCF_Face  pcf )
   {
   static FT_Error
   pcf_interpret_style( PCF_Face  pcf )
   {
-    FT_Error   error  = PCF_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
     FT_Face    face   = FT_FACE( pcf );
     FT_Memory  memory = face->memory;
 
     FT_Face    face   = FT_FACE( pcf );
     FT_Memory  memory = face->memory;
 
@@ -1023,20 +1014,20 @@ THE SOFTWARE.
          ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) )
     {
       face->style_flags |= FT_STYLE_FLAG_BOLD;
          ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) )
     {
       face->style_flags |= FT_STYLE_FLAG_BOLD;
-      strings[1] = (char *)"Bold";
+      strings[1] = (char*)"Bold";
     }
 
     prop = pcf_find_property( pcf, "SETWIDTH_NAME" );
     if ( prop && prop->isString                                        &&
          *(prop->value.atom)                                           &&
          !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )
     }
 
     prop = pcf_find_property( pcf, "SETWIDTH_NAME" );
     if ( prop && prop->isString                                        &&
          *(prop->value.atom)                                           &&
          !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )
-      strings[3] = (char *)(prop->value.atom);
+      strings[3] = (char*)( prop->value.atom );
 
     prop = pcf_find_property( pcf, "ADD_STYLE_NAME" );
     if ( prop && prop->isString                                        &&
          *(prop->value.atom)                                           &&
          !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )
 
     prop = pcf_find_property( pcf, "ADD_STYLE_NAME" );
     if ( prop && prop->isString                                        &&
          *(prop->value.atom)                                           &&
          !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )
-      strings[0] = (char *)(prop->value.atom);
+      strings[0] = (char*)( prop->value.atom );
 
     for ( len = 0, nn = 0; nn < 4; nn++ )
     {
 
     for ( len = 0, nn = 0; nn < 4; nn++ )
     {
@@ -1050,7 +1041,7 @@ THE SOFTWARE.
 
     if ( len == 0 )
     {
 
     if ( len == 0 )
     {
-      strings[0] = (char *)"Regular";
+      strings[0] = (char*)"Regular";
       lengths[0] = ft_strlen( strings[0] );
       len        = lengths[0] + 1;
     }
       lengths[0] = ft_strlen( strings[0] );
       len        = lengths[0] + 1;
     }
@@ -1088,7 +1079,7 @@ THE SOFTWARE.
 
 
           for ( mm = 0; mm < len; mm++ )
 
 
           for ( mm = 0; mm < len; mm++ )
-            if (s[mm] == ' ')
+            if ( s[mm] == ' ' )
               s[mm] = '-';
         }
 
               s[mm] = '-';
         }
 
@@ -1105,8 +1096,8 @@ THE SOFTWARE.
   pcf_load_font( FT_Stream  stream,
                  PCF_Face   face )
   {
   pcf_load_font( FT_Stream  stream,
                  PCF_Face   face )
   {
-    FT_Error   error  = PCF_Err_Ok;
-    FT_Memory  memory = FT_FACE(face)->memory;
+    FT_Error   error  = FT_Err_Ok;
+    FT_Memory  memory = FT_FACE( face )->memory;
     FT_Bool    hasBDFAccelerators;
 
 
     FT_Bool    hasBDFAccelerators;
 
 
@@ -1268,7 +1259,7 @@ THE SOFTWARE.
     {
       /* This is done to respect the behaviour of the original */
       /* PCF font driver.                                      */
     {
       /* This is done to respect the behaviour of the original */
       /* PCF font driver.                                      */
-      error = PCF_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
     }
 
     return error;
     }
 
     return error;
diff --git a/reactos/lib/3rdparty/freetype/src/pfr/Jamfile b/reactos/lib/3rdparty/freetype/src/pfr/Jamfile
deleted file mode 100644 (file)
index 9e2f2b8..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/pfr Jamfile
-#
-# Copyright 2002 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) pfr ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = pfrdrivr pfrgload pfrload pfrobjs pfrcmap pfrsbit ;
-  }
-  else
-  {
-    _sources = pfr ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/pfr Jamfile
index 9c8f9ed..740c433 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR cmap handling (body).                                   */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType PFR cmap handling (body).                                   */
 /*                                                                         */
-/*  Copyright 2002, 2007, 2009 by                                          */
+/*  Copyright 2002, 2007, 2009, 2013 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -16,6 +16,8 @@
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
 #include "pfrcmap.h"
 #include "pfrobjs.h"
 
 #include "pfrcmap.h"
 #include "pfrobjs.h"
 
@@ -25,7 +27,7 @@
   FT_CALLBACK_DEF( FT_Error )
   pfr_cmap_init( PFR_CMap  cmap )
   {
   FT_CALLBACK_DEF( FT_Error )
   pfr_cmap_init( PFR_CMap  cmap )
   {
-    FT_Error  error = PFR_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     PFR_Face  face  = (PFR_Face)FT_CMAP_FACE( cmap );
 
 
     PFR_Face  face  = (PFR_Face)FT_CMAP_FACE( cmap );
 
 
@@ -42,7 +44,7 @@
       {
         if ( cmap->chars[n - 1].char_code >= cmap->chars[n].char_code )
         {
       {
         if ( cmap->chars[n - 1].char_code >= cmap->chars[n].char_code )
         {
-          error = PFR_Err_Invalid_Table;
+          error = FT_THROW( Invalid_Table );
           goto Exit;
         }
       }
           goto Exit;
         }
       }
index 0053050..4c43947 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR driver interface (body).                                */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType PFR driver interface (body).                                */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2006, 2008, 2010 by                        */
+/*  Copyright 2002-2004, 2006, 2008, 2010, 2011, 2013 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -51,7 +51,7 @@
                                             phys->metrics_resolution );
     }
 
                                             phys->metrics_resolution );
     }
 
-    return PFR_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
@@ -66,7 +66,7 @@
                    FT_Pos   *anadvance )
   {
     PFR_Face  face  = (PFR_Face)pfrface;
                    FT_Pos   *anadvance )
   {
     PFR_Face  face  = (PFR_Face)pfrface;
-    FT_Error  error = PFR_Err_Invalid_Argument;
+    FT_Error  error = FT_ERR( Invalid_Argument );
 
 
     *anadvance = 0;
 
 
     *anadvance = 0;
@@ -84,7 +84,7 @@
       if ( gindex < phys->num_chars )
       {
         *anadvance = phys->chars[gindex].advance;
       if ( gindex < phys->num_chars )
       {
         *anadvance = phys->chars[gindex].advance;
-        error = PFR_Err_Ok;
+        error      = FT_Err_Ok;
       }
     }
 
       }
     }
 
     if ( ametrics_y_scale )
       *ametrics_y_scale = y_scale;
 
     if ( ametrics_y_scale )
       *ametrics_y_scale = y_scale;
 
-    return PFR_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
       FT_MODULE_FONT_DRIVER     |
       FT_MODULE_DRIVER_SCALABLE,
 
       FT_MODULE_FONT_DRIVER     |
       FT_MODULE_DRIVER_SCALABLE,
 
-      sizeof( FT_DriverRec ),
+      sizeof ( FT_DriverRec ),
 
       "pfr",
       0x10000L,
 
       "pfr",
       0x10000L,
 
       NULL,
 
 
       NULL,
 
-      0,
-      0,
+      0,                /* FT_Module_Constructor */
+      0,                /* FT_Module_Destructor  */
       pfr_get_service
     },
 
       pfr_get_service
     },
 
-    sizeof( PFR_FaceRec ),
-    sizeof( PFR_SizeRec ),
-    sizeof( PFR_SlotRec ),
+    sizeof ( PFR_FaceRec ),
+    sizeof ( PFR_SizeRec ),
+    sizeof ( PFR_SlotRec ),
 
     pfr_face_init,
     pfr_face_done,
 
     pfr_face_init,
     pfr_face_done,
     pfr_slot_init,
     pfr_slot_done,
 
     pfr_slot_init,
     pfr_slot_done,
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    ft_stub_set_char_sizes,
-    ft_stub_set_pixel_sizes,
-#endif
     pfr_slot_load,
 
     pfr_get_kerning,
     0,                  /* FT_Face_AttachFunc      */
     pfr_slot_load,
 
     pfr_get_kerning,
     0,                  /* FT_Face_AttachFunc      */
-    0,                   /* FT_Face_GetAdvancesFunc */
-    0,                  /* FT_Size_RequestFunc */
-    0,                  /* FT_Size_SelectFunc  */
+    0,                  /* FT_Face_GetAdvancesFunc */
+    0,                  /* FT_Size_RequestFunc     */
+    0,                  /* FT_Size_SelectFunc      */
   };
 
 
   };
 
 
index da0a1aa..75f86c5 100644 (file)
@@ -28,7 +28,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
-#endif 
+#endif
 
 
   FT_EXPORT_VAR( const FT_Driver_ClassRec )  pfr_driver_class;
 
 
   FT_EXPORT_VAR( const FT_Driver_ClassRec )  pfr_driver_class;
index 2e1c401..94dc8c5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PFR error codes (specification only).                                */
 /*                                                                         */
 /*                                                                         */
 /*    PFR error codes (specification only).                                */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,6 +29,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  PFR_Err_
 #define FT_ERR_BASE    FT_Mod_Err_PFR
 
 #define FT_ERR_PREFIX  PFR_Err_
 #define FT_ERR_BASE    FT_Mod_Err_PFR
 
index 6f65b01..88b4d66 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR glyph loader (body).                                    */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType PFR glyph loader (body).                                    */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2005, 2007, 2010 by                              */
+/*  Copyright 2002, 2003, 2005, 2007, 2010, 2013 by                        */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     /* check that we have begun a new path */
     if ( !glyph->path_begun )
     {
     /* check that we have begun a new path */
     if ( !glyph->path_begun )
     {
-      error = PFR_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
       FT_ERROR(( "pfr_glyph_line_to: invalid glyph data\n" ));
       goto Exit;
     }
       FT_ERROR(( "pfr_glyph_line_to: invalid glyph data\n" ));
       goto Exit;
     }
     /* check that we have begun a new path */
     if ( !glyph->path_begun )
     {
     /* check that we have begun a new path */
     if ( !glyph->path_begun )
     {
-      error = PFR_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
       FT_ERROR(( "pfr_glyph_line_to: invalid glyph data\n" ));
       goto Exit;
     }
       FT_ERROR(( "pfr_glyph_line_to: invalid glyph data\n" ));
       goto Exit;
     }
                          FT_Byte*   p,
                          FT_Byte*   limit )
   {
                          FT_Byte*   p,
                          FT_Byte*   limit )
   {
-    FT_Error   error  = PFR_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
     FT_Memory  memory = glyph->loader->memory;
     FT_UInt    flags, x_count, y_count, i, count, mask;
     FT_Int     x;
     FT_Memory  memory = glyph->loader->memory;
     FT_UInt    flags, x_count, y_count, i, count, mask;
     FT_Int     x;
 
   Failure:
   Too_Short:
 
   Failure:
   Too_Short:
-    error = PFR_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     FT_ERROR(( "pfr_glyph_load_simple: invalid glyph data\n" ));
     goto Exit;
   }
     FT_ERROR(( "pfr_glyph_load_simple: invalid glyph data\n" ));
     goto Exit;
   }
                            FT_Byte*   p,
                            FT_Byte*   limit )
   {
                            FT_Byte*   p,
                            FT_Byte*   limit )
   {
-    FT_Error        error  = PFR_Err_Ok;
+    FT_Error        error  = FT_Err_Ok;
     FT_GlyphLoader  loader = glyph->loader;
     FT_Memory       memory = loader->memory;
     PFR_SubGlyph    subglyph;
     FT_GlyphLoader  loader = glyph->loader;
     FT_Memory       memory = loader->memory;
     PFR_SubGlyph    subglyph;
       /* to avoid endless recursion                   */
       if ( new_max > 64 )
       {
       /* to avoid endless recursion                   */
       if ( new_max > 64 )
       {
-        error = PFR_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         FT_ERROR(( "pfr_glyph_load_compound:"
                    " too many compound glyphs components\n" ));
         goto Exit;
         FT_ERROR(( "pfr_glyph_load_compound:"
                    " too many compound glyphs components\n" ));
         goto Exit;
 
   Failure:
   Too_Short:
 
   Failure:
   Too_Short:
-    error = PFR_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     FT_ERROR(( "pfr_glyph_load_compound: invalid glyph data\n" ));
     goto Exit;
   }
     FT_ERROR(( "pfr_glyph_load_compound: invalid glyph data\n" ));
     goto Exit;
   }
index e919fa5..c19fceb 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR loader (body).                                          */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType PFR loader (body).                                          */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010 by                  */
+/*  Copyright 2002-2005, 2007, 2009, 2010, 2013 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -49,7 +49,7 @@
                          PFR_ExtraItem   item_list,
                          FT_Pointer      item_data )
   {
                          PFR_ExtraItem   item_list,
                          FT_Pointer      item_data )
   {
-    FT_Error  error = PFR_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_Byte*  p     = *pp;
     FT_UInt   num_items, item_type, item_size;
 
     FT_Byte*  p     = *pp;
     FT_UInt   num_items, item_type, item_size;
 
@@ -91,7 +91,7 @@
 
   Too_Short:
     FT_ERROR(( "pfr_extra_items_parse: invalid extra items table\n" ));
 
   Too_Short:
     FT_ERROR(( "pfr_extra_items_parse: invalid extra items table\n" ));
-    error = PFR_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     goto Exit;
   }
 
     goto Exit;
   }
 
       goto Exit;
 
     if ( idx >= num_log_fonts )
       goto Exit;
 
     if ( idx >= num_log_fonts )
-      return PFR_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( FT_STREAM_SKIP( idx * 5 ) ||
          FT_READ_USHORT( size )    ||
 
     if ( FT_STREAM_SKIP( idx * 5 ) ||
          FT_READ_USHORT( size )    ||
 
   Too_Short:
     FT_ERROR(( "pfr_log_font_load: invalid logical font table\n" ));
 
   Too_Short:
     FT_ERROR(( "pfr_log_font_load: invalid logical font table\n" ));
-    error = PFR_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     goto Fail;
   }
 
     goto Fail;
   }
 
     PFR_Strike  strike;
     FT_UInt     flags0;
     FT_UInt     n, count, size1;
     PFR_Strike  strike;
     FT_UInt     flags0;
     FT_UInt     n, count, size1;
-    FT_Error    error = PFR_Err_Ok;
+    FT_Error    error = FT_Err_Ok;
 
 
     PFR_CHECK( 5 );
 
 
     PFR_CHECK( 5 );
     return error;
 
   Too_Short:
     return error;
 
   Too_Short:
-    error = PFR_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     FT_ERROR(( "pfr_extra_item_load_bitmap_info:"
                " invalid bitmap info table\n" ));
     goto Exit;
     FT_ERROR(( "pfr_extra_item_load_bitmap_info:"
                " invalid bitmap info table\n" ));
     goto Exit;
                                FT_Byte*     limit,
                                PFR_PhyFont  phy_font )
   {
                                FT_Byte*     limit,
                                PFR_PhyFont  phy_font )
   {
-    FT_Error    error  = PFR_Err_Ok;
+    FT_Error    error  = FT_Err_Ok;
     FT_Memory   memory = phy_font->memory;
     FT_PtrDist  len    = limit - p;
 
     FT_Memory   memory = phy_font->memory;
     FT_PtrDist  len    = limit - p;
 
                                   PFR_PhyFont  phy_font )
   {
     FT_UInt    count, num_vert, num_horz;
                                   PFR_PhyFont  phy_font )
   {
     FT_UInt    count, num_vert, num_horz;
-    FT_Int*    snaps;
-    FT_Error   error  = PFR_Err_Ok;
+    FT_Int*    snaps  = NULL;
+    FT_Error   error  = FT_Err_Ok;
     FT_Memory  memory = phy_font->memory;
 
 
     FT_Memory  memory = phy_font->memory;
 
 
     return error;
 
   Too_Short:
     return error;
 
   Too_Short:
-    error = PFR_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     FT_ERROR(( "pfr_exta_item_load_stem_snaps:"
                " invalid stem snaps table\n" ));
     goto Exit;
     FT_ERROR(( "pfr_exta_item_load_stem_snaps:"
                " invalid stem snaps table\n" ));
     goto Exit;
                                      PFR_PhyFont  phy_font )
   {
     PFR_KernItem  item   = NULL;
                                      PFR_PhyFont  phy_font )
   {
     PFR_KernItem  item   = NULL;
-    FT_Error      error  = PFR_Err_Ok;
+    FT_Error      error  = FT_Err_Ok;
     FT_Memory     memory = phy_font->memory;
 
 
     FT_Memory     memory = phy_font->memory;
 
 
   Too_Short:
     FT_FREE( item );
 
   Too_Short:
     FT_FREE( item );
 
-    error = PFR_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     FT_ERROR(( "pfr_extra_item_load_kerning_pairs:"
                " invalid kerning pairs table\n" ));
     goto Exit;
     FT_ERROR(( "pfr_extra_item_load_kerning_pairs:"
                " invalid kerning pairs table\n" ));
     goto Exit;
                      FT_Memory    memory,
                      FT_String*  *astring )
   {
                      FT_Memory    memory,
                      FT_String*  *astring )
   {
-    FT_Error    error = PFR_Err_Ok;
+    FT_Error    error  = FT_Err_Ok;
     FT_String*  result = NULL;
     FT_UInt     n, ok;
 
     FT_String*  result = NULL;
     FT_UInt     n, ok;
 
     return error;
 
   Too_Short:
     return error;
 
   Too_Short:
-    error = PFR_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     FT_ERROR(( "pfr_phy_font_load: invalid physical font table\n" ));
     goto Fail;
   }
     FT_ERROR(( "pfr_phy_font_load: invalid physical font table\n" ));
     goto Fail;
   }
index 3e5e86e..75fc4c3 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR object methods (body).                                  */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType PFR object methods (body).                                  */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by            */
+/*  Copyright 2002-2008, 2010-2011, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -23,7 +23,7 @@
 #include "pfrsbit.h"
 #include FT_OUTLINE_H
 #include FT_INTERNAL_DEBUG_H
 #include "pfrsbit.h"
 #include FT_OUTLINE_H
 #include FT_INTERNAL_DEBUG_H
-#include FT_TRUETYPE_IDS_H 
+#include FT_TRUETYPE_IDS_H
 
 #include "pfrerror.h"
 
 
 #include "pfrerror.h"
 
@@ -77,6 +77,8 @@
     FT_UNUSED( params );
 
 
     FT_UNUSED( params );
 
 
+    FT_TRACE2(( "PFR driver\n" ));
+
     /* load the header and check it */
     error = pfr_header_load( &face->header, stream );
     if ( error )
     /* load the header and check it */
     error = pfr_header_load( &face->header, stream );
     if ( error )
@@ -84,8 +86,8 @@
 
     if ( !pfr_header_check( &face->header ) )
     {
 
     if ( !pfr_header_check( &face->header ) )
     {
-      FT_TRACE4(( "pfr_face_init: not a valid PFR font\n" ));
-      error = PFR_Err_Unknown_File_Format;
+      FT_TRACE2(( "  not a PFR font\n" ));
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
     if ( face_index >= pfrface->num_faces )
     {
       FT_ERROR(( "pfr_face_init: invalid face index\n" ));
     if ( face_index >= pfrface->num_faces )
     {
       FT_ERROR(( "pfr_face_init: invalid face index\n" ));
-      error = PFR_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
           else
           {
             FT_ERROR(( "pfr_face_init: font doesn't contain glyphs\n" ));
           else
           {
             FT_ERROR(( "pfr_face_init: font doesn't contain glyphs\n" ));
-            error = PFR_Err_Invalid_File_Format;
+            error = FT_THROW( Invalid_File_Format );
             goto Exit;
           }
         }
             goto Exit;
           }
         }
 
     if ( !face || gindex >= face->phy_font.num_chars )
     {
 
     if ( !face || gindex >= face->phy_font.num_chars )
     {
-      error = PFR_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
     if ( load_flags & FT_LOAD_SBITS_ONLY )
     {
 
     if ( load_flags & FT_LOAD_SBITS_ONLY )
     {
-      error = PFR_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
                         FT_Vector*  kerning )
   {
     PFR_Face     face     = (PFR_Face)pfrface;
                         FT_Vector*  kerning )
   {
     PFR_Face     face     = (PFR_Face)pfrface;
-    FT_Error     error    = PFR_Err_Ok;
+    FT_Error     error    = FT_Err_Ok;
     PFR_PhyFont  phy_font = &face->phy_font;
     FT_UInt32    code1, code2, pair;
 
     PFR_PhyFont  phy_font = &face->phy_font;
     FT_UInt32    code1, code2, pair;
 
index 52bc2c8..2da1500 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR bitmap loader (body).                                   */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType PFR bitmap loader (body).                                   */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2006, 2009, 2010 by                              */
+/*  Copyright 2002, 2003, 2006, 2009, 2010, 2013 by                        */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
                            FT_Long   *aadvance,
                            FT_UInt   *aformat )
   {
                            FT_Long   *aadvance,
                            FT_UInt   *aformat )
   {
-    FT_Error  error = PFR_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_Byte   flags;
     FT_Char   b;
     FT_Byte*  p = *pdata;
     FT_Byte   flags;
     FT_Char   b;
     FT_Byte*  p = *pdata;
     return error;
 
   Too_Short:
     return error;
 
   Too_Short:
-    error = PFR_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     FT_ERROR(( "pfr_load_bitmap_metrics: invalid glyph data\n" ));
     goto Exit;
   }
     FT_ERROR(( "pfr_load_bitmap_metrics: invalid glyph data\n" ));
     goto Exit;
   }
                         FT_Bool     decreasing,
                         FT_Bitmap*  target )
   {
                         FT_Bool     decreasing,
                         FT_Bitmap*  target )
   {
-    FT_Error          error = PFR_Err_Ok;
+    FT_Error          error = FT_Err_Ok;
     PFR_BitWriterRec  writer;
 
 
     PFR_BitWriterRec  writer;
 
 
 
       default:
         FT_ERROR(( "pfr_read_bitmap_data: invalid image type\n" ));
 
       default:
         FT_ERROR(( "pfr_read_bitmap_data: invalid image type\n" ));
-        error = PFR_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
       }
     }
 
       }
     }
 
       }
 
       /* couldn't find it */
       }
 
       /* couldn't find it */
-      return PFR_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
     }
 
   Found_Strike:
     }
 
   Found_Strike:
       if ( gps_size == 0 )
       {
         /* Could not find a bitmap program string for this glyph */
       if ( gps_size == 0 )
       {
         /* Could not find a bitmap program string for this glyph */
-        error = PFR_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Exit;
       }
     }
         goto Exit;
       }
     }
         FT_TRACE1(( "pfr_slot_load_bitmap:" ));
         FT_TRACE1(( "huge bitmap glyph %dx%d over FT_GlyphSlot\n",
                      xpos, ypos ));
         FT_TRACE1(( "pfr_slot_load_bitmap:" ));
         FT_TRACE1(( "huge bitmap glyph %dx%d over FT_GlyphSlot\n",
                      xpos, ypos ));
-        error = PFR_Err_Invalid_Pixel_Size;
+        error = FT_THROW( Invalid_Pixel_Size );
       }
 
       if ( !error )
       }
 
       if ( !error )
index d7de373..6a40e11 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    AFM parser (body).                                                   */
 /*                                                                         */
 /*                                                                         */
 /*    AFM parser (body).                                                   */
 /*                                                                         */
-/*  Copyright 2006, 2007, 2008, 2009, 2010 by                              */
+/*  Copyright 2006-2010, 2012, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -17,6 +17,7 @@
 
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
 #include <ft2build.h>
 #include FT_FREETYPE_H
+#include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_POSTSCRIPT_AUX_H
 
 #include "afmparse.h"
 #include FT_INTERNAL_POSTSCRIPT_AUX_H
 
 #include "afmparse.h"
   afm_stream_read_one( AFM_Stream  stream )
   {
     char*  str;
   afm_stream_read_one( AFM_Stream  stream )
   {
     char*  str;
-    int    ch;
 
 
     afm_stream_skip_spaces( stream );
 
 
     afm_stream_skip_spaces( stream );
 
     while ( 1 )
     {
 
     while ( 1 )
     {
-      ch = AFM_GETC();
+      int  ch = AFM_GETC();
+
+
       if ( AFM_IS_SPACE( ch ) )
         break;
       else if ( AFM_IS_NEWLINE( ch ) )
       if ( AFM_IS_SPACE( ch ) )
         break;
       else if ( AFM_IS_NEWLINE( ch ) )
   afm_stream_read_string( AFM_Stream  stream )
   {
     char*  str;
   afm_stream_read_string( AFM_Stream  stream )
   {
     char*  str;
-    int    ch;
 
 
     afm_stream_skip_spaces( stream );
 
 
     afm_stream_skip_spaces( stream );
     /* scan to eol */
     while ( 1 )
     {
     /* scan to eol */
     while ( 1 )
     {
-      ch = AFM_GETC();
+      int  ch = AFM_GETC();
+
+
       if ( AFM_IS_NEWLINE( ch ) )
       {
         stream->status = AFM_STREAM_STATUS_EOL;
       if ( AFM_IS_NEWLINE( ch ) )
       {
         stream->status = AFM_STREAM_STATUS_EOL;
     parser->FontInfo  = NULL;
     parser->get_index = NULL;
 
     parser->FontInfo  = NULL;
     parser->get_index = NULL;
 
-    return PSaux_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     {
       *aint = val.u.i;
 
     {
       *aint = val.u.i;
 
-      return PSaux_Err_Ok;
+      return FT_Err_Ok;
     }
     else
     }
     else
-      return PSaux_Err_Syntax_Error;
+      return FT_THROW( Syntax_Error );
   }
 
 
   }
 
 
         tk->max_ptsize = shared_vals[3].u.f;
         tk->max_kern   = shared_vals[4].u.f;
 
         tk->max_ptsize = shared_vals[3].u.f;
         tk->max_kern   = shared_vals[4].u.f;
 
-        /* is this correct? */
-        if ( tk->degree < 0 && tk->min_kern > 0 )
-          tk->min_kern = -tk->min_kern;
         break;
 
       case AFM_TOKEN_ENDTRACKKERN:
       case AFM_TOKEN_ENDKERNDATA:
       case AFM_TOKEN_ENDFONTMETRICS:
         fi->NumTrackKern = n + 1;
         break;
 
       case AFM_TOKEN_ENDTRACKKERN:
       case AFM_TOKEN_ENDKERNDATA:
       case AFM_TOKEN_ENDFONTMETRICS:
         fi->NumTrackKern = n + 1;
-        return PSaux_Err_Ok;
+        return FT_Err_Ok;
 
       case AFM_TOKEN_UNKNOWN:
         break;
 
       case AFM_TOKEN_UNKNOWN:
         break;
     }
 
   Fail:
     }
 
   Fail:
-    return PSaux_Err_Syntax_Error;
+    return FT_THROW( Syntax_Error );
   }
 
 
   }
 
 
       case AFM_TOKEN_ENDFONTMETRICS:
         fi->NumKernPair = n + 1;
         ft_qsort( fi->KernPairs, fi->NumKernPair,
       case AFM_TOKEN_ENDFONTMETRICS:
         fi->NumKernPair = n + 1;
         ft_qsort( fi->KernPairs, fi->NumKernPair,
-                  sizeof( AFM_KernPairRec ),
+                  sizeof ( AFM_KernPairRec ),
                   afm_compare_kern_pairs );
                   afm_compare_kern_pairs );
-        return PSaux_Err_Ok;
+        return FT_Err_Ok;
 
       case AFM_TOKEN_UNKNOWN:
         break;
 
       case AFM_TOKEN_UNKNOWN:
         break;
     }
 
   Fail:
     }
 
   Fail:
-    return PSaux_Err_Syntax_Error;
+    return FT_THROW( Syntax_Error );
   }
 
 
   }
 
 
 
       case AFM_TOKEN_ENDKERNDATA:
       case AFM_TOKEN_ENDFONTMETRICS:
 
       case AFM_TOKEN_ENDKERNDATA:
       case AFM_TOKEN_ENDFONTMETRICS:
-        return PSaux_Err_Ok;
+        return FT_Err_Ok;
 
       case AFM_TOKEN_UNKNOWN:
         break;
 
       case AFM_TOKEN_UNKNOWN:
         break;
     }
 
   Fail:
     }
 
   Fail:
-    return PSaux_Err_Syntax_Error;
+    return FT_THROW( Syntax_Error );
   }
 
 
   }
 
 
 
 
       if ( token == end_section || token == AFM_TOKEN_ENDFONTMETRICS )
 
 
       if ( token == end_section || token == AFM_TOKEN_ENDFONTMETRICS )
-        return PSaux_Err_Ok;
+        return FT_Err_Ok;
     }
 
   Fail:
     }
 
   Fail:
-    return PSaux_Err_Syntax_Error;
+    return FT_THROW( Syntax_Error );
   }
 
 
   }
 
 
   {
     FT_Memory     memory = parser->memory;
     AFM_FontInfo  fi     = parser->FontInfo;
   {
     FT_Memory     memory = parser->memory;
     AFM_FontInfo  fi     = parser->FontInfo;
-    FT_Error      error  = PSaux_Err_Syntax_Error;
+    FT_Error      error  = FT_ERR( Syntax_Error );
     char*         key;
     FT_Offset     len;
     FT_Int        metrics_sets = 0;
 
 
     if ( !fi )
     char*         key;
     FT_Offset     len;
     FT_Int        metrics_sets = 0;
 
 
     if ( !fi )
-      return PSaux_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     key = afm_parser_next_key( parser, 1, &len );
     if ( !key || len != 16                              ||
          ft_strncmp( key, "StartFontMetrics", 16 ) != 0 )
 
     key = afm_parser_next_key( parser, 1, &len );
     if ( !key || len != 16                              ||
          ft_strncmp( key, "StartFontMetrics", 16 ) != 0 )
-      return PSaux_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 
     while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
     {
 
     while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
     {
 
         if ( metrics_sets != 0 && metrics_sets != 2 )
         {
 
         if ( metrics_sets != 0 && metrics_sets != 2 )
         {
-          error = PSaux_Err_Unimplemented_Feature;
+          error = FT_THROW( Unimplemented_Feature );
 
           goto Fail;
         }
 
           goto Fail;
         }
         /* fall through since we only support kern data */
 
       case AFM_TOKEN_ENDFONTMETRICS:
         /* fall through since we only support kern data */
 
       case AFM_TOKEN_ENDFONTMETRICS:
-        return PSaux_Err_Ok;
+        return FT_Err_Ok;
 
       default:
         break;
 
       default:
         break;
index d0baa3c..d52375f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PS auxiliary module error codes (specification only).                */
 /*                                                                         */
 /*                                                                         */
 /*    PS auxiliary module error codes (specification only).                */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,6 +30,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  PSaux_Err_
 #define FT_ERR_BASE    FT_Mod_Err_PSaux
 
 #define FT_ERR_PREFIX  PSaux_Err_
 #define FT_ERR_BASE    FT_Mod_Err_PSaux
 
index 4c3579f..4b1249d 100644 (file)
   const FT_Module_Class  psaux_module_class =
   {
     0,
   const FT_Module_Class  psaux_module_class =
   {
     0,
-    sizeof( FT_ModuleRec ),
+    sizeof ( FT_ModuleRec ),
     "psaux",
     0x20000L,
     0x20000L,
     "psaux",
     0x20000L,
     0x20000L,
index 35e042d..1217236 100644 (file)
@@ -28,7 +28,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
-#endif 
+#endif
 
 
   FT_EXPORT_VAR( const FT_Module_Class )  psaux_driver_class;
 
 
   FT_EXPORT_VAR( const FT_Module_Class )  psaux_driver_class;
index 1531d8f..d0d8861 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Some convenience conversions (body).                                 */
 /*                                                                         */
 /*                                                                         */
 /*    Some convenience conversions (body).                                 */
 /*                                                                         */
-/*  Copyright 2006, 2008, 2009 by                                          */
+/*  Copyright 2006, 2008, 2009, 2012-2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #include <ft2build.h>
 #include FT_INTERNAL_POSTSCRIPT_AUX_H
 
 #include <ft2build.h>
 #include FT_INTERNAL_POSTSCRIPT_AUX_H
+#include FT_INTERNAL_DEBUG_H
 
 #include "psconv.h"
 #include "psauxerr.h"
 
 
 
 #include "psconv.h"
 #include "psauxerr.h"
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_psconv
+
+
   /* The following array is used by various functions to quickly convert */
   /* digits (both decimal and non-decimal) into numbers.                 */
 
   /* The following array is used by various functions to quickly convert */
   /* digits (both decimal and non-decimal) into numbers.                 */
 
 #endif /* 'A' == 193 */
 
 
 #endif /* 'A' == 193 */
 
 
-  FT_LOCAL_DEF( FT_Int )
+  FT_LOCAL_DEF( FT_Long )
   PS_Conv_Strtol( FT_Byte**  cursor,
                   FT_Byte*   limit,
   PS_Conv_Strtol( FT_Byte**  cursor,
                   FT_Byte*   limit,
-                  FT_Int     base )
+                  FT_Long    base )
   {
     FT_Byte*  p = *cursor;
   {
     FT_Byte*  p = *cursor;
-    FT_Int    num = 0;
-    FT_Bool   sign = 0;
 
 
+    FT_Long   num           = 0;
+    FT_Bool   sign          = 0;
+    FT_Bool   have_overflow = 0;
+
+    FT_Long   num_limit;
+    FT_Char   c_limit;
 
 
-    if ( p == limit || base < 2 || base > 36 )
+
+    if ( p >= limit )
+      goto Bad;
+
+    if ( base < 2 || base > 36 )
+    {
+      FT_TRACE4(( "!!!INVALID BASE:!!!" ));
       return 0;
       return 0;
+    }
 
     if ( *p == '-' || *p == '+' )
     {
 
     if ( *p == '-' || *p == '+' )
     {
 
       p++;
       if ( p == limit )
 
       p++;
       if ( p == limit )
-        return 0;
+        goto Bad;
     }
 
     }
 
+    num_limit = 0x7FFFFFFFL / base;
+    c_limit   = (FT_Char)( 0x7FFFFFFFL % base );
+
     for ( ; p < limit; p++ )
     {
       FT_Char  c;
     for ( ; p < limit; p++ )
     {
       FT_Char  c;
       if ( c < 0 || c >= base )
         break;
 
       if ( c < 0 || c >= base )
         break;
 
-      num = num * base + c;
+      if ( num > num_limit || ( num == num_limit && c > c_limit ) )
+        have_overflow = 1;
+      else
+        num = num * base + c;
+    }
+
+    *cursor = p;
+
+    if ( have_overflow )
+    {
+      num = 0x7FFFFFFFL;
+      FT_TRACE4(( "!!!OVERFLOW:!!!" ));
     }
 
     if ( sign )
       num = -num;
 
     }
 
     if ( sign )
       num = -num;
 
-    *cursor = p;
-
     return num;
     return num;
+
+  Bad:
+    FT_TRACE4(( "!!!END OF DATA:!!!" ));
+    return 0;
   }
 
 
   }
 
 
-  FT_LOCAL_DEF( FT_Int )
+  FT_LOCAL_DEF( FT_Long )
   PS_Conv_ToInt( FT_Byte**  cursor,
                  FT_Byte*   limit )
 
   {
   PS_Conv_ToInt( FT_Byte**  cursor,
                  FT_Byte*   limit )
 
   {
-    FT_Byte*  p;
-    FT_Int    num;
+    FT_Byte*  p = *cursor;
+    FT_Byte*  curp;
+
+    FT_Long   num;
 
 
 
 
-    num = PS_Conv_Strtol( cursor, limit, 10 );
-    p   = *cursor;
+    curp = p;
+    num  = PS_Conv_Strtol( &p, limit, 10 );
+
+    if ( p == curp )
+      return 0;
 
     if ( p < limit && *p == '#' )
     {
 
     if ( p < limit && *p == '#' )
     {
-      *cursor = p + 1;
+      p++;
 
 
-      return PS_Conv_Strtol( cursor, limit, num );
+      curp = p;
+      num  = PS_Conv_Strtol( &p, limit, num );
+
+      if ( p == curp )
+        return 0;
     }
     }
-    else
-      return num;
+
+    *cursor = p;
+
+    return num;
   }
 
 
   FT_LOCAL_DEF( FT_Fixed )
   PS_Conv_ToFixed( FT_Byte**  cursor,
                    FT_Byte*   limit,
   }
 
 
   FT_LOCAL_DEF( FT_Fixed )
   PS_Conv_ToFixed( FT_Byte**  cursor,
                    FT_Byte*   limit,
-                   FT_Int     power_ten )
+                   FT_Long    power_ten )
   {
     FT_Byte*  p = *cursor;
   {
     FT_Byte*  p = *cursor;
-    FT_Fixed  integral;
-    FT_Long   decimal = 0, divider = 1;
-    FT_Bool   sign = 0;
+    FT_Byte*  curp;
 
 
+    FT_Fixed  integral = 0;
+    FT_Long   decimal  = 0;
+    FT_Long   divider  = 1;
 
 
-    if ( p == limit )
-      return 0;
+    FT_Bool   sign           = 0;
+    FT_Bool   have_overflow  = 0;
+    FT_Bool   have_underflow = 0;
+
+
+    if ( p >= limit )
+      goto Bad;
 
     if ( *p == '-' || *p == '+' )
     {
 
     if ( *p == '-' || *p == '+' )
     {
 
       p++;
       if ( p == limit )
 
       p++;
       if ( p == limit )
-        return 0;
+        goto Bad;
     }
 
     }
 
+    /* read the integer part */
     if ( *p != '.' )
     if ( *p != '.' )
-      integral = PS_Conv_ToInt( &p, limit ) << 16;
-    else
-      integral = 0;
+    {
+      curp     = p;
+      integral = PS_Conv_ToInt( &p, limit );
+
+      if ( p == curp )
+        return 0;
+
+      if ( integral > 0x7FFF )
+        have_overflow = 1;
+      else
+        integral = (FT_Fixed)( (FT_UInt32)integral << 16 );
+    }
 
     /* read the decimal part */
     if ( p < limit && *p == '.' )
 
     /* read the decimal part */
     if ( p < limit && *p == '.' )
         if ( c < 0 || c >= 10 )
           break;
 
         if ( c < 0 || c >= 10 )
           break;
 
-        if ( !integral && power_ten > 0 )
+        if ( decimal < 0xCCCCCCCL )
         {
         {
-          power_ten--;
           decimal = decimal * 10 + c;
           decimal = decimal * 10 + c;
-        }
-        else
-        {
-          if ( divider < 10000000L )
-          {
-            decimal = decimal * 10 + c;
+
+          if ( !integral && power_ten > 0 )
+            power_ten--;
+          else
             divider *= 10;
             divider *= 10;
-          }
         }
       }
     }
         }
       }
     }
     /* read exponent, if any */
     if ( p + 1 < limit && ( *p == 'e' || *p == 'E' ) )
     {
     /* read exponent, if any */
     if ( p + 1 < limit && ( *p == 'e' || *p == 'E' ) )
     {
+      FT_Long  exponent;
+
+
       p++;
       p++;
-      power_ten += PS_Conv_ToInt( &p, limit );
+
+      curp     = p;
+      exponent = PS_Conv_ToInt( &p, limit );
+
+      if ( curp == p )
+        return 0;
+
+      /* arbitrarily limit exponent */
+      if ( exponent > 1000 )
+        have_overflow = 1;
+      else if ( exponent < -1000 )
+        have_underflow = 1;
+      else
+        power_ten += exponent;
     }
 
     }
 
+    *cursor = p;
+
+    if ( !integral && !decimal )
+      return 0;
+
+    if ( have_overflow )
+      goto Overflow;
+    if ( have_underflow )
+      goto Underflow;
+
     while ( power_ten > 0 )
     {
     while ( power_ten > 0 )
     {
+      if ( integral >= 0xCCCCCCCL )
+        goto Overflow;
       integral *= 10;
       integral *= 10;
-      decimal  *= 10;
+
+      if ( decimal >= 0xCCCCCCCL )
+      {
+        if ( divider == 1 )
+          goto Overflow;
+        divider /= 10;
+      }
+      else
+        decimal *= 10;
+
       power_ten--;
     }
 
     while ( power_ten < 0 )
     {
       integral /= 10;
       power_ten--;
     }
 
     while ( power_ten < 0 )
     {
       integral /= 10;
-      divider  *= 10;
+      if ( divider < 0xCCCCCCCL )
+        divider *= 10;
+      else
+        decimal /= 10;
+
+      if ( !integral && !decimal )
+        goto Underflow;
+
       power_ten++;
     }
 
     if ( decimal )
       power_ten++;
     }
 
     if ( decimal )
-      integral += FT_DivFix( decimal, divider );
+    {
+      decimal = FT_DivFix( decimal, divider );
+      /* it's not necessary to check this addition for overflow */
+      /* due to the structure of the real number representation */
+      integral += decimal;
+    }
 
 
+  Exit:
     if ( sign )
       integral = -integral;
 
     if ( sign )
       integral = -integral;
 
-    *cursor = p;
-
     return integral;
     return integral;
+
+  Bad:
+    FT_TRACE4(( "!!!END OF DATA:!!!" ));
+    return 0;
+
+  Overflow:
+    integral = 0x7FFFFFFFL;
+    FT_TRACE4(( "!!!OVERFLOW:!!!" ));
+    goto Exit;
+
+  Underflow:
+    FT_TRACE4(( "!!!UNDERFLOW:!!!" ));
+    return 0;
   }
 
 
   }
 
 
 
 #if 1
 
 
 #if 1
 
-    p  = *cursor;
+    p = *cursor;
+
+    if ( p >= limit )
+      return 0;
+
     if ( n > (FT_UInt)( limit - p ) )
       n = (FT_UInt)( limit - p );
 
     if ( n > (FT_UInt)( limit - p ) )
       n = (FT_UInt)( limit - p );
 
 #if 1
 
     p = *cursor;
 #if 1
 
     p = *cursor;
+
+    if ( p >= limit )
+      return 0;
+
     if ( n > (FT_UInt)(limit - p) )
       n = (FT_UInt)(limit - p);
 
     if ( n > (FT_UInt)(limit - p) )
       n = (FT_UInt)(limit - p);
 
index 84854ba..d91c762 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Some convenience conversions (specification).                        */
 /*                                                                         */
 /*                                                                         */
 /*    Some convenience conversions (specification).                        */
 /*                                                                         */
-/*  Copyright 2006 by                                                      */
+/*  Copyright 2006, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
 
 
-  FT_LOCAL( FT_Int )
+  FT_LOCAL( FT_Long )
   PS_Conv_Strtol( FT_Byte**  cursor,
                   FT_Byte*   limit,
   PS_Conv_Strtol( FT_Byte**  cursor,
                   FT_Byte*   limit,
-                  FT_Int     base );
+                  FT_Long    base );
 
 
 
 
-  FT_LOCAL( FT_Int )
+  FT_LOCAL( FT_Long )
   PS_Conv_ToInt( FT_Byte**  cursor,
                  FT_Byte*   limit );
 
   FT_LOCAL( FT_Fixed )
   PS_Conv_ToFixed( FT_Byte**  cursor,
                    FT_Byte*   limit,
   PS_Conv_ToInt( FT_Byte**  cursor,
                  FT_Byte*   limit );
 
   FT_LOCAL( FT_Fixed )
   PS_Conv_ToFixed( FT_Byte**  cursor,
                    FT_Byte*   limit,
-                   FT_Int     power_ten );
+                   FT_Long    power_ten );
 
 #if 0
   FT_LOCAL( FT_UInt )
 
 #if 0
   FT_LOCAL( FT_UInt )
index 45c7419..dd976d3 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    Auxiliary functions for PostScript fonts (body).                     */
 /*                                                                         */
 /*                                                                         */
 /*    Auxiliary functions for PostScript fonts (body).                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 
   static FT_Error
 
 
   static FT_Error
-  reallocate_t1_table( PS_Table  table,
-                       FT_Long   new_size )
+  reallocate_t1_table( PS_Table   table,
+                       FT_Offset  new_size )
   {
     FT_Memory  memory   = table->memory;
     FT_Byte*   old_base = table->block;
   {
     FT_Memory  memory   = table->memory;
     FT_Byte*   old_base = table->block;
 
     table->capacity = new_size;
 
 
     table->capacity = new_size;
 
-    return PSaux_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     if ( idx < 0 || idx >= table->max_elems )
     {
       FT_ERROR(( "ps_table_add: invalid index\n" ));
     if ( idx < 0 || idx >= table->max_elems )
     {
       FT_ERROR(( "ps_table_add: invalid index\n" ));
-      return PSaux_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
     }
 
     if ( length < 0 )
     {
       FT_ERROR(( "ps_table_add: invalid length\n" ));
     }
 
     if ( length < 0 )
     {
       FT_ERROR(( "ps_table_add: invalid length\n" ));
-      return PSaux_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
     }
 
     /* grow the base block if needed */
     if ( table->cursor + length > table->capacity )
     {
     }
 
     /* grow the base block if needed */
     if ( table->cursor + length > table->capacity )
     {
-      FT_Error   error;
-      FT_Offset  new_size = table->capacity;
-      FT_Long    in_offset;
+      FT_Error    error;
+      FT_Offset   new_size = table->capacity;
+      FT_PtrDist  in_offset;
 
 
 
 
-      in_offset = (FT_Long)((FT_Byte*)object - table->block);
-      if ( (FT_ULong)in_offset >= table->capacity )
+      in_offset = (FT_Byte*)object - table->block;
+      if ( in_offset < 0 || (FT_Offset)in_offset >= table->capacity )
         in_offset = -1;
 
       while ( new_size < table->cursor + length )
         in_offset = -1;
 
       while ( new_size < table->cursor + length )
     FT_MEM_COPY( table->block + table->cursor, object, length );
 
     table->cursor += length;
     FT_MEM_COPY( table->block + table->cursor, object, length );
 
     table->cursor += length;
-    return PSaux_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   {
     FT_Byte*      cur   = *acur;
     FT_Int        embed = 0;
   {
     FT_Byte*      cur   = *acur;
     FT_Int        embed = 0;
-    FT_Error      error = PSaux_Err_Invalid_File_Format;
+    FT_Error      error = FT_ERR( Invalid_File_Format );
     unsigned int  i;
 
 
     unsigned int  i;
 
 
         embed--;
         if ( embed == 0 )
         {
         embed--;
         if ( embed == 0 )
         {
-          error = PSaux_Err_Ok;
+          error = FT_Err_Ok;
           break;
         }
       }
           break;
         }
       }
                FT_Byte*   limit )
   {
     FT_Byte*  cur = *acur;
                FT_Byte*   limit )
   {
     FT_Byte*  cur = *acur;
-    FT_Error  err =  PSaux_Err_Ok;
+    FT_Error  err =  FT_Err_Ok;
 
 
     while ( ++cur < limit )
 
 
     while ( ++cur < limit )
     if ( cur < limit && *cur != '>' )
     {
       FT_ERROR(( "skip_string: missing closing delimiter `>'\n" ));
     if ( cur < limit && *cur != '>' )
     {
       FT_ERROR(( "skip_string: missing closing delimiter `>'\n" ));
-      err = PSaux_Err_Invalid_File_Format;
+      err = FT_THROW( Invalid_File_Format );
     }
     else
       cur++;
     }
     else
       cur++;
   {
     FT_Byte*  cur;
     FT_Int    embed = 0;
   {
     FT_Byte*  cur;
     FT_Int    embed = 0;
-    FT_Error  error = PSaux_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     FT_ASSERT( **acur == '{' );
 
 
 
     FT_ASSERT( **acur == '{' );
 
-    for ( cur = *acur; cur < limit && error == PSaux_Err_Ok; ++cur )
+    for ( cur = *acur; cur < limit && error == FT_Err_Ok; ++cur )
     {
       switch ( *cur )
       {
     {
       switch ( *cur )
       {
 
   end:
     if ( embed != 0 )
 
   end:
     if ( embed != 0 )
-      error = PSaux_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
 
     *acur = cur;
 
 
     *acur = cur;
 
 
     FT_Byte*  cur   = parser->cursor;
     FT_Byte*  limit = parser->limit;
 
     FT_Byte*  cur   = parser->cursor;
     FT_Byte*  limit = parser->limit;
-    FT_Error  error = PSaux_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     skip_spaces( &cur, limit );             /* this also skips comments */
 
 
     skip_spaces( &cur, limit );             /* this also skips comments */
       {
         FT_ERROR(( "ps_parser_skip_PS_token:"
                    " unexpected closing delimiter `>'\n" ));
       {
         FT_ERROR(( "ps_parser_skip_PS_token:"
                    " unexpected closing delimiter `>'\n" ));
-        error = PSaux_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
       cur++;
         goto Exit;
       }
       cur++;
     }
 
   Exit:
     }
 
   Exit:
-    if ( cur == parser->cursor )
+    if ( cur < limit && cur == parser->cursor )
     {
       FT_ERROR(( "ps_parser_skip_PS_token:"
                  " current token is `%c' which is self-delimiting\n"
     {
       FT_ERROR(( "ps_parser_skip_PS_token:"
                  " current token is `%c' which is self-delimiting\n"
                  " but invalid at this point\n",
                  *cur ));
 
                  " but invalid at this point\n",
                  *cur ));
 
-      error = PSaux_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
     }
 
     parser->error  = error;
     }
 
     parser->error  = error;
       token->type  = T1_TOKEN_TYPE_STRING;
       token->start = cur;
 
       token->type  = T1_TOKEN_TYPE_STRING;
       token->start = cur;
 
-      if ( skip_literal_string( &cur, limit ) == PSaux_Err_Ok )
+      if ( skip_literal_string( &cur, limit ) == FT_Err_Ok )
         token->limit = cur;
       break;
 
         token->limit = cur;
       break;
 
       token->type  = T1_TOKEN_TYPE_ARRAY;
       token->start = cur;
 
       token->type  = T1_TOKEN_TYPE_ARRAY;
       token->start = cur;
 
-      if ( skip_procedure( &cur, limit ) == PSaux_Err_Ok )
+      if ( skip_procedure( &cur, limit ) == FT_Err_Ok )
         token->limit = cur;
       break;
 
         token->limit = cur;
       break;
 
                         FT_UInt         max_objects,
                         FT_ULong*       pflags )
   {
                         FT_UInt         max_objects,
                         FT_ULong*       pflags )
   {
-    T1_TokenRec  token;
-    FT_Byte*     cur;
-    FT_Byte*     limit;
-    FT_UInt      count;
-    FT_UInt      idx;
-    FT_Error     error;
+    T1_TokenRec   token;
+    FT_Byte*      cur;
+    FT_Byte*      limit;
+    FT_UInt       count;
+    FT_UInt       idx;
+    FT_Error      error;
+    T1_FieldType  type;
 
 
     /* this also skips leading whitespace */
 
 
     /* this also skips leading whitespace */
     cur   = token.start;
     limit = token.limit;
 
     cur   = token.start;
     limit = token.limit;
 
+    type = field->type;
+
     /* we must detect arrays in /FontBBox */
     /* we must detect arrays in /FontBBox */
-    if ( field->type == T1_FIELD_TYPE_BBOX )
+    if ( type == T1_FIELD_TYPE_BBOX )
     {
       T1_TokenRec  token2;
       FT_Byte*     old_cur   = parser->cursor;
     {
       T1_TokenRec  token2;
       FT_Byte*     old_cur   = parser->cursor;
       parser->limit  = old_limit;
 
       if ( token2.type == T1_TOKEN_TYPE_ARRAY )
       parser->limit  = old_limit;
 
       if ( token2.type == T1_TOKEN_TYPE_ARRAY )
+      {
+        type = T1_FIELD_TYPE_MM_BBOX;
         goto FieldArray;
         goto FieldArray;
+      }
     }
     else if ( token.type == T1_TOKEN_TYPE_ARRAY )
     {
     }
     else if ( token.type == T1_TOKEN_TYPE_ARRAY )
     {
+      count = max_objects;
+
     FieldArray:
       /* if this is an array and we have no blend, an error occurs */
       if ( max_objects == 0 )
         goto Fail;
 
     FieldArray:
       /* if this is an array and we have no blend, an error occurs */
       if ( max_objects == 0 )
         goto Fail;
 
-      count = max_objects;
-      idx   = 1;
+      idx = 1;
 
       /* don't include delimiters */
       cur++;
 
       /* don't include delimiters */
       cur++;
 
       skip_spaces( &cur, limit );
 
 
       skip_spaces( &cur, limit );
 
-      switch ( field->type )
+      switch ( type )
       {
       case T1_FIELD_TYPE_BOOL:
         val = ps_tobool( &cur, limit );
       {
       case T1_FIELD_TYPE_BOOL:
         val = ps_tobool( &cur, limit );
                        "                     "
                        " but found token of type %d instead\n",
                        token.type ));
                        "                     "
                        " but found token of type %d instead\n",
                        token.type ));
-            error = PSaux_Err_Invalid_File_Format;
+            error = FT_THROW( Invalid_File_Format );
             goto Exit;
           }
 
             goto Exit;
           }
 
           {
             FT_ERROR(( "ps_parser_load_field:"
                        " expected four integers in bounding box\n" ));
           {
             FT_ERROR(( "ps_parser_load_field:"
                        " expected four integers in bounding box\n" ));
-            error = PSaux_Err_Invalid_File_Format;
+            error = FT_THROW( Invalid_File_Format );
             goto Exit;
           }
 
             goto Exit;
           }
 
         }
         break;
 
         }
         break;
 
+      case T1_FIELD_TYPE_MM_BBOX:
+        {
+          FT_Memory  memory = parser->memory;
+          FT_Fixed*  temp;
+          FT_Int     result;
+          FT_UInt    i;
+
+
+          if ( FT_NEW_ARRAY( temp, max_objects * 4 ) )
+            goto Exit;
+
+          for ( i = 0; i < 4; i++ )
+          {
+            result = ps_tofixedarray( &cur, limit, max_objects,
+                                      temp + i * max_objects, 0 );
+            if ( result < 0 )
+            {
+              FT_ERROR(( "ps_parser_load_field:"
+                         " expected %d integers in the %s subarray\n"
+                         "                     "
+                         " of /FontBBox in the /Blend dictionary\n",
+                         max_objects,
+                         i == 0 ? "first"
+                                : ( i == 1 ? "second"
+                                           : ( i == 2 ? "third"
+                                                      : "fourth" ) ) ));
+              error = FT_THROW( Invalid_File_Format );
+              goto Exit;
+            }
+
+            skip_spaces( &cur, limit );
+          }
+
+          for ( i = 0; i < max_objects; i++ )
+          {
+            FT_BBox*  bbox = (FT_BBox*)objects[i];
+
+
+            bbox->xMin = FT_RoundFix( temp[i                  ] );
+            bbox->yMin = FT_RoundFix( temp[i +     max_objects] );
+            bbox->xMax = FT_RoundFix( temp[i + 2 * max_objects] );
+            bbox->yMax = FT_RoundFix( temp[i + 3 * max_objects] );
+          }
+
+          FT_FREE( temp );
+        }
+        break;
+
       default:
         /* an error occurred */
         goto Fail;
       default:
         /* an error occurred */
         goto Fail;
     FT_UNUSED( pflags );
 #endif
 
     FT_UNUSED( pflags );
 #endif
 
-    error = PSaux_Err_Ok;
+    error = FT_Err_Ok;
 
   Exit:
     return error;
 
   Fail:
 
   Exit:
     return error;
 
   Fail:
-    error = PSaux_Err_Invalid_File_Format;
+    error = FT_THROW( Invalid_File_Format );
     goto Exit;
   }
 
     goto Exit;
   }
 
     T1_TokenRec  elements[T1_MAX_TABLE_ELEMENTS];
     T1_Token     token;
     FT_Int       num_elements;
     T1_TokenRec  elements[T1_MAX_TABLE_ELEMENTS];
     T1_Token     token;
     FT_Int       num_elements;
-    FT_Error     error = PSaux_Err_Ok;
+    FT_Error     error = FT_Err_Ok;
     FT_Byte*     old_cursor;
     FT_Byte*     old_limit;
     T1_FieldRec  fieldrec = *(T1_Field)field;
     FT_Byte*     old_cursor;
     FT_Byte*     old_limit;
     T1_FieldRec  fieldrec = *(T1_Field)field;
                               T1_MAX_TABLE_ELEMENTS, &num_elements );
     if ( num_elements < 0 )
     {
                               T1_MAX_TABLE_ELEMENTS, &num_elements );
     if ( num_elements < 0 )
     {
-      error = PSaux_Err_Ignore;
+      error = FT_ERR( Ignore );
       goto Exit;
     }
     if ( (FT_UInt)num_elements > field->array_max )
       goto Exit;
     }
     if ( (FT_UInt)num_elements > field->array_max )
                       FT_Long*   pnum_bytes,
                       FT_Bool    delimiters )
   {
                       FT_Long*   pnum_bytes,
                       FT_Bool    delimiters )
   {
-    FT_Error  error = PSaux_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_Byte*  cur;
 
 
     FT_Byte*  cur;
 
 
       if ( *cur != '<' )
       {
         FT_ERROR(( "ps_parser_to_bytes: Missing starting delimiter `<'\n" ));
       if ( *cur != '<' )
       {
         FT_ERROR(( "ps_parser_to_bytes: Missing starting delimiter `<'\n" ));
-        error = PSaux_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
       if ( cur < parser->limit && *cur != '>' )
       {
         FT_ERROR(( "ps_parser_to_bytes: Missing closing delimiter `>'\n" ));
       if ( cur < parser->limit && *cur != '>' )
       {
         FT_ERROR(( "ps_parser_to_bytes: Missing closing delimiter `>'\n" ));
-        error = PSaux_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
                   FT_Byte*   limit,
                   FT_Memory  memory )
   {
                   FT_Byte*   limit,
                   FT_Memory  memory )
   {
-    parser->error  = PSaux_Err_Ok;
+    parser->error  = FT_Err_Ok;
     parser->base   = base;
     parser->limit  = limit;
     parser->cursor = base;
     parser->base   = base;
     parser->limit  = limit;
     parser->cursor = base;
     if ( !outline )
     {
       FT_ERROR(( "t1_builder_add_contour: no outline to add points to\n" ));
     if ( !outline )
     {
       FT_ERROR(( "t1_builder_add_contour: no outline to add points to\n" ));
-      return PSaux_Err_Invalid_File_Format;
+      return FT_THROW( Invalid_File_Format );
     }
 
     if ( !builder->load_points )
     {
       outline->n_contours++;
     }
 
     if ( !builder->load_points )
     {
       outline->n_contours++;
-      return PSaux_Err_Ok;
+      return FT_Err_Ok;
     }
 
     error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );
     }
 
     error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );
                           FT_Pos      x,
                           FT_Pos      y )
   {
                           FT_Pos      x,
                           FT_Pos      y )
   {
-    FT_Error  error = PSaux_Err_Invalid_File_Format;
+    FT_Error  error = FT_ERR( Invalid_File_Format );
 
 
     /* test whether we are building a new contour */
 
     if ( builder->parse_state == T1_Parse_Have_Path )
 
 
     /* test whether we are building a new contour */
 
     if ( builder->parse_state == T1_Parse_Have_Path )
-      error = PSaux_Err_Ok;
+      error = FT_Err_Ok;
     else
     {
       builder->parse_state = T1_Parse_Have_Path;
     else
     {
       builder->parse_state = T1_Parse_Have_Path;
index f933e4d..9e5bd34 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 character map support (body).                                 */
 /*                                                                         */
 /*                                                                         */
 /*    Type 1 character map support (body).                                 */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2006, 2007 by                                    */
+/*  Copyright 2002, 2003, 2006, 2007, 2012 by                              */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   /*************************************************************************/
 
   FT_CALLBACK_DEF( const char * )
   /*************************************************************************/
 
   FT_CALLBACK_DEF( const char * )
-  t1_get_glyph_name( T1_Face  face,
-                     FT_UInt  idx )
+  psaux_get_glyph_name( T1_Face  face,
+                        FT_UInt  idx )
   {
     return face->type1.glyph_names[idx];
   }
   {
     return face->type1.glyph_names[idx];
   }
     return psnames->unicodes_init( memory,
                                    unicodes,
                                    face->type1.num_glyphs,
     return psnames->unicodes_init( memory,
                                    unicodes,
                                    face->type1.num_glyphs,
-                                   (PS_GetGlyphNameFunc)&t1_get_glyph_name,
+                                   (PS_GetGlyphNameFunc)&psaux_get_glyph_name,
                                    (PS_FreeGlyphNameFunc)NULL,
                                    (FT_Pointer)face );
   }
                                    (PS_FreeGlyphNameFunc)NULL,
                                    (FT_Pointer)face );
   }
index ea31c51..6ce370b 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    PostScript Type 1 decoding routines (body).                          */
 /*                                                                         */
 /*                                                                         */
 /*    PostScript Type 1 decoding routines (body).                          */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009    */
-/*            2010 by                                                      */
+/*  Copyright 2000-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -28,6 +27,8 @@
 
 #include "psauxerr.h"
 
 
 #include "psauxerr.h"
 
+/* ensure proper sign extension */
+#define Fix2Int( f )  ( (FT_Int)(FT_Short)( (f) >> 16 ) )
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     T1_Face      face  = (T1_Face)decoder->builder.face;
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     T1_Face      face  = (T1_Face)decoder->builder.face;
-#endif     
+#endif
 
 
     if ( decoder->seac )
     {
       FT_ERROR(( "t1operator_seac: invalid nested seac\n" ));
 
 
     if ( decoder->seac )
     {
       FT_ERROR(( "t1operator_seac: invalid nested seac\n" ));
-      return PSaux_Err_Syntax_Error;
+      return FT_THROW( Syntax_Error );
+    }
+
+    if ( decoder->builder.metrics_only )
+    {
+      FT_ERROR(( "t1operator_seac: unexpected seac\n" ));
+      return FT_THROW( Syntax_Error );
     }
 
     /* seac weirdness */
     }
 
     /* seac weirdness */
     {
       FT_ERROR(( "t1operator_seac:"
                  " glyph names table not available in this font\n" ));
     {
       FT_ERROR(( "t1operator_seac:"
                  " glyph names table not available in this font\n" ));
-      return PSaux_Err_Syntax_Error;
+      return FT_THROW( Syntax_Error );
     }
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     }
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     {
       FT_ERROR(( "t1operator_seac:"
                  " invalid seac character code arguments\n" ));
     {
       FT_ERROR(( "t1operator_seac:"
                  " invalid seac character code arguments\n" ));
-      return PSaux_Err_Syntax_Error;
+      return FT_THROW( Syntax_Error );
     }
 
     /* if we are trying to load a composite glyph, do not load the */
     }
 
     /* if we are trying to load a composite glyph, do not load the */
     FT_ASSERT( ( decoder->len_buildchar == 0 ) ==
                ( decoder->buildchar == NULL )  );
 
     FT_ASSERT( ( decoder->len_buildchar == 0 ) ==
                ( decoder->buildchar == NULL )  );
 
-    if ( decoder->len_buildchar > 0 )
+    if ( decoder->buildchar && decoder->len_buildchar > 0 )
       ft_memset( &decoder->buildchar[0],
                  0,
       ft_memset( &decoder->buildchar[0],
                  0,
-                 sizeof( decoder->buildchar[0] ) * decoder->len_buildchar );
+                 sizeof ( decoder->buildchar[0] ) * decoder->len_buildchar );
 
     FT_TRACE4(( "\n"
                 "Start charstring\n" ));
 
     FT_TRACE4(( "\n"
                 "Start charstring\n" ));
     limit = zone->limit  = charstring_base + charstring_len;
     ip    = zone->cursor = zone->base;
 
     limit = zone->limit  = charstring_base + charstring_len;
     ip    = zone->cursor = zone->base;
 
-    error = PSaux_Err_Ok;
+    error = FT_Err_Ok;
 
     x = orig_x = builder->pos_x;
     y = orig_y = builder->pos_y;
 
     x = orig_x = builder->pos_x;
     y = orig_y = builder->pos_y;
           goto Syntax_Error;
         }
 
           goto Syntax_Error;
         }
 
-        value = (FT_Int32)( ( (FT_Long)ip[0] << 24 ) |
-                            ( (FT_Long)ip[1] << 16 ) |
-                            ( (FT_Long)ip[2] << 8  ) |
-                                       ip[3]         );
+        value = (FT_Int32)( ( (FT_UInt32)ip[0] << 24 ) |
+                            ( (FT_UInt32)ip[1] << 16 ) |
+                            ( (FT_UInt32)ip[2] << 8  ) |
+                              (FT_UInt32)ip[3]         );
         ip += 4;
 
         /* According to the specification, values > 32000 or < -32000 must */
         ip += 4;
 
         /* According to the specification, values > 32000 or < -32000 must */
         else
         {
           if ( !large_int )
         else
         {
           if ( !large_int )
-            value <<= 16;
+            value = (FT_Int32)( (FT_UInt32)value << 16 );
         }
 
         break;
         }
 
         break;
             }
 
             if ( ip[-2] < 251 )
             }
 
             if ( ip[-2] < 251 )
-              value =  ( ( (FT_Int32)ip[-2] - 247 ) << 8 ) + ip[-1] + 108;
+              value =    ( ( ip[-2] - 247 ) * 256 ) + ip[-1] + 108;
             else
             else
-              value = -( ( ( (FT_Int32)ip[-2] - 251 ) << 8 ) + ip[-1] + 108 );
+              value = -( ( ( ip[-2] - 251 ) * 256 ) + ip[-1] + 108 );
           }
 
           if ( !large_int )
           }
 
           if ( !large_int )
-            value <<= 16;
+            value = (FT_Int32)( (FT_UInt32)value << 16 );
         }
         else
         {
         }
         else
         {
         if ( large_int )
           FT_TRACE4(( " %ld", value ));
         else
         if ( large_int )
           FT_TRACE4(( " %ld", value ));
         else
-          FT_TRACE4(( " %ld", (FT_Int32)( value >> 16 ) ));
+          FT_TRACE4(( " %ld", Fix2Int( value ) ));
 #endif
 
         *top++       = value;
 #endif
 
         *top++       = value;
 
         top -= 2;
 
 
         top -= 2;
 
-        subr_no = (FT_Int)( top[1] >> 16 );
-        arg_cnt = (FT_Int)( top[0] >> 16 );
+        subr_no = Fix2Int( top[1] );
+        arg_cnt = Fix2Int( top[0] );
 
         /***********************************************************/
         /*                                                         */
 
         /***********************************************************/
         /*                                                         */
 
         switch ( subr_no )
         {
 
         switch ( subr_no )
         {
+        case 0:                     /* end flex feature */
+          if ( arg_cnt != 3 )
+            goto Unexpected_OtherSubr;
+
+          if ( decoder->flex_state       == 0 ||
+               decoder->num_flex_vectors != 7 )
+          {
+            FT_ERROR(( "t1_decoder_parse_charstrings:"
+                       " unexpected flex end\n" ));
+            goto Syntax_Error;
+          }
+
+          /* the two `results' are popped by the following setcurrentpoint */
+          top[0] = x;
+          top[1] = y;
+          known_othersubr_result_cnt = 2;
+          break;
+
         case 1:                     /* start flex feature */
           if ( arg_cnt != 0 )
             goto Unexpected_OtherSubr;
         case 1:                     /* start flex feature */
           if ( arg_cnt != 0 )
             goto Unexpected_OtherSubr;
           decoder->flex_state        = 1;
           decoder->num_flex_vectors  = 0;
           if ( ( error = t1_builder_start_point( builder, x, y ) )
           decoder->flex_state        = 1;
           decoder->num_flex_vectors  = 0;
           if ( ( error = t1_builder_start_point( builder, x, y ) )
-                 != PSaux_Err_Ok                                   ||
+                 != FT_Err_Ok                                   ||
                ( error = t1_builder_check_points( builder, 6 ) )
                ( error = t1_builder_check_points( builder, 6 ) )
-                 != PSaux_Err_Ok                                   )
+                 != FT_Err_Ok                                   )
             goto Fail;
           break;
 
             goto Fail;
           break;
 
             if ( arg_cnt != 0 )
               goto Unexpected_OtherSubr;
 
             if ( arg_cnt != 0 )
               goto Unexpected_OtherSubr;
 
+            if ( decoder->flex_state == 0 )
+            {
+              FT_ERROR(( "t1_decoder_parse_charstrings:"
+                         " missing flex start\n" ));
+              goto Syntax_Error;
+            }
+
             /* note that we should not add a point for index 0; */
             /* this will move our current position to the flex  */
             /* point without adding any point to the outline    */
             /* note that we should not add a point for index 0; */
             /* this will move our current position to the flex  */
             /* point without adding any point to the outline    */
           }
           break;
 
           }
           break;
 
-        case 0:                     /* end flex feature */
-          if ( arg_cnt != 3 )
-            goto Unexpected_OtherSubr;
-
-          if ( decoder->flex_state       == 0 ||
-               decoder->num_flex_vectors != 7 )
-          {
-            FT_ERROR(( "t1_decoder_parse_charstrings:"
-                       " unexpected flex end\n" ));
-            goto Syntax_Error;
-          }
-
-          /* the two `results' are popped by the following setcurrentpoint */
-          top[0] = x;
-          top[1] = y;
-          known_othersubr_result_cnt = 2;
-          break;
-
         case 3:                     /* change hints */
           if ( arg_cnt != 1 )
             goto Unexpected_OtherSubr;
         case 3:                     /* change hints */
           if ( arg_cnt != 1 )
             goto Unexpected_OtherSubr;
               goto Syntax_Error;
             }
 
               goto Syntax_Error;
             }
 
-            /* we want to compute:                                   */
+            /* We want to compute                                    */
+            /*                                                       */
+            /*   a0*w0 + a1*w1 + ... + ak*wk                         */
             /*                                                       */
             /*                                                       */
-            /*  a0*w0 + a1*w1 + ... + ak*wk                          */
+            /* but we only have a0, a1-a0, a2-a0, ..., ak-a0.        */
             /*                                                       */
             /*                                                       */
-            /* but we only have the a0, a1-a0, a2-a0, .. ak-a0       */
-            /* however, given that w0 + w1 + ... + wk == 1, we can   */
-            /* rewrite it easily as:                                 */
+            /* However, given that w0 + w1 + ... + wk == 1, we can   */
+            /* rewrite it easily as                                  */
             /*                                                       */
             /*                                                       */
-            /*  a0 + (a1-a0)*w1 + (a2-a0)*w2 + .. + (ak-a0)*wk       */
+            /*   a0 + (a1-a0)*w1 + (a2-a0)*w2 + ... + (ak-a0)*wk     */
             /*                                                       */
             /*                                                       */
-            /* where k == num_designs-1                              */
+            /* where k == num_designs-1.                             */
             /*                                                       */
             /* I guess that's why it's written in this `compact'     */
             /* form.                                                 */
             /*                                                       */
             /* I guess that's why it's written in this `compact'     */
             /* form.                                                 */
             if ( arg_cnt != 1 || blend == NULL )
               goto Unexpected_OtherSubr;
 
             if ( arg_cnt != 1 || blend == NULL )
               goto Unexpected_OtherSubr;
 
-            idx = (FT_Int)( top[0] >> 16 );
+            idx = Fix2Int( top[0] );
 
             if ( idx < 0                                           ||
                  idx + blend->num_designs > decoder->len_buildchar )
 
             if ( idx < 0                                           ||
                  idx + blend->num_designs > decoder->len_buildchar )
             ft_memcpy( &decoder->buildchar[idx],
                        blend->weight_vector,
                        blend->num_designs *
             ft_memcpy( &decoder->buildchar[idx],
                        blend->weight_vector,
                        blend->num_designs *
-                         sizeof( blend->weight_vector[0] ) );
+                         sizeof ( blend->weight_vector[0] ) );
           }
           break;
 
           }
           break;
 
             if ( arg_cnt != 2 || blend == NULL )
               goto Unexpected_OtherSubr;
 
             if ( arg_cnt != 2 || blend == NULL )
               goto Unexpected_OtherSubr;
 
-            idx = (FT_Int)( top[1] >> 16 );
+            idx = Fix2Int( top[1] );
 
             if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )
               goto Unexpected_OtherSubr;
 
             if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )
               goto Unexpected_OtherSubr;
             if ( arg_cnt != 1 || blend == NULL )
               goto Unexpected_OtherSubr;
 
             if ( arg_cnt != 1 || blend == NULL )
               goto Unexpected_OtherSubr;
 
-            idx = (FT_Int)( top[0] >> 16 );
+            idx = Fix2Int( top[0] );
 
             if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )
               goto Unexpected_OtherSubr;
 
             if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )
               goto Unexpected_OtherSubr;
           break;
 
         default:
           break;
 
         default:
-          FT_ERROR(( "t1_decoder_parse_charstrings:"
-                     " unknown othersubr [%d %d], wish me luck\n",
-                     arg_cnt, subr_no ));
-          unknown_othersubr_result_cnt = arg_cnt;
-          break;
+          if ( arg_cnt >= 0 && subr_no >= 0 )
+          {
+            FT_ERROR(( "t1_decoder_parse_charstrings:"
+                       " unknown othersubr [%d %d], wish me luck\n",
+                       arg_cnt, subr_no ));
+            unknown_othersubr_result_cnt = arg_cnt;
+            break;
+          }
+          /* fall through */
 
         Unexpected_OtherSubr:
           FT_ERROR(( "t1_decoder_parse_charstrings:"
 
         Unexpected_OtherSubr:
           FT_ERROR(( "t1_decoder_parse_charstrings:"
             FT_TRACE4(( "BuildCharArray = [ " ));
 
             for ( i = 0; i < decoder->len_buildchar; ++i )
             FT_TRACE4(( "BuildCharArray = [ " ));
 
             for ( i = 0; i < decoder->len_buildchar; ++i )
-              FT_TRACE4(( "%d ", decoder->buildchar[ i ] ));
+              FT_TRACE4(( "%d ", decoder->buildchar[i] ));
 
             FT_TRACE4(( "]\n" ));
           }
 
             FT_TRACE4(( "]\n" ));
           }
           FT_TRACE4(( "\n" ));
 
           /* return now! */
           FT_TRACE4(( "\n" ));
 
           /* return now! */
-          return PSaux_Err_Ok;
+          return FT_Err_Ok;
 
         case op_hsbw:
           FT_TRACE4(( " hsbw" ));
 
         case op_hsbw:
           FT_TRACE4(( " hsbw" ));
           /* the glyph's metrics (lsb + advance width), not load the   */
           /* rest of it; so exit immediately                           */
           if ( builder->metrics_only )
           /* the glyph's metrics (lsb + advance width), not load the   */
           /* rest of it; so exit immediately                           */
           if ( builder->metrics_only )
-            return PSaux_Err_Ok;
+            return FT_Err_Ok;
 
           break;
 
 
           break;
 
                                   top[0],
                                   top[1],
                                   top[2],
                                   top[0],
                                   top[1],
                                   top[2],
-                                  (FT_Int)( top[3] >> 16 ),
-                                  (FT_Int)( top[4] >> 16 ) );
+                                  Fix2Int( top[3] ),
+                                  Fix2Int( top[4] ) );
 
         case op_sbw:
           FT_TRACE4(( " sbw" ));
 
         case op_sbw:
           FT_TRACE4(( " sbw" ));
           /* the glyph's metrics (lsb + advance width), not load the   */
           /* rest of it; so exit immediately                           */
           if ( builder->metrics_only )
           /* the glyph's metrics (lsb + advance width), not load the   */
           /* rest of it; so exit immediately                           */
           if ( builder->metrics_only )
-            return PSaux_Err_Ok;
+            return FT_Err_Ok;
 
           break;
 
 
           break;
 
           FT_TRACE4(( " hlineto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
           FT_TRACE4(( " hlineto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
-                 != PSaux_Err_Ok )
+                 != FT_Err_Ok )
             goto Fail;
 
           x += top[0];
             goto Fail;
 
           x += top[0];
           FT_TRACE4(( " hvcurveto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
           FT_TRACE4(( " hvcurveto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
-                 != PSaux_Err_Ok                                   ||
+                 != FT_Err_Ok                                   ||
                ( error = t1_builder_check_points( builder, 3 ) )
                ( error = t1_builder_check_points( builder, 3 ) )
-                 != PSaux_Err_Ok                                   )
+                 != FT_Err_Ok                                   )
             goto Fail;
 
           x += top[0];
             goto Fail;
 
           x += top[0];
           FT_TRACE4(( " rlineto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
           FT_TRACE4(( " rlineto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
-                 != PSaux_Err_Ok )
+                 != FT_Err_Ok )
             goto Fail;
 
           x += top[0];
             goto Fail;
 
           x += top[0];
 
         Add_Line:
           if ( ( error = t1_builder_add_point1( builder, x, y ) )
 
         Add_Line:
           if ( ( error = t1_builder_add_point1( builder, x, y ) )
-                 != PSaux_Err_Ok )
+                 != FT_Err_Ok )
             goto Fail;
           break;
 
             goto Fail;
           break;
 
           FT_TRACE4(( " rrcurveto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
           FT_TRACE4(( " rrcurveto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
-                 != PSaux_Err_Ok                                   ||
+                 != FT_Err_Ok                                   ||
                ( error = t1_builder_check_points( builder, 3 ) )
                ( error = t1_builder_check_points( builder, 3 ) )
-                 != PSaux_Err_Ok                                   )
+                 != FT_Err_Ok                                   )
             goto Fail;
 
           x += top[0];
             goto Fail;
 
           x += top[0];
           FT_TRACE4(( " vhcurveto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
           FT_TRACE4(( " vhcurveto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
-                 != PSaux_Err_Ok                                   ||
+                 != FT_Err_Ok                                   ||
                ( error = t1_builder_check_points( builder, 3 ) )
                ( error = t1_builder_check_points( builder, 3 ) )
-                 != PSaux_Err_Ok                                   )
+                 != FT_Err_Ok                                   )
             goto Fail;
 
           y += top[0];
             goto Fail;
 
           y += top[0];
           FT_TRACE4(( " vlineto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
           FT_TRACE4(( " vlineto" ));
 
           if ( ( error = t1_builder_start_point( builder, x, y ) )
-                 != PSaux_Err_Ok )
+                 != FT_Err_Ok )
             goto Fail;
 
           y += top[0];
             goto Fail;
 
           y += top[0];
 
             FT_TRACE4(( " callsubr" ));
 
 
             FT_TRACE4(( " callsubr" ));
 
-            idx = (FT_Int)( top[0] >> 16 );
+            idx = Fix2Int( top[0] );
             if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
             {
               FT_ERROR(( "t1_decoder_parse_charstrings:"
             if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
             {
               FT_ERROR(( "t1_decoder_parse_charstrings:"
     return error;
 
   Syntax_Error:
     return error;
 
   Syntax_Error:
-    return PSaux_Err_Syntax_Error;
+    return FT_THROW( Syntax_Error );
 
   Stack_Underflow:
 
   Stack_Underflow:
-    return PSaux_Err_Stack_Underflow;
+    return FT_THROW( Stack_Underflow );
   }
 
 
   }
 
 
       {
         FT_ERROR(( "t1_decoder_init:"
                    " the `psnames' module is not available\n" ));
       {
         FT_ERROR(( "t1_decoder_init:"
                    " the `psnames' module is not available\n" ));
-        return PSaux_Err_Unimplemented_Feature;
+        return FT_THROW( Unimplemented_Feature );
       }
 
       decoder->psnames = psnames;
       }
 
       decoder->psnames = psnames;
 
     decoder->funcs          = t1_decoder_funcs;
 
 
     decoder->funcs          = t1_decoder_funcs;
 
-    return PSaux_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
diff --git a/reactos/lib/3rdparty/freetype/src/pshinter/Jamfile b/reactos/lib/3rdparty/freetype/src/pshinter/Jamfile
deleted file mode 100644 (file)
index 779f1b0..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/pshinter Jamfile
-#
-# Copyright 2001, 2003 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) pshinter ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = pshrec pshglob pshalgo pshmod pshpic ;
-  }
-  else
-  {
-    _sources = pshinter ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/pshinter Jamfile
index d798978..343472d 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    PostScript hinting algorithm (body).                                 */
 /*                                                                         */
 /*                                                                         */
 /*    PostScript hinting algorithm (body).                                 */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010   */
-/*            by                                                           */
+/*  Copyright 2001-2010, 2012, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used        */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used        */
                    FT_Fixed        delta,
                    FT_Int          dimension )
   {
                    FT_Fixed        delta,
                    FT_Int          dimension )
   {
-    PSH_Hint  hint;
-    FT_UInt   count;
+    FT_UInt  count;
 
 
     for ( count = 0; count < table->max_hints; count++ )
     {
 
 
     for ( count = 0; count < table->max_hints; count++ )
     {
-      hint = table->hints + count;
+      PSH_Hint  hint = table->hints + count;
+
 
       hint->cur_pos = FT_MulFix( hint->org_pos, scale ) + delta;
       hint->cur_len = FT_MulFix( hint->org_len, scale );
 
       hint->cur_pos = FT_MulFix( hint->org_pos, scale ) + delta;
       hint->cur_len = FT_MulFix( hint->org_len, scale );
               else if ( len > 0 )
               {
                 /* This is a very small stem; we simply align it to the
               else if ( len > 0 )
               {
                 /* This is a very small stem; we simply align it to the
-                 * pixel grid, trying to find the minimal displacement.
+                 * pixel grid, trying to find the minimum displacement.
                  *
                  * left               = pos
                  * right              = pos + len
                  *
                  * left               = pos
                  * right              = pos + len
     int     result = PSH_DIR_NONE;
 
 
     int     result = PSH_DIR_NONE;
 
 
-    ax = ( dx >= 0 ) ? dx : -dx;
-    ay = ( dy >= 0 ) ? dy : -dy;
+    ax = FT_ABS( dx );
+    ay = FT_ABS( dy );
 
     if ( ay * 12 < ax )
     {
 
     if ( ay * 12 < ax )
     {
 
     /* something to do? */
     if ( outline->n_points == 0 || outline->n_contours == 0 )
 
     /* something to do? */
     if ( outline->n_points == 0 || outline->n_contours == 0 )
-      return PSH_Err_Ok;
+      return FT_Err_Ok;
 
 #ifdef DEBUG_HINTER
 
 
 #ifdef DEBUG_HINTER
 
index 1a248a7..c70f31e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PostScript hinting algorithm (specification).                        */
 /*                                                                         */
 /*                                                                         */
 /*    PostScript hinting algorithm (specification).                        */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2008 by                                    */
+/*  Copyright 2001-2003, 2008, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -22,7 +22,6 @@
 
 #include "pshrec.h"
 #include "pshglob.h"
 
 #include "pshrec.h"
 #include "pshglob.h"
-#include FT_TRIGONOMETRY_H
 
 
 FT_BEGIN_HEADER
 
 
 FT_BEGIN_HEADER
@@ -168,8 +167,6 @@ FT_BEGIN_HEADER
     FT_UInt      flags2;
     FT_Char      dir_in;
     FT_Char      dir_out;
     FT_UInt      flags2;
     FT_Char      dir_in;
     FT_Char      dir_out;
-    FT_Angle     angle_in;
-    FT_Angle     angle_out;
     PSH_Hint     hint;
     FT_Pos       org_u;
     FT_Pos       org_v;
     PSH_Hint     hint;
     FT_Pos       org_u;
     FT_Pos       org_v;
@@ -186,12 +183,6 @@ FT_BEGIN_HEADER
   } PSH_PointRec;
 
 
   } PSH_PointRec;
 
 
-#define PSH_POINT_EQUAL_ORG( a, b )  ( (a)->org_u == (b)->org_u && \
-                                       (a)->org_v == (b)->org_v )
-
-#define PSH_POINT_ANGLE( a, b )  FT_Atan2( (b)->org_u - (a)->org_u,  \
-                                           (b)->org_v - (a)->org_v )
-
   typedef struct  PSH_ContourRec_
   {
     PSH_Point  start;
   typedef struct  PSH_ContourRec_
   {
     PSH_Point  start;
index 31231ad..9285efc 100644 (file)
@@ -5,7 +5,7 @@
 /*    PostScript hinter global hinting management (body).                  */
 /*    Inspired by the new auto-hinter module.                              */
 /*                                                                         */
 /*    PostScript hinter global hinting management (body).                  */
 /*    Inspired by the new auto-hinter module.                              */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2006, 2010 by                        */
+/*  Copyright 2001-2004, 2006, 2010, 2012 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used        */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used        */
   }
 
 
   }
 
 
+  /* calculate the maximum height of given blue zones */
+  static FT_Short
+  psh_calc_max_height( FT_UInt          num,
+                       const FT_Short*  values,
+                       FT_Short         cur_max )
+  {
+    FT_UInt  count;
+
+
+    for ( count = 0; count < num; count += 2 )
+    {
+      FT_Short  cur_height = values[count + 1] - values[count];
+
+
+      if ( cur_height > cur_max )
+        cur_max = cur_height;
+    }
+
+    return cur_max;
+  }
+
+
   FT_LOCAL_DEF( void )
   psh_blues_snap_stem( PSH_Blues      blues,
                        FT_Int         stem_top,
   FT_LOCAL_DEF( void )
   psh_blues_snap_stem( PSH_Blues      blues,
                        FT_Int         stem_top,
                            priv->family_blues, priv->num_family_other_blues,
                            priv->family_other_blues, priv->blue_fuzz, 1 );
 
                            priv->family_blues, priv->num_family_other_blues,
                            priv->family_other_blues, priv->blue_fuzz, 1 );
 
-      globals->blues.blue_scale = priv->blue_scale;
+      /* limit the BlueScale value to `1 / max_of_blue_zone_heights' */
+      {
+        FT_Fixed  max_scale;
+        FT_Short  max_height = 1;
+
+
+        max_height = psh_calc_max_height( priv->num_blue_values,
+                                          priv->blue_values,
+                                          max_height );
+        max_height = psh_calc_max_height( priv->num_other_blues,
+                                          priv->other_blues,
+                                          max_height );
+        max_height = psh_calc_max_height( priv->num_family_blues,
+                                          priv->family_blues,
+                                          max_height );
+        max_height = psh_calc_max_height( priv->num_family_other_blues,
+                                          priv->family_other_blues,
+                                          max_height );
+
+        /* BlueScale is scaled 1000 times */
+        max_scale = FT_DivFix( 1000, max_height );
+        globals->blues.blue_scale = priv->blue_scale < max_scale
+                                      ? priv->blue_scale
+                                      : max_scale;
+      }
+
       globals->blues.blue_shift = priv->blue_shift;
       globals->blues.blue_fuzz  = priv->blue_fuzz;
 
       globals->blues.blue_shift = priv->blue_shift;
       globals->blues.blue_fuzz  = priv->blue_fuzz;
 
index 91da5d7..cdeaca1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PostScript hinter module implementation (body).             */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType PostScript hinter module implementation (body).             */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2007 by                                          */
+/*  Copyright 2001, 2002, 2007, 2009, 2012 by                              */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
   }
 
 
   }
 
 
-  FT_DEFINE_PSHINTER_INTERFACE(pshinter_interface,
+  FT_DEFINE_PSHINTER_INTERFACE(
+    pshinter_interface,
     pshinter_get_globals_funcs,
     pshinter_get_t1_funcs,
     pshinter_get_globals_funcs,
     pshinter_get_t1_funcs,
-    pshinter_get_t2_funcs
-  )
+    pshinter_get_t2_funcs )
 
 
 
 
-  FT_DEFINE_MODULE(pshinter_module_class,
+  FT_DEFINE_MODULE(
+    pshinter_module_class,
 
     0,
     sizeof ( PS_Hinter_ModuleRec ),
 
     0,
     sizeof ( PS_Hinter_ModuleRec ),
     0x10000L,
     0x20000L,
 
     0x10000L,
     0x20000L,
 
-    &FTPSHINTER_INTERFACE_GET,            /* module-specific interface */
+    &PSHINTER_INTERFACE_GET,              /* module-specific interface */
 
     (FT_Module_Constructor)ps_hinter_init,
     (FT_Module_Destructor) ps_hinter_done,
 
     (FT_Module_Constructor)ps_hinter_init,
     (FT_Module_Destructor) ps_hinter_done,
-    (FT_Module_Requester)  0        /* no additional interface for now */
-  )
+    (FT_Module_Requester)  NULL )   /* no additional interface for now */
+
 
 /* END */
 
 /* END */
index 3c0029f..7cc180f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PS Hinter error codes (specification only).                          */
 /*                                                                         */
 /*                                                                         */
 /*    PS Hinter error codes (specification only).                          */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,6 +29,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  PSH_Err_
 #define FT_ERR_BASE    FT_Mod_Err_PShinter
 
 #define FT_ERR_PREFIX  PSH_Err_
 #define FT_ERR_BASE    FT_Mod_Err_PShinter
 
index 5efb422..568f4ac 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for pshinter module. */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for pshinter module. */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009, 2010, 2012, 2013 by                                    */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "pshpic.h"
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "pshpic.h"
+#include "pshnterr.h"
+
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from pshmod.c */
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from pshmod.c */
-  void FT_Init_Class_pshinter_interface( FT_Library, PSHinter_Interface*);
+  void
+  FT_Init_Class_pshinter_interface( FT_Library           library,
+                                    PSHinter_Interface*  clazz );
 
   void
 
   void
-  pshinter_module_class_pic_free( FT_Library library )
+  pshinter_module_class_pic_free( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Memory memory = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Memory          memory        = library->memory;
+
+
     if ( pic_container->pshinter )
     {
       FT_FREE( pic_container->pshinter );
     if ( pic_container->pshinter )
     {
       FT_FREE( pic_container->pshinter );
   pshinter_module_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
   pshinter_module_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Error           error         = PSH_Err_Ok;
-    PSHinterPIC*       container;
+    FT_Error           error         = FT_Err_Ok;
+    PSHinterPIC*       container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
     /* allocate pointer, clear and set global container pointer */
     FT_Memory          memory        = library->memory;
 
 
     /* allocate pointer, clear and set global container pointer */
-    if ( FT_ALLOC ( container, sizeof ( *container ) ) )
+    if ( FT_ALLOC( container, sizeof ( *container ) ) )
       return error;
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->pshinter = container;
       return error;
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->pshinter = container;
-    
+
     /* add call to initialization function when you add new scripts */
     /* add call to initialization function when you add new scripts */
-    FT_Init_Class_pshinter_interface(library, &container->pshinter_interface);
+    FT_Init_Class_pshinter_interface(
+      library, &container->pshinter_interface );
+
+    if ( error )
+      pshinter_module_class_pic_free( library );
 
 
-/*Exit:*/
-    if(error)
-      pshinter_module_class_pic_free(library);
     return error;
   }
 
     return error;
   }
 
-
 #endif /* FT_CONFIG_OPTION_PIC */
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
+
 /* END */
 /* END */
index 3555d8e..b46f853 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for pshinter module. */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for pshinter module. */
 /*                                                                         */
-/*  Copyright 2009 by                                                      */
+/*  Copyright 2009, 2012, 2013 by                                          */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #ifndef __PSHPIC_H__
 #define __PSHPIC_H__
 
 #ifndef __PSHPIC_H__
 #define __PSHPIC_H__
 
-  
+
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FTPSHINTER_INTERFACE_GET        pshinter_interface
+#define PSHINTER_INTERFACE_GET  pshinter_interface
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 #include FT_INTERNAL_POSTSCRIPT_HINTS_H
 
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 #include FT_INTERNAL_POSTSCRIPT_HINTS_H
 
-  typedef struct PSHinterPIC_
+  typedef struct  PSHinterPIC_
   {
   {
-    PSHinter_Interface pshinter_interface;
+    PSHinter_Interface  pshinter_interface;
+
   } PSHinterPIC;
 
   } PSHinterPIC;
 
-#define GET_PIC(lib)                    ((PSHinterPIC*)((lib)->pic_container.autofit))
-#define FTPSHINTER_INTERFACE_GET        (GET_PIC(library)->pshinter_interface)
 
 
+#define GET_PIC( lib )  ( (PSHinterPIC*)( (lib)->pic_container.pshinter ) )
+
+#define PSHINTER_INTERFACE_GET  ( GET_PIC( library )->pshinter_interface )
+
+  /* see pshpic.c for the implementation */
+  void
+  pshinter_module_class_pic_free( FT_Library  library );
+
+  FT_Error
+  pshinter_module_class_pic_init( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
index 0910cc5..cd66ea8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PostScript hints recorder (body).                           */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType PostScript hints recorder (body).                           */
 /*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2004, 2007, 2009 by                        */
+/*  Copyright 2001-2004, 2007, 2009, 2013 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -64,7 +64,7 @@
   {
     FT_UInt   old_max = table->max_hints;
     FT_UInt   new_max = count;
   {
     FT_UInt   old_max = table->max_hints;
     FT_UInt   new_max = count;
-    FT_Error  error   = PSH_Err_Ok;
+    FT_Error  error   = FT_Err_Ok;
 
 
     if ( new_max > old_max )
 
 
     if ( new_max > old_max )
@@ -83,7 +83,7 @@
                        FT_Memory      memory,
                        PS_Hint       *ahint )
   {
                        FT_Memory      memory,
                        PS_Hint       *ahint )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_UInt   count;
     PS_Hint   hint = 0;
 
     FT_UInt   count;
     PS_Hint   hint = 0;
 
   {
     FT_UInt   old_max = ( mask->max_bits + 7 ) >> 3;
     FT_UInt   new_max = ( count          + 7 ) >> 3;
   {
     FT_UInt   old_max = ( mask->max_bits + 7 ) >> 3;
     FT_UInt   new_max = ( count          + 7 ) >> 3;
-    FT_Error  error   = PSH_Err_Ok;
+    FT_Error  error   = FT_Err_Ok;
 
 
     if ( new_max > old_max )
 
 
     if ( new_max > old_max )
                    FT_Int     idx,
                    FT_Memory  memory )
   {
                    FT_Int     idx,
                    FT_Memory  memory )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_Byte*  p;
 
 
     FT_Byte*  p;
 
 
   {
     FT_UInt   old_max = table->max_masks;
     FT_UInt   new_max = count;
   {
     FT_UInt   old_max = table->max_masks;
     FT_UInt   new_max = count;
-    FT_Error  error   = PSH_Err_Ok;
+    FT_Error  error   = FT_Err_Ok;
 
 
     if ( new_max > old_max )
 
 
     if ( new_max > old_max )
                        PS_Mask       *amask )
   {
     FT_UInt   count;
                        PS_Mask       *amask )
   {
     FT_UInt   count;
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     PS_Mask   mask  = 0;
 
 
     PS_Mask   mask  = 0;
 
 
                       FT_Memory      memory,
                       PS_Mask       *amask )
   {
                       FT_Memory      memory,
                       PS_Mask       *amask )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_UInt   count;
     PS_Mask   mask;
 
     FT_UInt   count;
     PS_Mask   mask;
 
                           FT_UInt         bit_count,
                           FT_Memory       memory )
   {
                           FT_UInt         bit_count,
                           FT_Memory       memory )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error;
     PS_Mask   mask;
 
 
     PS_Mask   mask;
 
 
     FT_UInt   count;
 
 
     FT_UInt   count;
 
 
-    count = ( count1 <= count2 ) ? count1 : count2;
+    count = FT_MIN( count1, count2 );
     for ( ; count >= 8; count -= 8 )
     {
       if ( p1[0] & p2[0] )
     for ( ; count >= 8; count -= 8 )
     {
       if ( p1[0] & p2[0] )
                        FT_Memory      memory )
   {
     FT_UInt   temp;
                        FT_Memory      memory )
   {
     FT_UInt   temp;
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     /* swap index1 and index2 so that index1 < index2 */
 
 
     /* swap index1 and index2 so that index1 < index2 */
                            FT_Memory      memory )
   {
     FT_Int    index1, index2;
                            FT_Memory      memory )
   {
     FT_Int    index1, index2;
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     for ( index1 = table->num_masks - 1; index1 > 0; index1-- )
 
 
     for ( index1 = table->num_masks - 1; index1 > 0; index1-- )
                              FT_Memory     memory )
   {
     PS_Mask   mask;
                              FT_Memory     memory )
   {
     PS_Mask   mask;
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     /* get last hint mask */
 
 
     /* get last hint mask */
                          FT_UInt       end_point )
   {
     FT_UInt  count = dim->masks.num_masks;
                          FT_UInt       end_point )
   {
     FT_UInt  count = dim->masks.num_masks;
-    PS_Mask  mask;
 
 
     if ( count > 0 )
     {
 
 
     if ( count > 0 )
     {
-      mask            = dim->masks.masks + count - 1;
+      PS_Mask  mask = dim->masks.masks + count - 1;
+
+
       mask->end_point = end_point;
     }
   }
       mask->end_point = end_point;
     }
   }
                               FT_UInt         end_point,
                               FT_Memory       memory )
   {
                               FT_UInt         end_point,
                               FT_Memory       memory )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error;
 
 
     /* reset current mask, if any */
 
 
     /* reset current mask, if any */
                            FT_Memory     memory,
                            FT_Int       *aindex )
   {
                            FT_Memory     memory,
                            FT_Int       *aindex )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_UInt   flags = 0;
 
 
     FT_UInt   flags = 0;
 
 
                             FT_Int        hint3,
                             FT_Memory     memory )
   {
                             FT_Int        hint3,
                             FT_Memory     memory )
   {
-    FT_Error  error   = PSH_Err_Ok;
+    FT_Error  error   = FT_Err_Ok;
     FT_UInt   count   = dim->counters.num_masks;
     PS_Mask   counter = dim->counters.masks;
 
     FT_UInt   count   = dim->counters.num_masks;
     PS_Mask   counter = dim->counters.masks;
 
     ps_dimension_done( &hints->dimension[0], memory );
     ps_dimension_done( &hints->dimension[1], memory );
 
     ps_dimension_done( &hints->dimension[0], memory );
     ps_dimension_done( &hints->dimension[1], memory );
 
-    hints->error  = PSH_Err_Ok;
+    hints->error  = FT_Err_Ok;
     hints->memory = 0;
   }
 
     hints->memory = 0;
   }
 
   {
     FT_MEM_ZERO( hints, sizeof ( *hints ) );
     hints->memory = memory;
   {
     FT_MEM_ZERO( hints, sizeof ( *hints ) );
     hints->memory = memory;
-    return PSH_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     {
     case PS_HINT_TYPE_1:
     case PS_HINT_TYPE_2:
     {
     case PS_HINT_TYPE_1:
     case PS_HINT_TYPE_2:
-      hints->error     = PSH_Err_Ok;
+      hints->error     = FT_Err_Ok;
       hints->hint_type = hint_type;
 
       ps_dimension_init( &hints->dimension[0] );
       hints->hint_type = hint_type;
 
       ps_dimension_init( &hints->dimension[0] );
       break;
 
     default:
       break;
 
     default:
-      hints->error     = PSH_Err_Invalid_Argument;
+      hints->error     = FT_THROW( Invalid_Argument );
       hints->hint_type = hint_type;
 
       FT_TRACE0(( "ps_hints_open: invalid charstring type\n" ));
       hints->hint_type = hint_type;
 
       FT_TRACE0(( "ps_hints_open: invalid charstring type\n" ));
                     FT_Int     dimension,
                     FT_Fixed*  stems )
   {
                     FT_Int     dimension,
                     FT_Fixed*  stems )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( !hints->error )
 
 
     if ( !hints->error )
       else
       {
         FT_ERROR(( "ps_hints_t1stem3: called with invalid hint type\n" ));
       else
       {
         FT_ERROR(( "ps_hints_t1stem3: called with invalid hint type\n" ));
-        error = PSH_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Fail;
       }
     }
         goto Fail;
       }
     }
   ps_hints_t1reset( PS_Hints  hints,
                     FT_UInt   end_point )
   {
   ps_hints_t1reset( PS_Hints  hints,
                     FT_UInt   end_point )
   {
-    FT_Error  error = PSH_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( !hints->error )
 
 
     if ( !hints->error )
       else
       {
         /* invalid hint type */
       else
       {
         /* invalid hint type */
-        error = PSH_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Fail;
       }
     }
         goto Fail;
       }
     }
index 5777339..888ece1 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
 #
 
 
-# Copyright 2001, 2003 by
+# Copyright 2001, 2003, 2011 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -25,10 +25,11 @@ PSHINTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSHINTER_DIR))
 
 # PSHINTER driver sources (i.e., C files)
 #
 
 # PSHINTER driver sources (i.e., C files)
 #
-PSHINTER_DRV_SRC := $(PSHINTER_DIR)/pshrec.c  \
+PSHINTER_DRV_SRC := $(PSHINTER_DIR)/pshalgo.c \
                     $(PSHINTER_DIR)/pshglob.c \
                     $(PSHINTER_DIR)/pshmod.c  \
                     $(PSHINTER_DIR)/pshglob.c \
                     $(PSHINTER_DIR)/pshmod.c  \
-                    $(PSHINTER_DIR)/pshalgo.c
+                    $(PSHINTER_DIR)/pshpic.c  \
+                    $(PSHINTER_DIR)/pshrec.c
 
 
 # PSHINTER driver headers
 
 
 # PSHINTER driver headers
diff --git a/reactos/lib/3rdparty/freetype/src/psnames/Jamfile b/reactos/lib/3rdparty/freetype/src/psnames/Jamfile
deleted file mode 100644 (file)
index 06c0dda..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/psnames Jamfile
-#
-# Copyright 2001 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) psnames ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = psmodule pspic ;
-  }
-  else
-  {
-    _sources = psnames ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/psnames Jamfile
index 7528696..0a5bcb7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PSNames module implementation (body).                                */
 /*                                                                         */
 /*                                                                         */
 /*    PSNames module implementation (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008 by             */
+/*  Copyright 1996-2003, 2005-2008, 2012, 2013 by                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -17,6 +17,7 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
 
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
 
         /* No unicode chars here! */
         FT_FREE( table->maps );
         if ( !error )
         /* No unicode chars here! */
         FT_FREE( table->maps );
         if ( !error )
-          error = PSnames_Err_No_Unicode_Glyph_Name;
+          error = FT_THROW( No_Unicode_Glyph_Name );
       }
       else
       {
       }
       else
       {
         if ( count < num_glyphs / 2 )
         {
           (void)FT_RENEW_ARRAY( table->maps, num_glyphs, count );
         if ( count < num_glyphs / 2 )
         {
           (void)FT_RENEW_ARRAY( table->maps, num_glyphs, count );
-          error = PSnames_Err_Ok;
+          error = FT_Err_Ok;
         }
 
         /* Sort the table in increasing order of unicode values, */
         }
 
         /* Sort the table in increasing order of unicode values, */
 
 
 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
 
 
 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
-  FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface, 
+
+  FT_DEFINE_SERVICE_PSCMAPSREC(
+    pscmaps_interface,
     (PS_Unicode_ValueFunc)     ps_unicode_value,
     (PS_Unicodes_InitFunc)     ps_unicodes_init,
     (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index,
     (PS_Unicode_ValueFunc)     ps_unicode_value,
     (PS_Unicodes_InitFunc)     ps_unicodes_init,
     (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index,
     (PS_Adobe_Std_StringsFunc) ps_get_standard_strings,
 
     t1_standard_encoding,
     (PS_Adobe_Std_StringsFunc) ps_get_standard_strings,
 
     t1_standard_encoding,
-    t1_expert_encoding
-  )
+    t1_expert_encoding )
 
 #else
 
 
 #else
 
-  FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface, 
-    0,
-    0,
-    0,
-    0,
+  FT_DEFINE_SERVICE_PSCMAPSREC(
+    pscmaps_interface,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
     (PS_Macintosh_NameFunc)    ps_get_macintosh_name,
     (PS_Adobe_Std_StringsFunc) ps_get_standard_strings,
 
     t1_standard_encoding,
 
     (PS_Macintosh_NameFunc)    ps_get_macintosh_name,
     (PS_Adobe_Std_StringsFunc) ps_get_standard_strings,
 
     t1_standard_encoding,
-    t1_expert_encoding
-  )
+    t1_expert_encoding )
 
 #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
 
 
 
 #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
 
 
-  FT_DEFINE_SERVICEDESCREC1(pscmaps_services, 
-    FT_SERVICE_ID_POSTSCRIPT_CMAPS, &FT_PSCMAPS_INTERFACE_GET
-  )
-
-
+  FT_DEFINE_SERVICEDESCREC1(
+    pscmaps_services,
+    FT_SERVICE_ID_POSTSCRIPT_CMAPS, &PSCMAPS_INTERFACE_GET )
 
 
   static FT_Pointer
   psnames_get_service( FT_Module    module,
                        const char*  service_id )
   {
 
 
   static FT_Pointer
   psnames_get_service( FT_Module    module,
                        const char*  service_id )
   {
+    /* PSCMAPS_SERVICES_GET derefers `library' in PIC mode */
+#ifdef FT_CONFIG_OPTION_PIC
+    FT_Library  library;
+
+
+    if ( !module )
+      return NULL;
+    library = module->library;
+    if ( !library )
+      return NULL;
+#else
     FT_UNUSED( module );
     FT_UNUSED( module );
+#endif
 
 
-    return ft_service_list_lookup( FT_PSCMAPS_SERVICES_GET, service_id );
+    return ft_service_list_lookup( PSCMAPS_SERVICES_GET, service_id );
   }
 
 #endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
 
 
 #ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
   }
 
 #endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
 
 
 #ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
-#define PUT_PS_NAMES_SERVICE(a) 0
+#define PUT_PS_NAMES_SERVICE( a )  NULL
 #else
 #else
-#define PUT_PS_NAMES_SERVICE(a) a
+#define PUT_PS_NAMES_SERVICE( a )  a
 #endif
 
 #endif
 
-  FT_DEFINE_MODULE(psnames_module_class,
-  
+  FT_DEFINE_MODULE(
+    psnames_module_class,
+
     0,  /* this is not a font driver, nor a renderer */
     sizeof ( FT_ModuleRec ),
 
     0,  /* this is not a font driver, nor a renderer */
     sizeof ( FT_ModuleRec ),
 
     0x10000L,   /* driver version                      */
     0x20000L,   /* driver requires FreeType 2 or above */
 
     0x10000L,   /* driver version                      */
     0x20000L,   /* driver requires FreeType 2 or above */
 
-    PUT_PS_NAMES_SERVICE((void*)&FT_PSCMAPS_INTERFACE_GET),   /* module specific interface */
-    (FT_Module_Constructor)0,
-    (FT_Module_Destructor) 0,
-    (FT_Module_Requester)  PUT_PS_NAMES_SERVICE(psnames_get_service)
-  )
-
+    PUT_PS_NAMES_SERVICE(
+      (void*)&PSCMAPS_INTERFACE_GET ),   /* module specific interface */
+    (FT_Module_Constructor)NULL,
+    (FT_Module_Destructor) NULL,
+    (FT_Module_Requester)  PUT_PS_NAMES_SERVICE( psnames_get_service ) )
 
 
 /* END */
 
 
 /* END */
index ae1541d..acda7f9 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PS names module error codes (specification only).                    */
 /*                                                                         */
 /*                                                                         */
 /*    PS names module error codes (specification only).                    */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,6 +30,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  PSnames_Err_
 #define FT_ERR_BASE    FT_Mod_Err_PSnames
 
 #define FT_ERR_PREFIX  PSnames_Err_
 #define FT_ERR_BASE    FT_Mod_Err_PSnames
 
index b9075d5..3820f65 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for psnames module.  */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for psnames module.  */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009, 2010, 2012, 2013 by                                    */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "pspic.h"
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "pspic.h"
+#include "psnamerr.h"
+
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from psmodule.c */
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from psmodule.c */
-  FT_Error FT_Create_Class_pscmaps_services( FT_Library, FT_ServiceDescRec**);
-  void FT_Destroy_Class_pscmaps_services( FT_Library, FT_ServiceDescRec*);
-  void FT_Init_Class_pscmaps_interface( FT_Library, FT_Service_PsCMapsRec*);
+  FT_Error
+  FT_Create_Class_pscmaps_services( FT_Library           library,
+                                    FT_ServiceDescRec**  output_class );
+  void
+  FT_Destroy_Class_pscmaps_services( FT_Library          library,
+                                     FT_ServiceDescRec*  clazz );
 
   void
 
   void
-  psnames_module_class_pic_free(  FT_Library library )
+  FT_Init_Class_pscmaps_interface( FT_Library              library,
+                                   FT_Service_PsCMapsRec*  clazz );
+
+
+  void
+  psnames_module_class_pic_free( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Memory memory = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Memory          memory        = library->memory;
+
+
     if ( pic_container->psnames )
     {
     if ( pic_container->psnames )
     {
-      PSModulePIC* container = (PSModulePIC*)pic_container->psnames;
-      if(container->pscmaps_services)
-        FT_Destroy_Class_pscmaps_services(library, container->pscmaps_services);
+      PSModulePIC*  container = (PSModulePIC*)pic_container->psnames;
+
+
+      if ( container->pscmaps_services )
+        FT_Destroy_Class_pscmaps_services( library,
+                                           container->pscmaps_services );
       container->pscmaps_services = NULL;
       FT_FREE( container );
       pic_container->psnames = NULL;
       container->pscmaps_services = NULL;
       FT_FREE( container );
       pic_container->psnames = NULL;
   psnames_module_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
   psnames_module_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Error           error         = PSnames_Err_Ok;
-    PSModulePIC*       container;
+    FT_Error           error         = FT_Err_Ok;
+    PSModulePIC*       container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
     /* allocate pointer, clear and set global container pointer */
     FT_Memory          memory        = library->memory;
 
 
     /* allocate pointer, clear and set global container pointer */
-    if ( FT_ALLOC ( container, sizeof ( *container ) ) )
+    if ( FT_ALLOC( container, sizeof ( *container ) ) )
       return error;
       return error;
-    FT_MEM_SET( container, 0, sizeof(*container) );
+    FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->psnames = container;
 
     pic_container->psnames = container;
 
-    /* initialize pointer table - this is how the module usually expects this data */
-    error = FT_Create_Class_pscmaps_services(library, &container->pscmaps_services);
-    if(error) 
+    /* initialize pointer table -                       */
+    /* this is how the module usually expects this data */
+    error = FT_Create_Class_pscmaps_services(
+              library, &container->pscmaps_services );
+    if ( error )
       goto Exit;
       goto Exit;
-    FT_Init_Class_pscmaps_interface(library, &container->pscmaps_interface);
-    
-Exit:
-    if(error)
-      psnames_module_class_pic_free(library);
+    FT_Init_Class_pscmaps_interface( library,
+                                     &container->pscmaps_interface );
+
+  Exit:
+    if ( error )
+      psnames_module_class_pic_free( library );
     return error;
   }
 
     return error;
   }
 
index 75a14fd..6ff002c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for psnames module.  */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for psnames module.  */
 /*                                                                         */
-/*  Copyright 2009 by                                                      */
+/*  Copyright 2009, 2012 by                                                */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #ifndef __PSPIC_H__
 #define __PSPIC_H__
 
 #ifndef __PSPIC_H__
 #define __PSPIC_H__
 
-  
+
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 #ifndef FT_CONFIG_OPTION_PIC
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 #ifndef FT_CONFIG_OPTION_PIC
-#define FT_PSCMAPS_SERVICES_GET     pscmaps_services
-#define FT_PSCMAPS_INTERFACE_GET    pscmaps_interface
+
+#define PSCMAPS_SERVICES_GET   pscmaps_services
+#define PSCMAPS_INTERFACE_GET  pscmaps_interface
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
 
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
 
-  typedef struct PSModulePIC_
+  typedef struct  PSModulePIC_
   {
   {
-    FT_ServiceDescRec* pscmaps_services;
-    FT_Service_PsCMapsRec pscmaps_interface;
+    FT_ServiceDescRec*     pscmaps_services;
+    FT_Service_PsCMapsRec  pscmaps_interface;
+
   } PSModulePIC;
 
   } PSModulePIC;
 
-#define GET_PIC(lib)                ((PSModulePIC*)((lib)->pic_container.psnames))
-#define FT_PSCMAPS_SERVICES_GET     (GET_PIC(library)->pscmaps_services)
-#define FT_PSCMAPS_INTERFACE_GET    (GET_PIC(library)->pscmaps_interface)
+
+#define GET_PIC( lib )                                     \
+          ( (PSModulePIC*)((lib)->pic_container.psnames) )
+#define PSCMAPS_SERVICES_GET   ( GET_PIC( library )->pscmaps_services )
+#define PSCMAPS_INTERFACE_GET  ( GET_PIC( library )->pscmaps_interface )
+
+
+  /* see pspic.c for the implementation */
+  void
+  psnames_module_class_pic_free( FT_Library  library );
+
+  FT_Error
+  psnames_module_class_pic_init( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
index 1521e9c..0a6637f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PostScript glyph names.                                              */
 /*                                                                         */
 /*                                                                         */
 /*    PostScript glyph names.                                              */
 /*                                                                         */
-/*  Copyright 2005, 2008 by                                                */
+/*  Copyright 2005, 2008, 2011 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
 
 
 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
 
-  static const unsigned char  ft_adobe_glyph_list[54791L] =
+  static const unsigned char  ft_adobe_glyph_list[55997L] =
   {
       0, 52,  0,106,  2,167,  3, 63,  4,220,  6,125,  9,143, 10, 23,
      11,137, 12,199, 14,246, 15, 87, 16,233, 17,219, 18,104, 19, 88,
      22,110, 23, 32, 23, 71, 24, 77, 27,156, 29, 73, 31,247, 32,107,
   {
       0, 52,  0,106,  2,167,  3, 63,  4,220,  6,125,  9,143, 10, 23,
      11,137, 12,199, 14,246, 15, 87, 16,233, 17,219, 18,104, 19, 88,
      22,110, 23, 32, 23, 71, 24, 77, 27,156, 29, 73, 31,247, 32,107,
-     32,222, 33, 55, 34,154, 35,218, 53, 84, 59,196, 68,  6, 75,183,
-     83,178, 88,135, 93,242,101,165,109,185,111, 55,117,254,123, 73,
-    130,238,138,206,145, 31,153,182,156,189,163,249,178,221,193, 17,
-    197, 99,199,240,204, 27,204,155,210,100, 65,143,  0, 65,  0,140,
+     32,222, 33, 55, 34,154, 35,218, 58, 10, 64,122, 72,188, 80,109,
+     88,104, 93, 61, 98,168,106, 91,114,111,115,237,122,180,127,255,
+    135,164,143,132,149,213,158,108,161,115,168,175,183,147,197,199,
+    202, 25,204,166,208,209,209, 81,215, 26, 65,143,  0, 65,  0,140,
       0,175,  0,193,  1, 15,  1,147,  1,233,  1,251,  2,  7,  2, 40,
       2, 57,  2, 82,  2, 91,  2,128,  2,136,  2,154, 69,131,  0,198,
       0,150,  0,158,  0,167,225,227,245,244,101,128,  1,252,237,225,
       0,175,  0,193,  1, 15,  1,147,  1,233,  1,251,  2,  7,  2, 40,
       2, 57,  2, 82,  2, 91,  2,128,  2,136,  2,154, 69,131,  0,198,
       0,150,  0,158,  0,167,225,227,245,244,101,128,  1,252,237,225,
     233,243,227,249,242,233,236,236,233, 99,128,  4,220,236,233,238,
     229,226,229,236,239,119,128, 30,148,237,239,238,239,243,240,225,
     227,101,128,255, 58,115,  2, 35,203, 35,210,237,225,236,108,128,
     233,243,227,249,242,233,236,236,233, 99,128,  4,220,236,233,238,
     229,226,229,236,239,119,128, 30,148,237,239,238,239,243,240,225,
     227,101,128,255, 58,115,  2, 35,203, 35,210,237,225,236,108,128,
-    247,122,244,242,239,235,101,128,  1,181, 97,149,  0, 97, 36,  8,
-     36,144, 37, 35, 37,211, 38, 55, 38, 91, 45, 10, 45, 47, 45, 74,
-     46, 43, 46, 81, 47,170, 47,242, 48,197, 48,206, 49, 79, 51, 87,
-     52, 77, 52,124, 53, 19, 53, 33, 97,  7, 36, 24, 36, 34, 36, 41,
-     36, 48, 36, 73, 36, 89, 36,100,226,229,238,231,225,236,105,128,
-      9,134,227,245,244,101,128,  0,225,228,229,246, 97,128,  9,  6,
-    231,117,  2, 36, 55, 36, 64,234,225,242,225,244,105,128, 10,134,
-    242,237,245,235,232,105,128, 10,  6,237,225,244,242,225,231,245,
-    242,237,245,235,232,105,128, 10, 62,242,245,243,241,245,225,242,
-    101,128, 51,  3,246,239,247,229,236,243,233,231,110,  3, 36,116,
-     36,126, 36,133,226,229,238,231,225,236,105,128,  9,190,228,229,
-    246, 97,128,  9, 62,231,245,234,225,242,225,244,105,128, 10,190,
-     98,  4, 36,154, 36,195, 36,204, 36,214,226,242,229,246,233,225,
-    244,233,239,110,  2, 36,169, 36,184,237,225,242,235,225,242,237,
-    229,238,233,225,110,128,  5, 95,243,233,231,238,228,229,246, 97,
-    128,  9,112,229,238,231,225,236,105,128,  9,133,239,240,239,237,
-    239,230,111,128, 49, 26,242,229,246,101,134,  1,  3, 36,233, 36,
-    241, 36,252, 37,  7, 37, 15, 37, 27,225,227,245,244,101,128, 30,
-    175,227,249,242,233,236,236,233, 99,128,  4,209,228,239,244,226,
-    229,236,239,119,128, 30,183,231,242,225,246,101,128, 30,177,232,
-    239,239,235,225,226,239,246,101,128, 30,179,244,233,236,228,101,
-    128, 30,181, 99,  4, 37, 45, 37, 52, 37,131, 37,201,225,242,239,
-    110,128,  1,206,233,242, 99,  2, 37, 60, 37, 65,236,101,128, 36,
-    208,245,237,230,236,229,120,133,  0,226, 37, 84, 37, 92, 37,103,
-     37,111, 37,123,225,227,245,244,101,128, 30,165,228,239,244,226,
-    229,236,239,119,128, 30,173,231,242,225,246,101,128, 30,167,232,
-    239,239,235,225,226,239,246,101,128, 30,169,244,233,236,228,101,
-    128, 30,171,245,244,101,133,  0,180, 37,147, 37,158, 37,175, 37,
-    182, 37,191,226,229,236,239,247,227,237, 98,128,  3, 23, 99,  2,
-     37,164, 37,169,237, 98,128,  3,  1,239,237, 98,128,  3,  1,228,
-    229,246, 97,128,  9, 84,236,239,247,237,239,100,128,  2,207,244,
-    239,238,229,227,237, 98,128,  3, 65,249,242,233,236,236,233, 99,
-    128,  4, 48,100,  5, 37,223, 37,233, 37,247, 37,253, 38, 31,226,
-    236,231,242,225,246,101,128,  2,  1,228,225,235,231,245,242,237,
-    245,235,232,105,128, 10,113,229,246, 97,128,  9,  5,233,229,242,
-    229,243,233,115,130,  0,228, 38, 11, 38, 22,227,249,242,233,236,
-    236,233, 99,128,  4,211,237,225,227,242,239,110,128,  1,223,239,
-    116,  2, 38, 38, 38, 46,226,229,236,239,119,128, 30,161,237,225,
-    227,242,239,110,128,  1,225,101,131,  0,230, 38, 65, 38, 73, 38,
-     82,225,227,245,244,101,128,  1,253,235,239,242,229,225,110,128,
-     49, 80,237,225,227,242,239,110,128,  1,227,230,233,105,  6, 38,
-    107, 38,127, 41, 64, 41, 70, 41, 85, 44,185, 48,  2, 38,113, 38,
-    120,176,178,176, 56,128, 32, 21,184,185,180, 49,128, 32,164,177,
-     48,  3, 38,136, 40,160, 41, 39, 48,  9, 38,156, 38,176, 38,238,
-     39, 44, 39,106, 39,168, 39,230, 40, 36, 40, 98, 49,  3, 38,164,
-     38,168, 38,172, 55,128,  4, 16, 56,128,  4, 17, 57,128,  4, 18,
-     50, 10, 38,198, 38,202, 38,206, 38,210, 38,214, 38,218, 38,222,
-     38,226, 38,230, 38,234, 48,128,  4, 19, 49,128,  4, 20, 50,128,
-      4, 21, 51,128,  4,  1, 52,128,  4, 22, 53,128,  4, 23, 54,128,
-      4, 24, 55,128,  4, 25, 56,128,  4, 26, 57,128,  4, 27, 51, 10,
-     39,  4, 39,  8, 39, 12, 39, 16, 39, 20, 39, 24, 39, 28, 39, 32,
-     39, 36, 39, 40, 48,128,  4, 28, 49,128,  4, 29, 50,128,  4, 30,
-     51,128,  4, 31, 52,128,  4, 32, 53,128,  4, 33, 54,128,  4, 34,
-     55,128,  4, 35, 56,128,  4, 36, 57,128,  4, 37, 52, 10, 39, 66,
-     39, 70, 39, 74, 39, 78, 39, 82, 39, 86, 39, 90, 39, 94, 39, 98,
-     39,102, 48,128,  4, 38, 49,128,  4, 39, 50,128,  4, 40, 51,128,
-      4, 41, 52,128,  4, 42, 53,128,  4, 43, 54,128,  4, 44, 55,128,
-      4, 45, 56,128,  4, 46, 57,128,  4, 47, 53, 10, 39,128, 39,132,
-     39,136, 39,140, 39,144, 39,148, 39,152, 39,156, 39,160, 39,164,
-     48,128,  4,144, 49,128,  4,  2, 50,128,  4,  3, 51,128,  4,  4,
-     52,128,  4,  5, 53,128,  4,  6, 54,128,  4,  7, 55,128,  4,  8,
-     56,128,  4,  9, 57,128,  4, 10, 54, 10, 39,190, 39,194, 39,198,
-     39,202, 39,206, 39,210, 39,214, 39,218, 39,222, 39,226, 48,128,
-      4, 11, 49,128,  4, 12, 50,128,  4, 14, 51,128,246,196, 52,128,
-    246,197, 53,128,  4, 48, 54,128,  4, 49, 55,128,  4, 50, 56,128,
-      4, 51, 57,128,  4, 52, 55, 10, 39,252, 40,  0, 40,  4, 40,  8,
-     40, 12, 40, 16, 40, 20, 40, 24, 40, 28, 40, 32, 48,128,  4, 53,
-     49,128,  4, 81, 50,128,  4, 54, 51,128,  4, 55, 52,128,  4, 56,
-     53,128,  4, 57, 54,128,  4, 58, 55,128,  4, 59, 56,128,  4, 60,
-     57,128,  4, 61, 56, 10, 40, 58, 40, 62, 40, 66, 40, 70, 40, 74,
-     40, 78, 40, 82, 40, 86, 40, 90, 40, 94, 48,128,  4, 62, 49,128,
-      4, 63, 50,128,  4, 64, 51,128,  4, 65, 52,128,  4, 66, 53,128,
-      4, 67, 54,128,  4, 68, 55,128,  4, 69, 56,128,  4, 70, 57,128,
-      4, 71, 57, 10, 40,120, 40,124, 40,128, 40,132, 40,136, 40,140,
-     40,144, 40,148, 40,152, 40,156, 48,128,  4, 72, 49,128,  4, 73,
-     50,128,  4, 74, 51,128,  4, 75, 52,128,  4, 76, 53,128,  4, 77,
-     54,128,  4, 78, 55,128,  4, 79, 56,128,  4,145, 57,128,  4, 82,
-     49,  4, 40,170, 40,232, 40,237, 41,  7, 48, 10, 40,192, 40,196,
-     40,200, 40,204, 40,208, 40,212, 40,216, 40,220, 40,224, 40,228,
-     48,128,  4, 83, 49,128,  4, 84, 50,128,  4, 85, 51,128,  4, 86,
-     52,128,  4, 87, 53,128,  4, 88, 54,128,  4, 89, 55,128,  4, 90,
-     56,128,  4, 91, 57,128,  4, 92,177, 48,128,  4, 94, 52,  4, 40,
-    247, 40,251, 40,255, 41,  3, 53,128,  4, 15, 54,128,  4, 98, 55,
-    128,  4,114, 56,128,  4,116, 57,  5, 41, 19, 41, 23, 41, 27, 41,
-     31, 41, 35, 50,128,246,198, 51,128,  4, 95, 52,128,  4, 99, 53,
-    128,  4,115, 54,128,  4,117, 56,  2, 41, 45, 41, 59, 51,  2, 41,
-     51, 41, 55, 49,128,246,199, 50,128,246,200,180, 54,128,  4,217,
-    178,185, 57,128, 32, 14,179, 48,  2, 41, 77, 41, 81, 48,128, 32,
-     15, 49,128, 32, 13,181, 55,  7, 41,102, 41,172, 42,237, 43, 58,
-     44, 15, 44,108, 44,179, 51,  2, 41,108, 41,122, 56,  2, 41,114,
-     41,118, 49,128,  6,106, 56,128,  6, 12, 57,  8, 41,140, 41,144,
-     41,148, 41,152, 41,156, 41,160, 41,164, 41,168, 50,128,  6, 96,
-     51,128,  6, 97, 52,128,  6, 98, 53,128,  6, 99, 54,128,  6,100,
-     55,128,  6,101, 56,128,  6,102, 57,128,  6,103, 52,  7, 41,188,
-     41,220, 42, 26, 42, 88, 42,120, 42,176, 42,232, 48,  5, 41,200,
-     41,204, 41,208, 41,212, 41,216, 48,128,  6,104, 49,128,  6,105,
-     51,128,  6, 27, 55,128,  6, 31, 57,128,  6, 33, 49, 10, 41,242,
-     41,246, 41,250, 41,254, 42,  2, 42,  6, 42, 10, 42, 14, 42, 18,
-     42, 22, 48,128,  6, 34, 49,128,  6, 35, 50,128,  6, 36, 51,128,
-      6, 37, 52,128,  6, 38, 53,128,  6, 39, 54,128,  6, 40, 55,128,
-      6, 41, 56,128,  6, 42, 57,128,  6, 43, 50, 10, 42, 48, 42, 52,
-     42, 56, 42, 60, 42, 64, 42, 68, 42, 72, 42, 76, 42, 80, 42, 84,
-     48,128,  6, 44, 49,128,  6, 45, 50,128,  6, 46, 51,128,  6, 47,
-     52,128,  6, 48, 53,128,  6, 49, 54,128,  6, 50, 55,128,  6, 51,
-     56,128,  6, 52, 57,128,  6, 53, 51,  5, 42,100, 42,104, 42,108,
-     42,112, 42,116, 48,128,  6, 54, 49,128,  6, 55, 50,128,  6, 56,
-     51,128,  6, 57, 52,128,  6, 58, 52,  9, 42,140, 42,144, 42,148,
-     42,152, 42,156, 42,160, 42,164, 42,168, 42,172, 48,128,  6, 64,
-     49,128,  6, 65, 50,128,  6, 66, 51,128,  6, 67, 52,128,  6, 68,
-     53,128,  6, 69, 54,128,  6, 70, 56,128,  6, 72, 57,128,  6, 73,
-     53,  9, 42,196, 42,200, 42,204, 42,208, 42,212, 42,216, 42,220,
-     42,224, 42,228, 48,128,  6, 74, 49,128,  6, 75, 50,128,  6, 76,
-     51,128,  6, 77, 52,128,  6, 78, 53,128,  6, 79, 54,128,  6, 80,
-     55,128,  6, 81, 56,128,  6, 82,183, 48,128,  6, 71, 53,  3, 42,
-    245, 43, 21, 43, 53, 48,  5, 43,  1, 43,  5, 43,  9, 43, 13, 43,
-     17, 53,128,  6,164, 54,128,  6,126, 55,128,  6,134, 56,128,  6,
-    152, 57,128,  6,175, 49,  5, 43, 33, 43, 37, 43, 41, 43, 45, 43,
-     49, 49,128,  6,121, 50,128,  6,136, 51,128,  6,145, 52,128,  6,
-    186, 57,128,  6,210,179, 52,128,  6,213, 54,  7, 43, 74, 43, 79,
-     43, 84, 43, 89, 43,127, 43,189, 43,251,179, 54,128, 32,170,180,
-     53,128,  5,190,181, 56,128,  5,195, 54,  6, 43,103, 43,107, 43,
-    111, 43,115, 43,119, 43,123, 52,128,  5,208, 53,128,  5,209, 54,
-    128,  5,210, 55,128,  5,211, 56,128,  5,212, 57,128,  5,213, 55,
-     10, 43,149, 43,153, 43,157, 43,161, 43,165, 43,169, 43,173, 43,
-    177, 43,181, 43,185, 48,128,  5,214, 49,128,  5,215, 50,128,  5,
-    216, 51,128,  5,217, 52,128,  5,218, 53,128,  5,219, 54,128,  5,
-    220, 55,128,  5,221, 56,128,  5,222, 57,128,  5,223, 56, 10, 43,
-    211, 43,215, 43,219, 43,223, 43,227, 43,231, 43,235, 43,239, 43,
-    243, 43,247, 48,128,  5,224, 49,128,  5,225, 50,128,  5,226, 51,
-    128,  5,227, 52,128,  5,228, 53,128,  5,229, 54,128,  5,230, 55,
-    128,  5,231, 56,128,  5,232, 57,128,  5,233, 57,  3, 44,  3, 44,
-      7, 44, 11, 48,128,  5,234, 52,128,251, 42, 53,128,251, 43, 55,
-      4, 44, 25, 44, 39, 44, 59, 44, 64, 48,  2, 44, 31, 44, 35, 48,
-    128,251, 75, 53,128,251, 31, 49,  3, 44, 47, 44, 51, 44, 55, 54,
-    128,  5,240, 55,128,  5,241, 56,128,  5,242,178, 51,128,251, 53,
-     57,  7, 44, 80, 44, 84, 44, 88, 44, 92, 44, 96, 44,100, 44,104,
-     51,128,  5,180, 52,128,  5,181, 53,128,  5,182, 54,128,  5,187,
-     55,128,  5,184, 56,128,  5,183, 57,128,  5,176, 56,  3, 44,116,
-     44,160, 44,165, 48,  7, 44,132, 44,136, 44,140, 44,144, 44,148,
-     44,152, 44,156, 48,128,  5,178, 49,128,  5,177, 50,128,  5,179,
-     51,128,  5,194, 52,128,  5,193, 54,128,  5,185, 55,128,  5,188,
-    179, 57,128,  5,189, 52,  2, 44,171, 44,175, 49,128,  5,191, 50,
-    128,  5,192,185,178, 57,128,  2,188, 54,  3, 44,193, 44,252, 45,
-      3, 49,  4, 44,203, 44,219, 44,225, 44,246, 50,  2, 44,209, 44,
-    214,180, 56,128, 33,  5,184, 57,128, 33, 19,179,181, 50,128, 33,
-     22,181, 55,  3, 44,234, 44,238, 44,242, 51,128, 32, 44, 52,128,
-     32, 45, 53,128, 32, 46,182,182, 52,128, 32, 12,179,177,182, 55,
-    128,  6,109,180,185,179, 55,128,  2,189,103,  2, 45, 16, 45, 23,
-    242,225,246,101,128,  0,224,117,  2, 45, 29, 45, 38,234,225,242,
-    225,244,105,128, 10,133,242,237,245,235,232,105,128, 10,  5,104,
-      2, 45, 53, 45, 63,233,242,225,231,225,238, 97,128, 48, 66,239,
-    239,235,225,226,239,246,101,128, 30,163,105,  7, 45, 90, 45,115,
-     45,122, 45,134, 45,159, 45,175, 45,255, 98,  2, 45, 96, 45,105,
-    229,238,231,225,236,105,128,  9,144,239,240,239,237,239,230,111,
-    128, 49, 30,228,229,246, 97,128,  9, 16,229,227,249,242,233,236,
-    236,233, 99,128,  4,213,231,117,  2, 45,141, 45,150,234,225,242,
-    225,244,105,128, 10,144,242,237,245,235,232,105,128, 10, 16,237,
-    225,244,242,225,231,245,242,237,245,235,232,105,128, 10, 72,110,
-      5, 45,187, 45,196, 45,210, 45,226, 45,241,225,242,225,226,233,
-     99,128,  6, 57,230,233,238,225,236,225,242,225,226,233, 99,128,
-    254,202,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,
-    254,203,237,229,228,233,225,236,225,242,225,226,233, 99,128,254,
-    204,246,229,242,244,229,228,226,242,229,246,101,128,  2,  3,246,
-    239,247,229,236,243,233,231,110,  3, 46, 15, 46, 25, 46, 32,226,
-    229,238,231,225,236,105,128,  9,200,228,229,246, 97,128,  9, 72,
-    231,245,234,225,242,225,244,105,128, 10,200,107,  2, 46, 49, 46,
-     73,225,244,225,235,225,238, 97,129, 48,162, 46, 61,232,225,236,
-    230,247,233,228,244,104,128,255,113,239,242,229,225,110,128, 49,
-     79,108,  3, 46, 89, 47,145, 47,154,101,  2, 46, 95, 47,140,102,
-    136,  5,208, 46,115, 46,124, 46,139, 46,153, 46,242, 47,  0, 47,
-    111, 47,125,225,242,225,226,233, 99,128,  6, 39,228,225,231,229,
-    243,232,232,229,226,242,229,119,128,251, 48,230,233,238,225,236,
-    225,242,225,226,233, 99,128,254,142,104,  2, 46,159, 46,234,225,
-    237,250, 97,  2, 46,168, 46,201,225,226,239,246,101,  2, 46,178,
-     46,187,225,242,225,226,233, 99,128,  6, 35,230,233,238,225,236,
-    225,242,225,226,233, 99,128,254,132,226,229,236,239,119,  2, 46,
-    211, 46,220,225,242,225,226,233, 99,128,  6, 37,230,233,238,225,
-    236,225,242,225,226,233, 99,128,254,136,229,226,242,229,119,128,
-      5,208,236,225,237,229,228,232,229,226,242,229,119,128,251, 79,
-    237, 97,  2, 47,  7, 47, 43,228,228,225,225,226,239,246,101,  2,
-     47, 20, 47, 29,225,242,225,226,233, 99,128,  6, 34,230,233,238,
-    225,236,225,242,225,226,233, 99,128,254,130,235,243,245,242, 97,
-      4, 47, 57, 47, 66, 47, 80, 47, 96,225,242,225,226,233, 99,128,
-      6, 73,230,233,238,225,236,225,242,225,226,233, 99,128,254,240,
-    233,238,233,244,233,225,236,225,242,225,226,233, 99,128,254,243,
-    237,229,228,233,225,236,225,242,225,226,233, 99,128,254,244,240,
-    225,244,225,232,232,229,226,242,229,119,128,251, 46,241,225,237,
-    225,244,243,232,229,226,242,229,119,128,251, 47,240,104,128, 33,
-     53,236,229,241,245,225,108,128, 34, 76,240,232, 97,129,  3,177,
-     47,162,244,239,238,239,115,128,  3,172,109,  4, 47,180, 47,188,
-     47,199, 47,233,225,227,242,239,110,128,  1,  1,239,238,239,243,
-    240,225,227,101,128,255, 65,240,229,242,243,225,238,100,130,  0,
-     38, 47,213, 47,225,237,239,238,239,243,240,225,227,101,128,255,
-      6,243,237,225,236,108,128,247, 38,243,241,245,225,242,101,128,
-     51,194,110,  4, 47,252, 48,  7, 48,129, 48,139,226,239,240,239,
-    237,239,230,111,128, 49, 34,103,  4, 48, 17, 48, 28, 48, 42, 48,
-    121,226,239,240,239,237,239,230,111,128, 49, 36,235,232,225,238,
-    235,232,245,244,232,225,105,128, 14, 90,236,101,131, 34, 32, 48,
-     53, 48,106, 48,113,226,242,225,227,235,229,116,  2, 48, 65, 48,
-     85,236,229,230,116,129, 48,  8, 48, 74,246,229,242,244,233,227,
-    225,108,128,254, 63,242,233,231,232,116,129, 48,  9, 48, 95,246,
-    229,242,244,233,227,225,108,128,254, 64,236,229,230,116,128, 35,
-     41,242,233,231,232,116,128, 35, 42,243,244,242,239,109,128, 33,
-     43,239,244,229,236,229,233, 97,128,  3,135,117,  2, 48,145, 48,
-    157,228,225,244,244,225,228,229,246, 97,128,  9, 82,243,246,225,
-    242, 97,  3, 48,169, 48,179, 48,186,226,229,238,231,225,236,105,
-    128,  9,130,228,229,246, 97,128,  9,  2,231,245,234,225,242,225,
-    244,105,128, 10,130,239,231,239,238,229,107,128,  1,  5,112,  3,
-     48,214, 48,238, 49, 12, 97,  2, 48,220, 48,232,225,244,239,243,
-    241,245,225,242,101,128, 51,  0,242,229,110,128, 36,156,239,243,
-    244,242,239,240,232,101,  2, 48,251, 49,  6,225,242,237,229,238,
-    233,225,110,128,  5, 90,237,239,100,128,  2,188,112,  2, 49, 18,
-     49, 23,236,101,128,248,255,242,111,  2, 49, 30, 49, 38,225,227,
-    232,229,115,128, 34, 80,120,  2, 49, 44, 49, 64,229,241,245,225,
-    108,129, 34, 72, 49, 54,239,242,233,237,225,231,101,128, 34, 82,
-    233,237,225,244,229,236,249,229,241,245,225,108,128, 34, 69,114,
-      4, 49, 89, 49,116, 49,120, 49,165,225,229, 97,  2, 49, 97, 49,
-    107,229,235,239,242,229,225,110,128, 49,142,235,239,242,229,225,
-    110,128, 49,141, 99,128, 35, 18,105,  2, 49,126, 49,140,231,232,
-    244,232,225,236,230,242,233,238,103,128, 30,154,238,103,130,  0,
-    229, 49,149, 49,157,225,227,245,244,101,128,  1,251,226,229,236,
-    239,119,128, 30,  1,242,239,119,  8, 49,185, 49,192, 50, 65, 50,
-    131, 50,181, 50,236, 51,  3, 51, 78,226,239,244,104,128, 33,148,
-    100,  3, 49,200, 49,239, 50, 30,225,243,104,  4, 49,212, 49,219,
-     49,226, 49,234,228,239,247,110,128, 33,227,236,229,230,116,128,
-     33,224,242,233,231,232,116,128, 33,226,245,112,128, 33,225,226,
-    108,  5, 49,252, 50,  3, 50, 10, 50, 17, 50, 25,226,239,244,104,
-    128, 33,212,228,239,247,110,128, 33,211,236,229,230,116,128, 33,
-    208,242,233,231,232,116,128, 33,210,245,112,128, 33,209,239,247,
-    110,131, 33,147, 50, 42, 50, 49, 50, 57,236,229,230,116,128, 33,
-    153,242,233,231,232,116,128, 33,152,247,232,233,244,101,128, 33,
-    233,104,  2, 50, 71, 50,122,229,225,100,  4, 50, 83, 50, 93, 50,
-    103, 50,114,228,239,247,238,237,239,100,128,  2,197,236,229,230,
-    244,237,239,100,128,  2,194,242,233,231,232,244,237,239,100,128,
-      2,195,245,240,237,239,100,128,  2,196,239,242,233,250,229,120,
-    128,248,231,236,229,230,116,131, 33,144, 50,144, 50,161, 50,173,
-    228,226,108,129, 33,208, 50,152,243,244,242,239,235,101,128, 33,
-    205,239,246,229,242,242,233,231,232,116,128, 33,198,247,232,233,
-    244,101,128, 33,230,242,233,231,232,116,132, 33,146, 50,197, 50,
-    209, 50,217, 50,228,228,226,236,243,244,242,239,235,101,128, 33,
-    207,232,229,225,246,121,128, 39,158,239,246,229,242,236,229,230,
-    116,128, 33,196,247,232,233,244,101,128, 33,232,244,225, 98,  2,
-     50,244, 50,251,236,229,230,116,128, 33,228,242,233,231,232,116,
-    128, 33,229,245,112,132, 33,145, 51, 16, 51, 44, 51, 62, 51, 70,
-    100,  2, 51, 22, 51, 34,110,129, 33,149, 51, 28,226,243,101,128,
-     33,168,239,247,238,226,225,243,101,128, 33,168,236,229,230,116,
-    129, 33,150, 51, 53,239,230,228,239,247,110,128, 33,197,242,233,
-    231,232,116,128, 33,151,247,232,233,244,101,128, 33,231,246,229,
-    242,244,229,120,128,248,230,115,  5, 51, 99, 51,175, 51,220, 52,
-     47, 52, 57, 99,  2, 51,105, 51,157,233,105,  2, 51,112, 51,135,
-    227,233,242,227,245,109,129,  0, 94, 51,123,237,239,238,239,243,
-    240,225,227,101,128,255, 62,244,233,236,228,101,129,  0,126, 51,
-    145,237,239,238,239,243,240,225,227,101,128,255, 94,242,233,240,
-    116,129,  2, 81, 51,166,244,245,242,238,229,100,128,  2, 82,237,
-    225,236,108,  2, 51,184, 51,195,232,233,242,225,231,225,238, 97,
-    128, 48, 65,235,225,244,225,235,225,238, 97,129, 48,161, 51,208,
-    232,225,236,230,247,233,228,244,104,128,255,103,244,229,242,233,
-    115,  2, 51,230, 52, 43,107,131,  0, 42, 51,240, 52, 12, 52, 35,
-     97,  2, 51,246, 52,  4,236,244,239,238,229,225,242,225,226,233,
-     99,128,  6,109,242,225,226,233, 99,128,  6,109,109,  2, 52, 18,
-     52, 24,225,244,104,128, 34, 23,239,238,239,243,240,225,227,101,
-    128,255, 10,243,237,225,236,108,128,254, 97,109,128, 32, 66,245,
-    240,229,242,233,239,114,128,246,233,249,237,240,244,239,244,233,
-    227,225,236,236,249,229,241,245,225,108,128, 34, 67,116,132,  0,
-     64, 52, 89, 52, 96, 52,108, 52,116,233,236,228,101,128,  0,227,
-    237,239,238,239,243,240,225,227,101,128,255, 32,243,237,225,236,
-    108,128,254,107,245,242,238,229,100,128,  2, 80,117,  6, 52,138,
-     52,163, 52,170, 52,195, 52,215, 52,231, 98,  2, 52,144, 52,153,
-    229,238,231,225,236,105,128,  9,148,239,240,239,237,239,230,111,
-    128, 49, 32,228,229,246, 97,128,  9, 20,231,117,  2, 52,177, 52,
-    186,234,225,242,225,244,105,128, 10,148,242,237,245,235,232,105,
-    128, 10, 20,236,229,238,231,244,232,237,225,242,235,226,229,238,
-    231,225,236,105,128,  9,215,237,225,244,242,225,231,245,242,237,
-    245,235,232,105,128, 10, 76,246,239,247,229,236,243,233,231,110,
-      3, 52,247, 53,  1, 53,  8,226,229,238,231,225,236,105,128,  9,
-    204,228,229,246, 97,128,  9, 76,231,245,234,225,242,225,244,105,
-    128, 10,204,246,225,231,242,225,232,225,228,229,246, 97,128,  9,
-     61,121,  2, 53, 39, 53, 51,226,225,242,237,229,238,233,225,110,
-    128,  5, 97,233,110,130,  5,226, 53, 60, 53, 75,225,236,244,239,
-    238,229,232,229,226,242,229,119,128,251, 32,232,229,226,242,229,
-    119,128,  5,226, 98,144,  0, 98, 53,120, 53,255, 54, 10, 54, 19,
-     54, 44, 55, 85, 55,147, 55,220, 57,146, 57,158, 57,201, 57,209,
-     57,219, 59, 89, 59,113, 59,122, 97,  7, 53,136, 53,146, 53,170,
-     53,177, 53,202, 53,226, 53,237,226,229,238,231,225,236,105,128,
-      9,172,227,235,243,236,225,243,104,129,  0, 92, 53,158,237,239,
-    238,239,243,240,225,227,101,128,255, 60,228,229,246, 97,128,  9,
-     44,231,117,  2, 53,184, 53,193,234,225,242,225,244,105,128, 10,
-    172,242,237,245,235,232,105,128, 10, 44,104,  2, 53,208, 53,218,
-    233,242,225,231,225,238, 97,128, 48,112,244,244,232,225,105,128,
-     14, 63,235,225,244,225,235,225,238, 97,128, 48,208,114,129,  0,
-    124, 53,243,237,239,238,239,243,240,225,227,101,128,255, 92,226,
-    239,240,239,237,239,230,111,128, 49,  5,227,233,242,227,236,101,
-    128, 36,209,228,239,116,  2, 54, 27, 54, 36,225,227,227,229,238,
-    116,128, 30,  3,226,229,236,239,119,128, 30,  5,101,  6, 54, 58,
-     54, 79, 54,102, 54,244, 54,255, 55, 11,225,237,229,228,243,233,
-    248,244,229,229,238,244,232,238,239,244,229,115,128, 38,108, 99,
-      2, 54, 85, 54, 92,225,245,243,101,128, 34, 53,249,242,233,236,
-    236,233, 99,128,  4, 49,104,  5, 54,114, 54,123, 54,137, 54,167,
-     54,226,225,242,225,226,233, 99,128,  6, 40,230,233,238,225,236,
-    225,242,225,226,233, 99,128,254,144,105,  2, 54,143, 54,158,238,
-    233,244,233,225,236,225,242,225,226,233, 99,128,254,145,242,225,
-    231,225,238, 97,128, 48,121,237,101,  2, 54,174, 54,187,228,233,
-    225,236,225,242,225,226,233, 99,128,254,146,229,237,105,  2, 54,
-    195, 54,210,238,233,244,233,225,236,225,242,225,226,233, 99,128,
-    252,159,243,239,236,225,244,229,228,225,242,225,226,233, 99,128,
-    252,  8,238,239,239,238,230,233,238,225,236,225,242,225,226,233,
-     99,128,252,109,235,225,244,225,235,225,238, 97,128, 48,217,238,
-    225,242,237,229,238,233,225,110,128,  5, 98,116,132,  5,209, 55,
-     23, 55, 43, 55, 63, 55, 72, 97,129,  3,178, 55, 29,243,249,237,
-    226,239,236,231,242,229,229,107,128,  3,208,228,225,231,229,243,
-    104,129,251, 49, 55, 54,232,229,226,242,229,119,128,251, 49,232,
-    229,226,242,229,119,128,  5,209,242,225,230,229,232,229,226,242,
-    229,119,128,251, 76,104,  2, 55, 91, 55,141, 97,  3, 55, 99, 55,
-    109, 55,116,226,229,238,231,225,236,105,128,  9,173,228,229,246,
-     97,128,  9, 45,231,117,  2, 55,123, 55,132,234,225,242,225,244,
-    105,128, 10,173,242,237,245,235,232,105,128, 10, 45,239,239,107,
-    128,  2, 83,105,  5, 55,159, 55,170, 55,181, 55,195, 55,209,232,
-    233,242,225,231,225,238, 97,128, 48,115,235,225,244,225,235,225,
-    238, 97,128, 48,211,236,225,226,233,225,236,227,236,233,227,107,
-    128,  2,152,238,228,233,231,245,242,237,245,235,232,105,128, 10,
-      2,242,245,243,241,245,225,242,101,128, 51, 49,108,  3, 55,228,
-     57,129, 57,140, 97,  2, 55,234, 57,124,227,107,  6, 55,249, 56,
-      2, 56, 39, 56,188, 56,243, 57, 39,227,233,242,227,236,101,128,
-     37,207,100,  2, 56,  8, 56, 17,233,225,237,239,238,100,128, 37,
-    198,239,247,238,240,239,233,238,244,233,238,231,244,242,233,225,
-    238,231,236,101,128, 37,188,108,  2, 56, 45, 56,148,101,  2, 56,
-     51, 56, 87,230,244,240,239,233,238,244,233,238,103,  2, 56, 66,
-     56, 76,240,239,233,238,244,229,114,128, 37,196,244,242,233,225,
-    238,231,236,101,128, 37,192,238,244,233,227,245,236,225,242,226,
-    242,225,227,235,229,116,  2, 56,107, 56,127,236,229,230,116,129,
-     48, 16, 56,116,246,229,242,244,233,227,225,108,128,254, 59,242,
-    233,231,232,116,129, 48, 17, 56,137,246,229,242,244,233,227,225,
-    108,128,254, 60,239,247,229,114,  2, 56,157, 56,172,236,229,230,
-    244,244,242,233,225,238,231,236,101,128, 37,227,242,233,231,232,
-    244,244,242,233,225,238,231,236,101,128, 37,226,114,  2, 56,194,
-     56,205,229,227,244,225,238,231,236,101,128, 37,172,233,231,232,
-    244,240,239,233,238,244,233,238,103,  2, 56,222, 56,232,240,239,
-    233,238,244,229,114,128, 37,186,244,242,233,225,238,231,236,101,
-    128, 37,182,115,  3, 56,251, 57, 25, 57, 33,109,  2, 57,  1, 57,
-     13,225,236,236,243,241,245,225,242,101,128, 37,170,233,236,233,
-    238,231,230,225,227,101,128, 38, 59,241,245,225,242,101,128, 37,
-    160,244,225,114,128, 38,  5,245,240,112,  2, 57, 47, 57, 85,229,
-    114,  2, 57, 54, 57, 69,236,229,230,244,244,242,233,225,238,231,
-    236,101,128, 37,228,242,233,231,232,244,244,242,233,225,238,231,
-    236,101,128, 37,229,239,233,238,244,233,238,103,  2, 57, 97, 57,
-    113,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37,
-    180,244,242,233,225,238,231,236,101,128, 37,178,238,107,128, 36,
-     35,233,238,229,226,229,236,239,119,128, 30,  7,239,227,107,128,
-     37,136,237,239,238,239,243,240,225,227,101,128,255, 66,111,  3,
-     57,166, 57,179, 57,190,226,225,233,237,225,233,244,232,225,105,
-    128, 14, 26,232,233,242,225,231,225,238, 97,128, 48,124,235,225,
-    244,225,235,225,238, 97,128, 48,220,240,225,242,229,110,128, 36,
-    157,241,243,241,245,225,242,101,128, 51,195,114,  4, 57,229, 58,
-    223, 59, 40, 59, 79,225, 99,  2, 57,236, 58,130,101,  3, 57,244,
-     57,249, 58, 61,229,120,128,248,244,236,229,230,116,133,  0,123,
-     58, 10, 58, 15, 58, 37, 58, 45, 58, 50,226,116,128,248,243,109,
-      2, 58, 21, 58, 26,233,100,128,248,242,239,238,239,243,240,225,
-    227,101,128,255, 91,243,237,225,236,108,128,254, 91,244,112,128,
-    248,241,246,229,242,244,233,227,225,108,128,254, 55,242,233,231,
-    232,116,133,  0,125, 58, 79, 58, 84, 58,106, 58,114, 58,119,226,
-    116,128,248,254,109,  2, 58, 90, 58, 95,233,100,128,248,253,239,
-    238,239,243,240,225,227,101,128,255, 93,243,237,225,236,108,128,
-    254, 92,244,112,128,248,252,246,229,242,244,233,227,225,108,128,
-    254, 56,235,229,116,  2, 58,138, 58,180,236,229,230,116,132,  0,
-     91, 58,153, 58,158, 58,163, 58,175,226,116,128,248,240,229,120,
-    128,248,239,237,239,238,239,243,240,225,227,101,128,255, 59,244,
-    112,128,248,238,242,233,231,232,116,132,  0, 93, 58,196, 58,201,
-     58,206, 58,218,226,116,128,248,251,229,120,128,248,250,237,239,
-    238,239,243,240,225,227,101,128,255, 61,244,112,128,248,249,229,
-    246,101,131,  2,216, 58,235, 58,246, 58,252,226,229,236,239,247,
-    227,237, 98,128,  3, 46,227,237, 98,128,  3,  6,233,238,246,229,
-    242,244,229,100,  3, 59, 11, 59, 22, 59, 28,226,229,236,239,247,
-    227,237, 98,128,  3, 47,227,237, 98,128,  3, 17,228,239,245,226,
-    236,229,227,237, 98,128,  3, 97,233,228,231,101,  2, 59, 49, 59,
-     60,226,229,236,239,247,227,237, 98,128,  3, 42,233,238,246,229,
-    242,244,229,228,226,229,236,239,247,227,237, 98,128,  3, 58,239,
-    235,229,238,226,225,114,128,  0,166,115,  2, 59, 95, 59,103,244,
-    242,239,235,101,128,  1,128,245,240,229,242,233,239,114,128,246,
-    234,244,239,240,226,225,114,128,  1,131,117,  3, 59,130, 59,141,
-     59,152,232,233,242,225,231,225,238, 97,128, 48,118,235,225,244,
-    225,235,225,238, 97,128, 48,214,236,108,  2, 59,159, 59,189,229,
-    116,130, 32, 34, 59,168, 59,178,233,238,246,229,242,243,101,128,
-     37,216,239,240,229,242,225,244,239,114,128, 34, 25,243,229,249,
-    101,128, 37,206, 99,143,  0, 99, 59,230, 60,179, 60,190, 60,254,
-     61, 29, 61,122, 63, 33, 64, 17, 64,117, 64,166, 67,158, 67,166,
-     67,176, 67,188, 67,221, 97,  9, 59,250, 60,  5, 60, 15, 60, 22,
-     60, 29, 60, 54, 60, 64, 60,116, 60,125,225,242,237,229,238,233,
-    225,110,128,  5,110,226,229,238,231,225,236,105,128,  9,154,227,
-    245,244,101,128,  1,  7,228,229,246, 97,128,  9, 26,231,117,  2,
-     60, 36, 60, 45,234,225,242,225,244,105,128, 10,154,242,237,245,
-    235,232,105,128, 10, 26,236,243,241,245,225,242,101,128, 51,136,
-    238,228,242,225,226,233,238,228,117,  4, 60, 82, 60, 92, 60, 98,
-     60,105,226,229,238,231,225,236,105,128,  9,129,227,237, 98,128,
-      3, 16,228,229,246, 97,128,  9,  1,231,245,234,225,242,225,244,
-    105,128, 10,129,240,243,236,239,227,107,128, 33,234,114,  3, 60,
-    133, 60,139, 60,165,229,239,102,128, 33,  5,239,110,130,  2,199,
-     60,148, 60,159,226,229,236,239,247,227,237, 98,128,  3, 44,227,
-    237, 98,128,  3, 12,242,233,225,231,229,242,229,244,245,242,110,
-    128, 33,181,226,239,240,239,237,239,230,111,128, 49, 24, 99,  4,
-     60,200, 60,207, 60,226, 60,248,225,242,239,110,128,  1, 13,229,
-    228,233,236,236, 97,129,  0,231, 60,218,225,227,245,244,101,128,
-     30,  9,233,242, 99,  2, 60,234, 60,239,236,101,128, 36,210,245,
-    237,230,236,229,120,128,  1,  9,245,242,108,128,  2, 85,100,  2,
-     61,  4, 61, 20,239,116,129,  1, 11, 61, 11,225,227,227,229,238,
-    116,128,  1, 11,243,241,245,225,242,101,128, 51,197,101,  2, 61,
-     35, 61, 51,228,233,236,236, 97,129,  0,184, 61, 45,227,237, 98,
-    128,  3, 39,238,116,132,  0,162, 61, 64, 61, 88, 61,100, 61,111,
-    105,  2, 61, 70, 61, 78,231,242,225,228,101,128, 33,  3,238,230,
-    229,242,233,239,114,128,246,223,237,239,238,239,243,240,225,227,
-    101,128,255,224,239,236,228,243,244,249,236,101,128,247,162,243,
-    245,240,229,242,233,239,114,128,246,224,104,  5, 61,134, 61,197,
-     61,208, 62,136, 62,228, 97,  4, 61,144, 61,155, 61,165, 61,172,
-    225,242,237,229,238,233,225,110,128,  5,121,226,229,238,231,225,
-    236,105,128,  9,155,228,229,246, 97,128,  9, 27,231,117,  2, 61,
-    179, 61,188,234,225,242,225,244,105,128, 10,155,242,237,245,235,
-    232,105,128, 10, 27,226,239,240,239,237,239,230,111,128, 49, 20,
-    101,  6, 61,222, 61,242, 62, 10, 62, 78, 62, 90, 62,111,225,226,
-    235,232,225,243,233,225,238,227,249,242,233,236,236,233, 99,128,
-      4,189, 99,  2, 61,248, 62,  0,235,237,225,242,107,128, 39, 19,
-    249,242,233,236,236,233, 99,128,  4, 71,100,  2, 62, 16, 62, 60,
-    229,243,227,229,238,228,229,114,  2, 62, 29, 62, 49,225,226,235,
-    232,225,243,233,225,238,227,249,242,233,236,236,233, 99,128,  4,
-    191,227,249,242,233,236,236,233, 99,128,  4,183,233,229,242,229,
-    243,233,243,227,249,242,233,236,236,233, 99,128,  4,245,232,225,
-    242,237,229,238,233,225,110,128,  5,115,235,232,225,235,225,243,
-    243,233,225,238,227,249,242,233,236,236,233, 99,128,  4,204,246,
-    229,242,244,233,227,225,236,243,244,242,239,235,229,227,249,242,
-    233,236,236,233, 99,128,  4,185,105,129,  3,199, 62,142,229,245,
-    227,104,  4, 62,155, 62,190, 62,205, 62,214, 97,  2, 62,161, 62,
-    176,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,119,
-    240,225,242,229,238,235,239,242,229,225,110,128, 50, 23,227,233,
-    242,227,236,229,235,239,242,229,225,110,128, 50,105,235,239,242,
-    229,225,110,128, 49, 74,240,225,242,229,238,235,239,242,229,225,
-    110,128, 50,  9,111,  2, 62,234, 63, 28,227,104,  3, 62,243, 63,
-      9, 63, 19,225,110,  2, 62,250, 63,  2,231,244,232,225,105,128,
-     14, 10,244,232,225,105,128, 14,  8,233,238,231,244,232,225,105,
-    128, 14,  9,239,229,244,232,225,105,128, 14, 12,239,107,128,  1,
-    136,105,  2, 63, 39, 63,141,229,245, 99,  5, 63, 53, 63, 88, 63,
-    103, 63,112, 63,126, 97,  2, 63, 59, 63, 74,227,233,242,227,236,
-    229,235,239,242,229,225,110,128, 50,118,240,225,242,229,238,235,
-    239,242,229,225,110,128, 50, 22,227,233,242,227,236,229,235,239,
-    242,229,225,110,128, 50,104,235,239,242,229,225,110,128, 49, 72,
-    240,225,242,229,238,235,239,242,229,225,110,128, 50,  8,245,240,
-    225,242,229,238,235,239,242,229,225,110,128, 50, 28,242, 99,  2,
-     63,148, 63,243,236,101,132, 37,203, 63,161, 63,172, 63,177, 63,
-    201,237,245,236,244,233,240,236,121,128, 34,151,239,116,128, 34,
-    153,112,  2, 63,183, 63,189,236,245,115,128, 34,149,239,243,244,
-    225,236,237,225,242,107,128, 48, 54,247,233,244,104,  2, 63,210,
-     63,226,236,229,230,244,232,225,236,230,226,236,225,227,107,128,
-     37,208,242,233,231,232,244,232,225,236,230,226,236,225,227,107,
-    128, 37,209,245,237,230,236,229,120,130,  2,198, 64,  0, 64, 11,
-    226,229,236,239,247,227,237, 98,128,  3, 45,227,237, 98,128,  3,
-      2,108,  3, 64, 25, 64, 31, 64, 85,229,225,114,128, 35, 39,233,
-    227,107,  4, 64, 43, 64, 54, 64, 63, 64, 73,225,236,246,229,239,
-    236,225,114,128,  1,194,228,229,238,244,225,108,128,  1,192,236,
-    225,244,229,242,225,108,128,  1,193,242,229,244,242,239,230,236,
-    229,120,128,  1,195,245, 98,129, 38, 99, 64, 92,243,245,233,116,
-      2, 64,101, 64,109,226,236,225,227,107,128, 38, 99,247,232,233,
-    244,101,128, 38,103,109,  3, 64,125, 64,139, 64,150,227,245,226,
-    229,228,243,241,245,225,242,101,128, 51,164,239,238,239,243,240,
-    225,227,101,128,255, 67,243,241,245,225,242,229,228,243,241,245,
-    225,242,101,128, 51,160,111,  8, 64,184, 64,195, 65, 26, 65,224,
-     66,253, 67, 28, 67,135, 67,144,225,242,237,229,238,233,225,110,
-    128,  5,129,236,239,110,131,  0, 58, 64,207, 64,232, 64,251,237,
-    239,110,  2, 64,215, 64,223,229,244,225,242,121,128, 32,161,239,
-    243,240,225,227,101,128,255, 26,115,  2, 64,238, 64,244,233,231,
-    110,128, 32,161,237,225,236,108,128,254, 85,244,242,233,225,238,
-    231,245,236,225,114,  2, 65, 10, 65, 20,232,225,236,230,237,239,
-    100,128,  2,209,237,239,100,128,  2,208,109,  2, 65, 32, 65,217,
-    237, 97,134,  0, 44, 65, 49, 65,113, 65,124, 65,136, 65,166, 65,
-    189, 97,  3, 65, 57, 65, 83, 65, 91,226,239,246,101,  2, 65, 66,
-     65, 72,227,237, 98,128,  3, 19,242,233,231,232,244,227,237, 98,
-    128,  3, 21,227,227,229,238,116,128,246,195,114,  2, 65, 97, 65,
-    104,225,226,233, 99,128,  6, 12,237,229,238,233,225,110,128,  5,
-     93,233,238,230,229,242,233,239,114,128,246,225,237,239,238,239,
-    243,240,225,227,101,128,255, 12,242,229,246,229,242,243,229,100,
-      2, 65,149, 65,160,225,226,239,246,229,227,237, 98,128,  3, 20,
-    237,239,100,128,  2,189,115,  2, 65,172, 65,179,237,225,236,108,
-    128,254, 80,245,240,229,242,233,239,114,128,246,226,244,245,242,
-    238,229,100,  2, 65,200, 65,211,225,226,239,246,229,227,237, 98,
-    128,  3, 18,237,239,100,128,  2,187,240,225,243,115,128, 38, 60,
-    110,  2, 65,230, 65,239,231,242,245,229,238,116,128, 34, 69,116,
-      2, 65,245, 66,  3,239,245,242,233,238,244,229,231,242,225,108,
-    128, 34, 46,242,239,108,142, 35,  3, 66, 37, 66, 43, 66, 58, 66,
-     73, 66,117, 66,162, 66,176, 66,181, 66,186, 66,191, 66,197, 66,
-    202, 66,243, 66,248,193,195, 75,128,  0,  6, 66,  2, 66, 49, 66,
-     54,197, 76,128,  0,  7, 83,128,  0,  8, 67,  2, 66, 64, 66, 69,
-    193, 78,128,  0, 24, 82,128,  0, 13, 68,  3, 66, 81, 66,107, 66,
-    112, 67,  4, 66, 91, 66, 95, 66, 99, 66,103, 49,128,  0, 17, 50,
-    128,  0, 18, 51,128,  0, 19, 52,128,  0, 20,197, 76,128,  0,127,
-    204, 69,128,  0, 16, 69,  5, 66,129, 66,133, 66,138, 66,143, 66,
-    148, 77,128,  0, 25,206, 81,128,  0,  5,207, 84,128,  0,  4,211,
-     67,128,  0, 27, 84,  2, 66,154, 66,158, 66,128,  0, 23, 88,128,
-      0,  3, 70,  2, 66,168, 66,172, 70,128,  0, 12, 83,128,  0, 28,
-    199, 83,128,  0, 29,200, 84,128,  0,  9,204, 70,128,  0, 10,206,
-    193, 75,128,  0, 21,210, 83,128,  0, 30, 83,  5, 66,214, 66,218,
-     66,228, 66,233, 66,238, 73,128,  0, 15, 79,129,  0, 14, 66,224,
-     84,128,  0,  2,212, 88,128,  0,  1,213, 66,128,  0, 26,217, 78,
-    128,  0, 22,213, 83,128,  0, 31,214, 84,128,  0, 11,240,249,242,
-    233,231,232,116,129,  0,169, 67,  9,115,  2, 67, 15, 67, 21,225,
-    238,115,128,248,233,229,242,233,102,128,246,217,114,  2, 67, 34,
-     67,118,238,229,242,226,242,225,227,235,229,116,  2, 67, 49, 67,
-     83,236,229,230,116,130, 48, 12, 67, 60, 67, 72,232,225,236,230,
-    247,233,228,244,104,128,255, 98,246,229,242,244,233,227,225,108,
-    128,254, 65,242,233,231,232,116,130, 48, 13, 67, 95, 67,107,232,
-    225,236,230,247,233,228,244,104,128,255, 99,246,229,242,244,233,
-    227,225,108,128,254, 66,240,239,242,225,244,233,239,238,243,241,
-    245,225,242,101,128, 51,127,243,241,245,225,242,101,128, 51,199,
-    246,229,242,235,231,243,241,245,225,242,101,128, 51,198,240,225,
-    242,229,110,128, 36,158,242,245,250,229,233,242,111,128, 32,162,
-    243,244,242,229,244,227,232,229,100,128,  2,151,245,114,  2, 67,
-    195, 67,213,236,121,  2, 67,202, 67,208,225,238,100,128, 34,207,
-    239,114,128, 34,206,242,229,238,227,121,128,  0,164,249,114,  4,
-     67,232, 67,240, 67,247, 67,255,194,242,229,246,101,128,246,209,
-    198,236,229,120,128,246,210,226,242,229,246,101,128,246,212,230,
-    236,229,120,128,246,213,100,146,  0,100, 68, 46, 69,184, 70,208,
-     71, 12, 71,188, 72,142, 72,204, 73,133, 73,146, 73,155, 73,181,
-     73,206, 73,215, 75, 26, 75, 34, 75, 45, 75, 65, 75, 93, 97, 11,
-     68, 70, 68, 81, 68, 91, 68,163, 68,226, 68,237, 68,248, 69, 61,
-     69,123, 69,129, 69,159,225,242,237,229,238,233,225,110,128,  5,
-    100,226,229,238,231,225,236,105,128,  9,166,100,  5, 68,103, 68,
-    112, 68,118, 68,132, 68,148,225,242,225,226,233, 99,128,  6, 54,
-    229,246, 97,128,  9, 38,230,233,238,225,236,225,242,225,226,233,
-     99,128,254,190,233,238,233,244,233,225,236,225,242,225,226,233,
-     99,128,254,191,237,229,228,233,225,236,225,242,225,226,233, 99,
-    128,254,192,103,  3, 68,171, 68,188, 68,202,229,243,104,129,  5,
-    188, 68,179,232,229,226,242,229,119,128,  5,188,231,229,114,129,
-     32, 32, 68,196,228,226,108,128, 32, 33,117,  2, 68,208, 68,217,
-    234,225,242,225,244,105,128, 10,166,242,237,245,235,232,105,128,
-     10, 38,232,233,242,225,231,225,238, 97,128, 48, 96,235,225,244,
-    225,235,225,238, 97,128, 48,192,108,  3, 69,  0, 69,  9, 69, 47,
-    225,242,225,226,233, 99,128,  6, 47,229,116,130,  5,211, 69, 18,
-     69, 38,228,225,231,229,243,104,129,251, 51, 69, 29,232,229,226,
-    242,229,119,128,251, 51,232,229,226,242,229,119,128,  5,211,230,
-    233,238,225,236,225,242,225,226,233, 99,128,254,170,237,237, 97,
-      3, 69, 71, 69, 80, 69, 92,225,242,225,226,233, 99,128,  6, 79,
-    236,239,247,225,242,225,226,233, 99,128,  6, 79,244,225,238, 97,
-      2, 69,101, 69,115,236,244,239,238,229,225,242,225,226,233, 99,
-    128,  6, 76,242,225,226,233, 99,128,  6, 76,238,228, 97,128,  9,
-    100,242,231, 97,  2, 69,137, 69,146,232,229,226,242,229,119,128,
-      5,167,236,229,230,244,232,229,226,242,229,119,128,  5,167,243,
-    233,225,240,238,229,245,237,225,244,225,227,249,242,233,236,236,
-    233,227,227,237, 98,128,  4,133, 98,  3, 69,192, 70,189, 70,199,
-    108,  9, 69,212, 69,220, 70, 77, 70, 85, 70,101, 70,112, 70,130,
-     70,144, 70,155,199,242,225,246,101,128,246,211, 97,  2, 69,226,
-     70, 27,238,231,236,229,226,242,225,227,235,229,116,  2, 69,242,
-     70,  6,236,229,230,116,129, 48, 10, 69,251,246,229,242,244,233,
-    227,225,108,128,254, 61,242,233,231,232,116,129, 48, 11, 70, 16,
-    246,229,242,244,233,227,225,108,128,254, 62,114,  2, 70, 33, 70,
-     54,227,232,233,238,246,229,242,244,229,228,226,229,236,239,247,
-    227,237, 98,128,  3, 43,242,239,119,  2, 70, 62, 70, 69,236,229,
-    230,116,128, 33,212,242,233,231,232,116,128, 33,210,228,225,238,
-    228, 97,128,  9,101,231,242,225,246,101,129,246,214, 70, 95,227,
-    237, 98,128,  3, 15,233,238,244,229,231,242,225,108,128, 34, 44,
-    236,239,247,236,233,238,101,129, 32, 23, 70,124,227,237, 98,128,
-      3, 51,239,246,229,242,236,233,238,229,227,237, 98,128,  3, 63,
-    240,242,233,237,229,237,239,100,128,  2,186,246,229,242,244,233,
-    227,225,108,  2, 70,168, 70,174,226,225,114,128, 32, 22,236,233,
-    238,229,225,226,239,246,229,227,237, 98,128,  3, 14,239,240,239,
-    237,239,230,111,128, 49,  9,243,241,245,225,242,101,128, 51,200,
-     99,  4, 70,218, 70,225, 70,234, 71,  5,225,242,239,110,128,  1,
-     15,229,228,233,236,236, 97,128, 30, 17,233,242, 99,  2, 70,242,
-     70,247,236,101,128, 36,211,245,237,230,236,229,248,226,229,236,
-    239,119,128, 30, 19,242,239,225,116,128,  1, 17,100,  4, 71, 22,
-     71,103, 71,113, 71,164, 97,  4, 71, 32, 71, 42, 71, 49, 71, 74,
-    226,229,238,231,225,236,105,128,  9,161,228,229,246, 97,128,  9,
-     33,231,117,  2, 71, 56, 71, 65,234,225,242,225,244,105,128, 10,
-    161,242,237,245,235,232,105,128, 10, 33,108,  2, 71, 80, 71, 89,
-    225,242,225,226,233, 99,128,  6,136,230,233,238,225,236,225,242,
-    225,226,233, 99,128,251,137,228,232,225,228,229,246, 97,128,  9,
-     92,232, 97,  3, 71,122, 71,132, 71,139,226,229,238,231,225,236,
-    105,128,  9,162,228,229,246, 97,128,  9, 34,231,117,  2, 71,146,
-     71,155,234,225,242,225,244,105,128, 10,162,242,237,245,235,232,
-    105,128, 10, 34,239,116,  2, 71,171, 71,180,225,227,227,229,238,
-    116,128, 30, 11,226,229,236,239,119,128, 30, 13,101,  8, 71,206,
-     72,  3, 72, 10, 72, 35, 72, 45, 72, 56, 72,101, 72,137, 99,  2,
-     71,212, 71,249,233,237,225,236,243,229,240,225,242,225,244,239,
-    114,  2, 71,230, 71,239,225,242,225,226,233, 99,128,  6,107,240,
-    229,242,243,233,225,110,128,  6,107,249,242,233,236,236,233, 99,
-    128,  4, 52,231,242,229,101,128,  0,176,232,105,  2, 72, 17, 72,
-     26,232,229,226,242,229,119,128,  5,173,242,225,231,225,238, 97,
-    128, 48,103,233,227,239,240,244,233, 99,128,  3,239,235,225,244,
-    225,235,225,238, 97,128, 48,199,108,  2, 72, 62, 72, 85,229,244,
-    101,  2, 72, 70, 72, 77,236,229,230,116,128, 35, 43,242,233,231,
-    232,116,128, 35, 38,244, 97,129,  3,180, 72, 92,244,245,242,238,
-    229,100,128,  1,141,238,239,237,233,238,225,244,239,242,237,233,
-    238,245,243,239,238,229,238,245,237,229,242,225,244,239,242,226,
-    229,238,231,225,236,105,128,  9,248,250,104,128,  2,164,104,  2,
-     72,148, 72,198, 97,  3, 72,156, 72,166, 72,173,226,229,238,231,
-    225,236,105,128,  9,167,228,229,246, 97,128,  9, 39,231,117,  2,
-     72,180, 72,189,234,225,242,225,244,105,128, 10,167,242,237,245,
-    235,232,105,128, 10, 39,239,239,107,128,  2, 87,105,  6, 72,218,
-     73, 11, 73, 71, 73, 82, 73, 93, 73,103, 97,  2, 72,224, 72,246,
-    236,249,244,233,235,225,244,239,238,239,115,129,  3,133, 72,240,
-    227,237, 98,128,  3, 68,237,239,238,100,129, 38,102, 72,255,243,
-    245,233,244,247,232,233,244,101,128, 38, 98,229,242,229,243,233,
-    115,133,  0,168, 73, 30, 73, 38, 73, 49, 73, 55, 73, 63,225,227,
-    245,244,101,128,246,215,226,229,236,239,247,227,237, 98,128,  3,
-     36,227,237, 98,128,  3,  8,231,242,225,246,101,128,246,216,244,
-    239,238,239,115,128,  3,133,232,233,242,225,231,225,238, 97,128,
-     48, 98,235,225,244,225,235,225,238, 97,128, 48,194,244,244,239,
-    237,225,242,107,128, 48,  3,246,105,  2, 73,110, 73,121,228,101,
-    129,  0,247, 73,117,115,128, 34, 35,243,233,239,238,243,236,225,
-    243,104,128, 34, 21,234,229,227,249,242,233,236,236,233, 99,128,
-      4, 82,235,243,232,225,228,101,128, 37,147,108,  2, 73,161, 73,
-    172,233,238,229,226,229,236,239,119,128, 30, 15,243,241,245,225,
-    242,101,128, 51,151,109,  2, 73,187, 73,195,225,227,242,239,110,
-    128,  1, 17,239,238,239,243,240,225,227,101,128,255, 68,238,226,
-    236,239,227,107,128, 37,132,111, 10, 73,237, 73,249, 74,  3, 74,
-     14, 74, 25, 74, 97, 74,102, 74,113, 74,228, 74,254,227,232,225,
-    228,225,244,232,225,105,128, 14, 14,228,229,235,244,232,225,105,
-    128, 14, 20,232,233,242,225,231,225,238, 97,128, 48,105,235,225,
-    244,225,235,225,238, 97,128, 48,201,236,236,225,114,132,  0, 36,
-     74, 40, 74, 51, 74, 63, 74, 74,233,238,230,229,242,233,239,114,
-    128,246,227,237,239,238,239,243,240,225,227,101,128,255,  4,239,
-    236,228,243,244,249,236,101,128,247, 36,115,  2, 74, 80, 74, 87,
-    237,225,236,108,128,254,105,245,240,229,242,233,239,114,128,246,
-    228,238,103,128, 32,171,242,245,243,241,245,225,242,101,128, 51,
-     38,116,  6, 74,127, 74,144, 74,166, 74,177, 74,209, 74,216,225,
-    227,227,229,238,116,129,  2,217, 74,138,227,237, 98,128,  3,  7,
-    226,229,236,239,247, 99,  2, 74,155, 74,160,237, 98,128,  3, 35,
-    239,237, 98,128,  3, 35,235,225,244,225,235,225,238, 97,128, 48,
-    251,236,229,243,115,  2, 74,186, 74,190,105,128,  1, 49,106,129,
-    246,190, 74,196,243,244,242,239,235,229,232,239,239,107,128,  2,
-    132,237,225,244,104,128, 34,197,244,229,228,227,233,242,227,236,
-    101,128, 37,204,245,226,236,229,249,239,228,240,225,244,225,104,
-    129,251, 31, 74,245,232,229,226,242,229,119,128,251, 31,247,238,
-    244,225,227,107,  2, 75,  9, 75, 20,226,229,236,239,247,227,237,
-     98,128,  3, 30,237,239,100,128,  2,213,240,225,242,229,110,128,
-     36,159,243,245,240,229,242,233,239,114,128,246,235,116,  2, 75,
-     51, 75, 57,225,233,108,128,  2, 86,239,240,226,225,114,128,  1,
-    140,117,  2, 75, 71, 75, 82,232,233,242,225,231,225,238, 97,128,
-     48,101,235,225,244,225,235,225,238, 97,128, 48,197,122,132,  1,
-    243, 75,105, 75,114, 75,133, 75,170,225,236,244,239,238,101,128,
-      2,163, 99,  2, 75,120, 75,127,225,242,239,110,128,  1,198,245,
-    242,108,128,  2,165,101,  2, 75,139, 75,159,225,226,235,232,225,
-    243,233,225,238,227,249,242,233,236,236,233, 99,128,  4,225,227,
-    249,242,233,236,236,233, 99,128,  4, 85,232,229,227,249,242,233,
-    236,236,233, 99,128,  4, 95,101,151,  0,101, 75,233, 75,252, 76,
-     30, 77,  4, 77, 66, 77, 99, 77,111, 77,134, 77,187, 79, 43, 79,
-    101, 79,203, 80, 63, 80,198, 81, 17, 81, 48, 81,110, 81,163, 82,
-     98, 82,231, 82,251, 83, 39, 83,130, 97,  2, 75,239, 75,246,227,
-    245,244,101,128,  0,233,242,244,104,128, 38, 65, 98,  3, 76,  4,
-     76, 13, 76, 23,229,238,231,225,236,105,128,  9,143,239,240,239,
-    237,239,230,111,128, 49, 28,242,229,246,101,128,  1, 21, 99,  5,
-     76, 42, 76,115, 76,129, 76,161, 76,250, 97,  2, 76, 48, 76,109,
-    238,228,242, 97,  3, 76, 59, 76, 66, 76, 77,228,229,246, 97,128,
-      9, 13,231,245,234,225,242,225,244,105,128, 10,141,246,239,247,
-    229,236,243,233,231,110,  2, 76, 91, 76, 98,228,229,246, 97,128,
-      9, 69,231,245,234,225,242,225,244,105,128, 10,197,242,239,110,
-    128,  1, 27,229,228,233,236,236,225,226,242,229,246,101,128, 30,
-     29,104,  2, 76,135, 76,146,225,242,237,229,238,233,225,110,128,
-      5,101,249,233,247,238,225,242,237,229,238,233,225,110,128,  5,
-    135,233,242, 99,  2, 76,169, 76,174,236,101,128, 36,212,245,237,
-    230,236,229,120,134,  0,234, 76,195, 76,203, 76,211, 76,222, 76,
-    230, 76,242,225,227,245,244,101,128, 30,191,226,229,236,239,119,
-    128, 30, 25,228,239,244,226,229,236,239,119,128, 30,199,231,242,
-    225,246,101,128, 30,193,232,239,239,235,225,226,239,246,101,128,
-     30,195,244,233,236,228,101,128, 30,197,249,242,233,236,236,233,
-     99,128,  4, 84,100,  4, 77, 14, 77, 24, 77, 30, 77, 40,226,236,
-    231,242,225,246,101,128,  2,  5,229,246, 97,128,  9, 15,233,229,
-    242,229,243,233,115,128,  0,235,239,116,130,  1, 23, 77, 49, 77,
-     58,225,227,227,229,238,116,128,  1, 23,226,229,236,239,119,128,
-     30,185,101,  2, 77, 72, 77, 83,231,245,242,237,245,235,232,105,
-    128, 10, 15,237,225,244,242,225,231,245,242,237,245,235,232,105,
-    128, 10, 71,230,227,249,242,233,236,236,233, 99,128,  4, 68,103,
-      2, 77,117, 77,124,242,225,246,101,128,  0,232,245,234,225,242,
-    225,244,105,128, 10,143,104,  4, 77,144, 77,155, 77,166, 77,176,
-    225,242,237,229,238,233,225,110,128,  5,103,226,239,240,239,237,
-    239,230,111,128, 49, 29,233,242,225,231,225,238, 97,128, 48, 72,
-    239,239,235,225,226,239,246,101,128, 30,187,105,  4, 77,197, 77,
-    208, 79, 10, 79, 25,226,239,240,239,237,239,230,111,128, 49, 31,
-    231,232,116,142,  0, 56, 77,242, 77,251, 78,  5, 78, 35, 78, 42,
-     78, 80, 78,105, 78,150, 78,184, 78,196, 78,207, 78,240, 78,248,
-     79,  3,225,242,225,226,233, 99,128,  6,104,226,229,238,231,225,
-    236,105,128,  9,238,227,233,242,227,236,101,129, 36,103, 78, 16,
-    233,238,246,229,242,243,229,243,225,238,243,243,229,242,233,102,
-    128, 39,145,228,229,246, 97,128,  9,110,229,229,110,  2, 78, 50,
-     78, 59,227,233,242,227,236,101,128, 36,113,112,  2, 78, 65, 78,
-     72,225,242,229,110,128, 36,133,229,242,233,239,100,128, 36,153,
-    231,117,  2, 78, 87, 78, 96,234,225,242,225,244,105,128, 10,238,
-    242,237,245,235,232,105,128, 10,110,104,  2, 78,111, 78,137, 97,
-      2, 78,117, 78,128,227,235,225,242,225,226,233, 99,128,  6,104,
-    238,231,250,232,239,117,128, 48, 40,238,239,244,229,226,229,225,
-    237,229,100,128, 38,107,105,  2, 78,156, 78,174,228,229,239,231,
-    242,225,240,232,233,227,240,225,242,229,110,128, 50, 39,238,230,
-    229,242,233,239,114,128, 32,136,237,239,238,239,243,240,225,227,
-    101,128,255, 24,239,236,228,243,244,249,236,101,128,247, 56,112,
-      2, 78,213, 78,220,225,242,229,110,128, 36,123,229,114,  2, 78,
-    227, 78,233,233,239,100,128, 36,143,243,233,225,110,128,  6,248,
-    242,239,237,225,110,128, 33,119,243,245,240,229,242,233,239,114,
-    128, 32,120,244,232,225,105,128, 14, 88,238,246,229,242,244,229,
-    228,226,242,229,246,101,128,  2,  7,239,244,233,230,233,229,228,
-    227,249,242,233,236,236,233, 99,128,  4,101,107,  2, 79, 49, 79,
-     73,225,244,225,235,225,238, 97,129, 48,168, 79, 61,232,225,236,
-    230,247,233,228,244,104,128,255,116,111,  2, 79, 79, 79, 94,238,
-    235,225,242,231,245,242,237,245,235,232,105,128, 10,116,242,229,
-    225,110,128, 49, 84,108,  3, 79,109, 79,120, 79,181,227,249,242,
-    233,236,236,233, 99,128,  4, 59,101,  2, 79,126, 79,133,237,229,
-    238,116,128, 34,  8,246,229,110,  3, 79,143, 79,152, 79,173,227,
-    233,242,227,236,101,128, 36,106,112,  2, 79,158, 79,165,225,242,
-    229,110,128, 36,126,229,242,233,239,100,128, 36,146,242,239,237,
-    225,110,128, 33,122,236,233,240,243,233,115,129, 32, 38, 79,192,
-    246,229,242,244,233,227,225,108,128, 34,238,109,  5, 79,215, 79,
-    243, 79,254, 80, 18, 80, 29,225,227,242,239,110,130,  1, 19, 79,
-    227, 79,235,225,227,245,244,101,128, 30, 23,231,242,225,246,101,
-    128, 30, 21,227,249,242,233,236,236,233, 99,128,  4, 60,228,225,
-    243,104,129, 32, 20, 80,  7,246,229,242,244,233,227,225,108,128,
-    254, 49,239,238,239,243,240,225,227,101,128,255, 69,112,  2, 80,
-     35, 80, 55,232,225,243,233,243,237,225,242,235,225,242,237,229,
-    238,233,225,110,128,  5, 91,244,249,243,229,116,128, 34,  5,110,
-      6, 80, 77, 80, 88, 80, 99, 80,143, 80,175, 80,190,226,239,240,
-    239,237,239,230,111,128, 49, 35,227,249,242,233,236,236,233, 99,
-    128,  4, 61,100,  2, 80,105, 80,124,225,243,104,129, 32, 19, 80,
-    113,246,229,242,244,233,227,225,108,128,254, 50,229,243,227,229,
-    238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,163,103,
-    130,  1, 75, 80,151, 80,162,226,239,240,239,237,239,230,111,128,
-     49, 37,232,229,227,249,242,233,236,236,233, 99,128,  4,165,232,
-    239,239,235,227,249,242,233,236,236,233, 99,128,  4,200,243,240,
-    225,227,101,128, 32,  2,111,  3, 80,206, 80,214, 80,223,231,239,
-    238,229,107,128,  1, 25,235,239,242,229,225,110,128, 49, 83,240,
-    229,110,130,  2, 91, 80,233, 80,242,227,236,239,243,229,100,128,
-      2,154,242,229,246,229,242,243,229,100,130,  2, 92, 81,  1, 81,
-     10,227,236,239,243,229,100,128,  2, 94,232,239,239,107,128,  2,
-     93,112,  2, 81, 23, 81, 30,225,242,229,110,128, 36,160,243,233,
-    236,239,110,129,  3,181, 81, 40,244,239,238,239,115,128,  3,173,
-    241,117,  2, 81, 55, 81, 99,225,108,130,  0, 61, 81, 64, 81, 76,
-    237,239,238,239,243,240,225,227,101,128,255, 29,115,  2, 81, 82,
-     81, 89,237,225,236,108,128,254,102,245,240,229,242,233,239,114,
-    128, 32,124,233,246,225,236,229,238,227,101,128, 34, 97,114,  3,
-     81,118, 81,129, 81,140,226,239,240,239,237,239,230,111,128, 49,
-     38,227,249,242,233,236,236,233, 99,128,  4, 64,229,246,229,242,
-    243,229,100,129,  2, 88, 81,152,227,249,242,233,236,236,233, 99,
-    128,  4, 77,115,  6, 81,177, 81,188, 81,208, 82, 33, 82, 78, 82,
-     88,227,249,242,233,236,236,233, 99,128,  4, 65,228,229,243,227,
-    229,238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,171,
-    104,132,  2,131, 81,220, 81,227, 82,  2, 82, 17,227,245,242,108,
-    128,  2,134,239,242,116,  2, 81,235, 81,242,228,229,246, 97,128,
-      9, 14,246,239,247,229,236,243,233,231,238,228,229,246, 97,128,
-      9, 70,242,229,246,229,242,243,229,228,236,239,239,112,128,  1,
-    170,243,241,245,225,244,242,229,246,229,242,243,229,100,128,  2,
-    133,237,225,236,108,  2, 82, 42, 82, 53,232,233,242,225,231,225,
-    238, 97,128, 48, 71,235,225,244,225,235,225,238, 97,129, 48,167,
-     82, 66,232,225,236,230,247,233,228,244,104,128,255,106,244,233,
-    237,225,244,229,100,128, 33, 46,245,240,229,242,233,239,114,128,
-    246,236,116,  5, 82,110, 82,136, 82,140, 82,157, 82,223, 97,130,
-      3,183, 82,118, 82,128,242,237,229,238,233,225,110,128,  5,104,
-    244,239,238,239,115,128,  3,174,104,128,  0,240,233,236,228,101,
-    129, 30,189, 82,149,226,229,236,239,119,128, 30, 27,238,225,232,
-    244, 97,  3, 82,169, 82,201, 82,210,230,239,245,235,104,  2, 82,
-    179, 82,188,232,229,226,242,229,119,128,  5,145,236,229,230,244,
-    232,229,226,242,229,119,128,  5,145,232,229,226,242,229,119,128,
-      5,145,236,229,230,244,232,229,226,242,229,119,128,  5,145,245,
-    242,238,229,100,128,  1,221,117,  2, 82,237, 82,246,235,239,242,
-    229,225,110,128, 49, 97,242,111,128, 32,172,246,239,247,229,236,
-    243,233,231,110,  3, 83, 11, 83, 21, 83, 28,226,229,238,231,225,
-    236,105,128,  9,199,228,229,246, 97,128,  9, 71,231,245,234,225,
-    242,225,244,105,128, 10,199,120,  2, 83, 45, 83,118,227,236,225,
-    109,132,  0, 33, 83, 60, 83, 71, 83, 98, 83,110,225,242,237,229,
-    238,233,225,110,128,  5, 92,100,  2, 83, 77, 83, 82,226,108,128,
-     32, 60,239,247,110,129,  0,161, 83, 90,243,237,225,236,108,128,
-    247,161,237,239,238,239,243,240,225,227,101,128,255,  1,243,237,
-    225,236,108,128,247, 33,233,243,244,229,238,244,233,225,108,128,
-     34,  3,250,104,131,  2,146, 83,141, 83,160, 83,171, 99,  2, 83,
-    147, 83,154,225,242,239,110,128,  1,239,245,242,108,128,  2,147,
-    242,229,246,229,242,243,229,100,128,  1,185,244,225,233,108,128,
-      1,186,102,140,  0,102, 83,206, 84, 32, 84, 43, 84, 52, 84, 64,
-     84,167, 84,183, 86,191, 86,204, 86,230, 88,107, 88,115, 97,  4,
-     83,216, 83,223, 83,234, 83,245,228,229,246, 97,128,  9, 94,231,
-    245,242,237,245,235,232,105,128, 10, 94,232,242,229,238,232,229,
-    233,116,128, 33,  9,244,232, 97,  3, 83,255, 84,  8, 84, 20,225,
-    242,225,226,233, 99,128,  6, 78,236,239,247,225,242,225,226,233,
-     99,128,  6, 78,244,225,238,225,242,225,226,233, 99,128,  6, 75,
-    226,239,240,239,237,239,230,111,128, 49,  8,227,233,242,227,236,
-    101,128, 36,213,228,239,244,225,227,227,229,238,116,128, 30, 31,
-    101,  3, 84, 72, 84,150, 84,160,104,  4, 84, 82, 84,105, 84,119,
-     84,135,225,114,  2, 84, 89, 84, 96,225,226,233, 99,128,  6, 65,
-    237,229,238,233,225,110,128,  5,134,230,233,238,225,236,225,242,
-    225,226,233, 99,128,254,210,233,238,233,244,233,225,236,225,242,
-    225,226,233, 99,128,254,211,237,229,228,233,225,236,225,242,225,
-    226,233, 99,128,254,212,233,227,239,240,244,233, 99,128,  3,229,
-    237,225,236,101,128, 38, 64,102,130,251,  0, 84,175, 84,179,105,
-    128,251,  3,108,128,251,  4,105,136,251,  1, 84,203, 84,243, 84,
-    254, 85, 20, 85,142, 85,159, 85,167, 85,180,230,244,229,229,110,
-      2, 84,213, 84,222,227,233,242,227,236,101,128, 36,110,112,  2,
-     84,228, 84,235,225,242,229,110,128, 36,130,229,242,233,239,100,
-    128, 36,150,231,245,242,229,228,225,243,104,128, 32, 18,236,236,
-    229,100,  2, 85,  7, 85, 13,226,239,120,128, 37,160,242,229,227,
-    116,128, 37,172,238,225,108,  5, 85, 34, 85, 73, 85, 90, 85,107,
-     85,123,235,225,102,130,  5,218, 85, 44, 85, 64,228,225,231,229,
-    243,104,129,251, 58, 85, 55,232,229,226,242,229,119,128,251, 58,
-    232,229,226,242,229,119,128,  5,218,237,229,109,129,  5,221, 85,
-     81,232,229,226,242,229,119,128,  5,221,238,245,110,129,  5,223,
-     85, 98,232,229,226,242,229,119,128,  5,223,240,101,129,  5,227,
-     85,114,232,229,226,242,229,119,128,  5,227,244,243,225,228,105,
-    129,  5,229, 85,133,232,229,226,242,229,119,128,  5,229,242,243,
-    244,244,239,238,229,227,232,233,238,229,243,101,128,  2,201,243,
-    232,229,249,101,128, 37,201,244,225,227,249,242,233,236,236,233,
-     99,128,  4,115,246,101,142,  0, 53, 85,213, 85,222, 85,232, 86,
-      6, 86, 13, 86, 23, 86, 48, 86, 75, 86,109, 86,121, 86,132, 86,
-    165, 86,173, 86,184,225,242,225,226,233, 99,128,  6,101,226,229,
-    238,231,225,236,105,128,  9,235,227,233,242,227,236,101,129, 36,
-    100, 85,243,233,238,246,229,242,243,229,243,225,238,243,243,229,
-    242,233,102,128, 39,142,228,229,246, 97,128,  9,107,229,233,231,
-    232,244,232,115,128, 33, 93,231,117,  2, 86, 30, 86, 39,234,225,
-    242,225,244,105,128, 10,235,242,237,245,235,232,105,128, 10,107,
-    232, 97,  2, 86, 55, 86, 66,227,235,225,242,225,226,233, 99,128,
-      6,101,238,231,250,232,239,117,128, 48, 37,105,  2, 86, 81, 86,
-     99,228,229,239,231,242,225,240,232,233,227,240,225,242,229,110,
-    128, 50, 36,238,230,229,242,233,239,114,128, 32,133,237,239,238,
-    239,243,240,225,227,101,128,255, 21,239,236,228,243,244,249,236,
-    101,128,247, 53,112,  2, 86,138, 86,145,225,242,229,110,128, 36,
-    120,229,114,  2, 86,152, 86,158,233,239,100,128, 36,140,243,233,
-    225,110,128,  6,245,242,239,237,225,110,128, 33,116,243,245,240,
-    229,242,233,239,114,128, 32,117,244,232,225,105,128, 14, 85,108,
-    129,251,  2, 86,197,239,242,233,110,128,  1,146,109,  2, 86,210,
-     86,221,239,238,239,243,240,225,227,101,128,255, 70,243,241,245,
-    225,242,101,128, 51,153,111,  4, 86,240, 87,  6, 87, 18, 87, 25,
-    230, 97,  2, 86,247, 86,255,238,244,232,225,105,128, 14, 31,244,
-    232,225,105,128, 14, 29,238,231,237,225,238,244,232,225,105,128,
-     14, 79,242,225,236,108,128, 34,  0,245,114,142,  0, 52, 87, 58,
-     87, 67, 87, 77, 87,107, 87,114, 87,139, 87,166, 87,200, 87,212,
-     87,231, 87,242, 88, 19, 88, 27, 88, 38,225,242,225,226,233, 99,
-    128,  6,100,226,229,238,231,225,236,105,128,  9,234,227,233,242,
-    227,236,101,129, 36, 99, 87, 88,233,238,246,229,242,243,229,243,
-    225,238,243,243,229,242,233,102,128, 39,141,228,229,246, 97,128,
-      9,106,231,117,  2, 87,121, 87,130,234,225,242,225,244,105,128,
-     10,234,242,237,245,235,232,105,128, 10,106,232, 97,  2, 87,146,
-     87,157,227,235,225,242,225,226,233, 99,128,  6,100,238,231,250,
-    232,239,117,128, 48, 36,105,  2, 87,172, 87,190,228,229,239,231,
-    242,225,240,232,233,227,240,225,242,229,110,128, 50, 35,238,230,
-    229,242,233,239,114,128, 32,132,237,239,238,239,243,240,225,227,
-    101,128,255, 20,238,245,237,229,242,225,244,239,242,226,229,238,
-    231,225,236,105,128,  9,247,239,236,228,243,244,249,236,101,128,
-    247, 52,112,  2, 87,248, 87,255,225,242,229,110,128, 36,119,229,
-    114,  2, 88,  6, 88, 12,233,239,100,128, 36,139,243,233,225,110,
-    128,  6,244,242,239,237,225,110,128, 33,115,243,245,240,229,242,
-    233,239,114,128, 32,116,116,  2, 88, 44, 88, 82,229,229,110,  2,
-     88, 52, 88, 61,227,233,242,227,236,101,128, 36,109,112,  2, 88,
-     67, 88, 74,225,242,229,110,128, 36,129,229,242,233,239,100,128,
-     36,149,104,  2, 88, 88, 88, 93,225,105,128, 14, 84,244,239,238,
-    229,227,232,233,238,229,243,101,128,  2,203,240,225,242,229,110,
-    128, 36,161,242, 97,  2, 88,122, 88,130,227,244,233,239,110,128,
-     32, 68,238, 99,128, 32,163,103,144,  0,103, 88,171, 89,117, 89,
-    140, 89,201, 89,218, 90,139, 91,132, 91,217, 91,230, 92, 88, 92,
-    113, 92,141, 92,163, 93,108, 93,130, 93,232, 97,  9, 88,191, 88,
-    201, 88,208, 88,215, 89, 23, 89, 48, 89, 59, 89, 70, 89,104,226,
-    229,238,231,225,236,105,128,  9,151,227,245,244,101,128,  1,245,
-    228,229,246, 97,128,  9, 23,102,  4, 88,225, 88,234, 88,248, 89,
-      8,225,242,225,226,233, 99,128,  6,175,230,233,238,225,236,225,
-    242,225,226,233, 99,128,251,147,233,238,233,244,233,225,236,225,
-    242,225,226,233, 99,128,251,148,237,229,228,233,225,236,225,242,
-    225,226,233, 99,128,251,149,231,117,  2, 89, 30, 89, 39,234,225,
-    242,225,244,105,128, 10,151,242,237,245,235,232,105,128, 10, 23,
-    232,233,242,225,231,225,238, 97,128, 48, 76,235,225,244,225,235,
-    225,238, 97,128, 48,172,237,237, 97,130,  3,179, 89, 80, 89, 93,
-    236,225,244,233,238,243,237,225,236,108,128,  2, 99,243,245,240,
-    229,242,233,239,114,128,  2,224,238,231,233,225,227,239,240,244,
-    233, 99,128,  3,235, 98,  2, 89,123, 89,133,239,240,239,237,239,
-    230,111,128, 49, 13,242,229,246,101,128,  1, 31, 99,  4, 89,150,
-     89,157, 89,166, 89,188,225,242,239,110,128,  1,231,229,228,233,
-    236,236, 97,128,  1, 35,233,242, 99,  2, 89,174, 89,179,236,101,
-    128, 36,214,245,237,230,236,229,120,128,  1, 29,239,237,237,225,
-    225,227,227,229,238,116,128,  1, 35,228,239,116,129,  1, 33, 89,
-    209,225,227,227,229,238,116,128,  1, 33,101,  6, 89,232, 89,243,
-     89,254, 90,  9, 90, 28, 90,130,227,249,242,233,236,236,233, 99,
-    128,  4, 51,232,233,242,225,231,225,238, 97,128, 48, 82,235,225,
-    244,225,235,225,238, 97,128, 48,178,239,237,229,244,242,233,227,
-    225,236,236,249,229,241,245,225,108,128, 34, 81,114,  3, 90, 36,
-     90, 85, 90, 95,229,243,104,  3, 90, 46, 90, 61, 90, 70,225,227,
-    227,229,238,244,232,229,226,242,229,119,128,  5,156,232,229,226,
-    242,229,119,128,  5,243,237,245,241,228,225,237,232,229,226,242,
-    229,119,128,  5,157,237,225,238,228,226,236,115,128,  0,223,243,
-    232,225,249,233,109,  2, 90,106, 90,121,225,227,227,229,238,244,
-    232,229,226,242,229,119,128,  5,158,232,229,226,242,229,119,128,
-      5,244,244,225,237,225,242,107,128, 48, 19,104,  5, 90,151, 91,
-     28, 91, 91, 91,116, 91,122, 97,  4, 90,161, 90,171, 90,194, 90,
-    219,226,229,238,231,225,236,105,128,  9,152,100,  2, 90,177, 90,
-    188,225,242,237,229,238,233,225,110,128,  5,114,229,246, 97,128,
-      9, 24,231,117,  2, 90,201, 90,210,234,225,242,225,244,105,128,
-     10,152,242,237,245,235,232,105,128, 10, 24,233,110,  4, 90,230,
-     90,239, 90,253, 91, 13,225,242,225,226,233, 99,128,  6, 58,230,
-    233,238,225,236,225,242,225,226,233, 99,128,254,206,233,238,233,
-    244,233,225,236,225,242,225,226,233, 99,128,254,207,237,229,228,
-    233,225,236,225,242,225,226,233, 99,128,254,208,101,  3, 91, 36,
-     91, 57, 91, 74,237,233,228,228,236,229,232,239,239,235,227,249,
-    242,233,236,236,233, 99,128,  4,149,243,244,242,239,235,229,227,
-    249,242,233,236,236,233, 99,128,  4,147,245,240,244,245,242,238,
-    227,249,242,233,236,236,233, 99,128,  4,145,232, 97,  2, 91, 98,
-     91,105,228,229,246, 97,128,  9, 90,231,245,242,237,245,235,232,
-    105,128, 10, 90,239,239,107,128,  2, 96,250,243,241,245,225,242,
-    101,128, 51,147,105,  3, 91,140, 91,151, 91,162,232,233,242,225,
-    231,225,238, 97,128, 48, 78,235,225,244,225,235,225,238, 97,128,
-     48,174,109,  2, 91,168, 91,179,225,242,237,229,238,233,225,110,
-    128,  5, 99,229,108,130,  5,210, 91,188, 91,208,228,225,231,229,
-    243,104,129,251, 50, 91,199,232,229,226,242,229,119,128,251, 50,
-    232,229,226,242,229,119,128,  5,210,234,229,227,249,242,233,236,
-    236,233, 99,128,  4, 83,236,239,244,244,225,108,  2, 91,241, 92,
-      2,233,238,246,229,242,244,229,228,243,244,242,239,235,101,128,
-      1,190,243,244,239,112,132,  2,148, 92, 17, 92, 28, 92, 34, 92,
-     66,233,238,246,229,242,244,229,100,128,  2,150,237,239,100,128,
-      2,192,242,229,246,229,242,243,229,100,130,  2,149, 92, 49, 92,
-     55,237,239,100,128,  2,193,243,245,240,229,242,233,239,114,128,
-      2,228,243,244,242,239,235,101,129,  2,161, 92, 77,242,229,246,
-    229,242,243,229,100,128,  2,162,109,  2, 92, 94, 92,102,225,227,
-    242,239,110,128, 30, 33,239,238,239,243,240,225,227,101,128,255,
-     71,111,  2, 92,119, 92,130,232,233,242,225,231,225,238, 97,128,
-     48, 84,235,225,244,225,235,225,238, 97,128, 48,180,240, 97,  2,
-     92,148, 92,154,242,229,110,128, 36,162,243,241,245,225,242,101,
-    128, 51,172,114,  2, 92,169, 93, 10, 97,  2, 92,175, 92,183,228,
-    233,229,238,116,128, 34,  7,246,101,134,  0, 96, 92,200, 92,211,
-     92,228, 92,235, 92,244, 93,  0,226,229,236,239,247,227,237, 98,
-    128,  3, 22, 99,  2, 92,217, 92,222,237, 98,128,  3,  0,239,237,
-     98,128,  3,  0,228,229,246, 97,128,  9, 83,236,239,247,237,239,
-    100,128,  2,206,237,239,238,239,243,240,225,227,101,128,255, 64,
-    244,239,238,229,227,237, 98,128,  3, 64,229,225,244,229,114,132,
-      0, 62, 93, 26, 93, 45, 93, 57, 93,100,229,241,245,225,108,129,
-     34,101, 93, 36,239,242,236,229,243,115,128, 34,219,237,239,238,
-    239,243,240,225,227,101,128,255, 30,111,  2, 93, 63, 93, 89,114,
-      2, 93, 69, 93, 82,229,241,245,233,246,225,236,229,238,116,128,
-     34,115,236,229,243,115,128, 34,119,246,229,242,229,241,245,225,
-    108,128, 34,103,243,237,225,236,108,128,254,101,115,  2, 93,114,
-     93,122,227,242,233,240,116,128,  2, 97,244,242,239,235,101,128,
-      1,229,117,  4, 93,140, 93,151, 93,208, 93,219,232,233,242,225,
-    231,225,238, 97,128, 48, 80,233,108,  2, 93,158, 93,183,236,229,
-    237,239,116,  2, 93,168, 93,175,236,229,230,116,128,  0,171,242,
-    233,231,232,116,128,  0,187,243,233,238,231,108,  2, 93,193, 93,
-    200,236,229,230,116,128, 32, 57,242,233,231,232,116,128, 32, 58,
-    235,225,244,225,235,225,238, 97,128, 48,176,242,225,237,245,243,
-    241,245,225,242,101,128, 51, 24,249,243,241,245,225,242,101,128,
-     51,201,104,144,  0,104, 94, 22, 96,164, 96,199, 96,236, 97, 20,
-     98,164, 98,184, 99,149, 99,161, 99,173,100,241,100,249,101,  4,
-    101, 13,101, 93,101, 97, 97, 13, 94, 50, 94, 89, 94, 99, 94,129,
-     94,154, 94,232, 94,244, 95, 13, 95, 28, 95, 57, 95, 70, 95,128,
-     95,137, 97,  2, 94, 56, 94, 75,226,235,232,225,243,233,225,238,
-    227,249,242,233,236,236,233, 99,128,  4,169,236,244,239,238,229,
-    225,242,225,226,233, 99,128,  6,193,226,229,238,231,225,236,105,
-    128,  9,185,228,101,  2, 94,106, 94,124,243,227,229,238,228,229,
-    242,227,249,242,233,236,236,233, 99,128,  4,179,246, 97,128,  9,
-     57,231,117,  2, 94,136, 94,145,234,225,242,225,244,105,128, 10,
-    185,242,237,245,235,232,105,128, 10, 57,104,  4, 94,164, 94,173,
-     94,187, 94,217,225,242,225,226,233, 99,128,  6, 45,230,233,238,
-    225,236,225,242,225,226,233, 99,128,254,162,105,  2, 94,193, 94,
-    208,238,233,244,233,225,236,225,242,225,226,233, 99,128,254,163,
-    242,225,231,225,238, 97,128, 48,111,237,229,228,233,225,236,225,
-    242,225,226,233, 99,128,254,164,233,244,245,243,241,245,225,242,
-    101,128, 51, 42,235,225,244,225,235,225,238, 97,129, 48,207, 95,
-      1,232,225,236,230,247,233,228,244,104,128,255,138,236,225,238,
-    244,231,245,242,237,245,235,232,105,128, 10, 77,237,250, 97,  2,
-     95, 36, 95, 45,225,242,225,226,233, 99,128,  6, 33,236,239,247,
-    225,242,225,226,233, 99,128,  6, 33,238,231,245,236,230,233,236,
-    236,229,114,128, 49,100,114,  2, 95, 76, 95, 92,228,243,233,231,
-    238,227,249,242,233,236,236,233, 99,128,  4, 74,240,239,239,110,
-      2, 95,101, 95,114,236,229,230,244,226,225,242,226,245,112,128,
-     33,188,242,233,231,232,244,226,225,242,226,245,112,128, 33,192,
-    243,241,245,225,242,101,128, 51,202,244,225,102,  3, 95,147, 95,
-    239, 96, 74,240,225,244,225,104,134,  5,178, 95,167, 95,172, 95,
-    186, 95,195, 95,210, 95,226,177, 54,128,  5,178, 50,  2, 95,178,
-     95,182, 51,128,  5,178,102,128,  5,178,232,229,226,242,229,119,
-    128,  5,178,238,225,242,242,239,247,232,229,226,242,229,119,128,
-      5,178,241,245,225,242,244,229,242,232,229,226,242,229,119,128,
-      5,178,247,233,228,229,232,229,226,242,229,119,128,  5,178,241,
-    225,237,225,244,115,135,  5,179, 96,  6, 96, 11, 96, 16, 96, 21,
-     96, 30, 96, 45, 96, 61,177, 98,128,  5,179,178, 56,128,  5,179,
-    179, 52,128,  5,179,232,229,226,242,229,119,128,  5,179,238,225,
-    242,242,239,247,232,229,226,242,229,119,128,  5,179,241,245,225,
-    242,244,229,242,232,229,226,242,229,119,128,  5,179,247,233,228,
-    229,232,229,226,242,229,119,128,  5,179,243,229,231,239,108,135,
-      5,177, 96, 96, 96,101, 96,106, 96,111, 96,120, 96,135, 96,151,
-    177, 55,128,  5,177,178, 52,128,  5,177,179, 48,128,  5,177,232,
-    229,226,242,229,119,128,  5,177,238,225,242,242,239,247,232,229,
-    226,242,229,119,128,  5,177,241,245,225,242,244,229,242,232,229,
-    226,242,229,119,128,  5,177,247,233,228,229,232,229,226,242,229,
-    119,128,  5,177, 98,  3, 96,172, 96,177, 96,187,225,114,128,  1,
-     39,239,240,239,237,239,230,111,128, 49, 15,242,229,246,229,226,
-    229,236,239,119,128, 30, 43, 99,  2, 96,205, 96,214,229,228,233,
-    236,236, 97,128, 30, 41,233,242, 99,  2, 96,222, 96,227,236,101,
-    128, 36,215,245,237,230,236,229,120,128,  1, 37,100,  2, 96,242,
-     96,252,233,229,242,229,243,233,115,128, 30, 39,239,116,  2, 97,
-      3, 97, 12,225,227,227,229,238,116,128, 30, 35,226,229,236,239,
-    119,128, 30, 37,101,136,  5,212, 97, 40, 97, 73, 97, 93, 98, 66,
-     98, 82, 98,127, 98,136, 98,149,225,242,116,129, 38,101, 97, 48,
-    243,245,233,116,  2, 97, 57, 97, 65,226,236,225,227,107,128, 38,
-    101,247,232,233,244,101,128, 38, 97,228,225,231,229,243,104,129,
-    251, 52, 97, 84,232,229,226,242,229,119,128,251, 52,104,  6, 97,
-    107, 97,135, 97,143, 97,193, 97,239, 98, 32, 97,  2, 97,113, 97,
-    127,236,244,239,238,229,225,242,225,226,233, 99,128,  6,193,242,
-    225,226,233, 99,128,  6, 71,229,226,242,229,119,128,  5,212,230,
-    233,238,225,236, 97,  2, 97,154, 97,185,236,116,  2, 97,161, 97,
-    173,239,238,229,225,242,225,226,233, 99,128,251,167,244,247,239,
-    225,242,225,226,233, 99,128,254,234,242,225,226,233, 99,128,254,
-    234,232,225,237,250,225,225,226,239,246,101,  2, 97,208, 97,222,
-    230,233,238,225,236,225,242,225,226,233, 99,128,251,165,233,243,
-    239,236,225,244,229,228,225,242,225,226,233, 99,128,251,164,105,
-      2, 97,245, 98, 23,238,233,244,233,225,236, 97,  2, 98,  1, 98,
-     15,236,244,239,238,229,225,242,225,226,233, 99,128,251,168,242,
-    225,226,233, 99,128,254,235,242,225,231,225,238, 97,128, 48,120,
-    237,229,228,233,225,236, 97,  2, 98, 44, 98, 58,236,244,239,238,
-    229,225,242,225,226,233, 99,128,251,169,242,225,226,233, 99,128,
-    254,236,233,243,229,233,229,242,225,243,241,245,225,242,101,128,
-     51,123,107,  2, 98, 88, 98,112,225,244,225,235,225,238, 97,129,
-     48,216, 98,100,232,225,236,230,247,233,228,244,104,128,255,141,
-    245,244,225,225,242,245,243,241,245,225,242,101,128, 51, 54,238,
-    231,232,239,239,107,128,  2,103,242,245,244,245,243,241,245,225,
-    242,101,128, 51, 57,116,129,  5,215, 98,155,232,229,226,242,229,
-    119,128,  5,215,232,239,239,107,129,  2,102, 98,173,243,245,240,
-    229,242,233,239,114,128,  2,177,105,  4, 98,194, 99, 23, 99, 34,
-     99, 59,229,245,104,  4, 98,206, 98,241, 99,  0, 99,  9, 97,  2,
-     98,212, 98,227,227,233,242,227,236,229,235,239,242,229,225,110,
-    128, 50,123,240,225,242,229,238,235,239,242,229,225,110,128, 50,
-     27,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,109,
-    235,239,242,229,225,110,128, 49, 78,240,225,242,229,238,235,239,
-    242,229,225,110,128, 50, 13,232,233,242,225,231,225,238, 97,128,
-     48,114,235,225,244,225,235,225,238, 97,129, 48,210, 99, 47,232,
-    225,236,230,247,233,228,244,104,128,255,139,242,233,113,134,  5,
-    180, 99, 77, 99, 82, 99, 96, 99,105, 99,120, 99,136,177, 52,128,
-      5,180, 50,  2, 99, 88, 99, 92, 49,128,  5,180,100,128,  5,180,
-    232,229,226,242,229,119,128,  5,180,238,225,242,242,239,247,232,
-    229,226,242,229,119,128,  5,180,241,245,225,242,244,229,242,232,
-    229,226,242,229,119,128,  5,180,247,233,228,229,232,229,226,242,
-    229,119,128,  5,180,236,233,238,229,226,229,236,239,119,128, 30,
-    150,237,239,238,239,243,240,225,227,101,128,255, 72,111,  9, 99,
-    193, 99,204, 99,228, 99,253,100, 85,100, 98,100,184,100,224,100,
-    235,225,242,237,229,238,233,225,110,128,  5,112,232,105,  2, 99,
-    211, 99,219,240,244,232,225,105,128, 14, 43,242,225,231,225,238,
-     97,128, 48,123,235,225,244,225,235,225,238, 97,129, 48,219, 99,
-    241,232,225,236,230,247,233,228,244,104,128,255,142,236,225,109,
-    135,  5,185,100, 17,100, 22,100, 27,100, 32,100, 41,100, 56,100,
-     72,177, 57,128,  5,185,178, 54,128,  5,185,179, 50,128,  5,185,
-    232,229,226,242,229,119,128,  5,185,238,225,242,242,239,247,232,
-    229,226,242,229,119,128,  5,185,241,245,225,242,244,229,242,232,
-    229,226,242,229,119,128,  5,185,247,233,228,229,232,229,226,242,
-    229,119,128,  5,185,238,239,235,232,245,235,244,232,225,105,128,
-     14, 46,111,  2,100,104,100,174,107,  4,100,114,100,126,100,132,
-    100,154,225,226,239,246,229,227,239,237, 98,128,  3,  9,227,237,
-     98,128,  3,  9,240,225,236,225,244,225,236,233,250,229,228,226,
-    229,236,239,247,227,237, 98,128,  3, 33,242,229,244,242,239,230,
-    236,229,248,226,229,236,239,247,227,237, 98,128,  3, 34,238,243,
-    241,245,225,242,101,128, 51, 66,114,  2,100,190,100,217,105,  2,
-    100,196,100,205,227,239,240,244,233, 99,128,  3,233,250,239,238,
-    244,225,236,226,225,114,128, 32, 21,238,227,237, 98,128,  3, 27,
-    244,243,240,242,233,238,231,115,128, 38,104,245,243,101,128, 35,
-      2,240,225,242,229,110,128, 36,163,243,245,240,229,242,233,239,
-    114,128,  2,176,244,245,242,238,229,100,128,  2,101,117,  4,101,
-     23,101, 34,101, 47,101, 72,232,233,242,225,231,225,238, 97,128,
-     48,117,233,233,244,239,243,241,245,225,242,101,128, 51, 51,235,
-    225,244,225,235,225,238, 97,129, 48,213,101, 60,232,225,236,230,
-    247,233,228,244,104,128,255,140,238,231,225,242,245,237,236,225,
-    245,116,129,  2,221,101, 87,227,237, 98,128,  3, 11,118,128,  1,
-    149,249,240,232,229,110,132,  0, 45,101,113,101,124,101,136,101,
-    159,233,238,230,229,242,233,239,114,128,246,229,237,239,238,239,
-    243,240,225,227,101,128,255, 13,115,  2,101,142,101,149,237,225,
-    236,108,128,254, 99,245,240,229,242,233,239,114,128,246,230,244,
-    247,111,128, 32, 16,105,149,  0,105,101,211,101,234,102, 12,102,
-     59,105,197,106, 61,106, 98,106,125,107, 31,107, 35,107, 73,107,
-     95,107,179,108, 88,108,163,108,171,108,184,109, 15,109, 72,109,
-    100,109,144,225, 99,  2,101,218,101,224,245,244,101,128,  0,237,
-    249,242,233,236,236,233, 99,128,  4, 79, 98,  3,101,242,101,251,
-    102,  5,229,238,231,225,236,105,128,  9,135,239,240,239,237,239,
-    230,111,128, 49, 39,242,229,246,101,128,  1, 45, 99,  3,102, 20,
-    102, 27,102, 49,225,242,239,110,128,  1,208,233,242, 99,  2,102,
-     35,102, 40,236,101,128, 36,216,245,237,230,236,229,120,128,  0,
-    238,249,242,233,236,236,233, 99,128,  4, 86,100,  4,102, 69,102,
-     79,105,154,105,187,226,236,231,242,225,246,101,128,  2,  9,101,
-      2,102, 85,105,149,239,231,242,225,240,104,  7,102,106,102,120,
-    102,133,105, 62,105, 93,105,106,105,118,229,225,242,244,232,227,
-    233,242,227,236,101,128, 50,143,230,233,242,229,227,233,242,227,
-    236,101,128, 50,139,233, 99, 14,102,164,102,180,103, 23,103, 77,
-    103,143,103,172,103,188,103,245,104, 38,104, 50,104, 77,104,144,
-    105, 26,105, 55,225,236,236,233,225,238,227,229,240,225,242,229,
-    110,128, 50, 63, 99,  4,102,190,102,201,102,215,102,222,225,236,
-    236,240,225,242,229,110,128, 50, 58,229,238,244,242,229,227,233,
-    242,227,236,101,128, 50,165,236,239,243,101,128, 48,  6,111,  3,
-    102,230,102,245,103,  9,237,237, 97,129, 48,  1,102,238,236,229,
-    230,116,128,255,100,238,231,242,225,244,245,236,225,244,233,239,
-    238,240,225,242,229,110,128, 50, 55,242,242,229,227,244,227,233,
-    242,227,236,101,128, 50,163,101,  3,103, 31,103, 43,103, 60,225,
-    242,244,232,240,225,242,229,110,128, 50, 47,238,244,229,242,240,
-    242,233,243,229,240,225,242,229,110,128, 50, 61,248,227,229,236,
-    236,229,238,244,227,233,242,227,236,101,128, 50,157,102,  2,103,
-     83,103, 98,229,243,244,233,246,225,236,240,225,242,229,110,128,
-     50, 64,105,  2,103,104,103,133,238,225,238,227,233,225,108,  2,
-    103,116,103,125,227,233,242,227,236,101,128, 50,150,240,225,242,
-    229,110,128, 50, 54,242,229,240,225,242,229,110,128, 50, 43,104,
-      2,103,149,103,160,225,246,229,240,225,242,229,110,128, 50, 50,
-    233,231,232,227,233,242,227,236,101,128, 50,164,233,244,229,242,
-    225,244,233,239,238,237,225,242,107,128, 48,  5,108,  3,103,196,
-    103,222,103,234,225,226,239,114,  2,103,205,103,214,227,233,242,
-    227,236,101,128, 50,152,240,225,242,229,110,128, 50, 56,229,230,
-    244,227,233,242,227,236,101,128, 50,167,239,247,227,233,242,227,
-    236,101,128, 50,166,109,  2,103,251,104, 27,101,  2,104,  1,104,
-     16,228,233,227,233,238,229,227,233,242,227,236,101,128, 50,169,
-    244,225,236,240,225,242,229,110,128, 50, 46,239,239,238,240,225,
-    242,229,110,128, 50, 42,238,225,237,229,240,225,242,229,110,128,
-     50, 52,112,  2,104, 56,104, 64,229,242,233,239,100,128, 48,  2,
-    242,233,238,244,227,233,242,227,236,101,128, 50,158,114,  2,104,
-     83,104,131,101,  3,104, 91,104,102,104,117,225,227,232,240,225,
-    242,229,110,128, 50, 67,240,242,229,243,229,238,244,240,225,242,
-    229,110,128, 50, 57,243,239,245,242,227,229,240,225,242,229,110,
-    128, 50, 62,233,231,232,244,227,233,242,227,236,101,128, 50,168,
-    115,  5,104,156,104,185,104,199,104,224,104,252,101,  2,104,162,
-    104,175,227,242,229,244,227,233,242,227,236,101,128, 50,153,236,
-    230,240,225,242,229,110,128, 50, 66,239,227,233,229,244,249,240,
-    225,242,229,110,128, 50, 51,112,  2,104,205,104,211,225,227,101,
-    128, 48,  0,229,227,233,225,236,240,225,242,229,110,128, 50, 53,
-    116,  2,104,230,104,241,239,227,235,240,225,242,229,110,128, 50,
-     49,245,228,249,240,225,242,229,110,128, 50, 59,117,  2,105,  2,
-    105, 11,238,240,225,242,229,110,128, 50, 48,240,229,242,246,233,
-    243,229,240,225,242,229,110,128, 50, 60,119,  2,105, 32,105, 44,
-    225,244,229,242,240,225,242,229,110,128, 50, 44,239,239,228,240,
-    225,242,229,110,128, 50, 45,250,229,242,111,128, 48,  7,109,  2,
-    105, 68,105, 81,229,244,225,236,227,233,242,227,236,101,128, 50,
-    142,239,239,238,227,233,242,227,236,101,128, 50,138,238,225,237,
-    229,227,233,242,227,236,101,128, 50,148,243,245,238,227,233,242,
-    227,236,101,128, 50,144,119,  2,105,124,105,137,225,244,229,242,
-    227,233,242,227,236,101,128, 50,140,239,239,228,227,233,242,227,
-    236,101,128, 50,141,246, 97,128,  9,  7,233,229,242,229,243,233,
-    115,130,  0,239,105,168,105,176,225,227,245,244,101,128, 30, 47,
-    227,249,242,233,236,236,233, 99,128,  4,229,239,244,226,229,236,
-    239,119,128, 30,203,101,  3,105,205,105,221,105,232,226,242,229,
-    246,229,227,249,242,233,236,236,233, 99,128,  4,215,227,249,242,
-    233,236,236,233, 99,128,  4, 53,245,238,103,  4,105,244,106, 23,
-    106, 38,106, 47, 97,  2,105,250,106,  9,227,233,242,227,236,229,
-    235,239,242,229,225,110,128, 50,117,240,225,242,229,238,235,239,
-    242,229,225,110,128, 50, 21,227,233,242,227,236,229,235,239,242,
-    229,225,110,128, 50,103,235,239,242,229,225,110,128, 49, 71,240,
-    225,242,229,238,235,239,242,229,225,110,128, 50,  7,103,  2,106,
-     67,106, 74,242,225,246,101,128,  0,236,117,  2,106, 80,106, 89,
-    234,225,242,225,244,105,128, 10,135,242,237,245,235,232,105,128,
-     10,  7,104,  2,106,104,106,114,233,242,225,231,225,238, 97,128,
-     48, 68,239,239,235,225,226,239,246,101,128, 30,201,105,  8,106,
-    143,106,153,106,164,106,171,106,196,106,212,106,227,106,243,226,
-    229,238,231,225,236,105,128,  9,136,227,249,242,233,236,236,233,
-     99,128,  4, 56,228,229,246, 97,128,  9,  8,231,117,  2,106,178,
-    106,187,234,225,242,225,244,105,128, 10,136,242,237,245,235,232,
-    105,128, 10,  8,237,225,244,242,225,231,245,242,237,245,235,232,
-    105,128, 10, 64,238,246,229,242,244,229,228,226,242,229,246,101,
-    128,  2, 11,243,232,239,242,244,227,249,242,233,236,236,233, 99,
-    128,  4, 57,246,239,247,229,236,243,233,231,110,  3,107,  3,107,
-     13,107, 20,226,229,238,231,225,236,105,128,  9,192,228,229,246,
-     97,128,  9, 64,231,245,234,225,242,225,244,105,128, 10,192,106,
-    128,  1, 51,107,  2,107, 41,107, 65,225,244,225,235,225,238, 97,
-    129, 48,164,107, 53,232,225,236,230,247,233,228,244,104,128,255,
-    114,239,242,229,225,110,128, 49, 99,108,  2,107, 79,107, 84,228,
-    101,128,  2,220,245,249,232,229,226,242,229,119,128,  5,172,109,
-      2,107,101,107,168, 97,  3,107,109,107,129,107,154,227,242,239,
-    110,129,  1, 43,107,118,227,249,242,233,236,236,233, 99,128,  4,
-    227,231,229,239,242,225,240,240,242,239,248,233,237,225,244,229,
-    236,249,229,241,245,225,108,128, 34, 83,244,242,225,231,245,242,
-    237,245,235,232,105,128, 10, 63,239,238,239,243,240,225,227,101,
-    128,255, 73,110,  5,107,191,107,201,107,210,107,222,108, 50,227,
-    242,229,237,229,238,116,128, 34,  6,230,233,238,233,244,121,128,
-     34, 30,233,225,242,237,229,238,233,225,110,128,  5,107,116,  2,
-    107,228,108, 40,101,  2,107,234,108, 29,231,242,225,108,131, 34,
-     43,107,247,108,  9,108, 14, 98,  2,107,253,108,  5,239,244,244,
-    239,109,128, 35, 33,116,128, 35, 33,229,120,128,248,245,116,  2,
-    108, 20,108, 25,239,112,128, 35, 32,112,128, 35, 32,242,243,229,
-    227,244,233,239,110,128, 34, 41,233,243,241,245,225,242,101,128,
-     51,  5,118,  3,108, 58,108, 67,108, 76,226,245,236,236,229,116,
-    128, 37,216,227,233,242,227,236,101,128, 37,217,243,237,233,236,
-    229,230,225,227,101,128, 38, 59,111,  3,108, 96,108,107,108,115,
-    227,249,242,233,236,236,233, 99,128,  4, 81,231,239,238,229,107,
-    128,  1, 47,244, 97,131,  3,185,108,126,108,147,108,155,228,233,
-    229,242,229,243,233,115,129,  3,202,108,139,244,239,238,239,115,
-    128,  3,144,236,225,244,233,110,128,  2,105,244,239,238,239,115,
-    128,  3,175,240,225,242,229,110,128, 36,164,242,233,231,245,242,
-    237,245,235,232,105,128, 10,114,115,  4,108,194,108,239,108,253,
-    109,  5,237,225,236,108,  2,108,203,108,214,232,233,242,225,231,
-    225,238, 97,128, 48, 67,235,225,244,225,235,225,238, 97,129, 48,
-    163,108,227,232,225,236,230,247,233,228,244,104,128,255,104,243,
-    232,225,242,226,229,238,231,225,236,105,128,  9,250,244,242,239,
-    235,101,128,  2,104,245,240,229,242,233,239,114,128,246,237,116,
-      2,109, 21,109, 55,229,242,225,244,233,239,110,  2,109, 33,109,
-     44,232,233,242,225,231,225,238, 97,128, 48,157,235,225,244,225,
-    235,225,238, 97,128, 48,253,233,236,228,101,129,  1, 41,109, 64,
-    226,229,236,239,119,128, 30, 45,117,  2,109, 78,109, 89,226,239,
-    240,239,237,239,230,111,128, 49, 41,227,249,242,233,236,236,233,
-     99,128,  4, 78,246,239,247,229,236,243,233,231,110,  3,109,116,
-    109,126,109,133,226,229,238,231,225,236,105,128,  9,191,228,229,
-    246, 97,128,  9, 63,231,245,234,225,242,225,244,105,128, 10,191,
-    250,232,233,244,243, 97,  2,109,155,109,166,227,249,242,233,236,
-    236,233, 99,128,  4,117,228,226,236,231,242,225,246,229,227,249,
-    242,233,236,236,233, 99,128,  4,119,106,138,  0,106,109,209,110,
-     16,110, 27,110, 77,110, 93,110,206,111, 19,111, 24,111, 36,111,
-     44, 97,  4,109,219,109,230,109,240,109,247,225,242,237,229,238,
-    233,225,110,128,  5,113,226,229,238,231,225,236,105,128,  9,156,
-    228,229,246, 97,128,  9, 28,231,117,  2,109,254,110,  7,234,225,
-    242,225,244,105,128, 10,156,242,237,245,235,232,105,128, 10, 28,
-    226,239,240,239,237,239,230,111,128, 49, 16, 99,  3,110, 35,110,
-     42,110, 64,225,242,239,110,128,  1,240,233,242, 99,  2,110, 50,
-    110, 55,236,101,128, 36,217,245,237,230,236,229,120,128,  1, 53,
-    242,239,243,243,229,228,244,225,233,108,128,  2,157,228,239,244,
-    236,229,243,243,243,244,242,239,235,101,128,  2, 95,101,  3,110,
-    101,110,112,110,177,227,249,242,233,236,236,233, 99,128,  4, 88,
-    229,109,  4,110,123,110,132,110,146,110,162,225,242,225,226,233,
-     99,128,  6, 44,230,233,238,225,236,225,242,225,226,233, 99,128,
-    254,158,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,
-    254,159,237,229,228,233,225,236,225,242,225,226,233, 99,128,254,
-    160,104,  2,110,183,110,192,225,242,225,226,233, 99,128,  6,152,
-    230,233,238,225,236,225,242,225,226,233, 99,128,251,139,104,  2,
-    110,212,111,  6, 97,  3,110,220,110,230,110,237,226,229,238,231,
-    225,236,105,128,  9,157,228,229,246, 97,128,  9, 29,231,117,  2,
-    110,244,110,253,234,225,242,225,244,105,128, 10,157,242,237,245,
-    235,232,105,128, 10, 29,229,232,225,242,237,229,238,233,225,110,
-    128,  5,123,233,115,128, 48,  4,237,239,238,239,243,240,225,227,
-    101,128,255, 74,240,225,242,229,110,128, 36,165,243,245,240,229,
-    242,233,239,114,128,  2,178,107,146,  0,107,111, 95,113,184,113,
-    195,114,  1,114, 12,114,102,114,116,115,224,116,164,116,177,116,
-    203,116,252,117,134,117,156,117,169,117,192,117,234,117,244, 97,
-     12,111,121,111,153,111,175,111,205,112, 63,112, 88,112,118,112,
-    143,112,249,113,  7,113,130,113,159, 98,  2,111,127,111,144,225,
-    243,232,235,233,242,227,249,242,233,236,236,233, 99,128,  4,161,
-    229,238,231,225,236,105,128,  9,149, 99,  2,111,159,111,165,245,
-    244,101,128, 30, 49,249,242,233,236,236,233, 99,128,  4, 58,228,
-    101,  2,111,182,111,200,243,227,229,238,228,229,242,227,249,242,
-    233,236,236,233, 99,128,  4,155,246, 97,128,  9, 21,102,135,  5,
-    219,111,223,111,232,111,252,112, 10,112, 19,112, 35,112, 50,225,
-    242,225,226,233, 99,128,  6, 67,228,225,231,229,243,104,129,251,
-     59,111,243,232,229,226,242,229,119,128,251, 59,230,233,238,225,
-    236,225,242,225,226,233, 99,128,254,218,232,229,226,242,229,119,
-    128,  5,219,233,238,233,244,233,225,236,225,242,225,226,233, 99,
-    128,254,219,237,229,228,233,225,236,225,242,225,226,233, 99,128,
-    254,220,242,225,230,229,232,229,226,242,229,119,128,251, 77,231,
-    117,  2,112, 70,112, 79,234,225,242,225,244,105,128, 10,149,242,
-    237,245,235,232,105,128, 10, 21,104,  2,112, 94,112,104,233,242,
-    225,231,225,238, 97,128, 48, 75,239,239,235,227,249,242,233,236,
-    236,233, 99,128,  4,196,235,225,244,225,235,225,238, 97,129, 48,
-    171,112,131,232,225,236,230,247,233,228,244,104,128,255,118,112,
-      2,112,149,112,170,240, 97,129,  3,186,112,156,243,249,237,226,
-    239,236,231,242,229,229,107,128,  3,240,249,229,239,245,110,  3,
-    112,182,112,196,112,230,237,233,229,245,237,235,239,242,229,225,
-    110,128, 49,113,112,  2,112,202,112,217,232,233,229,245,240,232,
-    235,239,242,229,225,110,128, 49,132,233,229,245,240,235,239,242,
-    229,225,110,128, 49,120,243,243,225,238,231,240,233,229,245,240,
-    235,239,242,229,225,110,128, 49,121,242,239,242,233,233,243,241,
-    245,225,242,101,128, 51, 13,115,  5,113, 19,113, 63,113, 78,113,
-     86,113,114,232,233,228,225,225,245,244,111,  2,113, 32,113, 41,
-    225,242,225,226,233, 99,128,  6, 64,238,239,243,233,228,229,226,
-    229,225,242,233,238,231,225,242,225,226,233, 99,128,  6, 64,237,
-    225,236,236,235,225,244,225,235,225,238, 97,128, 48,245,241,245,
-    225,242,101,128, 51,132,242, 97,  2,113, 93,113,102,225,242,225,
-    226,233, 99,128,  6, 80,244,225,238,225,242,225,226,233, 99,128,
-      6, 77,244,242,239,235,229,227,249,242,233,236,236,233, 99,128,
-      4,159,244,225,232,233,242,225,240,242,239,236,239,238,231,237,
-    225,242,235,232,225,236,230,247,233,228,244,104,128,255,112,246,
-    229,242,244,233,227,225,236,243,244,242,239,235,229,227,249,242,
-    233,236,236,233, 99,128,  4,157,226,239,240,239,237,239,230,111,
-    128, 49, 14, 99,  4,113,205,113,227,113,236,113,244, 97,  2,113,
-    211,113,221,236,243,241,245,225,242,101,128, 51,137,242,239,110,
-    128,  1,233,229,228,233,236,236, 97,128,  1, 55,233,242,227,236,
-    101,128, 36,218,239,237,237,225,225,227,227,229,238,116,128,  1,
-     55,228,239,244,226,229,236,239,119,128, 30, 51,101,  4,114, 22,
-    114, 49,114, 74,114, 86,104,  2,114, 28,114, 39,225,242,237,229,
-    238,233,225,110,128,  5,132,233,242,225,231,225,238, 97,128, 48,
-     81,235,225,244,225,235,225,238, 97,129, 48,177,114, 62,232,225,
-    236,230,247,233,228,244,104,128,255,121,238,225,242,237,229,238,
-    233,225,110,128,  5,111,243,237,225,236,236,235,225,244,225,235,
-    225,238, 97,128, 48,246,231,242,229,229,238,236,225,238,228,233,
-     99,128,  1, 56,104,  6,114,130,115,  3,115, 14,115, 39,115,126,
-    115,214, 97,  5,114,142,114,152,114,163,114,170,114,195,226,229,
-    238,231,225,236,105,128,  9,150,227,249,242,233,236,236,233, 99,
-    128,  4, 69,228,229,246, 97,128,  9, 22,231,117,  2,114,177,114,
-    186,234,225,242,225,244,105,128, 10,150,242,237,245,235,232,105,
-    128, 10, 22,104,  4,114,205,114,214,114,228,114,244,225,242,225,
-    226,233, 99,128,  6, 46,230,233,238,225,236,225,242,225,226,233,
-     99,128,254,166,233,238,233,244,233,225,236,225,242,225,226,233,
-     99,128,254,167,237,229,228,233,225,236,225,242,225,226,233, 99,
-    128,254,168,229,233,227,239,240,244,233, 99,128,  3,231,232, 97,
-      2,115, 21,115, 28,228,229,246, 97,128,  9, 89,231,245,242,237,
-    245,235,232,105,128, 10, 89,233,229,245,235,104,  4,115, 53,115,
-     88,115,103,115,112, 97,  2,115, 59,115, 74,227,233,242,227,236,
-    229,235,239,242,229,225,110,128, 50,120,240,225,242,229,238,235,
-    239,242,229,225,110,128, 50, 24,227,233,242,227,236,229,235,239,
-    242,229,225,110,128, 50,106,235,239,242,229,225,110,128, 49, 75,
-    240,225,242,229,238,235,239,242,229,225,110,128, 50, 10,111,  4,
-    115,136,115,185,115,195,115,200,235,104,  4,115,147,115,156,115,
-    165,115,175,225,233,244,232,225,105,128, 14,  2,239,238,244,232,
-    225,105,128, 14,  5,245,225,244,244,232,225,105,128, 14,  3,247,
-    225,233,244,232,225,105,128, 14,  4,237,245,244,244,232,225,105,
-    128, 14, 91,239,107,128,  1,153,242,225,235,232,225,238,231,244,
-    232,225,105,128, 14,  6,250,243,241,245,225,242,101,128, 51,145,
-    105,  4,115,234,115,245,116, 14,116, 63,232,233,242,225,231,225,
-    238, 97,128, 48, 77,235,225,244,225,235,225,238, 97,129, 48,173,
-    116,  2,232,225,236,230,247,233,228,244,104,128,255,119,242,111,
-      3,116, 23,116, 38,116, 54,231,245,242,225,237,245,243,241,245,
-    225,242,101,128, 51, 21,237,229,229,244,239,242,245,243,241,245,
-    225,242,101,128, 51, 22,243,241,245,225,242,101,128, 51, 20,249,
-    229,239,107,  5,116, 78,116,113,116,128,116,137,116,151, 97,  2,
-    116, 84,116, 99,227,233,242,227,236,229,235,239,242,229,225,110,
-    128, 50,110,240,225,242,229,238,235,239,242,229,225,110,128, 50,
-     14,227,233,242,227,236,229,235,239,242,229,225,110,128, 50, 96,
-    235,239,242,229,225,110,128, 49, 49,240,225,242,229,238,235,239,
-    242,229,225,110,128, 50,  0,243,233,239,243,235,239,242,229,225,
-    110,128, 49, 51,234,229,227,249,242,233,236,236,233, 99,128,  4,
-     92,108,  2,116,183,116,194,233,238,229,226,229,236,239,119,128,
-     30, 53,243,241,245,225,242,101,128, 51,152,109,  3,116,211,116,
-    225,116,236,227,245,226,229,228,243,241,245,225,242,101,128, 51,
-    166,239,238,239,243,240,225,227,101,128,255, 75,243,241,245,225,
-    242,229,228,243,241,245,225,242,101,128, 51,162,111,  5,117,  8,
-    117, 34,117, 72,117, 84,117, 98,104,  2,117, 14,117, 24,233,242,
-    225,231,225,238, 97,128, 48, 83,237,243,241,245,225,242,101,128,
-     51,192,235, 97,  2,117, 41,117, 49,233,244,232,225,105,128, 14,
-      1,244,225,235,225,238, 97,129, 48,179,117, 60,232,225,236,230,
-    247,233,228,244,104,128,255,122,239,240,239,243,241,245,225,242,
-    101,128, 51, 30,240,240,225,227,249,242,233,236,236,233, 99,128,
-      4,129,114,  2,117,104,117,124,229,225,238,243,244,225,238,228,
-    225,242,228,243,249,237,226,239,108,128, 50,127,239,238,233,243,
-    227,237, 98,128,  3, 67,240, 97,  2,117,141,117,147,242,229,110,
-    128, 36,166,243,241,245,225,242,101,128, 51,170,243,233,227,249,
-    242,233,236,236,233, 99,128,  4,111,116,  2,117,175,117,184,243,
-    241,245,225,242,101,128, 51,207,245,242,238,229,100,128,  2,158,
-    117,  2,117,198,117,209,232,233,242,225,231,225,238, 97,128, 48,
-     79,235,225,244,225,235,225,238, 97,129, 48,175,117,222,232,225,
-    236,230,247,233,228,244,104,128,255,120,246,243,241,245,225,242,
-    101,128, 51,184,247,243,241,245,225,242,101,128, 51,190,108,146,
-      0,108,118, 38,120, 65,120, 94,120,160,120,198,121, 94,121,103,
-    121,119,121,143,121,161,122, 23,122, 64,122,199,122,207,122,240,
-    122,249,123,  1,123, 63, 97,  7,118, 54,118, 64,118, 71,118, 78,
-    118,103,118,119,120, 53,226,229,238,231,225,236,105,128,  9,178,
-    227,245,244,101,128,  1, 58,228,229,246, 97,128,  9, 50,231,117,
-      2,118, 85,118, 94,234,225,242,225,244,105,128, 10,178,242,237,
-    245,235,232,105,128, 10, 50,235,235,232,225,238,231,249,225,239,
-    244,232,225,105,128, 14, 69,109, 10,118,141,119, 80,119, 97,119,
-    135,119,149,119,168,119,184,119,204,119,224,119,247, 97,  2,118,
-    147,119, 72,236,229,102,  4,118,159,118,173,119,  9,119, 26,230,
-    233,238,225,236,225,242,225,226,233, 99,128,254,252,232,225,237,
-    250, 97,  2,118,183,118,224,225,226,239,246,101,  2,118,193,118,
-    207,230,233,238,225,236,225,242,225,226,233, 99,128,254,248,233,
-    243,239,236,225,244,229,228,225,242,225,226,233, 99,128,254,247,
-    226,229,236,239,119,  2,118,234,118,248,230,233,238,225,236,225,
-    242,225,226,233, 99,128,254,250,233,243,239,236,225,244,229,228,
-    225,242,225,226,233, 99,128,254,249,233,243,239,236,225,244,229,
-    228,225,242,225,226,233, 99,128,254,251,237,225,228,228,225,225,
-    226,239,246,101,  2,119, 41,119, 55,230,233,238,225,236,225,242,
-    225,226,233, 99,128,254,246,233,243,239,236,225,244,229,228,225,
-    242,225,226,233, 99,128,254,245,242,225,226,233, 99,128,  6, 68,
-    226,228, 97,129,  3,187,119, 88,243,244,242,239,235,101,128,  1,
-    155,229,100,130,  5,220,119,106,119,126,228,225,231,229,243,104,
-    129,251, 60,119,117,232,229,226,242,229,119,128,251, 60,232,229,
-    226,242,229,119,128,  5,220,230,233,238,225,236,225,242,225,226,
-    233, 99,128,254,222,232,225,232,233,238,233,244,233,225,236,225,
-    242,225,226,233, 99,128,252,202,233,238,233,244,233,225,236,225,
-    242,225,226,233, 99,128,254,223,234,229,229,237,233,238,233,244,
-    233,225,236,225,242,225,226,233, 99,128,252,201,235,232,225,232,
-    233,238,233,244,233,225,236,225,242,225,226,233, 99,128,252,203,
-    236,225,237,232,229,232,233,243,239,236,225,244,229,228,225,242,
-    225,226,233, 99,128,253,242,237,101,  2,119,254,120, 11,228,233,
-    225,236,225,242,225,226,233, 99,128,254,224,229,109,  2,120, 18,
-    120, 37,232,225,232,233,238,233,244,233,225,236,225,242,225,226,
-    233, 99,128,253,136,233,238,233,244,233,225,236,225,242,225,226,
-    233, 99,128,252,204,242,231,229,227,233,242,227,236,101,128, 37,
-    239, 98,  3,120, 73,120, 78,120, 84,225,114,128,  1,154,229,236,
-    116,128,  2,108,239,240,239,237,239,230,111,128, 49, 12, 99,  4,
-    120,104,120,111,120,120,120,147,225,242,239,110,128,  1, 62,229,
-    228,233,236,236, 97,128,  1, 60,233,242, 99,  2,120,128,120,133,
-    236,101,128, 36,219,245,237,230,236,229,248,226,229,236,239,119,
-    128, 30, 61,239,237,237,225,225,227,227,229,238,116,128,  1, 60,
-    228,239,116,130,  1, 64,120,170,120,179,225,227,227,229,238,116,
-    128,  1, 64,226,229,236,239,119,129, 30, 55,120,189,237,225,227,
-    242,239,110,128, 30, 57,101,  3,120,206,120,244,121, 89,230,116,
-      2,120,213,120,229,225,238,231,236,229,225,226,239,246,229,227,
-    237, 98,128,  3, 26,244,225,227,235,226,229,236,239,247,227,237,
-     98,128,  3, 24,243,115,132,  0, 60,121,  1,121, 23,121, 35,121,
-     81,229,241,245,225,108,129, 34,100,121, 11,239,242,231,242,229,
-    225,244,229,114,128, 34,218,237,239,238,239,243,240,225,227,101,
-    128,255, 28,111,  2,121, 41,121, 70,114,  2,121, 47,121, 60,229,
-    241,245,233,246,225,236,229,238,116,128, 34,114,231,242,229,225,
-    244,229,114,128, 34,118,246,229,242,229,241,245,225,108,128, 34,
-    102,243,237,225,236,108,128,254,100,250,104,128,  2,110,230,226,
-    236,239,227,107,128, 37,140,232,239,239,235,242,229,244,242,239,
-    230,236,229,120,128,  2,109,105,  2,121,125,121,130,242, 97,128,
-     32,164,247,238,225,242,237,229,238,233,225,110,128,  5,108,106,
-    129,  1,201,121,149,229,227,249,242,233,236,236,233, 99,128,  4,
-     89,108,132,246,192,121,173,121,197,121,208,121,217, 97,  2,121,
-    179,121,186,228,229,246, 97,128,  9, 51,231,245,234,225,242,225,
-    244,105,128, 10,179,233,238,229,226,229,236,239,119,128, 30, 59,
-    236,225,228,229,246, 97,128,  9, 52,246,239,227,225,236,233, 99,
-      3,121,231,121,241,121,248,226,229,238,231,225,236,105,128,  9,
-    225,228,229,246, 97,128,  9, 97,246,239,247,229,236,243,233,231,
-    110,  2,122,  6,122, 16,226,229,238,231,225,236,105,128,  9,227,
-    228,229,246, 97,128,  9, 99,109,  3,122, 31,122, 44,122, 55,233,
-    228,228,236,229,244,233,236,228,101,128,  2,107,239,238,239,243,
-    240,225,227,101,128,255, 76,243,241,245,225,242,101,128, 51,208,
-    111,  6,122, 78,122, 90,122,132,122,143,122,149,122,191,227,232,
-    245,236,225,244,232,225,105,128, 14, 44,231,233,227,225,108,  3,
-    122,102,122,108,122,127,225,238,100,128, 34, 39,238,239,116,129,
-      0,172,122,116,242,229,246,229,242,243,229,100,128, 35, 16,239,
-    114,128, 34, 40,236,233,238,231,244,232,225,105,128, 14, 37,238,
-    231,115,128,  1,127,247,236,233,238,101,  2,122,159,122,182, 99,
-      2,122,165,122,177,229,238,244,229,242,236,233,238,101,128,254,
-     78,237, 98,128,  3, 50,228,225,243,232,229,100,128,254, 77,250,
-    229,238,231,101,128, 37,202,240,225,242,229,110,128, 36,167,115,
-      3,122,215,122,222,122,230,236,225,243,104,128,  1, 66,241,245,
-    225,242,101,128, 33, 19,245,240,229,242,233,239,114,128,246,238,
-    244,243,232,225,228,101,128, 37,145,245,244,232,225,105,128, 14,
-     38,246,239,227,225,236,233, 99,  3,123, 15,123, 25,123, 32,226,
-    229,238,231,225,236,105,128,  9,140,228,229,246, 97,128,  9, 12,
-    246,239,247,229,236,243,233,231,110,  2,123, 46,123, 56,226,229,
-    238,231,225,236,105,128,  9,226,228,229,246, 97,128,  9, 98,248,
-    243,241,245,225,242,101,128, 51,211,109,144,  0,109,123,109,125,
-    218,125,243,126, 14,126, 39,127, 92,127,114,128,169,128,199,128,
-    248,129, 99,129,121,129,146,129,155,130,182,130,210, 97, 12,123,
-    135,123,145,123,209,123,216,123,241,124, 33,125,125,125,150,125,
-    155,125,169,125,181,125,186,226,229,238,231,225,236,105,128,  9,
-    174, 99,  2,123,151,123,203,242,239,110,132,  0,175,123,165,123,
-    176,123,182,123,191,226,229,236,239,247,227,237, 98,128,  3, 49,
-    227,237, 98,128,  3,  4,236,239,247,237,239,100,128,  2,205,237,
-    239,238,239,243,240,225,227,101,128,255,227,245,244,101,128, 30,
-     63,228,229,246, 97,128,  9, 46,231,117,  2,123,223,123,232,234,
-    225,242,225,244,105,128, 10,174,242,237,245,235,232,105,128, 10,
-     46,104,  2,123,247,124, 23,225,240,225,235,104,  2,124,  1,124,
-     10,232,229,226,242,229,119,128,  5,164,236,229,230,244,232,229,
-    226,242,229,119,128,  5,164,233,242,225,231,225,238, 97,128, 48,
-    126,105,  5,124, 45,124,114,124,177,124,207,125,113,227,232,225,
-    244,244,225,247, 97,  3,124, 60,124, 91,124, 98,236,239,119,  2,
-    124, 68,124, 79,236,229,230,244,244,232,225,105,128,248,149,242,
-    233,231,232,244,244,232,225,105,128,248,148,244,232,225,105,128,
-     14, 75,245,240,240,229,242,236,229,230,244,244,232,225,105,128,
-    248,147,229,107,  3,124,123,124,154,124,161,236,239,119,  2,124,
-    131,124,142,236,229,230,244,244,232,225,105,128,248,140,242,233,
-    231,232,244,244,232,225,105,128,248,139,244,232,225,105,128, 14,
-     72,245,240,240,229,242,236,229,230,244,244,232,225,105,128,248,
-    138,232,225,238,225,235,225,116,  2,124,189,124,200,236,229,230,
-    244,244,232,225,105,128,248,132,244,232,225,105,128, 14, 49,116,
-      3,124,215,124,243,125, 50,225,233,235,232,117,  2,124,225,124,
-    236,236,229,230,244,244,232,225,105,128,248,137,244,232,225,105,
-    128, 14, 71,232,111,  3,124,252,125, 27,125, 34,236,239,119,  2,
-    125,  4,125, 15,236,229,230,244,244,232,225,105,128,248,143,242,
-    233,231,232,244,244,232,225,105,128,248,142,244,232,225,105,128,
-     14, 73,245,240,240,229,242,236,229,230,244,244,232,225,105,128,
-    248,141,242,105,  3,125, 59,125, 90,125, 97,236,239,119,  2,125,
-     67,125, 78,236,229,230,244,244,232,225,105,128,248,146,242,233,
-    231,232,244,244,232,225,105,128,248,145,244,232,225,105,128, 14,
-     74,245,240,240,229,242,236,229,230,244,244,232,225,105,128,248,
-    144,249,225,237,239,235,244,232,225,105,128, 14, 70,235,225,244,
-    225,235,225,238, 97,129, 48,222,125,138,232,225,236,230,247,233,
-    228,244,104,128,255,143,236,101,128, 38, 66,238,243,249,239,238,
-    243,241,245,225,242,101,128, 51, 71,241,225,230,232,229,226,242,
-    229,119,128,  5,190,242,115,128, 38, 66,115,  2,125,192,125,210,
-    239,242,225,227,233,242,227,236,229,232,229,226,242,229,119,128,
-      5,175,241,245,225,242,101,128, 51,131, 98,  2,125,224,125,234,
-    239,240,239,237,239,230,111,128, 49,  7,243,241,245,225,242,101,
-    128, 51,212, 99,  2,125,249,126,  1,233,242,227,236,101,128, 36,
-    220,245,226,229,228,243,241,245,225,242,101,128, 51,165,228,239,
-    116,  2,126, 22,126, 31,225,227,227,229,238,116,128, 30, 65,226,
-    229,236,239,119,128, 30, 67,101,  7,126, 55,126,182,126,193,126,
-    208,126,233,127, 14,127, 26,101,  2,126, 61,126,169,109,  4,126,
-     71,126, 80,126, 94,126,110,225,242,225,226,233, 99,128,  6, 69,
-    230,233,238,225,236,225,242,225,226,233, 99,128,254,226,233,238,
-    233,244,233,225,236,225,242,225,226,233, 99,128,254,227,237,101,
-      2,126,117,126,130,228,233,225,236,225,242,225,226,233, 99,128,
-    254,228,229,237,105,  2,126,138,126,153,238,233,244,233,225,236,
-    225,242,225,226,233, 99,128,252,209,243,239,236,225,244,229,228,
-    225,242,225,226,233, 99,128,252, 72,244,239,242,245,243,241,245,
-    225,242,101,128, 51, 77,232,233,242,225,231,225,238, 97,128, 48,
-    129,233,250,233,229,242,225,243,241,245,225,242,101,128, 51,126,
-    235,225,244,225,235,225,238, 97,129, 48,225,126,221,232,225,236,
-    230,247,233,228,244,104,128,255,146,109,130,  5,222,126,241,127,
-      5,228,225,231,229,243,104,129,251, 62,126,252,232,229,226,242,
-    229,119,128,251, 62,232,229,226,242,229,119,128,  5,222,238,225,
-    242,237,229,238,233,225,110,128,  5,116,242,235,232, 97,  3,127,
-     37,127, 46,127, 79,232,229,226,242,229,119,128,  5,165,235,229,
-    230,245,236, 97,  2,127, 57,127, 66,232,229,226,242,229,119,128,
-      5,166,236,229,230,244,232,229,226,242,229,119,128,  5,166,236,
-    229,230,244,232,229,226,242,229,119,128,  5,165,104,  2,127, 98,
-    127,104,239,239,107,128,  2,113,250,243,241,245,225,242,101,128,
-     51,146,105,  6,127,128,127,165,128, 46,128, 57,128, 82,128,139,
-    228,100,  2,127,135,127,160,236,229,228,239,244,235,225,244,225,
-    235,225,238,225,232,225,236,230,247,233,228,244,104,128,255,101,
-    239,116,128,  0,183,229,245,109,  5,127,179,127,214,127,229,127,
-    238,128, 33, 97,  2,127,185,127,200,227,233,242,227,236,229,235,
-    239,242,229,225,110,128, 50,114,240,225,242,229,238,235,239,242,
-    229,225,110,128, 50, 18,227,233,242,227,236,229,235,239,242,229,
-    225,110,128, 50,100,235,239,242,229,225,110,128, 49, 65,112,  2,
-    127,244,128, 20, 97,  2,127,250,128,  8,238,243,233,239,243,235,
-    239,242,229,225,110,128, 49,112,242,229,238,235,239,242,229,225,
-    110,128, 50,  4,233,229,245,240,235,239,242,229,225,110,128, 49,
-    110,243,233,239,243,235,239,242,229,225,110,128, 49,111,232,233,
-    242,225,231,225,238, 97,128, 48,127,235,225,244,225,235,225,238,
-     97,129, 48,223,128, 70,232,225,236,230,247,233,228,244,104,128,
-    255,144,238,117,  2,128, 89,128,134,115,132, 34, 18,128,101,128,
-    112,128,121,128,127,226,229,236,239,247,227,237, 98,128,  3, 32,
-    227,233,242,227,236,101,128, 34,150,237,239,100,128,  2,215,240,
-    236,245,115,128, 34, 19,244,101,128, 32, 50,242,105,  2,128,146,
-    128,160,226,225,225,242,245,243,241,245,225,242,101,128, 51, 74,
-    243,241,245,225,242,101,128, 51, 73,108,  2,128,175,128,190,239,
-    238,231,236,229,231,244,245,242,238,229,100,128,  2,112,243,241,
-    245,225,242,101,128, 51,150,109,  3,128,207,128,221,128,232,227,
-    245,226,229,228,243,241,245,225,242,101,128, 51,163,239,238,239,
-    243,240,225,227,101,128,255, 77,243,241,245,225,242,229,228,243,
-    241,245,225,242,101,128, 51,159,111,  5,129,  4,129, 30,129, 55,
-    129, 65,129, 74,104,  2,129, 10,129, 20,233,242,225,231,225,238,
-     97,128, 48,130,237,243,241,245,225,242,101,128, 51,193,235,225,
-    244,225,235,225,238, 97,129, 48,226,129, 43,232,225,236,230,247,
-    233,228,244,104,128,255,147,236,243,241,245,225,242,101,128, 51,
-    214,237,225,244,232,225,105,128, 14, 33,246,229,242,243,243,241,
-    245,225,242,101,129, 51,167,129, 89,228,243,241,245,225,242,101,
-    128, 51,168,240, 97,  2,129,106,129,112,242,229,110,128, 36,168,
-    243,241,245,225,242,101,128, 51,171,115,  2,129,127,129,136,243,
-    241,245,225,242,101,128, 51,179,245,240,229,242,233,239,114,128,
-    246,239,244,245,242,238,229,100,128,  2,111,117,141,  0,181,129,
-    185,129,189,129,199,129,223,129,233,129,255,130, 10,130, 35,130,
-     58,130, 68,130, 98,130,162,130,172, 49,128,  0,181,225,243,241,
-    245,225,242,101,128, 51,130,227,104,  2,129,206,129,216,231,242,
-    229,225,244,229,114,128, 34,107,236,229,243,115,128, 34,106,230,
-    243,241,245,225,242,101,128, 51,140,103,  2,129,239,129,246,242,
-    229,229,107,128,  3,188,243,241,245,225,242,101,128, 51,141,232,
-    233,242,225,231,225,238, 97,128, 48,128,235,225,244,225,235,225,
-    238, 97,129, 48,224,130, 23,232,225,236,230,247,233,228,244,104,
-    128,255,145,108,  2,130, 41,130, 50,243,241,245,225,242,101,128,
-     51,149,244,233,240,236,121,128,  0,215,237,243,241,245,225,242,
-    101,128, 51,155,238,225,104,  2,130, 76,130, 85,232,229,226,242,
-    229,119,128,  5,163,236,229,230,244,232,229,226,242,229,119,128,
-      5,163,115,  2,130,104,130,153,233, 99,  3,130,113,130,130,130,
-    141,225,236,238,239,244,101,129, 38,106,130,124,228,226,108,128,
-     38,107,230,236,225,244,243,233,231,110,128, 38,109,243,232,225,
-    242,240,243,233,231,110,128, 38,111,243,241,245,225,242,101,128,
-     51,178,246,243,241,245,225,242,101,128, 51,182,247,243,241,245,
-    225,242,101,128, 51,188,118,  2,130,188,130,201,237,229,231,225,
-    243,241,245,225,242,101,128, 51,185,243,241,245,225,242,101,128,
-     51,183,119,  2,130,216,130,229,237,229,231,225,243,241,245,225,
-    242,101,128, 51,191,243,241,245,225,242,101,128, 51,189,110,150,
-      0,110,131, 30,131,164,131,188,131,254,132, 23,132, 81,132, 91,
-    132,158,132,201,134,235,134,253,135, 22,135, 53,135, 79,135,144,
-    137,126,137,134,137,159,137,167,138,135,138,145,138,155, 97,  8,
-    131, 48,131, 68,131, 75,131, 82,131,107,131,118,131,143,131,155,
-     98,  2,131, 54,131, 63,229,238,231,225,236,105,128,  9,168,236,
-     97,128, 34,  7,227,245,244,101,128,  1, 68,228,229,246, 97,128,
-      9, 40,231,117,  2,131, 89,131, 98,234,225,242,225,244,105,128,
-     10,168,242,237,245,235,232,105,128, 10, 40,232,233,242,225,231,
-    225,238, 97,128, 48,106,235,225,244,225,235,225,238, 97,129, 48,
-    202,131,131,232,225,236,230,247,233,228,244,104,128,255,133,240,
-    239,243,244,242,239,240,232,101,128,  1, 73,243,241,245,225,242,
-    101,128, 51,129, 98,  2,131,170,131,180,239,240,239,237,239,230,
-    111,128, 49, 11,243,240,225,227,101,128,  0,160, 99,  4,131,198,
-    131,205,131,214,131,241,225,242,239,110,128,  1, 72,229,228,233,
-    236,236, 97,128,  1, 70,233,242, 99,  2,131,222,131,227,236,101,
-    128, 36,221,245,237,230,236,229,248,226,229,236,239,119,128, 30,
-     75,239,237,237,225,225,227,227,229,238,116,128,  1, 70,228,239,
-    116,  2,132,  6,132, 15,225,227,227,229,238,116,128, 30, 69,226,
-    229,236,239,119,128, 30, 71,101,  3,132, 31,132, 42,132, 67,232,
-    233,242,225,231,225,238, 97,128, 48,109,235,225,244,225,235,225,
-    238, 97,129, 48,205,132, 55,232,225,236,230,247,233,228,244,104,
-    128,255,136,247,243,232,229,241,229,236,243,233,231,110,128, 32,
-    170,230,243,241,245,225,242,101,128, 51,139,103,  2,132, 97,132,
-    147, 97,  3,132,105,132,115,132,122,226,229,238,231,225,236,105,
-    128,  9,153,228,229,246, 97,128,  9, 25,231,117,  2,132,129,132,
-    138,234,225,242,225,244,105,128, 10,153,242,237,245,235,232,105,
-    128, 10, 25,239,238,231,245,244,232,225,105,128, 14,  7,104,  2,
-    132,164,132,174,233,242,225,231,225,238, 97,128, 48,147,239,239,
-    107,  2,132,182,132,189,236,229,230,116,128,  2,114,242,229,244,
-    242,239,230,236,229,120,128,  2,115,105,  4,132,211,133,124,133,
-    135,133,193,229,245,110,  7,132,229,133,  8,133, 40,133, 54,133,
-     63,133, 96,133,109, 97,  2,132,235,132,250,227,233,242,227,236,
-    229,235,239,242,229,225,110,128, 50,111,240,225,242,229,238,235,
-    239,242,229,225,110,128, 50, 15,227,105,  2,133, 15,133, 27,229,
-    245,227,235,239,242,229,225,110,128, 49, 53,242,227,236,229,235,
-    239,242,229,225,110,128, 50, 97,232,233,229,245,232,235,239,242,
-    229,225,110,128, 49, 54,235,239,242,229,225,110,128, 49, 52,240,
-     97,  2,133, 70,133, 84,238,243,233,239,243,235,239,242,229,225,
-    110,128, 49,104,242,229,238,235,239,242,229,225,110,128, 50,  1,
-    243,233,239,243,235,239,242,229,225,110,128, 49,103,244,233,235,
-    229,245,244,235,239,242,229,225,110,128, 49,102,232,233,242,225,
-    231,225,238, 97,128, 48,107,107,  2,133,141,133,165,225,244,225,
-    235,225,238, 97,129, 48,203,133,153,232,225,236,230,247,233,228,
-    244,104,128,255,134,232,225,232,233,116,  2,133,175,133,186,236,
-    229,230,244,244,232,225,105,128,248,153,244,232,225,105,128, 14,
-     77,238,101,141,  0, 57,133,224,133,233,133,243,134, 17,134, 24,
-    134, 49,134, 76,134,110,134,122,134,133,134,166,134,174,134,185,
-    225,242,225,226,233, 99,128,  6,105,226,229,238,231,225,236,105,
-    128,  9,239,227,233,242,227,236,101,129, 36,104,133,254,233,238,
+    247,122,244,242,239,235,101,128,  1,181, 97,158,  0, 97, 36, 26,
+     38,154, 39,  4, 39, 68, 39,132, 39,196, 40,  4, 40, 68, 40,126,
+     40,190, 41, 70, 41,217, 42,137, 42,237, 43, 17, 49,192, 49,229,
+     50,  0, 50,225, 51,  7, 52, 96, 52,168, 53,123, 53,132, 54,  5,
+     56, 13, 57,  3, 57, 50, 57,201, 57,215, 49,138, 39,  1, 36, 50,
+     36,114, 36,154, 36,218, 37, 26, 37, 90, 37,154, 37,218, 38, 26,
+     38, 90, 48,138, 39, 33, 36, 74, 36, 78, 36, 82, 36, 86, 36, 90,
+     36, 94, 36, 98, 36,102, 36,106, 36,110, 48,128, 39, 94, 49,128,
+     39, 97, 50,128, 39, 98, 51,128, 39, 99, 52,128, 39,100, 53,128,
+     39, 16, 54,128, 39,101, 55,128, 39,102, 56,128, 39,103, 57,128,
+     38, 96, 49,134, 38, 27, 36,130, 36,134, 36,138, 36,142, 36,146,
+     36,150, 48,128, 38,101, 49,128, 38,102, 50,128, 38, 99, 55,128,
+     39,  9, 56,128, 39,  8, 57,128, 39,  7, 50,138, 38, 30, 36,178,
+     36,182, 36,186, 36,190, 36,194, 36,198, 36,202, 36,206, 36,210,
+     36,214, 48,128, 36, 96, 49,128, 36, 97, 50,128, 36, 98, 51,128,
+     36, 99, 52,128, 36,100, 53,128, 36,101, 54,128, 36,102, 55,128,
+     36,103, 56,128, 36,104, 57,128, 36,105, 51,138, 39, 12, 36,242,
+     36,246, 36,250, 36,254, 37,  2, 37,  6, 37, 10, 37, 14, 37, 18,
+     37, 22, 48,128, 39,118, 49,128, 39,119, 50,128, 39,120, 51,128,
+     39,121, 52,128, 39,122, 53,128, 39,123, 54,128, 39,124, 55,128,
+     39,125, 56,128, 39,126, 57,128, 39,127, 52,138, 39, 13, 37, 50,
+     37, 54, 37, 58, 37, 62, 37, 66, 37, 70, 37, 74, 37, 78, 37, 82,
+     37, 86, 48,128, 39,128, 49,128, 39,129, 50,128, 39,130, 51,128,
+     39,131, 52,128, 39,132, 53,128, 39,133, 54,128, 39,134, 55,128,
+     39,135, 56,128, 39,136, 57,128, 39,137, 53,138, 39, 14, 37,114,
+     37,118, 37,122, 37,126, 37,130, 37,134, 37,138, 37,142, 37,146,
+     37,150, 48,128, 39,138, 49,128, 39,139, 50,128, 39,140, 51,128,
+     39,141, 52,128, 39,142, 53,128, 39,143, 54,128, 39,144, 55,128,
+     39,145, 56,128, 39,146, 57,128, 39,147, 54,138, 39, 15, 37,178,
+     37,182, 37,186, 37,190, 37,194, 37,198, 37,202, 37,206, 37,210,
+     37,214, 48,128, 39,148, 49,128, 33,146, 50,128, 39,163, 51,128,
+     33,148, 52,128, 33,149, 53,128, 39,153, 54,128, 39,155, 55,128,
+     39,156, 56,128, 39,157, 57,128, 39,158, 55,138, 39, 17, 37,242,
+     37,246, 37,250, 37,254, 38,  2, 38,  6, 38, 10, 38, 14, 38, 18,
+     38, 22, 48,128, 39,159, 49,128, 39,160, 50,128, 39,161, 51,128,
+     39,162, 52,128, 39,164, 53,128, 39,165, 54,128, 39,166, 55,128,
+     39,167, 56,128, 39,168, 57,128, 39,169, 56,138, 39, 18, 38, 50,
+     38, 54, 38, 58, 38, 62, 38, 66, 38, 70, 38, 74, 38, 78, 38, 82,
+     38, 86, 48,128, 39,171, 49,128, 39,173, 50,128, 39,175, 51,128,
+     39,178, 52,128, 39,179, 53,128, 39,181, 54,128, 39,184, 55,128,
+     39,186, 56,128, 39,187, 57,128, 39,188, 57,138, 39, 19, 38,114,
+     38,118, 38,122, 38,126, 38,130, 38,134, 38,138, 38,142, 38,146,
+     38,150, 48,128, 39,189, 49,128, 39,190, 50,128, 39,154, 51,128,
+     39,170, 52,128, 39,182, 53,128, 39,185, 54,128, 39,152, 55,128,
+     39,180, 56,128, 39,183, 57,128, 39,172, 50,138, 39,  2, 38,178,
+     38,224, 38,228, 38,232, 38,236, 38,240, 38,244, 38,248, 38,252,
+     39,  0, 48,135, 39, 20, 38,196, 38,200, 38,204, 38,208, 38,212,
+     38,216, 38,220, 48,128, 39,174, 49,128, 39,177, 50,128, 39,  3,
+     51,128, 39, 80, 52,128, 39, 82, 53,128, 39,110, 54,128, 39,112,
+     49,128, 39, 21, 50,128, 39, 22, 51,128, 39, 23, 52,128, 39, 24,
+     53,128, 39, 25, 54,128, 39, 26, 55,128, 39, 27, 56,128, 39, 28,
+     57,128, 39, 34, 51,138, 39,  4, 39, 28, 39, 32, 39, 36, 39, 40,
+     39, 44, 39, 48, 39, 52, 39, 56, 39, 60, 39, 64, 48,128, 39, 35,
+     49,128, 39, 36, 50,128, 39, 37, 51,128, 39, 38, 52,128, 39, 39,
+     53,128, 38,  5, 54,128, 39, 41, 55,128, 39, 42, 56,128, 39, 43,
+     57,128, 39, 44, 52,138, 38, 14, 39, 92, 39, 96, 39,100, 39,104,
+     39,108, 39,112, 39,116, 39,120, 39,124, 39,128, 48,128, 39, 45,
+     49,128, 39, 46, 50,128, 39, 47, 51,128, 39, 48, 52,128, 39, 49,
+     53,128, 39, 50, 54,128, 39, 51, 55,128, 39, 52, 56,128, 39, 53,
+     57,128, 39, 54, 53,138, 39,  6, 39,156, 39,160, 39,164, 39,168,
+     39,172, 39,176, 39,180, 39,184, 39,188, 39,192, 48,128, 39, 55,
+     49,128, 39, 56, 50,128, 39, 57, 51,128, 39, 58, 52,128, 39, 59,
+     53,128, 39, 60, 54,128, 39, 61, 55,128, 39, 62, 56,128, 39, 63,
+     57,128, 39, 64, 54,138, 39, 29, 39,220, 39,224, 39,228, 39,232,
+     39,236, 39,240, 39,244, 39,248, 39,252, 40,  0, 48,128, 39, 65,
+     49,128, 39, 66, 50,128, 39, 67, 51,128, 39, 68, 52,128, 39, 69,
+     53,128, 39, 70, 54,128, 39, 71, 55,128, 39, 72, 56,128, 39, 73,
+     57,128, 39, 74, 55,138, 39, 30, 40, 28, 40, 32, 40, 36, 40, 40,
+     40, 44, 40, 48, 40, 52, 40, 56, 40, 60, 40, 64, 48,128, 39, 75,
+     49,128, 37,207, 50,128, 39, 77, 51,128, 37,160, 52,128, 39, 79,
+     53,128, 39, 81, 54,128, 37,178, 55,128, 37,188, 56,128, 37,198,
+     57,128, 39, 86, 56,137, 39, 31, 40, 90, 40, 94, 40, 98, 40,102,
+     40,106, 40,110, 40,114, 40,118, 40,122, 49,128, 37,215, 50,128,
+     39, 88, 51,128, 39, 89, 52,128, 39, 90, 53,128, 39,111, 54,128,
+     39,113, 55,128, 39,114, 56,128, 39,115, 57,128, 39,104, 57,138,
+     39, 32, 40,150, 40,154, 40,158, 40,162, 40,166, 40,170, 40,174,
+     40,178, 40,182, 40,186, 48,128, 39,105, 49,128, 39,108, 50,128,
+     39,109, 51,128, 39,106, 52,128, 39,107, 53,128, 39,116, 54,128,
+     39,117, 55,128, 39, 91, 56,128, 39, 92, 57,128, 39, 93, 97,  7,
+     40,206, 40,216, 40,223, 40,230, 40,255, 41, 15, 41, 26,226,229,
+    238,231,225,236,105,128,  9,134,227,245,244,101,128,  0,225,228,
+    229,246, 97,128,  9,  6,231,117,  2, 40,237, 40,246,234,225,242,
+    225,244,105,128, 10,134,242,237,245,235,232,105,128, 10,  6,237,
+    225,244,242,225,231,245,242,237,245,235,232,105,128, 10, 62,242,
+    245,243,241,245,225,242,101,128, 51,  3,246,239,247,229,236,243,
+    233,231,110,  3, 41, 42, 41, 52, 41, 59,226,229,238,231,225,236,
+    105,128,  9,190,228,229,246, 97,128,  9, 62,231,245,234,225,242,
+    225,244,105,128, 10,190, 98,  4, 41, 80, 41,121, 41,130, 41,140,
+    226,242,229,246,233,225,244,233,239,110,  2, 41, 95, 41,110,237,
+    225,242,235,225,242,237,229,238,233,225,110,128,  5, 95,243,233,
+    231,238,228,229,246, 97,128,  9,112,229,238,231,225,236,105,128,
+      9,133,239,240,239,237,239,230,111,128, 49, 26,242,229,246,101,
+    134,  1,  3, 41,159, 41,167, 41,178, 41,189, 41,197, 41,209,225,
+    227,245,244,101,128, 30,175,227,249,242,233,236,236,233, 99,128,
+      4,209,228,239,244,226,229,236,239,119,128, 30,183,231,242,225,
+    246,101,128, 30,177,232,239,239,235,225,226,239,246,101,128, 30,
+    179,244,233,236,228,101,128, 30,181, 99,  4, 41,227, 41,234, 42,
+     57, 42,127,225,242,239,110,128,  1,206,233,242, 99,  2, 41,242,
+     41,247,236,101,128, 36,208,245,237,230,236,229,120,133,  0,226,
+     42, 10, 42, 18, 42, 29, 42, 37, 42, 49,225,227,245,244,101,128,
+     30,165,228,239,244,226,229,236,239,119,128, 30,173,231,242,225,
+    246,101,128, 30,167,232,239,239,235,225,226,239,246,101,128, 30,
+    169,244,233,236,228,101,128, 30,171,245,244,101,133,  0,180, 42,
+     73, 42, 84, 42,101, 42,108, 42,117,226,229,236,239,247,227,237,
+     98,128,  3, 23, 99,  2, 42, 90, 42, 95,237, 98,128,  3,  1,239,
+    237, 98,128,  3,  1,228,229,246, 97,128,  9, 84,236,239,247,237,
+    239,100,128,  2,207,244,239,238,229,227,237, 98,128,  3, 65,249,
+    242,233,236,236,233, 99,128,  4, 48,100,  5, 42,149, 42,159, 42,
+    173, 42,179, 42,213,226,236,231,242,225,246,101,128,  2,  1,228,
+    225,235,231,245,242,237,245,235,232,105,128, 10,113,229,246, 97,
+    128,  9,  5,233,229,242,229,243,233,115,130,  0,228, 42,193, 42,
+    204,227,249,242,233,236,236,233, 99,128,  4,211,237,225,227,242,
+    239,110,128,  1,223,239,116,  2, 42,220, 42,228,226,229,236,239,
+    119,128, 30,161,237,225,227,242,239,110,128,  1,225,101,131,  0,
+    230, 42,247, 42,255, 43,  8,225,227,245,244,101,128,  1,253,235,
+    239,242,229,225,110,128, 49, 80,237,225,227,242,239,110,128,  1,
+    227,230,233,105,  6, 43, 33, 43, 53, 45,246, 45,252, 46, 11, 49,
+    111, 48,  2, 43, 39, 43, 46,176,178,176, 56,128, 32, 21,184,185,
+    180, 49,128, 32,164,177, 48,  3, 43, 62, 45, 86, 45,221, 48,  9,
+     43, 82, 43,102, 43,164, 43,226, 44, 32, 44, 94, 44,156, 44,218,
+     45, 24, 49,  3, 43, 90, 43, 94, 43, 98, 55,128,  4, 16, 56,128,
+      4, 17, 57,128,  4, 18, 50, 10, 43,124, 43,128, 43,132, 43,136,
+     43,140, 43,144, 43,148, 43,152, 43,156, 43,160, 48,128,  4, 19,
+     49,128,  4, 20, 50,128,  4, 21, 51,128,  4,  1, 52,128,  4, 22,
+     53,128,  4, 23, 54,128,  4, 24, 55,128,  4, 25, 56,128,  4, 26,
+     57,128,  4, 27, 51, 10, 43,186, 43,190, 43,194, 43,198, 43,202,
+     43,206, 43,210, 43,214, 43,218, 43,222, 48,128,  4, 28, 49,128,
+      4, 29, 50,128,  4, 30, 51,128,  4, 31, 52,128,  4, 32, 53,128,
+      4, 33, 54,128,  4, 34, 55,128,  4, 35, 56,128,  4, 36, 57,128,
+      4, 37, 52, 10, 43,248, 43,252, 44,  0, 44,  4, 44,  8, 44, 12,
+     44, 16, 44, 20, 44, 24, 44, 28, 48,128,  4, 38, 49,128,  4, 39,
+     50,128,  4, 40, 51,128,  4, 41, 52,128,  4, 42, 53,128,  4, 43,
+     54,128,  4, 44, 55,128,  4, 45, 56,128,  4, 46, 57,128,  4, 47,
+     53, 10, 44, 54, 44, 58, 44, 62, 44, 66, 44, 70, 44, 74, 44, 78,
+     44, 82, 44, 86, 44, 90, 48,128,  4,144, 49,128,  4,  2, 50,128,
+      4,  3, 51,128,  4,  4, 52,128,  4,  5, 53,128,  4,  6, 54,128,
+      4,  7, 55,128,  4,  8, 56,128,  4,  9, 57,128,  4, 10, 54, 10,
+     44,116, 44,120, 44,124, 44,128, 44,132, 44,136, 44,140, 44,144,
+     44,148, 44,152, 48,128,  4, 11, 49,128,  4, 12, 50,128,  4, 14,
+     51,128,246,196, 52,128,246,197, 53,128,  4, 48, 54,128,  4, 49,
+     55,128,  4, 50, 56,128,  4, 51, 57,128,  4, 52, 55, 10, 44,178,
+     44,182, 44,186, 44,190, 44,194, 44,198, 44,202, 44,206, 44,210,
+     44,214, 48,128,  4, 53, 49,128,  4, 81, 50,128,  4, 54, 51,128,
+      4, 55, 52,128,  4, 56, 53,128,  4, 57, 54,128,  4, 58, 55,128,
+      4, 59, 56,128,  4, 60, 57,128,  4, 61, 56, 10, 44,240, 44,244,
+     44,248, 44,252, 45,  0, 45,  4, 45,  8, 45, 12, 45, 16, 45, 20,
+     48,128,  4, 62, 49,128,  4, 63, 50,128,  4, 64, 51,128,  4, 65,
+     52,128,  4, 66, 53,128,  4, 67, 54,128,  4, 68, 55,128,  4, 69,
+     56,128,  4, 70, 57,128,  4, 71, 57, 10, 45, 46, 45, 50, 45, 54,
+     45, 58, 45, 62, 45, 66, 45, 70, 45, 74, 45, 78, 45, 82, 48,128,
+      4, 72, 49,128,  4, 73, 50,128,  4, 74, 51,128,  4, 75, 52,128,
+      4, 76, 53,128,  4, 77, 54,128,  4, 78, 55,128,  4, 79, 56,128,
+      4,145, 57,128,  4, 82, 49,  4, 45, 96, 45,158, 45,163, 45,189,
+     48, 10, 45,118, 45,122, 45,126, 45,130, 45,134, 45,138, 45,142,
+     45,146, 45,150, 45,154, 48,128,  4, 83, 49,128,  4, 84, 50,128,
+      4, 85, 51,128,  4, 86, 52,128,  4, 87, 53,128,  4, 88, 54,128,
+      4, 89, 55,128,  4, 90, 56,128,  4, 91, 57,128,  4, 92,177, 48,
+    128,  4, 94, 52,  4, 45,173, 45,177, 45,181, 45,185, 53,128,  4,
+     15, 54,128,  4, 98, 55,128,  4,114, 56,128,  4,116, 57,  5, 45,
+    201, 45,205, 45,209, 45,213, 45,217, 50,128,246,198, 51,128,  4,
+     95, 52,128,  4, 99, 53,128,  4,115, 54,128,  4,117, 56,  2, 45,
+    227, 45,241, 51,  2, 45,233, 45,237, 49,128,246,199, 50,128,246,
+    200,180, 54,128,  4,217,178,185, 57,128, 32, 14,179, 48,  2, 46,
+      3, 46,  7, 48,128, 32, 15, 49,128, 32, 13,181, 55,  7, 46, 28,
+     46, 98, 47,163, 47,240, 48,197, 49, 34, 49,105, 51,  2, 46, 34,
+     46, 48, 56,  2, 46, 40, 46, 44, 49,128,  6,106, 56,128,  6, 12,
+     57,  8, 46, 66, 46, 70, 46, 74, 46, 78, 46, 82, 46, 86, 46, 90,
+     46, 94, 50,128,  6, 96, 51,128,  6, 97, 52,128,  6, 98, 53,128,
+      6, 99, 54,128,  6,100, 55,128,  6,101, 56,128,  6,102, 57,128,
+      6,103, 52,  7, 46,114, 46,146, 46,208, 47, 14, 47, 46, 47,102,
+     47,158, 48,  5, 46,126, 46,130, 46,134, 46,138, 46,142, 48,128,
+      6,104, 49,128,  6,105, 51,128,  6, 27, 55,128,  6, 31, 57,128,
+      6, 33, 49, 10, 46,168, 46,172, 46,176, 46,180, 46,184, 46,188,
+     46,192, 46,196, 46,200, 46,204, 48,128,  6, 34, 49,128,  6, 35,
+     50,128,  6, 36, 51,128,  6, 37, 52,128,  6, 38, 53,128,  6, 39,
+     54,128,  6, 40, 55,128,  6, 41, 56,128,  6, 42, 57,128,  6, 43,
+     50, 10, 46,230, 46,234, 46,238, 46,242, 46,246, 46,250, 46,254,
+     47,  2, 47,  6, 47, 10, 48,128,  6, 44, 49,128,  6, 45, 50,128,
+      6, 46, 51,128,  6, 47, 52,128,  6, 48, 53,128,  6, 49, 54,128,
+      6, 50, 55,128,  6, 51, 56,128,  6, 52, 57,128,  6, 53, 51,  5,
+     47, 26, 47, 30, 47, 34, 47, 38, 47, 42, 48,128,  6, 54, 49,128,
+      6, 55, 50,128,  6, 56, 51,128,  6, 57, 52,128,  6, 58, 52,  9,
+     47, 66, 47, 70, 47, 74, 47, 78, 47, 82, 47, 86, 47, 90, 47, 94,
+     47, 98, 48,128,  6, 64, 49,128,  6, 65, 50,128,  6, 66, 51,128,
+      6, 67, 52,128,  6, 68, 53,128,  6, 69, 54,128,  6, 70, 56,128,
+      6, 72, 57,128,  6, 73, 53,  9, 47,122, 47,126, 47,130, 47,134,
+     47,138, 47,142, 47,146, 47,150, 47,154, 48,128,  6, 74, 49,128,
+      6, 75, 50,128,  6, 76, 51,128,  6, 77, 52,128,  6, 78, 53,128,
+      6, 79, 54,128,  6, 80, 55,128,  6, 81, 56,128,  6, 82,183, 48,
+    128,  6, 71, 53,  3, 47,171, 47,203, 47,235, 48,  5, 47,183, 47,
+    187, 47,191, 47,195, 47,199, 53,128,  6,164, 54,128,  6,126, 55,
+    128,  6,134, 56,128,  6,152, 57,128,  6,175, 49,  5, 47,215, 47,
+    219, 47,223, 47,227, 47,231, 49,128,  6,121, 50,128,  6,136, 51,
+    128,  6,145, 52,128,  6,186, 57,128,  6,210,179, 52,128,  6,213,
+     54,  7, 48,  0, 48,  5, 48, 10, 48, 15, 48, 53, 48,115, 48,177,
+    179, 54,128, 32,170,180, 53,128,  5,190,181, 56,128,  5,195, 54,
+      6, 48, 29, 48, 33, 48, 37, 48, 41, 48, 45, 48, 49, 52,128,  5,
+    208, 53,128,  5,209, 54,128,  5,210, 55,128,  5,211, 56,128,  5,
+    212, 57,128,  5,213, 55, 10, 48, 75, 48, 79, 48, 83, 48, 87, 48,
+     91, 48, 95, 48, 99, 48,103, 48,107, 48,111, 48,128,  5,214, 49,
+    128,  5,215, 50,128,  5,216, 51,128,  5,217, 52,128,  5,218, 53,
+    128,  5,219, 54,128,  5,220, 55,128,  5,221, 56,128,  5,222, 57,
+    128,  5,223, 56, 10, 48,137, 48,141, 48,145, 48,149, 48,153, 48,
+    157, 48,161, 48,165, 48,169, 48,173, 48,128,  5,224, 49,128,  5,
+    225, 50,128,  5,226, 51,128,  5,227, 52,128,  5,228, 53,128,  5,
+    229, 54,128,  5,230, 55,128,  5,231, 56,128,  5,232, 57,128,  5,
+    233, 57,  3, 48,185, 48,189, 48,193, 48,128,  5,234, 52,128,251,
+     42, 53,128,251, 43, 55,  4, 48,207, 48,221, 48,241, 48,246, 48,
+      2, 48,213, 48,217, 48,128,251, 75, 53,128,251, 31, 49,  3, 48,
+    229, 48,233, 48,237, 54,128,  5,240, 55,128,  5,241, 56,128,  5,
+    242,178, 51,128,251, 53, 57,  7, 49,  6, 49, 10, 49, 14, 49, 18,
+     49, 22, 49, 26, 49, 30, 51,128,  5,180, 52,128,  5,181, 53,128,
+      5,182, 54,128,  5,187, 55,128,  5,184, 56,128,  5,183, 57,128,
+      5,176, 56,  3, 49, 42, 49, 86, 49, 91, 48,  7, 49, 58, 49, 62,
+     49, 66, 49, 70, 49, 74, 49, 78, 49, 82, 48,128,  5,178, 49,128,
+      5,177, 50,128,  5,179, 51,128,  5,194, 52,128,  5,193, 54,128,
+      5,185, 55,128,  5,188,179, 57,128,  5,189, 52,  2, 49, 97, 49,
+    101, 49,128,  5,191, 50,128,  5,192,185,178, 57,128,  2,188, 54,
+      3, 49,119, 49,178, 49,185, 49,  4, 49,129, 49,145, 49,151, 49,
+    172, 50,  2, 49,135, 49,140,180, 56,128, 33,  5,184, 57,128, 33,
+     19,179,181, 50,128, 33, 22,181, 55,  3, 49,160, 49,164, 49,168,
+     51,128, 32, 44, 52,128, 32, 45, 53,128, 32, 46,182,182, 52,128,
+     32, 12,179,177,182, 55,128,  6,109,180,185,179, 55,128,  2,189,
+    103,  2, 49,198, 49,205,242,225,246,101,128,  0,224,117,  2, 49,
+    211, 49,220,234,225,242,225,244,105,128, 10,133,242,237,245,235,
+    232,105,128, 10,  5,104,  2, 49,235, 49,245,233,242,225,231,225,
+    238, 97,128, 48, 66,239,239,235,225,226,239,246,101,128, 30,163,
+    105,  7, 50, 16, 50, 41, 50, 48, 50, 60, 50, 85, 50,101, 50,181,
+     98,  2, 50, 22, 50, 31,229,238,231,225,236,105,128,  9,144,239,
+    240,239,237,239,230,111,128, 49, 30,228,229,246, 97,128,  9, 16,
+    229,227,249,242,233,236,236,233, 99,128,  4,213,231,117,  2, 50,
+     67, 50, 76,234,225,242,225,244,105,128, 10,144,242,237,245,235,
+    232,105,128, 10, 16,237,225,244,242,225,231,245,242,237,245,235,
+    232,105,128, 10, 72,110,  5, 50,113, 50,122, 50,136, 50,152, 50,
+    167,225,242,225,226,233, 99,128,  6, 57,230,233,238,225,236,225,
+    242,225,226,233, 99,128,254,202,233,238,233,244,233,225,236,225,
+    242,225,226,233, 99,128,254,203,237,229,228,233,225,236,225,242,
+    225,226,233, 99,128,254,204,246,229,242,244,229,228,226,242,229,
+    246,101,128,  2,  3,246,239,247,229,236,243,233,231,110,  3, 50,
+    197, 50,207, 50,214,226,229,238,231,225,236,105,128,  9,200,228,
+    229,246, 97,128,  9, 72,231,245,234,225,242,225,244,105,128, 10,
+    200,107,  2, 50,231, 50,255,225,244,225,235,225,238, 97,129, 48,
+    162, 50,243,232,225,236,230,247,233,228,244,104,128,255,113,239,
+    242,229,225,110,128, 49, 79,108,  3, 51, 15, 52, 71, 52, 80,101,
+      2, 51, 21, 52, 66,102,136,  5,208, 51, 41, 51, 50, 51, 65, 51,
+     79, 51,168, 51,182, 52, 37, 52, 51,225,242,225,226,233, 99,128,
+      6, 39,228,225,231,229,243,232,232,229,226,242,229,119,128,251,
+     48,230,233,238,225,236,225,242,225,226,233, 99,128,254,142,104,
+      2, 51, 85, 51,160,225,237,250, 97,  2, 51, 94, 51,127,225,226,
+    239,246,101,  2, 51,104, 51,113,225,242,225,226,233, 99,128,  6,
+     35,230,233,238,225,236,225,242,225,226,233, 99,128,254,132,226,
+    229,236,239,119,  2, 51,137, 51,146,225,242,225,226,233, 99,128,
+      6, 37,230,233,238,225,236,225,242,225,226,233, 99,128,254,136,
+    229,226,242,229,119,128,  5,208,236,225,237,229,228,232,229,226,
+    242,229,119,128,251, 79,237, 97,  2, 51,189, 51,225,228,228,225,
+    225,226,239,246,101,  2, 51,202, 51,211,225,242,225,226,233, 99,
+    128,  6, 34,230,233,238,225,236,225,242,225,226,233, 99,128,254,
+    130,235,243,245,242, 97,  4, 51,239, 51,248, 52,  6, 52, 22,225,
+    242,225,226,233, 99,128,  6, 73,230,233,238,225,236,225,242,225,
+    226,233, 99,128,254,240,233,238,233,244,233,225,236,225,242,225,
+    226,233, 99,128,254,243,237,229,228,233,225,236,225,242,225,226,
+    233, 99,128,254,244,240,225,244,225,232,232,229,226,242,229,119,
+    128,251, 46,241,225,237,225,244,243,232,229,226,242,229,119,128,
+    251, 47,240,104,128, 33, 53,236,229,241,245,225,108,128, 34, 76,
+    240,232, 97,129,  3,177, 52, 88,244,239,238,239,115,128,  3,172,
+    109,  4, 52,106, 52,114, 52,125, 52,159,225,227,242,239,110,128,
+      1,  1,239,238,239,243,240,225,227,101,128,255, 65,240,229,242,
+    243,225,238,100,130,  0, 38, 52,139, 52,151,237,239,238,239,243,
+    240,225,227,101,128,255,  6,243,237,225,236,108,128,247, 38,243,
+    241,245,225,242,101,128, 51,194,110,  4, 52,178, 52,189, 53, 55,
+     53, 65,226,239,240,239,237,239,230,111,128, 49, 34,103,  4, 52,
+    199, 52,210, 52,224, 53, 47,226,239,240,239,237,239,230,111,128,
+     49, 36,235,232,225,238,235,232,245,244,232,225,105,128, 14, 90,
+    236,101,131, 34, 32, 52,235, 53, 32, 53, 39,226,242,225,227,235,
+    229,116,  2, 52,247, 53, 11,236,229,230,116,129, 48,  8, 53,  0,
+    246,229,242,244,233,227,225,108,128,254, 63,242,233,231,232,116,
+    129, 48,  9, 53, 21,246,229,242,244,233,227,225,108,128,254, 64,
+    236,229,230,116,128, 35, 41,242,233,231,232,116,128, 35, 42,243,
+    244,242,239,109,128, 33, 43,239,244,229,236,229,233, 97,128,  3,
+    135,117,  2, 53, 71, 53, 83,228,225,244,244,225,228,229,246, 97,
+    128,  9, 82,243,246,225,242, 97,  3, 53, 95, 53,105, 53,112,226,
+    229,238,231,225,236,105,128,  9,130,228,229,246, 97,128,  9,  2,
+    231,245,234,225,242,225,244,105,128, 10,130,239,231,239,238,229,
+    107,128,  1,  5,112,  3, 53,140, 53,164, 53,194, 97,  2, 53,146,
+     53,158,225,244,239,243,241,245,225,242,101,128, 51,  0,242,229,
+    110,128, 36,156,239,243,244,242,239,240,232,101,  2, 53,177, 53,
+    188,225,242,237,229,238,233,225,110,128,  5, 90,237,239,100,128,
+      2,188,112,  2, 53,200, 53,205,236,101,128,248,255,242,111,  2,
+     53,212, 53,220,225,227,232,229,115,128, 34, 80,120,  2, 53,226,
+     53,246,229,241,245,225,108,129, 34, 72, 53,236,239,242,233,237,
+    225,231,101,128, 34, 82,233,237,225,244,229,236,249,229,241,245,
+    225,108,128, 34, 69,114,  4, 54, 15, 54, 42, 54, 46, 54, 91,225,
+    229, 97,  2, 54, 23, 54, 33,229,235,239,242,229,225,110,128, 49,
+    142,235,239,242,229,225,110,128, 49,141, 99,128, 35, 18,105,  2,
+     54, 52, 54, 66,231,232,244,232,225,236,230,242,233,238,103,128,
+     30,154,238,103,130,  0,229, 54, 75, 54, 83,225,227,245,244,101,
+    128,  1,251,226,229,236,239,119,128, 30,  1,242,239,119,  8, 54,
+    111, 54,118, 54,247, 55, 57, 55,107, 55,162, 55,185, 56,  4,226,
+    239,244,104,128, 33,148,100,  3, 54,126, 54,165, 54,212,225,243,
+    104,  4, 54,138, 54,145, 54,152, 54,160,228,239,247,110,128, 33,
+    227,236,229,230,116,128, 33,224,242,233,231,232,116,128, 33,226,
+    245,112,128, 33,225,226,108,  5, 54,178, 54,185, 54,192, 54,199,
+     54,207,226,239,244,104,128, 33,212,228,239,247,110,128, 33,211,
+    236,229,230,116,128, 33,208,242,233,231,232,116,128, 33,210,245,
+    112,128, 33,209,239,247,110,131, 33,147, 54,224, 54,231, 54,239,
+    236,229,230,116,128, 33,153,242,233,231,232,116,128, 33,152,247,
+    232,233,244,101,128, 33,233,104,  2, 54,253, 55, 48,229,225,100,
+      4, 55,  9, 55, 19, 55, 29, 55, 40,228,239,247,238,237,239,100,
+    128,  2,197,236,229,230,244,237,239,100,128,  2,194,242,233,231,
+    232,244,237,239,100,128,  2,195,245,240,237,239,100,128,  2,196,
+    239,242,233,250,229,120,128,248,231,236,229,230,116,131, 33,144,
+     55, 70, 55, 87, 55, 99,228,226,108,129, 33,208, 55, 78,243,244,
+    242,239,235,101,128, 33,205,239,246,229,242,242,233,231,232,116,
+    128, 33,198,247,232,233,244,101,128, 33,230,242,233,231,232,116,
+    132, 33,146, 55,123, 55,135, 55,143, 55,154,228,226,236,243,244,
+    242,239,235,101,128, 33,207,232,229,225,246,121,128, 39,158,239,
+    246,229,242,236,229,230,116,128, 33,196,247,232,233,244,101,128,
+     33,232,244,225, 98,  2, 55,170, 55,177,236,229,230,116,128, 33,
+    228,242,233,231,232,116,128, 33,229,245,112,132, 33,145, 55,198,
+     55,226, 55,244, 55,252,100,  2, 55,204, 55,216,110,129, 33,149,
+     55,210,226,243,101,128, 33,168,239,247,238,226,225,243,101,128,
+     33,168,236,229,230,116,129, 33,150, 55,235,239,230,228,239,247,
+    110,128, 33,197,242,233,231,232,116,128, 33,151,247,232,233,244,
+    101,128, 33,231,246,229,242,244,229,120,128,248,230,115,  5, 56,
+     25, 56,101, 56,146, 56,229, 56,239, 99,  2, 56, 31, 56, 83,233,
+    105,  2, 56, 38, 56, 61,227,233,242,227,245,109,129,  0, 94, 56,
+     49,237,239,238,239,243,240,225,227,101,128,255, 62,244,233,236,
+    228,101,129,  0,126, 56, 71,237,239,238,239,243,240,225,227,101,
+    128,255, 94,242,233,240,116,129,  2, 81, 56, 92,244,245,242,238,
+    229,100,128,  2, 82,237,225,236,108,  2, 56,110, 56,121,232,233,
+    242,225,231,225,238, 97,128, 48, 65,235,225,244,225,235,225,238,
+     97,129, 48,161, 56,134,232,225,236,230,247,233,228,244,104,128,
+    255,103,244,229,242,233,115,  2, 56,156, 56,225,107,131,  0, 42,
+     56,166, 56,194, 56,217, 97,  2, 56,172, 56,186,236,244,239,238,
+    229,225,242,225,226,233, 99,128,  6,109,242,225,226,233, 99,128,
+      6,109,109,  2, 56,200, 56,206,225,244,104,128, 34, 23,239,238,
+    239,243,240,225,227,101,128,255, 10,243,237,225,236,108,128,254,
+     97,109,128, 32, 66,245,240,229,242,233,239,114,128,246,233,249,
+    237,240,244,239,244,233,227,225,236,236,249,229,241,245,225,108,
+    128, 34, 67,116,132,  0, 64, 57, 15, 57, 22, 57, 34, 57, 42,233,
+    236,228,101,128,  0,227,237,239,238,239,243,240,225,227,101,128,
+    255, 32,243,237,225,236,108,128,254,107,245,242,238,229,100,128,
+      2, 80,117,  6, 57, 64, 57, 89, 57, 96, 57,121, 57,141, 57,157,
+     98,  2, 57, 70, 57, 79,229,238,231,225,236,105,128,  9,148,239,
+    240,239,237,239,230,111,128, 49, 32,228,229,246, 97,128,  9, 20,
+    231,117,  2, 57,103, 57,112,234,225,242,225,244,105,128, 10,148,
+    242,237,245,235,232,105,128, 10, 20,236,229,238,231,244,232,237,
+    225,242,235,226,229,238,231,225,236,105,128,  9,215,237,225,244,
+    242,225,231,245,242,237,245,235,232,105,128, 10, 76,246,239,247,
+    229,236,243,233,231,110,  3, 57,173, 57,183, 57,190,226,229,238,
+    231,225,236,105,128,  9,204,228,229,246, 97,128,  9, 76,231,245,
+    234,225,242,225,244,105,128, 10,204,246,225,231,242,225,232,225,
+    228,229,246, 97,128,  9, 61,121,  2, 57,221, 57,233,226,225,242,
+    237,229,238,233,225,110,128,  5, 97,233,110,130,  5,226, 57,242,
+     58,  1,225,236,244,239,238,229,232,229,226,242,229,119,128,251,
+     32,232,229,226,242,229,119,128,  5,226, 98,144,  0, 98, 58, 46,
+     58,181, 58,192, 58,201, 58,226, 60, 11, 60, 73, 60,146, 62, 72,
+     62, 84, 62,127, 62,135, 62,145, 64, 15, 64, 39, 64, 48, 97,  7,
+     58, 62, 58, 72, 58, 96, 58,103, 58,128, 58,152, 58,163,226,229,
+    238,231,225,236,105,128,  9,172,227,235,243,236,225,243,104,129,
+      0, 92, 58, 84,237,239,238,239,243,240,225,227,101,128,255, 60,
+    228,229,246, 97,128,  9, 44,231,117,  2, 58,110, 58,119,234,225,
+    242,225,244,105,128, 10,172,242,237,245,235,232,105,128, 10, 44,
+    104,  2, 58,134, 58,144,233,242,225,231,225,238, 97,128, 48,112,
+    244,244,232,225,105,128, 14, 63,235,225,244,225,235,225,238, 97,
+    128, 48,208,114,129,  0,124, 58,169,237,239,238,239,243,240,225,
+    227,101,128,255, 92,226,239,240,239,237,239,230,111,128, 49,  5,
+    227,233,242,227,236,101,128, 36,209,228,239,116,  2, 58,209, 58,
+    218,225,227,227,229,238,116,128, 30,  3,226,229,236,239,119,128,
+     30,  5,101,  6, 58,240, 59,  5, 59, 28, 59,170, 59,181, 59,193,
+    225,237,229,228,243,233,248,244,229,229,238,244,232,238,239,244,
+    229,115,128, 38,108, 99,  2, 59, 11, 59, 18,225,245,243,101,128,
+     34, 53,249,242,233,236,236,233, 99,128,  4, 49,104,  5, 59, 40,
+     59, 49, 59, 63, 59, 93, 59,152,225,242,225,226,233, 99,128,  6,
+     40,230,233,238,225,236,225,242,225,226,233, 99,128,254,144,105,
+      2, 59, 69, 59, 84,238,233,244,233,225,236,225,242,225,226,233,
+     99,128,254,145,242,225,231,225,238, 97,128, 48,121,237,101,  2,
+     59,100, 59,113,228,233,225,236,225,242,225,226,233, 99,128,254,
+    146,229,237,105,  2, 59,121, 59,136,238,233,244,233,225,236,225,
+    242,225,226,233, 99,128,252,159,243,239,236,225,244,229,228,225,
+    242,225,226,233, 99,128,252,  8,238,239,239,238,230,233,238,225,
+    236,225,242,225,226,233, 99,128,252,109,235,225,244,225,235,225,
+    238, 97,128, 48,217,238,225,242,237,229,238,233,225,110,128,  5,
+     98,116,132,  5,209, 59,205, 59,225, 59,245, 59,254, 97,129,  3,
+    178, 59,211,243,249,237,226,239,236,231,242,229,229,107,128,  3,
+    208,228,225,231,229,243,104,129,251, 49, 59,236,232,229,226,242,
+    229,119,128,251, 49,232,229,226,242,229,119,128,  5,209,242,225,
+    230,229,232,229,226,242,229,119,128,251, 76,104,  2, 60, 17, 60,
+     67, 97,  3, 60, 25, 60, 35, 60, 42,226,229,238,231,225,236,105,
+    128,  9,173,228,229,246, 97,128,  9, 45,231,117,  2, 60, 49, 60,
+     58,234,225,242,225,244,105,128, 10,173,242,237,245,235,232,105,
+    128, 10, 45,239,239,107,128,  2, 83,105,  5, 60, 85, 60, 96, 60,
+    107, 60,121, 60,135,232,233,242,225,231,225,238, 97,128, 48,115,
+    235,225,244,225,235,225,238, 97,128, 48,211,236,225,226,233,225,
+    236,227,236,233,227,107,128,  2,152,238,228,233,231,245,242,237,
+    245,235,232,105,128, 10,  2,242,245,243,241,245,225,242,101,128,
+     51, 49,108,  3, 60,154, 62, 55, 62, 66, 97,  2, 60,160, 62, 50,
+    227,107,  6, 60,175, 60,184, 60,221, 61,114, 61,169, 61,221,227,
+    233,242,227,236,101,128, 37,207,100,  2, 60,190, 60,199,233,225,
+    237,239,238,100,128, 37,198,239,247,238,240,239,233,238,244,233,
+    238,231,244,242,233,225,238,231,236,101,128, 37,188,108,  2, 60,
+    227, 61, 74,101,  2, 60,233, 61, 13,230,244,240,239,233,238,244,
+    233,238,103,  2, 60,248, 61,  2,240,239,233,238,244,229,114,128,
+     37,196,244,242,233,225,238,231,236,101,128, 37,192,238,244,233,
+    227,245,236,225,242,226,242,225,227,235,229,116,  2, 61, 33, 61,
+     53,236,229,230,116,129, 48, 16, 61, 42,246,229,242,244,233,227,
+    225,108,128,254, 59,242,233,231,232,116,129, 48, 17, 61, 63,246,
+    229,242,244,233,227,225,108,128,254, 60,239,247,229,114,  2, 61,
+     83, 61, 98,236,229,230,244,244,242,233,225,238,231,236,101,128,
+     37,227,242,233,231,232,244,244,242,233,225,238,231,236,101,128,
+     37,226,114,  2, 61,120, 61,131,229,227,244,225,238,231,236,101,
+    128, 37,172,233,231,232,244,240,239,233,238,244,233,238,103,  2,
+     61,148, 61,158,240,239,233,238,244,229,114,128, 37,186,244,242,
+    233,225,238,231,236,101,128, 37,182,115,  3, 61,177, 61,207, 61,
+    215,109,  2, 61,183, 61,195,225,236,236,243,241,245,225,242,101,
+    128, 37,170,233,236,233,238,231,230,225,227,101,128, 38, 59,241,
+    245,225,242,101,128, 37,160,244,225,114,128, 38,  5,245,240,112,
+      2, 61,229, 62, 11,229,114,  2, 61,236, 61,251,236,229,230,244,
+    244,242,233,225,238,231,236,101,128, 37,228,242,233,231,232,244,
+    244,242,233,225,238,231,236,101,128, 37,229,239,233,238,244,233,
+    238,103,  2, 62, 23, 62, 39,243,237,225,236,236,244,242,233,225,
+    238,231,236,101,128, 37,180,244,242,233,225,238,231,236,101,128,
+     37,178,238,107,128, 36, 35,233,238,229,226,229,236,239,119,128,
+     30,  7,239,227,107,128, 37,136,237,239,238,239,243,240,225,227,
+    101,128,255, 66,111,  3, 62, 92, 62,105, 62,116,226,225,233,237,
+    225,233,244,232,225,105,128, 14, 26,232,233,242,225,231,225,238,
+     97,128, 48,124,235,225,244,225,235,225,238, 97,128, 48,220,240,
+    225,242,229,110,128, 36,157,241,243,241,245,225,242,101,128, 51,
+    195,114,  4, 62,155, 63,149, 63,222, 64,  5,225, 99,  2, 62,162,
+     63, 56,101,  3, 62,170, 62,175, 62,243,229,120,128,248,244,236,
+    229,230,116,133,  0,123, 62,192, 62,197, 62,219, 62,227, 62,232,
+    226,116,128,248,243,109,  2, 62,203, 62,208,233,100,128,248,242,
+    239,238,239,243,240,225,227,101,128,255, 91,243,237,225,236,108,
+    128,254, 91,244,112,128,248,241,246,229,242,244,233,227,225,108,
+    128,254, 55,242,233,231,232,116,133,  0,125, 63,  5, 63, 10, 63,
+     32, 63, 40, 63, 45,226,116,128,248,254,109,  2, 63, 16, 63, 21,
+    233,100,128,248,253,239,238,239,243,240,225,227,101,128,255, 93,
+    243,237,225,236,108,128,254, 92,244,112,128,248,252,246,229,242,
+    244,233,227,225,108,128,254, 56,235,229,116,  2, 63, 64, 63,106,
+    236,229,230,116,132,  0, 91, 63, 79, 63, 84, 63, 89, 63,101,226,
+    116,128,248,240,229,120,128,248,239,237,239,238,239,243,240,225,
+    227,101,128,255, 59,244,112,128,248,238,242,233,231,232,116,132,
+      0, 93, 63,122, 63,127, 63,132, 63,144,226,116,128,248,251,229,
+    120,128,248,250,237,239,238,239,243,240,225,227,101,128,255, 61,
+    244,112,128,248,249,229,246,101,131,  2,216, 63,161, 63,172, 63,
+    178,226,229,236,239,247,227,237, 98,128,  3, 46,227,237, 98,128,
+      3,  6,233,238,246,229,242,244,229,100,  3, 63,193, 63,204, 63,
+    210,226,229,236,239,247,227,237, 98,128,  3, 47,227,237, 98,128,
+      3, 17,228,239,245,226,236,229,227,237, 98,128,  3, 97,233,228,
+    231,101,  2, 63,231, 63,242,226,229,236,239,247,227,237, 98,128,
+      3, 42,233,238,246,229,242,244,229,228,226,229,236,239,247,227,
+    237, 98,128,  3, 58,239,235,229,238,226,225,114,128,  0,166,115,
+      2, 64, 21, 64, 29,244,242,239,235,101,128,  1,128,245,240,229,
+    242,233,239,114,128,246,234,244,239,240,226,225,114,128,  1,131,
+    117,  3, 64, 56, 64, 67, 64, 78,232,233,242,225,231,225,238, 97,
+    128, 48,118,235,225,244,225,235,225,238, 97,128, 48,214,236,108,
+      2, 64, 85, 64,115,229,116,130, 32, 34, 64, 94, 64,104,233,238,
+    246,229,242,243,101,128, 37,216,239,240,229,242,225,244,239,114,
+    128, 34, 25,243,229,249,101,128, 37,206, 99,143,  0, 99, 64,156,
+     65,105, 65,116, 65,180, 65,211, 66, 48, 67,215, 68,199, 69, 43,
+     69, 92, 72, 84, 72, 92, 72,102, 72,114, 72,147, 97,  9, 64,176,
+     64,187, 64,197, 64,204, 64,211, 64,236, 64,246, 65, 42, 65, 51,
+    225,242,237,229,238,233,225,110,128,  5,110,226,229,238,231,225,
+    236,105,128,  9,154,227,245,244,101,128,  1,  7,228,229,246, 97,
+    128,  9, 26,231,117,  2, 64,218, 64,227,234,225,242,225,244,105,
+    128, 10,154,242,237,245,235,232,105,128, 10, 26,236,243,241,245,
+    225,242,101,128, 51,136,238,228,242,225,226,233,238,228,117,  4,
+     65,  8, 65, 18, 65, 24, 65, 31,226,229,238,231,225,236,105,128,
+      9,129,227,237, 98,128,  3, 16,228,229,246, 97,128,  9,  1,231,
+    245,234,225,242,225,244,105,128, 10,129,240,243,236,239,227,107,
+    128, 33,234,114,  3, 65, 59, 65, 65, 65, 91,229,239,102,128, 33,
+      5,239,110,130,  2,199, 65, 74, 65, 85,226,229,236,239,247,227,
+    237, 98,128,  3, 44,227,237, 98,128,  3, 12,242,233,225,231,229,
+    242,229,244,245,242,110,128, 33,181,226,239,240,239,237,239,230,
+    111,128, 49, 24, 99,  4, 65,126, 65,133, 65,152, 65,174,225,242,
+    239,110,128,  1, 13,229,228,233,236,236, 97,129,  0,231, 65,144,
+    225,227,245,244,101,128, 30,  9,233,242, 99,  2, 65,160, 65,165,
+    236,101,128, 36,210,245,237,230,236,229,120,128,  1,  9,245,242,
+    108,128,  2, 85,100,  2, 65,186, 65,202,239,116,129,  1, 11, 65,
+    193,225,227,227,229,238,116,128,  1, 11,243,241,245,225,242,101,
+    128, 51,197,101,  2, 65,217, 65,233,228,233,236,236, 97,129,  0,
+    184, 65,227,227,237, 98,128,  3, 39,238,116,132,  0,162, 65,246,
+     66, 14, 66, 26, 66, 37,105,  2, 65,252, 66,  4,231,242,225,228,
+    101,128, 33,  3,238,230,229,242,233,239,114,128,246,223,237,239,
+    238,239,243,240,225,227,101,128,255,224,239,236,228,243,244,249,
+    236,101,128,247,162,243,245,240,229,242,233,239,114,128,246,224,
+    104,  5, 66, 60, 66,123, 66,134, 67, 62, 67,154, 97,  4, 66, 70,
+     66, 81, 66, 91, 66, 98,225,242,237,229,238,233,225,110,128,  5,
+    121,226,229,238,231,225,236,105,128,  9,155,228,229,246, 97,128,
+      9, 27,231,117,  2, 66,105, 66,114,234,225,242,225,244,105,128,
+     10,155,242,237,245,235,232,105,128, 10, 27,226,239,240,239,237,
+    239,230,111,128, 49, 20,101,  6, 66,148, 66,168, 66,192, 67,  4,
+     67, 16, 67, 37,225,226,235,232,225,243,233,225,238,227,249,242,
+    233,236,236,233, 99,128,  4,189, 99,  2, 66,174, 66,182,235,237,
+    225,242,107,128, 39, 19,249,242,233,236,236,233, 99,128,  4, 71,
+    100,  2, 66,198, 66,242,229,243,227,229,238,228,229,114,  2, 66,
+    211, 66,231,225,226,235,232,225,243,233,225,238,227,249,242,233,
+    236,236,233, 99,128,  4,191,227,249,242,233,236,236,233, 99,128,
+      4,183,233,229,242,229,243,233,243,227,249,242,233,236,236,233,
+     99,128,  4,245,232,225,242,237,229,238,233,225,110,128,  5,115,
+    235,232,225,235,225,243,243,233,225,238,227,249,242,233,236,236,
+    233, 99,128,  4,204,246,229,242,244,233,227,225,236,243,244,242,
+    239,235,229,227,249,242,233,236,236,233, 99,128,  4,185,105,129,
+      3,199, 67, 68,229,245,227,104,  4, 67, 81, 67,116, 67,131, 67,
+    140, 97,  2, 67, 87, 67,102,227,233,242,227,236,229,235,239,242,
+    229,225,110,128, 50,119,240,225,242,229,238,235,239,242,229,225,
+    110,128, 50, 23,227,233,242,227,236,229,235,239,242,229,225,110,
+    128, 50,105,235,239,242,229,225,110,128, 49, 74,240,225,242,229,
+    238,235,239,242,229,225,110,128, 50,  9,111,  2, 67,160, 67,210,
+    227,104,  3, 67,169, 67,191, 67,201,225,110,  2, 67,176, 67,184,
+    231,244,232,225,105,128, 14, 10,244,232,225,105,128, 14,  8,233,
+    238,231,244,232,225,105,128, 14,  9,239,229,244,232,225,105,128,
+     14, 12,239,107,128,  1,136,105,  2, 67,221, 68, 67,229,245, 99,
+      5, 67,235, 68, 14, 68, 29, 68, 38, 68, 52, 97,  2, 67,241, 68,
+      0,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,118,
+    240,225,242,229,238,235,239,242,229,225,110,128, 50, 22,227,233,
+    242,227,236,229,235,239,242,229,225,110,128, 50,104,235,239,242,
+    229,225,110,128, 49, 72,240,225,242,229,238,235,239,242,229,225,
+    110,128, 50,  8,245,240,225,242,229,238,235,239,242,229,225,110,
+    128, 50, 28,242, 99,  2, 68, 74, 68,169,236,101,132, 37,203, 68,
+     87, 68, 98, 68,103, 68,127,237,245,236,244,233,240,236,121,128,
+     34,151,239,116,128, 34,153,112,  2, 68,109, 68,115,236,245,115,
+    128, 34,149,239,243,244,225,236,237,225,242,107,128, 48, 54,247,
+    233,244,104,  2, 68,136, 68,152,236,229,230,244,232,225,236,230,
+    226,236,225,227,107,128, 37,208,242,233,231,232,244,232,225,236,
+    230,226,236,225,227,107,128, 37,209,245,237,230,236,229,120,130,
+      2,198, 68,182, 68,193,226,229,236,239,247,227,237, 98,128,  3,
+     45,227,237, 98,128,  3,  2,108,  3, 68,207, 68,213, 69, 11,229,
+    225,114,128, 35, 39,233,227,107,  4, 68,225, 68,236, 68,245, 68,
+    255,225,236,246,229,239,236,225,114,128,  1,194,228,229,238,244,
+    225,108,128,  1,192,236,225,244,229,242,225,108,128,  1,193,242,
+    229,244,242,239,230,236,229,120,128,  1,195,245, 98,129, 38, 99,
+     69, 18,243,245,233,116,  2, 69, 27, 69, 35,226,236,225,227,107,
+    128, 38, 99,247,232,233,244,101,128, 38,103,109,  3, 69, 51, 69,
+     65, 69, 76,227,245,226,229,228,243,241,245,225,242,101,128, 51,
+    164,239,238,239,243,240,225,227,101,128,255, 67,243,241,245,225,
+    242,229,228,243,241,245,225,242,101,128, 51,160,111,  8, 69,110,
+     69,121, 69,208, 70,150, 71,179, 71,210, 72, 61, 72, 70,225,242,
+    237,229,238,233,225,110,128,  5,129,236,239,110,131,  0, 58, 69,
+    133, 69,158, 69,177,237,239,110,  2, 69,141, 69,149,229,244,225,
+    242,121,128, 32,161,239,243,240,225,227,101,128,255, 26,115,  2,
+     69,164, 69,170,233,231,110,128, 32,161,237,225,236,108,128,254,
+     85,244,242,233,225,238,231,245,236,225,114,  2, 69,192, 69,202,
+    232,225,236,230,237,239,100,128,  2,209,237,239,100,128,  2,208,
+    109,  2, 69,214, 70,143,237, 97,134,  0, 44, 69,231, 70, 39, 70,
+     50, 70, 62, 70, 92, 70,115, 97,  3, 69,239, 70,  9, 70, 17,226,
+    239,246,101,  2, 69,248, 69,254,227,237, 98,128,  3, 19,242,233,
+    231,232,244,227,237, 98,128,  3, 21,227,227,229,238,116,128,246,
+    195,114,  2, 70, 23, 70, 30,225,226,233, 99,128,  6, 12,237,229,
+    238,233,225,110,128,  5, 93,233,238,230,229,242,233,239,114,128,
+    246,225,237,239,238,239,243,240,225,227,101,128,255, 12,242,229,
+    246,229,242,243,229,100,  2, 70, 75, 70, 86,225,226,239,246,229,
+    227,237, 98,128,  3, 20,237,239,100,128,  2,189,115,  2, 70, 98,
+     70,105,237,225,236,108,128,254, 80,245,240,229,242,233,239,114,
+    128,246,226,244,245,242,238,229,100,  2, 70,126, 70,137,225,226,
+    239,246,229,227,237, 98,128,  3, 18,237,239,100,128,  2,187,240,
+    225,243,115,128, 38, 60,110,  2, 70,156, 70,165,231,242,245,229,
+    238,116,128, 34, 69,116,  2, 70,171, 70,185,239,245,242,233,238,
+    244,229,231,242,225,108,128, 34, 46,242,239,108,142, 35,  3, 70,
+    219, 70,225, 70,240, 70,255, 71, 43, 71, 88, 71,102, 71,107, 71,
+    112, 71,117, 71,123, 71,128, 71,169, 71,174,193,195, 75,128,  0,
+      6, 66,  2, 70,231, 70,236,197, 76,128,  0,  7, 83,128,  0,  8,
+     67,  2, 70,246, 70,251,193, 78,128,  0, 24, 82,128,  0, 13, 68,
+      3, 71,  7, 71, 33, 71, 38, 67,  4, 71, 17, 71, 21, 71, 25, 71,
+     29, 49,128,  0, 17, 50,128,  0, 18, 51,128,  0, 19, 52,128,  0,
+     20,197, 76,128,  0,127,204, 69,128,  0, 16, 69,  5, 71, 55, 71,
+     59, 71, 64, 71, 69, 71, 74, 77,128,  0, 25,206, 81,128,  0,  5,
+    207, 84,128,  0,  4,211, 67,128,  0, 27, 84,  2, 71, 80, 71, 84,
+     66,128,  0, 23, 88,128,  0,  3, 70,  2, 71, 94, 71, 98, 70,128,
+      0, 12, 83,128,  0, 28,199, 83,128,  0, 29,200, 84,128,  0,  9,
+    204, 70,128,  0, 10,206,193, 75,128,  0, 21,210, 83,128,  0, 30,
+     83,  5, 71,140, 71,144, 71,154, 71,159, 71,164, 73,128,  0, 15,
+     79,129,  0, 14, 71,150, 84,128,  0,  2,212, 88,128,  0,  1,213,
+     66,128,  0, 26,217, 78,128,  0, 22,213, 83,128,  0, 31,214, 84,
+    128,  0, 11,240,249,242,233,231,232,116,129,  0,169, 71,191,115,
+      2, 71,197, 71,203,225,238,115,128,248,233,229,242,233,102,128,
+    246,217,114,  2, 71,216, 72, 44,238,229,242,226,242,225,227,235,
+    229,116,  2, 71,231, 72,  9,236,229,230,116,130, 48, 12, 71,242,
+     71,254,232,225,236,230,247,233,228,244,104,128,255, 98,246,229,
+    242,244,233,227,225,108,128,254, 65,242,233,231,232,116,130, 48,
+     13, 72, 21, 72, 33,232,225,236,230,247,233,228,244,104,128,255,
+     99,246,229,242,244,233,227,225,108,128,254, 66,240,239,242,225,
+    244,233,239,238,243,241,245,225,242,101,128, 51,127,243,241,245,
+    225,242,101,128, 51,199,246,229,242,235,231,243,241,245,225,242,
+    101,128, 51,198,240,225,242,229,110,128, 36,158,242,245,250,229,
+    233,242,111,128, 32,162,243,244,242,229,244,227,232,229,100,128,
+      2,151,245,114,  2, 72,121, 72,139,236,121,  2, 72,128, 72,134,
+    225,238,100,128, 34,207,239,114,128, 34,206,242,229,238,227,121,
+    128,  0,164,249,114,  4, 72,158, 72,166, 72,173, 72,181,194,242,
+    229,246,101,128,246,209,198,236,229,120,128,246,210,226,242,229,
+    246,101,128,246,212,230,236,229,120,128,246,213,100,146,  0,100,
+     72,228, 74,110, 75,134, 75,194, 76,114, 77, 68, 77,130, 78, 59,
+     78, 72, 78, 81, 78,107, 78,132, 78,141, 79,208, 79,216, 79,227,
+     79,247, 80, 19, 97, 11, 72,252, 73,  7, 73, 17, 73, 89, 73,152,
+     73,163, 73,174, 73,243, 74, 49, 74, 55, 74, 85,225,242,237,229,
+    238,233,225,110,128,  5,100,226,229,238,231,225,236,105,128,  9,
+    166,100,  5, 73, 29, 73, 38, 73, 44, 73, 58, 73, 74,225,242,225,
+    226,233, 99,128,  6, 54,229,246, 97,128,  9, 38,230,233,238,225,
+    236,225,242,225,226,233, 99,128,254,190,233,238,233,244,233,225,
+    236,225,242,225,226,233, 99,128,254,191,237,229,228,233,225,236,
+    225,242,225,226,233, 99,128,254,192,103,  3, 73, 97, 73,114, 73,
+    128,229,243,104,129,  5,188, 73,105,232,229,226,242,229,119,128,
+      5,188,231,229,114,129, 32, 32, 73,122,228,226,108,128, 32, 33,
+    117,  2, 73,134, 73,143,234,225,242,225,244,105,128, 10,166,242,
+    237,245,235,232,105,128, 10, 38,232,233,242,225,231,225,238, 97,
+    128, 48, 96,235,225,244,225,235,225,238, 97,128, 48,192,108,  3,
+     73,182, 73,191, 73,229,225,242,225,226,233, 99,128,  6, 47,229,
+    116,130,  5,211, 73,200, 73,220,228,225,231,229,243,104,129,251,
+     51, 73,211,232,229,226,242,229,119,128,251, 51,232,229,226,242,
+    229,119,128,  5,211,230,233,238,225,236,225,242,225,226,233, 99,
+    128,254,170,237,237, 97,  3, 73,253, 74,  6, 74, 18,225,242,225,
+    226,233, 99,128,  6, 79,236,239,247,225,242,225,226,233, 99,128,
+      6, 79,244,225,238, 97,  2, 74, 27, 74, 41,236,244,239,238,229,
+    225,242,225,226,233, 99,128,  6, 76,242,225,226,233, 99,128,  6,
+     76,238,228, 97,128,  9,100,242,231, 97,  2, 74, 63, 74, 72,232,
+    229,226,242,229,119,128,  5,167,236,229,230,244,232,229,226,242,
+    229,119,128,  5,167,243,233,225,240,238,229,245,237,225,244,225,
+    227,249,242,233,236,236,233,227,227,237, 98,128,  4,133, 98,  3,
+     74,118, 75,115, 75,125,108,  9, 74,138, 74,146, 75,  3, 75, 11,
+     75, 27, 75, 38, 75, 56, 75, 70, 75, 81,199,242,225,246,101,128,
+    246,211, 97,  2, 74,152, 74,209,238,231,236,229,226,242,225,227,
+    235,229,116,  2, 74,168, 74,188,236,229,230,116,129, 48, 10, 74,
+    177,246,229,242,244,233,227,225,108,128,254, 61,242,233,231,232,
+    116,129, 48, 11, 74,198,246,229,242,244,233,227,225,108,128,254,
+     62,114,  2, 74,215, 74,236,227,232,233,238,246,229,242,244,229,
+    228,226,229,236,239,247,227,237, 98,128,  3, 43,242,239,119,  2,
+     74,244, 74,251,236,229,230,116,128, 33,212,242,233,231,232,116,
+    128, 33,210,228,225,238,228, 97,128,  9,101,231,242,225,246,101,
+    129,246,214, 75, 21,227,237, 98,128,  3, 15,233,238,244,229,231,
+    242,225,108,128, 34, 44,236,239,247,236,233,238,101,129, 32, 23,
+     75, 50,227,237, 98,128,  3, 51,239,246,229,242,236,233,238,229,
+    227,237, 98,128,  3, 63,240,242,233,237,229,237,239,100,128,  2,
+    186,246,229,242,244,233,227,225,108,  2, 75, 94, 75,100,226,225,
+    114,128, 32, 22,236,233,238,229,225,226,239,246,229,227,237, 98,
+    128,  3, 14,239,240,239,237,239,230,111,128, 49,  9,243,241,245,
+    225,242,101,128, 51,200, 99,  4, 75,144, 75,151, 75,160, 75,187,
+    225,242,239,110,128,  1, 15,229,228,233,236,236, 97,128, 30, 17,
+    233,242, 99,  2, 75,168, 75,173,236,101,128, 36,211,245,237,230,
+    236,229,248,226,229,236,239,119,128, 30, 19,242,239,225,116,128,
+      1, 17,100,  4, 75,204, 76, 29, 76, 39, 76, 90, 97,  4, 75,214,
+     75,224, 75,231, 76,  0,226,229,238,231,225,236,105,128,  9,161,
+    228,229,246, 97,128,  9, 33,231,117,  2, 75,238, 75,247,234,225,
+    242,225,244,105,128, 10,161,242,237,245,235,232,105,128, 10, 33,
+    108,  2, 76,  6, 76, 15,225,242,225,226,233, 99,128,  6,136,230,
+    233,238,225,236,225,242,225,226,233, 99,128,251,137,228,232,225,
+    228,229,246, 97,128,  9, 92,232, 97,  3, 76, 48, 76, 58, 76, 65,
+    226,229,238,231,225,236,105,128,  9,162,228,229,246, 97,128,  9,
+     34,231,117,  2, 76, 72, 76, 81,234,225,242,225,244,105,128, 10,
+    162,242,237,245,235,232,105,128, 10, 34,239,116,  2, 76, 97, 76,
+    106,225,227,227,229,238,116,128, 30, 11,226,229,236,239,119,128,
+     30, 13,101,  8, 76,132, 76,185, 76,192, 76,217, 76,227, 76,238,
+     77, 27, 77, 63, 99,  2, 76,138, 76,175,233,237,225,236,243,229,
+    240,225,242,225,244,239,114,  2, 76,156, 76,165,225,242,225,226,
+    233, 99,128,  6,107,240,229,242,243,233,225,110,128,  6,107,249,
+    242,233,236,236,233, 99,128,  4, 52,231,242,229,101,128,  0,176,
+    232,105,  2, 76,199, 76,208,232,229,226,242,229,119,128,  5,173,
+    242,225,231,225,238, 97,128, 48,103,233,227,239,240,244,233, 99,
+    128,  3,239,235,225,244,225,235,225,238, 97,128, 48,199,108,  2,
+     76,244, 77, 11,229,244,101,  2, 76,252, 77,  3,236,229,230,116,
+    128, 35, 43,242,233,231,232,116,128, 35, 38,244, 97,129,  3,180,
+     77, 18,244,245,242,238,229,100,128,  1,141,238,239,237,233,238,
+    225,244,239,242,237,233,238,245,243,239,238,229,238,245,237,229,
+    242,225,244,239,242,226,229,238,231,225,236,105,128,  9,248,250,
+    104,128,  2,164,104,  2, 77, 74, 77,124, 97,  3, 77, 82, 77, 92,
+     77, 99,226,229,238,231,225,236,105,128,  9,167,228,229,246, 97,
+    128,  9, 39,231,117,  2, 77,106, 77,115,234,225,242,225,244,105,
+    128, 10,167,242,237,245,235,232,105,128, 10, 39,239,239,107,128,
+      2, 87,105,  6, 77,144, 77,193, 77,253, 78,  8, 78, 19, 78, 29,
+     97,  2, 77,150, 77,172,236,249,244,233,235,225,244,239,238,239,
+    115,129,  3,133, 77,166,227,237, 98,128,  3, 68,237,239,238,100,
+    129, 38,102, 77,181,243,245,233,244,247,232,233,244,101,128, 38,
+     98,229,242,229,243,233,115,133,  0,168, 77,212, 77,220, 77,231,
+     77,237, 77,245,225,227,245,244,101,128,246,215,226,229,236,239,
+    247,227,237, 98,128,  3, 36,227,237, 98,128,  3,  8,231,242,225,
+    246,101,128,246,216,244,239,238,239,115,128,  3,133,232,233,242,
+    225,231,225,238, 97,128, 48, 98,235,225,244,225,235,225,238, 97,
+    128, 48,194,244,244,239,237,225,242,107,128, 48,  3,246,105,  2,
+     78, 36, 78, 47,228,101,129,  0,247, 78, 43,115,128, 34, 35,243,
+    233,239,238,243,236,225,243,104,128, 34, 21,234,229,227,249,242,
+    233,236,236,233, 99,128,  4, 82,235,243,232,225,228,101,128, 37,
+    147,108,  2, 78, 87, 78, 98,233,238,229,226,229,236,239,119,128,
+     30, 15,243,241,245,225,242,101,128, 51,151,109,  2, 78,113, 78,
+    121,225,227,242,239,110,128,  1, 17,239,238,239,243,240,225,227,
+    101,128,255, 68,238,226,236,239,227,107,128, 37,132,111, 10, 78,
+    163, 78,175, 78,185, 78,196, 78,207, 79, 23, 79, 28, 79, 39, 79,
+    154, 79,180,227,232,225,228,225,244,232,225,105,128, 14, 14,228,
+    229,235,244,232,225,105,128, 14, 20,232,233,242,225,231,225,238,
+     97,128, 48,105,235,225,244,225,235,225,238, 97,128, 48,201,236,
+    236,225,114,132,  0, 36, 78,222, 78,233, 78,245, 79,  0,233,238,
+    230,229,242,233,239,114,128,246,227,237,239,238,239,243,240,225,
+    227,101,128,255,  4,239,236,228,243,244,249,236,101,128,247, 36,
+    115,  2, 79,  6, 79, 13,237,225,236,108,128,254,105,245,240,229,
+    242,233,239,114,128,246,228,238,103,128, 32,171,242,245,243,241,
+    245,225,242,101,128, 51, 38,116,  6, 79, 53, 79, 70, 79, 92, 79,
+    103, 79,135, 79,142,225,227,227,229,238,116,129,  2,217, 79, 64,
+    227,237, 98,128,  3,  7,226,229,236,239,247, 99,  2, 79, 81, 79,
+     86,237, 98,128,  3, 35,239,237, 98,128,  3, 35,235,225,244,225,
+    235,225,238, 97,128, 48,251,236,229,243,115,  2, 79,112, 79,116,
+    105,128,  1, 49,106,129,246,190, 79,122,243,244,242,239,235,229,
+    232,239,239,107,128,  2,132,237,225,244,104,128, 34,197,244,229,
+    228,227,233,242,227,236,101,128, 37,204,245,226,236,229,249,239,
+    228,240,225,244,225,104,129,251, 31, 79,171,232,229,226,242,229,
+    119,128,251, 31,247,238,244,225,227,107,  2, 79,191, 79,202,226,
+    229,236,239,247,227,237, 98,128,  3, 30,237,239,100,128,  2,213,
+    240,225,242,229,110,128, 36,159,243,245,240,229,242,233,239,114,
+    128,246,235,116,  2, 79,233, 79,239,225,233,108,128,  2, 86,239,
+    240,226,225,114,128,  1,140,117,  2, 79,253, 80,  8,232,233,242,
+    225,231,225,238, 97,128, 48,101,235,225,244,225,235,225,238, 97,
+    128, 48,197,122,132,  1,243, 80, 31, 80, 40, 80, 59, 80, 96,225,
+    236,244,239,238,101,128,  2,163, 99,  2, 80, 46, 80, 53,225,242,
+    239,110,128,  1,198,245,242,108,128,  2,165,101,  2, 80, 65, 80,
+     85,225,226,235,232,225,243,233,225,238,227,249,242,233,236,236,
+    233, 99,128,  4,225,227,249,242,233,236,236,233, 99,128,  4, 85,
+    232,229,227,249,242,233,236,236,233, 99,128,  4, 95,101,151,  0,
+    101, 80,159, 80,178, 80,212, 81,186, 81,248, 82, 25, 82, 37, 82,
+     60, 82,113, 83,225, 84, 27, 84,129, 84,245, 85,124, 85,199, 85,
+    230, 86, 36, 86, 89, 87, 24, 87,157, 87,177, 87,221, 88, 56, 97,
+      2, 80,165, 80,172,227,245,244,101,128,  0,233,242,244,104,128,
+     38, 65, 98,  3, 80,186, 80,195, 80,205,229,238,231,225,236,105,
+    128,  9,143,239,240,239,237,239,230,111,128, 49, 28,242,229,246,
+    101,128,  1, 21, 99,  5, 80,224, 81, 41, 81, 55, 81, 87, 81,176,
+     97,  2, 80,230, 81, 35,238,228,242, 97,  3, 80,241, 80,248, 81,
+      3,228,229,246, 97,128,  9, 13,231,245,234,225,242,225,244,105,
+    128, 10,141,246,239,247,229,236,243,233,231,110,  2, 81, 17, 81,
+     24,228,229,246, 97,128,  9, 69,231,245,234,225,242,225,244,105,
+    128, 10,197,242,239,110,128,  1, 27,229,228,233,236,236,225,226,
+    242,229,246,101,128, 30, 29,104,  2, 81, 61, 81, 72,225,242,237,
+    229,238,233,225,110,128,  5,101,249,233,247,238,225,242,237,229,
+    238,233,225,110,128,  5,135,233,242, 99,  2, 81, 95, 81,100,236,
+    101,128, 36,212,245,237,230,236,229,120,134,  0,234, 81,121, 81,
+    129, 81,137, 81,148, 81,156, 81,168,225,227,245,244,101,128, 30,
+    191,226,229,236,239,119,128, 30, 25,228,239,244,226,229,236,239,
+    119,128, 30,199,231,242,225,246,101,128, 30,193,232,239,239,235,
+    225,226,239,246,101,128, 30,195,244,233,236,228,101,128, 30,197,
+    249,242,233,236,236,233, 99,128,  4, 84,100,  4, 81,196, 81,206,
+     81,212, 81,222,226,236,231,242,225,246,101,128,  2,  5,229,246,
+     97,128,  9, 15,233,229,242,229,243,233,115,128,  0,235,239,116,
+    130,  1, 23, 81,231, 81,240,225,227,227,229,238,116,128,  1, 23,
+    226,229,236,239,119,128, 30,185,101,  2, 81,254, 82,  9,231,245,
+    242,237,245,235,232,105,128, 10, 15,237,225,244,242,225,231,245,
+    242,237,245,235,232,105,128, 10, 71,230,227,249,242,233,236,236,
+    233, 99,128,  4, 68,103,  2, 82, 43, 82, 50,242,225,246,101,128,
+      0,232,245,234,225,242,225,244,105,128, 10,143,104,  4, 82, 70,
+     82, 81, 82, 92, 82,102,225,242,237,229,238,233,225,110,128,  5,
+    103,226,239,240,239,237,239,230,111,128, 49, 29,233,242,225,231,
+    225,238, 97,128, 48, 72,239,239,235,225,226,239,246,101,128, 30,
+    187,105,  4, 82,123, 82,134, 83,192, 83,207,226,239,240,239,237,
+    239,230,111,128, 49, 31,231,232,116,142,  0, 56, 82,168, 82,177,
+     82,187, 82,217, 82,224, 83,  6, 83, 31, 83, 76, 83,110, 83,122,
+     83,133, 83,166, 83,174, 83,185,225,242,225,226,233, 99,128,  6,
+    104,226,229,238,231,225,236,105,128,  9,238,227,233,242,227,236,
+    101,129, 36,103, 82,198,233,238,246,229,242,243,229,243,225,238,
+    243,243,229,242,233,102,128, 39,145,228,229,246, 97,128,  9,110,
+    229,229,110,  2, 82,232, 82,241,227,233,242,227,236,101,128, 36,
+    113,112,  2, 82,247, 82,254,225,242,229,110,128, 36,133,229,242,
+    233,239,100,128, 36,153,231,117,  2, 83, 13, 83, 22,234,225,242,
+    225,244,105,128, 10,238,242,237,245,235,232,105,128, 10,110,104,
+      2, 83, 37, 83, 63, 97,  2, 83, 43, 83, 54,227,235,225,242,225,
+    226,233, 99,128,  6,104,238,231,250,232,239,117,128, 48, 40,238,
+    239,244,229,226,229,225,237,229,100,128, 38,107,105,  2, 83, 82,
+     83,100,228,229,239,231,242,225,240,232,233,227,240,225,242,229,
+    110,128, 50, 39,238,230,229,242,233,239,114,128, 32,136,237,239,
+    238,239,243,240,225,227,101,128,255, 24,239,236,228,243,244,249,
+    236,101,128,247, 56,112,  2, 83,139, 83,146,225,242,229,110,128,
+     36,123,229,114,  2, 83,153, 83,159,233,239,100,128, 36,143,243,
+    233,225,110,128,  6,248,242,239,237,225,110,128, 33,119,243,245,
+    240,229,242,233,239,114,128, 32,120,244,232,225,105,128, 14, 88,
+    238,246,229,242,244,229,228,226,242,229,246,101,128,  2,  7,239,
+    244,233,230,233,229,228,227,249,242,233,236,236,233, 99,128,  4,
+    101,107,  2, 83,231, 83,255,225,244,225,235,225,238, 97,129, 48,
+    168, 83,243,232,225,236,230,247,233,228,244,104,128,255,116,111,
+      2, 84,  5, 84, 20,238,235,225,242,231,245,242,237,245,235,232,
+    105,128, 10,116,242,229,225,110,128, 49, 84,108,  3, 84, 35, 84,
+     46, 84,107,227,249,242,233,236,236,233, 99,128,  4, 59,101,  2,
+     84, 52, 84, 59,237,229,238,116,128, 34,  8,246,229,110,  3, 84,
+     69, 84, 78, 84, 99,227,233,242,227,236,101,128, 36,106,112,  2,
+     84, 84, 84, 91,225,242,229,110,128, 36,126,229,242,233,239,100,
+    128, 36,146,242,239,237,225,110,128, 33,122,236,233,240,243,233,
+    115,129, 32, 38, 84,118,246,229,242,244,233,227,225,108,128, 34,
+    238,109,  5, 84,141, 84,169, 84,180, 84,200, 84,211,225,227,242,
+    239,110,130,  1, 19, 84,153, 84,161,225,227,245,244,101,128, 30,
+     23,231,242,225,246,101,128, 30, 21,227,249,242,233,236,236,233,
+     99,128,  4, 60,228,225,243,104,129, 32, 20, 84,189,246,229,242,
+    244,233,227,225,108,128,254, 49,239,238,239,243,240,225,227,101,
+    128,255, 69,112,  2, 84,217, 84,237,232,225,243,233,243,237,225,
+    242,235,225,242,237,229,238,233,225,110,128,  5, 91,244,249,243,
+    229,116,128, 34,  5,110,  6, 85,  3, 85, 14, 85, 25, 85, 69, 85,
+    101, 85,116,226,239,240,239,237,239,230,111,128, 49, 35,227,249,
+    242,233,236,236,233, 99,128,  4, 61,100,  2, 85, 31, 85, 50,225,
+    243,104,129, 32, 19, 85, 39,246,229,242,244,233,227,225,108,128,
+    254, 50,229,243,227,229,238,228,229,242,227,249,242,233,236,236,
+    233, 99,128,  4,163,103,130,  1, 75, 85, 77, 85, 88,226,239,240,
+    239,237,239,230,111,128, 49, 37,232,229,227,249,242,233,236,236,
+    233, 99,128,  4,165,232,239,239,235,227,249,242,233,236,236,233,
+     99,128,  4,200,243,240,225,227,101,128, 32,  2,111,  3, 85,132,
+     85,140, 85,149,231,239,238,229,107,128,  1, 25,235,239,242,229,
+    225,110,128, 49, 83,240,229,110,130,  2, 91, 85,159, 85,168,227,
+    236,239,243,229,100,128,  2,154,242,229,246,229,242,243,229,100,
+    130,  2, 92, 85,183, 85,192,227,236,239,243,229,100,128,  2, 94,
+    232,239,239,107,128,  2, 93,112,  2, 85,205, 85,212,225,242,229,
+    110,128, 36,160,243,233,236,239,110,129,  3,181, 85,222,244,239,
+    238,239,115,128,  3,173,241,117,  2, 85,237, 86, 25,225,108,130,
+      0, 61, 85,246, 86,  2,237,239,238,239,243,240,225,227,101,128,
+    255, 29,115,  2, 86,  8, 86, 15,237,225,236,108,128,254,102,245,
+    240,229,242,233,239,114,128, 32,124,233,246,225,236,229,238,227,
+    101,128, 34, 97,114,  3, 86, 44, 86, 55, 86, 66,226,239,240,239,
+    237,239,230,111,128, 49, 38,227,249,242,233,236,236,233, 99,128,
+      4, 64,229,246,229,242,243,229,100,129,  2, 88, 86, 78,227,249,
+    242,233,236,236,233, 99,128,  4, 77,115,  6, 86,103, 86,114, 86,
+    134, 86,215, 87,  4, 87, 14,227,249,242,233,236,236,233, 99,128,
+      4, 65,228,229,243,227,229,238,228,229,242,227,249,242,233,236,
+    236,233, 99,128,  4,171,104,132,  2,131, 86,146, 86,153, 86,184,
+     86,199,227,245,242,108,128,  2,134,239,242,116,  2, 86,161, 86,
+    168,228,229,246, 97,128,  9, 14,246,239,247,229,236,243,233,231,
+    238,228,229,246, 97,128,  9, 70,242,229,246,229,242,243,229,228,
+    236,239,239,112,128,  1,170,243,241,245,225,244,242,229,246,229,
+    242,243,229,100,128,  2,133,237,225,236,108,  2, 86,224, 86,235,
+    232,233,242,225,231,225,238, 97,128, 48, 71,235,225,244,225,235,
+    225,238, 97,129, 48,167, 86,248,232,225,236,230,247,233,228,244,
+    104,128,255,106,244,233,237,225,244,229,100,128, 33, 46,245,240,
+    229,242,233,239,114,128,246,236,116,  5, 87, 36, 87, 62, 87, 66,
+     87, 83, 87,149, 97,130,  3,183, 87, 44, 87, 54,242,237,229,238,
+    233,225,110,128,  5,104,244,239,238,239,115,128,  3,174,104,128,
+      0,240,233,236,228,101,129, 30,189, 87, 75,226,229,236,239,119,
+    128, 30, 27,238,225,232,244, 97,  3, 87, 95, 87,127, 87,136,230,
+    239,245,235,104,  2, 87,105, 87,114,232,229,226,242,229,119,128,
+      5,145,236,229,230,244,232,229,226,242,229,119,128,  5,145,232,
+    229,226,242,229,119,128,  5,145,236,229,230,244,232,229,226,242,
+    229,119,128,  5,145,245,242,238,229,100,128,  1,221,117,  2, 87,
+    163, 87,172,235,239,242,229,225,110,128, 49, 97,242,111,128, 32,
+    172,246,239,247,229,236,243,233,231,110,  3, 87,193, 87,203, 87,
+    210,226,229,238,231,225,236,105,128,  9,199,228,229,246, 97,128,
+      9, 71,231,245,234,225,242,225,244,105,128, 10,199,120,  2, 87,
+    227, 88, 44,227,236,225,109,132,  0, 33, 87,242, 87,253, 88, 24,
+     88, 36,225,242,237,229,238,233,225,110,128,  5, 92,100,  2, 88,
+      3, 88,  8,226,108,128, 32, 60,239,247,110,129,  0,161, 88, 16,
+    243,237,225,236,108,128,247,161,237,239,238,239,243,240,225,227,
+    101,128,255,  1,243,237,225,236,108,128,247, 33,233,243,244,229,
+    238,244,233,225,108,128, 34,  3,250,104,131,  2,146, 88, 67, 88,
+     86, 88, 97, 99,  2, 88, 73, 88, 80,225,242,239,110,128,  1,239,
+    245,242,108,128,  2,147,242,229,246,229,242,243,229,100,128,  1,
+    185,244,225,233,108,128,  1,186,102,140,  0,102, 88,132, 88,214,
+     88,225, 88,234, 88,246, 89, 93, 89,109, 91,117, 91,130, 91,156,
+     93, 33, 93, 41, 97,  4, 88,142, 88,149, 88,160, 88,171,228,229,
+    246, 97,128,  9, 94,231,245,242,237,245,235,232,105,128, 10, 94,
+    232,242,229,238,232,229,233,116,128, 33,  9,244,232, 97,  3, 88,
+    181, 88,190, 88,202,225,242,225,226,233, 99,128,  6, 78,236,239,
+    247,225,242,225,226,233, 99,128,  6, 78,244,225,238,225,242,225,
+    226,233, 99,128,  6, 75,226,239,240,239,237,239,230,111,128, 49,
+      8,227,233,242,227,236,101,128, 36,213,228,239,244,225,227,227,
+    229,238,116,128, 30, 31,101,  3, 88,254, 89, 76, 89, 86,104,  4,
+     89,  8, 89, 31, 89, 45, 89, 61,225,114,  2, 89, 15, 89, 22,225,
+    226,233, 99,128,  6, 65,237,229,238,233,225,110,128,  5,134,230,
+    233,238,225,236,225,242,225,226,233, 99,128,254,210,233,238,233,
+    244,233,225,236,225,242,225,226,233, 99,128,254,211,237,229,228,
+    233,225,236,225,242,225,226,233, 99,128,254,212,233,227,239,240,
+    244,233, 99,128,  3,229,237,225,236,101,128, 38, 64,102,130,251,
+      0, 89,101, 89,105,105,128,251,  3,108,128,251,  4,105,136,251,
+      1, 89,129, 89,169, 89,180, 89,202, 90, 68, 90, 85, 90, 93, 90,
+    106,230,244,229,229,110,  2, 89,139, 89,148,227,233,242,227,236,
+    101,128, 36,110,112,  2, 89,154, 89,161,225,242,229,110,128, 36,
+    130,229,242,233,239,100,128, 36,150,231,245,242,229,228,225,243,
+    104,128, 32, 18,236,236,229,100,  2, 89,189, 89,195,226,239,120,
+    128, 37,160,242,229,227,116,128, 37,172,238,225,108,  5, 89,216,
+     89,255, 90, 16, 90, 33, 90, 49,235,225,102,130,  5,218, 89,226,
+     89,246,228,225,231,229,243,104,129,251, 58, 89,237,232,229,226,
+    242,229,119,128,251, 58,232,229,226,242,229,119,128,  5,218,237,
+    229,109,129,  5,221, 90,  7,232,229,226,242,229,119,128,  5,221,
+    238,245,110,129,  5,223, 90, 24,232,229,226,242,229,119,128,  5,
+    223,240,101,129,  5,227, 90, 40,232,229,226,242,229,119,128,  5,
+    227,244,243,225,228,105,129,  5,229, 90, 59,232,229,226,242,229,
+    119,128,  5,229,242,243,244,244,239,238,229,227,232,233,238,229,
+    243,101,128,  2,201,243,232,229,249,101,128, 37,201,244,225,227,
+    249,242,233,236,236,233, 99,128,  4,115,246,101,142,  0, 53, 90,
+    139, 90,148, 90,158, 90,188, 90,195, 90,205, 90,230, 91,  1, 91,
+     35, 91, 47, 91, 58, 91, 91, 91, 99, 91,110,225,242,225,226,233,
+     99,128,  6,101,226,229,238,231,225,236,105,128,  9,235,227,233,
+    242,227,236,101,129, 36,100, 90,169,233,238,246,229,242,243,229,
+    243,225,238,243,243,229,242,233,102,128, 39,142,228,229,246, 97,
+    128,  9,107,229,233,231,232,244,232,115,128, 33, 93,231,117,  2,
+     90,212, 90,221,234,225,242,225,244,105,128, 10,235,242,237,245,
+    235,232,105,128, 10,107,232, 97,  2, 90,237, 90,248,227,235,225,
+    242,225,226,233, 99,128,  6,101,238,231,250,232,239,117,128, 48,
+     37,105,  2, 91,  7, 91, 25,228,229,239,231,242,225,240,232,233,
+    227,240,225,242,229,110,128, 50, 36,238,230,229,242,233,239,114,
+    128, 32,133,237,239,238,239,243,240,225,227,101,128,255, 21,239,
+    236,228,243,244,249,236,101,128,247, 53,112,  2, 91, 64, 91, 71,
+    225,242,229,110,128, 36,120,229,114,  2, 91, 78, 91, 84,233,239,
+    100,128, 36,140,243,233,225,110,128,  6,245,242,239,237,225,110,
+    128, 33,116,243,245,240,229,242,233,239,114,128, 32,117,244,232,
+    225,105,128, 14, 85,108,129,251,  2, 91,123,239,242,233,110,128,
+      1,146,109,  2, 91,136, 91,147,239,238,239,243,240,225,227,101,
+    128,255, 70,243,241,245,225,242,101,128, 51,153,111,  4, 91,166,
+     91,188, 91,200, 91,207,230, 97,  2, 91,173, 91,181,238,244,232,
+    225,105,128, 14, 31,244,232,225,105,128, 14, 29,238,231,237,225,
+    238,244,232,225,105,128, 14, 79,242,225,236,108,128, 34,  0,245,
+    114,142,  0, 52, 91,240, 91,249, 92,  3, 92, 33, 92, 40, 92, 65,
+     92, 92, 92,126, 92,138, 92,157, 92,168, 92,201, 92,209, 92,220,
+    225,242,225,226,233, 99,128,  6,100,226,229,238,231,225,236,105,
+    128,  9,234,227,233,242,227,236,101,129, 36, 99, 92, 14,233,238,
     246,229,242,243,229,243,225,238,243,243,229,242,233,102,128, 39,
     246,229,242,243,229,243,225,238,243,243,229,242,233,102,128, 39,
-    146,228,229,246, 97,128,  9,111,231,117,  2,134, 31,134, 40,234,
-    225,242,225,244,105,128, 10,239,242,237,245,235,232,105,128, 10,
-    111,232, 97,  2,134, 56,134, 67,227,235,225,242,225,226,233, 99,
-    128,  6,105,238,231,250,232,239,117,128, 48, 41,105,  2,134, 82,
-    134,100,228,229,239,231,242,225,240,232,233,227,240,225,242,229,
-    110,128, 50, 40,238,230,229,242,233,239,114,128, 32,137,237,239,
-    238,239,243,240,225,227,101,128,255, 25,239,236,228,243,244,249,
-    236,101,128,247, 57,112,  2,134,139,134,146,225,242,229,110,128,
-     36,124,229,114,  2,134,153,134,159,233,239,100,128, 36,144,243,
-    233,225,110,128,  6,249,242,239,237,225,110,128, 33,120,243,245,
-    240,229,242,233,239,114,128, 32,121,116,  2,134,191,134,229,229,
-    229,110,  2,134,199,134,208,227,233,242,227,236,101,128, 36,114,
-    112,  2,134,214,134,221,225,242,229,110,128, 36,134,229,242,233,
-    239,100,128, 36,154,232,225,105,128, 14, 89,106,129,  1,204,134,
-    241,229,227,249,242,233,236,236,233, 99,128,  4, 90,235,225,244,
-    225,235,225,238, 97,129, 48,243,135, 10,232,225,236,230,247,233,
-    228,244,104,128,255,157,108,  2,135, 28,135, 42,229,231,242,233,
-    231,232,244,236,239,238,103,128,  1,158,233,238,229,226,229,236,
-    239,119,128, 30, 73,109,  2,135, 59,135, 70,239,238,239,243,240,
-    225,227,101,128,255, 78,243,241,245,225,242,101,128, 51,154,110,
-      2,135, 85,135,135, 97,  3,135, 93,135,103,135,110,226,229,238,
-    231,225,236,105,128,  9,163,228,229,246, 97,128,  9, 35,231,117,
-      2,135,117,135,126,234,225,242,225,244,105,128, 10,163,242,237,
-    245,235,232,105,128, 10, 35,238,225,228,229,246, 97,128,  9, 41,
-    111,  6,135,158,135,169,135,194,135,235,136,187,137,114,232,233,
-    242,225,231,225,238, 97,128, 48,110,235,225,244,225,235,225,238,
-     97,129, 48,206,135,182,232,225,236,230,247,233,228,244,104,128,
-    255,137,110,  3,135,202,135,218,135,227,226,242,229,225,235,233,
-    238,231,243,240,225,227,101,128,  0,160,229,238,244,232,225,105,
-    128, 14, 19,245,244,232,225,105,128, 14, 25,239,110,  7,135,252,
-    136,  5,136, 19,136, 53,136, 69,136,110,136,169,225,242,225,226,
-    233, 99,128,  6, 70,230,233,238,225,236,225,242,225,226,233, 99,
-    128,254,230,231,232,245,238,238, 97,  2,136, 30,136, 39,225,242,
-    225,226,233, 99,128,  6,186,230,233,238,225,236,225,242,225,226,
-    233, 99,128,251,159,233,238,233,244,233,225,236,225,242,225,226,
-    233, 99,128,254,231,234,229,229,237,105,  2,136, 79,136, 94,238,
-    233,244,233,225,236,225,242,225,226,233, 99,128,252,210,243,239,
-    236,225,244,229,228,225,242,225,226,233, 99,128,252, 75,237,101,
-      2,136,117,136,130,228,233,225,236,225,242,225,226,233, 99,128,
-    254,232,229,237,105,  2,136,138,136,153,238,233,244,233,225,236,
-    225,242,225,226,233, 99,128,252,213,243,239,236,225,244,229,228,
-    225,242,225,226,233, 99,128,252, 78,238,239,239,238,230,233,238,
-    225,236,225,242,225,226,233, 99,128,252,141,116,  7,136,203,136,
-    214,136,243,137, 22,137, 34,137, 54,137, 80,227,239,238,244,225,
-    233,238,115,128, 34, 12,101,  2,136,220,136,236,236,229,237,229,
-    238,116,129, 34,  9,136,231,239,102,128, 34,  9,241,245,225,108,
-    128, 34, 96,231,242,229,225,244,229,114,129, 34,111,136,255,238,
-    239,114,  2,137,  7,137, 15,229,241,245,225,108,128, 34,113,236,
-    229,243,115,128, 34,121,233,228,229,238,244,233,227,225,108,128,
-     34, 98,236,229,243,115,129, 34,110,137, 43,238,239,242,229,241,
-    245,225,108,128, 34,112,112,  2,137, 60,137, 70,225,242,225,236,
-    236,229,108,128, 34, 38,242,229,227,229,228,229,115,128, 34,128,
-    243,117,  3,137, 89,137, 96,137,105,226,243,229,116,128, 34,132,
-    227,227,229,229,228,115,128, 34,129,240,229,242,243,229,116,128,
-     34,133,247,225,242,237,229,238,233,225,110,128,  5,118,240,225,
-    242,229,110,128, 36,169,115,  2,137,140,137,149,243,241,245,225,
-    242,101,128, 51,177,245,240,229,242,233,239,114,128, 32,127,244,
-    233,236,228,101,128,  0,241,117,132,  3,189,137,179,137,190,138,
-     15,138, 98,232,233,242,225,231,225,238, 97,128, 48,108,107,  2,
-    137,196,137,220,225,244,225,235,225,238, 97,129, 48,204,137,208,
-    232,225,236,230,247,233,228,244,104,128,255,135,244, 97,  3,137,
-    229,137,239,137,246,226,229,238,231,225,236,105,128,  9,188,228,
-    229,246, 97,128,  9, 60,231,117,  2,137,253,138,  6,234,225,242,
-    225,244,105,128, 10,188,242,237,245,235,232,105,128, 10, 60,109,
-      2,138, 21,138, 55,226,229,242,243,233,231,110,130,  0, 35,138,
-     35,138, 47,237,239,238,239,243,240,225,227,101,128,255,  3,243,
-    237,225,236,108,128,254, 95,229,114,  2,138, 62,138, 94,225,236,
-    243,233,231,110,  2,138, 73,138, 81,231,242,229,229,107,128,  3,
-    116,236,239,247,229,242,231,242,229,229,107,128,  3,117,111,128,
-     33, 22,110,130,  5,224,138,106,138,126,228,225,231,229,243,104,
-    129,251, 64,138,117,232,229,226,242,229,119,128,251, 64,232,229,
-    226,242,229,119,128,  5,224,246,243,241,245,225,242,101,128, 51,
-    181,247,243,241,245,225,242,101,128, 51,187,249, 97,  3,138,164,
-    138,174,138,181,226,229,238,231,225,236,105,128,  9,158,228,229,
-    246, 97,128,  9, 30,231,117,  2,138,188,138,197,234,225,242,225,
-    244,105,128, 10,158,242,237,245,235,232,105,128, 10, 30,111,147,
-      0,111,138,248,139, 14,139, 92,140,  6,140, 78,140, 93,140,133,
-    141,  0,141, 21,141, 59,141, 70,141,248,143, 82,143,146,143,179,
-    143,225,144, 98,144,145,144,157, 97,  2,138,254,139,  5,227,245,
-    244,101,128,  0,243,238,231,244,232,225,105,128, 14, 45, 98,  4,
-    139, 24,139, 66,139, 75,139, 85,225,242,242,229,100,130,  2,117,
-    139, 36,139, 47,227,249,242,233,236,236,233, 99,128,  4,233,228,
-    233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128,
-      4,235,229,238,231,225,236,105,128,  9,147,239,240,239,237,239,
-    230,111,128, 49, 27,242,229,246,101,128,  1, 79, 99,  3,139,100,
-    139,173,139,252, 97,  2,139,106,139,167,238,228,242, 97,  3,139,
-    117,139,124,139,135,228,229,246, 97,128,  9, 17,231,245,234,225,
-    242,225,244,105,128, 10,145,246,239,247,229,236,243,233,231,110,
-      2,139,149,139,156,228,229,246, 97,128,  9, 73,231,245,234,225,
-    242,225,244,105,128, 10,201,242,239,110,128,  1,210,233,242, 99,
-      2,139,181,139,186,236,101,128, 36,222,245,237,230,236,229,120,
-    133,  0,244,139,205,139,213,139,224,139,232,139,244,225,227,245,
-    244,101,128, 30,209,228,239,244,226,229,236,239,119,128, 30,217,
-    231,242,225,246,101,128, 30,211,232,239,239,235,225,226,239,246,
-    101,128, 30,213,244,233,236,228,101,128, 30,215,249,242,233,236,
-    236,233, 99,128,  4, 62,100,  4,140, 16,140, 39,140, 45,140, 68,
-    226,108,  2,140, 23,140, 31,225,227,245,244,101,128,  1, 81,231,
-    242,225,246,101,128,  2, 13,229,246, 97,128,  9, 19,233,229,242,
-    229,243,233,115,129,  0,246,140, 57,227,249,242,233,236,236,233,
-     99,128,  4,231,239,244,226,229,236,239,119,128, 30,205,101,129,
-      1, 83,140, 84,235,239,242,229,225,110,128, 49, 90,103,  3,140,
-    101,140,116,140,123,239,238,229,107,129,  2,219,140,110,227,237,
-     98,128,  3, 40,242,225,246,101,128,  0,242,245,234,225,242,225,
-    244,105,128, 10,147,104,  4,140,143,140,154,140,164,140,242,225,
-    242,237,229,238,233,225,110,128,  5,133,233,242,225,231,225,238,
-     97,128, 48, 74,111,  2,140,170,140,180,239,235,225,226,239,246,
-    101,128, 30,207,242,110,133,  1,161,140,195,140,203,140,214,140,
-    222,140,234,225,227,245,244,101,128, 30,219,228,239,244,226,229,
-    236,239,119,128, 30,227,231,242,225,246,101,128, 30,221,232,239,
-    239,235,225,226,239,246,101,128, 30,223,244,233,236,228,101,128,
-     30,225,245,238,231,225,242,245,237,236,225,245,116,128,  1, 81,
-    105,129,  1,163,141,  6,238,246,229,242,244,229,228,226,242,229,
-    246,101,128,  2, 15,107,  2,141, 27,141, 51,225,244,225,235,225,
-    238, 97,129, 48,170,141, 39,232,225,236,230,247,233,228,244,104,
-    128,255,117,239,242,229,225,110,128, 49, 87,236,229,232,229,226,
-    242,229,119,128,  5,171,109,  6,141, 84,141,112,141,119,141,208,
-    141,219,141,237,225,227,242,239,110,130,  1, 77,141, 96,141,104,
-    225,227,245,244,101,128, 30, 83,231,242,225,246,101,128, 30, 81,
-    228,229,246, 97,128,  9, 80,229,231, 97,133,  3,201,141,135,141,
-    139,141,150,141,164,141,180, 49,128,  3,214,227,249,242,233,236,
-    236,233, 99,128,  4, 97,236,225,244,233,238,227,236,239,243,229,
-    100,128,  2,119,242,239,245,238,228,227,249,242,233,236,236,233,
-     99,128,  4,123,116,  2,141,186,141,201,233,244,236,239,227,249,
-    242,233,236,236,233, 99,128,  4,125,239,238,239,115,128,  3,206,
-    231,245,234,225,242,225,244,105,128, 10,208,233,227,242,239,110,
-    129,  3,191,141,229,244,239,238,239,115,128,  3,204,239,238,239,
-    243,240,225,227,101,128,255, 79,238,101,145,  0, 49,142, 31,142,
-     40,142, 50,142, 80,142,105,142,114,142,123,142,148,142,182,142,
-    216,142,228,142,247,143,  2,143, 35,143, 45,143, 53,143, 64,225,
-    242,225,226,233, 99,128,  6, 97,226,229,238,231,225,236,105,128,
-      9,231,227,233,242,227,236,101,129, 36, 96,142, 61,233,238,246,
-    229,242,243,229,243,225,238,243,243,229,242,233,102,128, 39,138,
-    100,  2,142, 86,142, 92,229,246, 97,128,  9,103,239,244,229,238,
-    236,229,225,228,229,114,128, 32, 36,229,233,231,232,244,104,128,
-     33, 91,230,233,244,244,229,100,128,246,220,231,117,  2,142,130,
-    142,139,234,225,242,225,244,105,128, 10,231,242,237,245,235,232,
-    105,128, 10,103,232, 97,  3,142,157,142,168,142,173,227,235,225,
-    242,225,226,233, 99,128,  6, 97,236,102,128,  0,189,238,231,250,
-    232,239,117,128, 48, 33,105,  2,142,188,142,206,228,229,239,231,
-    242,225,240,232,233,227,240,225,242,229,110,128, 50, 32,238,230,
-    229,242,233,239,114,128, 32,129,237,239,238,239,243,240,225,227,
-    101,128,255, 17,238,245,237,229,242,225,244,239,242,226,229,238,
-    231,225,236,105,128,  9,244,239,236,228,243,244,249,236,101,128,
-    247, 49,112,  2,143,  8,143, 15,225,242,229,110,128, 36,116,229,
-    114,  2,143, 22,143, 28,233,239,100,128, 36,136,243,233,225,110,
-    128,  6,241,241,245,225,242,244,229,114,128,  0,188,242,239,237,
-    225,110,128, 33,112,243,245,240,229,242,233,239,114,128,  0,185,
-    244,104,  2,143, 71,143, 76,225,105,128, 14, 81,233,242,100,128,
-     33, 83,111,  3,143, 90,143,124,143,140,103,  2,143, 96,143,114,
-    239,238,229,107,129,  1,235,143,105,237,225,227,242,239,110,128,
-      1,237,245,242,237,245,235,232,105,128, 10, 19,237,225,244,242,
-    225,231,245,242,237,245,235,232,105,128, 10, 75,240,229,110,128,
-      2, 84,112,  3,143,154,143,161,143,172,225,242,229,110,128, 36,
-    170,229,238,226,245,236,236,229,116,128, 37,230,244,233,239,110,
-    128, 35, 37,114,  2,143,185,143,214,100,  2,143,191,143,202,230,
-    229,237,233,238,233,238,101,128,  0,170,237,225,243,227,245,236,
-    233,238,101,128,  0,186,244,232,239,231,239,238,225,108,128, 34,
-     31,115,  5,143,237,144, 13,144, 30,144, 75,144, 88,232,239,242,
-    116,  2,143,246,143,253,228,229,246, 97,128,  9, 18,246,239,247,
-    229,236,243,233,231,238,228,229,246, 97,128,  9, 74,236,225,243,
-    104,129,  0,248,144, 22,225,227,245,244,101,128,  1,255,237,225,
-    236,108,  2,144, 39,144, 50,232,233,242,225,231,225,238, 97,128,
-     48, 73,235,225,244,225,235,225,238, 97,129, 48,169,144, 63,232,
-    225,236,230,247,233,228,244,104,128,255,107,244,242,239,235,229,
-    225,227,245,244,101,128,  1,255,245,240,229,242,233,239,114,128,
-    246,240,116,  2,144,104,144,115,227,249,242,233,236,236,233, 99,
-    128,  4,127,233,236,228,101,130,  0,245,144,126,144,134,225,227,
-    245,244,101,128, 30, 77,228,233,229,242,229,243,233,115,128, 30,
-     79,245,226,239,240,239,237,239,230,111,128, 49, 33,118,  2,144,
-    163,144,244,229,114,  2,144,170,144,236,236,233,238,101,131, 32,
-     62,144,183,144,206,144,229, 99,  2,144,189,144,201,229,238,244,
-    229,242,236,233,238,101,128,254, 74,237, 98,128,  3,  5,100,  2,
-    144,212,144,220,225,243,232,229,100,128,254, 73,226,236,247,225,
-    246,121,128,254, 76,247,225,246,121,128,254, 75,243,227,239,242,
-    101,128,  0,175,239,247,229,236,243,233,231,110,  3,145,  3,145,
-     13,145, 20,226,229,238,231,225,236,105,128,  9,203,228,229,246,
-     97,128,  9, 75,231,245,234,225,242,225,244,105,128, 10,203,112,
-    145,  0,112,145, 69,147,197,147,208,147,217,147,229,149,154,149,
-    164,150,156,151,175,152,  9,152, 35,152,166,152,174,153, 76,153,
-    134,153,162,153,172, 97, 14,145, 99,145,131,145,141,145,148,145,
-    155,145,203,145,214,145,228,145,239,146, 30,146, 44,147, 56,147,
-     95,147,185, 97,  2,145,105,145,117,237,240,243,243,241,245,225,
-    242,101,128, 51,128,243,229,238,244,239,243,241,245,225,242,101,
-    128, 51, 43,226,229,238,231,225,236,105,128,  9,170,227,245,244,
-    101,128, 30, 85,228,229,246, 97,128,  9, 42,103,  2,145,161,145,
-    179,101,  2,145,167,145,174,228,239,247,110,128, 33,223,245,112,
-    128, 33,222,117,  2,145,185,145,194,234,225,242,225,244,105,128,
-     10,170,242,237,245,235,232,105,128, 10, 42,232,233,242,225,231,
-    225,238, 97,128, 48,113,233,249,225,238,238,239,233,244,232,225,
-    105,128, 14, 47,235,225,244,225,235,225,238, 97,128, 48,209,108,
-      2,145,245,146, 14,225,244,225,236,233,250,225,244,233,239,238,
-    227,249,242,233,236,236,233,227,227,237, 98,128,  4,132,239,227,
-    232,235,225,227,249,242,233,236,236,233, 99,128,  4,192,238,243,
-    233,239,243,235,239,242,229,225,110,128, 49,127,114,  3,146, 52,
-    146, 73,147, 45, 97,  2,146, 58,146, 66,231,242,225,240,104,128,
-      0,182,236,236,229,108,128, 34, 37,229,110,  2,146, 80,146,190,
-    236,229,230,116,136,  0, 40,146,103,146,118,146,123,146,128,146,
-    139,146,151,146,174,146,179,225,236,244,239,238,229,225,242,225,
-    226,233, 99,128,253, 62,226,116,128,248,237,229,120,128,248,236,
-    233,238,230,229,242,233,239,114,128, 32,141,237,239,238,239,243,
-    240,225,227,101,128,255,  8,115,  2,146,157,146,164,237,225,236,
-    108,128,254, 89,245,240,229,242,233,239,114,128, 32,125,244,112,
-    128,248,235,246,229,242,244,233,227,225,108,128,254, 53,242,233,
-    231,232,116,136,  0, 41,146,214,146,229,146,234,146,239,146,250,
-    147,  6,147, 29,147, 34,225,236,244,239,238,229,225,242,225,226,
-    233, 99,128,253, 63,226,116,128,248,248,229,120,128,248,247,233,
-    238,230,229,242,233,239,114,128, 32,142,237,239,238,239,243,240,
-    225,227,101,128,255,  9,115,  2,147, 12,147, 19,237,225,236,108,
-    128,254, 90,245,240,229,242,233,239,114,128, 32,126,244,112,128,
-    248,246,246,229,242,244,233,227,225,108,128,254, 54,244,233,225,
-    236,228,233,230,102,128, 34,  2,115,  3,147, 64,147, 75,147, 87,
-    229,241,232,229,226,242,229,119,128,  5,192,232,244,225,232,229,
-    226,242,229,119,128,  5,153,241,245,225,242,101,128, 51,169,244,
-    225,104,134,  5,183,147,113,147,127,147,132,147,141,147,156,147,
-    172, 49,  2,147,119,147,123, 49,128,  5,183,100,128,  5,183,178,
-     97,128,  5,183,232,229,226,242,229,119,128,  5,183,238,225,242,
-    242,239,247,232,229,226,242,229,119,128,  5,183,241,245,225,242,
-    244,229,242,232,229,226,242,229,119,128,  5,183,247,233,228,229,
-    232,229,226,242,229,119,128,  5,183,250,229,242,232,229,226,242,
-    229,119,128,  5,161,226,239,240,239,237,239,230,111,128, 49,  6,
-    227,233,242,227,236,101,128, 36,223,228,239,244,225,227,227,229,
-    238,116,128, 30, 87,101,137,  5,228,147,251,148,  6,148, 26,148,
-     38,148, 58,148,160,148,171,148,192,149,147,227,249,242,233,236,
-    236,233, 99,128,  4, 63,228,225,231,229,243,104,129,251, 68,148,
-     17,232,229,226,242,229,119,128,251, 68,229,250,233,243,241,245,
-    225,242,101,128, 51, 59,230,233,238,225,236,228,225,231,229,243,
-    232,232,229,226,242,229,119,128,251, 67,104,  5,148, 70,148, 93,
-    148,101,148,115,148,145,225,114,  2,148, 77,148, 84,225,226,233,
-     99,128,  6,126,237,229,238,233,225,110,128,  5,122,229,226,242,
-    229,119,128,  5,228,230,233,238,225,236,225,242,225,226,233, 99,
-    128,251, 87,105,  2,148,121,148,136,238,233,244,233,225,236,225,
-    242,225,226,233, 99,128,251, 88,242,225,231,225,238, 97,128, 48,
-    122,237,229,228,233,225,236,225,242,225,226,233, 99,128,251, 89,
-    235,225,244,225,235,225,238, 97,128, 48,218,237,233,228,228,236,
-    229,232,239,239,235,227,249,242,233,236,236,233, 99,128,  4,167,
-    114,  5,148,204,148,216,149,  2,149,123,149,136,225,230,229,232,
-    229,226,242,229,119,128,251, 78,227,229,238,116,131,  0, 37,148,
-    229,148,238,148,250,225,242,225,226,233, 99,128,  6,106,237,239,
-    238,239,243,240,225,227,101,128,255,  5,243,237,225,236,108,128,
-    254,106,105,  2,149,  8,149,105,239,100,134,  0, 46,149, 25,149,
-     36,149, 47,149, 59,149, 70,149, 82,225,242,237,229,238,233,225,
-    110,128,  5,137,227,229,238,244,229,242,229,100,128,  0,183,232,
-    225,236,230,247,233,228,244,104,128,255, 97,233,238,230,229,242,
-    233,239,114,128,246,231,237,239,238,239,243,240,225,227,101,128,
-    255, 14,115,  2,149, 88,149, 95,237,225,236,108,128,254, 82,245,
-    240,229,242,233,239,114,128,246,232,243,240,239,237,229,238,233,
-    231,242,229,229,235,227,237, 98,128,  3, 66,240,229,238,228,233,
-    227,245,236,225,114,128, 34,165,244,232,239,245,243,225,238,100,
-    128, 32, 48,243,229,244, 97,128, 32,167,230,243,241,245,225,242,
-    101,128, 51,138,104,  3,149,172,149,222,150,103, 97,  3,149,180,
-    149,190,149,197,226,229,238,231,225,236,105,128,  9,171,228,229,
-    246, 97,128,  9, 43,231,117,  2,149,204,149,213,234,225,242,225,
-    244,105,128, 10,171,242,237,245,235,232,105,128, 10, 43,105,133,
-      3,198,149,236,149,240,150, 70,150, 78,150, 89, 49,128,  3,213,
-    229,245,240,104,  4,149,253,150, 32,150, 47,150, 56, 97,  2,150,
-      3,150, 18,227,233,242,227,236,229,235,239,242,229,225,110,128,
-     50,122,240,225,242,229,238,235,239,242,229,225,110,128, 50, 26,
-    227,233,242,227,236,229,235,239,242,229,225,110,128, 50,108,235,
-    239,242,229,225,110,128, 49, 77,240,225,242,229,238,235,239,242,
-    229,225,110,128, 50, 12,236,225,244,233,110,128,  2,120,238,244,
-    232,245,244,232,225,105,128, 14, 58,243,249,237,226,239,236,231,
-    242,229,229,107,128,  3,213,111,  3,150,111,150,116,150,142,239,
-    107,128,  1,165,240,104,  2,150,123,150,132,225,238,244,232,225,
-    105,128, 14, 30,245,238,231,244,232,225,105,128, 14, 28,243,225,
-    237,240,232,225,239,244,232,225,105,128, 14, 32,105,133,  3,192,
-    150,170,151,126,151,137,151,148,151,162,229,245,112,  6,150,186,
-    150,221,150,253,151, 25,151, 39,151, 91, 97,  2,150,192,150,207,
-    227,233,242,227,236,229,235,239,242,229,225,110,128, 50,115,240,
-    225,242,229,238,235,239,242,229,225,110,128, 50, 19,227,105,  2,
-    150,228,150,240,229,245,227,235,239,242,229,225,110,128, 49,118,
-    242,227,236,229,235,239,242,229,225,110,128, 50,101,107,  2,151,
-      3,151, 17,233,249,229,239,235,235,239,242,229,225,110,128, 49,
-    114,239,242,229,225,110,128, 49, 66,240,225,242,229,238,235,239,
-    242,229,225,110,128, 50,  5,243,233,239,115,  2,151, 48,151, 76,
-    107,  2,151, 54,151, 68,233,249,229,239,235,235,239,242,229,225,
-    110,128, 49,116,239,242,229,225,110,128, 49, 68,244,233,235,229,
-    245,244,235,239,242,229,225,110,128, 49,117,116,  2,151, 97,151,
-    112,232,233,229,245,244,232,235,239,242,229,225,110,128, 49,119,
-    233,235,229,245,244,235,239,242,229,225,110,128, 49,115,232,233,
-    242,225,231,225,238, 97,128, 48,116,235,225,244,225,235,225,238,
-     97,128, 48,212,243,249,237,226,239,236,231,242,229,229,107,128,
-      3,214,247,242,225,242,237,229,238,233,225,110,128,  5,131,236,
-    245,115,132,  0, 43,151,189,151,200,151,209,151,242,226,229,236,
-    239,247,227,237, 98,128,  3, 31,227,233,242,227,236,101,128, 34,
-    149,109,  2,151,215,151,222,233,238,245,115,128,  0,177,111,  2,
-    151,228,151,232,100,128,  2,214,238,239,243,240,225,227,101,128,
-    255, 11,115,  2,151,248,151,255,237,225,236,108,128,254, 98,245,
-    240,229,242,233,239,114,128, 32,122,109,  2,152, 15,152, 26,239,
-    238,239,243,240,225,227,101,128,255, 80,243,241,245,225,242,101,
-    128, 51,216,111,  5,152, 47,152, 58,152,125,152,136,152,146,232,
-    233,242,225,231,225,238, 97,128, 48,125,233,238,244,233,238,231,
-    233,238,228,229,120,  4,152, 78,152, 90,152,102,152,115,228,239,
-    247,238,247,232,233,244,101,128, 38, 31,236,229,230,244,247,232,
-    233,244,101,128, 38, 28,242,233,231,232,244,247,232,233,244,101,
-    128, 38, 30,245,240,247,232,233,244,101,128, 38, 29,235,225,244,
-    225,235,225,238, 97,128, 48,221,240,236,225,244,232,225,105,128,
-     14, 27,243,244,225,236,237,225,242,107,129, 48, 18,152,159,230,
-    225,227,101,128, 48, 32,240,225,242,229,110,128, 36,171,114,  3,
-    152,182,152,208,152,233,101,  2,152,188,152,196,227,229,228,229,
-    115,128, 34,122,243,227,242,233,240,244,233,239,110,128, 33, 30,
-    233,237,101,  2,152,216,152,222,237,239,100,128,  2,185,242,229,
-    246,229,242,243,229,100,128, 32, 53,111,  4,152,243,152,250,153,
-      4,153, 17,228,245,227,116,128, 34, 15,234,229,227,244,233,246,
-    101,128, 35,  5,236,239,238,231,229,228,235,225,238, 97,128, 48,
-    252,112,  2,153, 23,153, 60,101,  2,153, 29,153, 36,236,236,239,
-    114,128, 35, 24,242,243,117,  2,153, 44,153, 51,226,243,229,116,
-    128, 34,130,240,229,242,243,229,116,128, 34,131,239,242,244,233,
-    239,110,129, 34, 55,153, 71,225,108,128, 34, 29,115,  2,153, 82,
-    153,125,105,130,  3,200,153, 90,153,101,227,249,242,233,236,236,
-    233, 99,128,  4,113,236,233,240,238,229,245,237,225,244,225,227,
-    249,242,233,236,236,233,227,227,237, 98,128,  4,134,243,241,245,
-    225,242,101,128, 51,176,117,  2,153,140,153,151,232,233,242,225,
-    231,225,238, 97,128, 48,119,235,225,244,225,235,225,238, 97,128,
-     48,215,246,243,241,245,225,242,101,128, 51,180,247,243,241,245,
-    225,242,101,128, 51,186,113,136,  0,113,153,202,154,251,155,  6,
-    155, 15,155, 22,155, 34,155, 72,155, 80, 97,  4,153,212,153,235,
-    154, 43,154,234,100,  2,153,218,153,224,229,246, 97,128,  9, 88,
-    237,225,232,229,226,242,229,119,128,  5,168,102,  4,153,245,153,
-    254,154, 12,154, 28,225,242,225,226,233, 99,128,  6, 66,230,233,
-    238,225,236,225,242,225,226,233, 99,128,254,214,233,238,233,244,
-    233,225,236,225,242,225,226,233, 99,128,254,215,237,229,228,233,
-    225,236,225,242,225,226,233, 99,128,254,216,237,225,244,115,136,
-      5,184,154, 66,154, 86,154,100,154,105,154,110,154,119,154,134,
-    154,221, 49,  3,154, 74,154, 78,154, 82, 48,128,  5,184, 97,128,
-      5,184, 99,128,  5,184, 50,  2,154, 92,154, 96, 55,128,  5,184,
-     57,128,  5,184,179, 51,128,  5,184,228,101,128,  5,184,232,229,
-    226,242,229,119,128,  5,184,238,225,242,242,239,247,232,229,226,
-    242,229,119,128,  5,184,113,  2,154,140,154,206,225,244,225,110,
-      4,154,153,154,162,154,177,154,193,232,229,226,242,229,119,128,
-      5,184,238,225,242,242,239,247,232,229,226,242,229,119,128,  5,
-    184,241,245,225,242,244,229,242,232,229,226,242,229,119,128,  5,
-    184,247,233,228,229,232,229,226,242,229,119,128,  5,184,245,225,
-    242,244,229,242,232,229,226,242,229,119,128,  5,184,247,233,228,
-    229,232,229,226,242,229,119,128,  5,184,242,238,229,249,240,225,
-    242,225,232,229,226,242,229,119,128,  5,159,226,239,240,239,237,
-    239,230,111,128, 49, 17,227,233,242,227,236,101,128, 36,224,232,
-    239,239,107,128,  2,160,237,239,238,239,243,240,225,227,101,128,
-    255, 81,239,102,130,  5,231,155, 43,155, 63,228,225,231,229,243,
-    104,129,251, 71,155, 54,232,229,226,242,229,119,128,251, 71,232,
-    229,226,242,229,119,128,  5,231,240,225,242,229,110,128, 36,172,
-    117,  4,155, 90,155,102,155,191,156, 22,225,242,244,229,242,238,
-    239,244,101,128, 38,105,226,245,244,115,135,  5,187,155,123,155,
-    128,155,133,155,138,155,147,155,162,155,178,177, 56,128,  5,187,
-    178, 53,128,  5,187,179, 49,128,  5,187,232,229,226,242,229,119,
-    128,  5,187,238,225,242,242,239,247,232,229,226,242,229,119,128,
-      5,187,241,245,225,242,244,229,242,232,229,226,242,229,119,128,
-      5,187,247,233,228,229,232,229,226,242,229,119,128,  5,187,229,
-    243,244,233,239,110,133,  0, 63,155,210,155,233,155,250,156,  2,
-    156, 14,225,114,  2,155,217,155,224,225,226,233, 99,128,  6, 31,
-    237,229,238,233,225,110,128,  5, 94,228,239,247,110,129,  0,191,
-    155,242,243,237,225,236,108,128,247,191,231,242,229,229,107,128,
-      3,126,237,239,238,239,243,240,225,227,101,128,255, 31,243,237,
-    225,236,108,128,247, 63,239,244,101,  4,156, 34,156,105,156,125,
-    156,154,228,226,108,133,  0, 34,156, 50,156, 57,156, 64,156, 76,
-    156, 97,226,225,243,101,128, 32, 30,236,229,230,116,128, 32, 28,
-    237,239,238,239,243,240,225,227,101,128,255,  2,240,242,233,237,
-    101,129, 48, 30,156, 86,242,229,246,229,242,243,229,100,128, 48,
-     29,242,233,231,232,116,128, 32, 29,236,229,230,116,129, 32, 24,
-    156,114,242,229,246,229,242,243,229,100,128, 32, 27,114,  2,156,
-    131,156,141,229,246,229,242,243,229,100,128, 32, 27,233,231,232,
-    116,129, 32, 25,156,150,110,128,  1, 73,243,233,238,231,108,  2,
-    156,164,156,171,226,225,243,101,128, 32, 26,101,129,  0, 39,156,
-    177,237,239,238,239,243,240,225,227,101,128,255,  7,114,145,  0,
-    114,156,227,157,231,157,242,158, 33,158, 84,159,101,159,125,159,
-    220,161,254,162, 35,162, 47,162,101,162,109,163, 15,163, 26,163,
-     61,163,161, 97, 11,156,251,157,  6,157, 16,157, 23,157, 88,157,
-    104,157,129,157,140,157,165,157,188,157,225,225,242,237,229,238,
-    233,225,110,128,  5,124,226,229,238,231,225,236,105,128,  9,176,
-    227,245,244,101,128,  1, 85,100,  4,157, 33,157, 39,157, 53,157,
-     79,229,246, 97,128,  9, 48,233,227,225,108,129, 34, 26,157, 48,
-    229,120,128,248,229,239,246,229,242,243,243,241,245,225,242,101,
-    129, 51,174,157, 69,228,243,241,245,225,242,101,128, 51,175,243,
-    241,245,225,242,101,128, 51,173,230,101,129,  5,191,157, 95,232,
-    229,226,242,229,119,128,  5,191,231,117,  2,157,111,157,120,234,
-    225,242,225,244,105,128, 10,176,242,237,245,235,232,105,128, 10,
-     48,232,233,242,225,231,225,238, 97,128, 48,137,235,225,244,225,
-    235,225,238, 97,129, 48,233,157,153,232,225,236,230,247,233,228,
-    244,104,128,255,151,236,239,247,229,242,228,233,225,231,239,238,
-    225,236,226,229,238,231,225,236,105,128,  9,241,109,  2,157,194,
-    157,217,233,228,228,236,229,228,233,225,231,239,238,225,236,226,
-    229,238,231,225,236,105,128,  9,240,243,232,239,242,110,128,  2,
-    100,244,233,111,128, 34, 54,226,239,240,239,237,239,230,111,128,
-     49, 22, 99,  4,157,252,158,  3,158, 12,158, 20,225,242,239,110,
-    128,  1, 89,229,228,233,236,236, 97,128,  1, 87,233,242,227,236,
-    101,128, 36,225,239,237,237,225,225,227,227,229,238,116,128,  1,
-     87,100,  2,158, 39,158, 49,226,236,231,242,225,246,101,128,  2,
-     17,239,116,  2,158, 56,158, 65,225,227,227,229,238,116,128, 30,
-     89,226,229,236,239,119,129, 30, 91,158, 75,237,225,227,242,239,
-    110,128, 30, 93,101,  6,158, 98,158,143,158,178,158,233,159,  2,
-    159, 35,102,  2,158,104,158,117,229,242,229,238,227,229,237,225,
-    242,107,128, 32, 59,236,229,248,243,117,  2,158,127,158,134,226,
-    243,229,116,128, 34,134,240,229,242,243,229,116,128, 34,135,231,
-    233,243,244,229,114,  2,158,154,158,159,229,100,128,  0,174,115,
-      2,158,165,158,171,225,238,115,128,248,232,229,242,233,102,128,
-    246,218,104,  3,158,186,158,209,158,223,225,114,  2,158,193,158,
-    200,225,226,233, 99,128,  6, 49,237,229,238,233,225,110,128,  5,
-    128,230,233,238,225,236,225,242,225,226,233, 99,128,254,174,233,
-    242,225,231,225,238, 97,128, 48,140,235,225,244,225,235,225,238,
-     97,129, 48,236,158,246,232,225,236,230,247,233,228,244,104,128,
-    255,154,243,104,130,  5,232,159, 11,159, 26,228,225,231,229,243,
-    232,232,229,226,242,229,119,128,251, 72,232,229,226,242,229,119,
-    128,  5,232,118,  3,159, 43,159, 56,159, 88,229,242,243,229,228,
-    244,233,236,228,101,128, 34, 61,233, 97,  2,159, 63,159, 72,232,
-    229,226,242,229,119,128,  5,151,237,245,231,242,225,243,232,232,
-    229,226,242,229,119,128,  5,151,236,239,231,233,227,225,236,238,
-    239,116,128, 35, 16,230,233,243,232,232,239,239,107,129,  2,126,
-    159,114,242,229,246,229,242,243,229,100,128,  2,127,104,  2,159,
-    131,159,154, 97,  2,159,137,159,147,226,229,238,231,225,236,105,
-    128,  9,221,228,229,246, 97,128,  9, 93,111,131,  3,193,159,164,
-    159,193,159,207,239,107,129,  2,125,159,171,244,245,242,238,229,
-    100,129,  2,123,159,182,243,245,240,229,242,233,239,114,128,  2,
-    181,243,249,237,226,239,236,231,242,229,229,107,128,  3,241,244,
-    233,227,232,239,239,235,237,239,100,128,  2,222,105,  6,159,234,
-    161, 22,161, 68,161, 79,161,104,161,240,229,245,108,  9,160,  0,
-    160, 35,160, 50,160, 64,160,110,160,124,160,210,160,223,161,  2,
-     97,  2,160,  6,160, 21,227,233,242,227,236,229,235,239,242,229,
-    225,110,128, 50,113,240,225,242,229,238,235,239,242,229,225,110,
-    128, 50, 17,227,233,242,227,236,229,235,239,242,229,225,110,128,
-     50, 99,232,233,229,245,232,235,239,242,229,225,110,128, 49, 64,
-    107,  2,160, 70,160,102,233,249,229,239,107,  2,160, 80,160, 89,
-    235,239,242,229,225,110,128, 49, 58,243,233,239,243,235,239,242,
-    229,225,110,128, 49,105,239,242,229,225,110,128, 49, 57,237,233,
-    229,245,237,235,239,242,229,225,110,128, 49, 59,112,  3,160,132,
-    160,164,160,179, 97,  2,160,138,160,152,238,243,233,239,243,235,
-    239,242,229,225,110,128, 49,108,242,229,238,235,239,242,229,225,
-    110,128, 50,  3,232,233,229,245,240,232,235,239,242,229,225,110,
-    128, 49, 63,233,229,245,112,  2,160,188,160,197,235,239,242,229,
-    225,110,128, 49, 60,243,233,239,243,235,239,242,229,225,110,128,
-     49,107,243,233,239,243,235,239,242,229,225,110,128, 49, 61,116,
-      2,160,229,160,244,232,233,229,245,244,232,235,239,242,229,225,
-    110,128, 49, 62,233,235,229,245,244,235,239,242,229,225,110,128,
-     49,106,249,229,239,242,233,238,232,233,229,245,232,235,239,242,
-    229,225,110,128, 49,109,231,232,116,  2,161, 30,161, 38,225,238,
-    231,236,101,128, 34, 31,116,  2,161, 44,161, 58,225,227,235,226,
-    229,236,239,247,227,237, 98,128,  3, 25,242,233,225,238,231,236,
-    101,128, 34,191,232,233,242,225,231,225,238, 97,128, 48,138,235,
-    225,244,225,235,225,238, 97,129, 48,234,161, 92,232,225,236,230,
-    247,233,228,244,104,128,255,152,110,  2,161,110,161,226,103,131,
-      2,218,161,120,161,131,161,137,226,229,236,239,247,227,237, 98,
-    128,  3, 37,227,237, 98,128,  3, 10,232,225,236,102,  2,161,146,
-    161,192,236,229,230,116,131,  2,191,161,159,161,170,161,181,225,
-    242,237,229,238,233,225,110,128,  5, 89,226,229,236,239,247,227,
-    237, 98,128,  3, 28,227,229,238,244,229,242,229,100,128,  2,211,
-    242,233,231,232,116,130,  2,190,161,204,161,215,226,229,236,239,
-    247,227,237, 98,128,  3, 57,227,229,238,244,229,242,229,100,128,
-      2,210,246,229,242,244,229,228,226,242,229,246,101,128,  2, 19,
-    244,244,239,242,245,243,241,245,225,242,101,128, 51, 81,108,  2,
-    162,  4,162, 15,233,238,229,226,229,236,239,119,128, 30, 95,239,
-    238,231,236,229,103,129,  2,124,162, 26,244,245,242,238,229,100,
-    128,  2,122,237,239,238,239,243,240,225,227,101,128,255, 82,111,
-      3,162, 55,162, 66,162, 91,232,233,242,225,231,225,238, 97,128,
-     48,141,235,225,244,225,235,225,238, 97,129, 48,237,162, 79,232,
-    225,236,230,247,233,228,244,104,128,255,155,242,245,225,244,232,
-    225,105,128, 14, 35,240,225,242,229,110,128, 36,173,114,  3,162,
-    117,162,153,162,183, 97,  3,162,125,162,135,162,142,226,229,238,
-    231,225,236,105,128,  9,220,228,229,246, 97,128,  9, 49,231,245,
-    242,237,245,235,232,105,128, 10, 92,229,104,  2,162,160,162,169,
-    225,242,225,226,233, 99,128,  6,145,230,233,238,225,236,225,242,
-    225,226,233, 99,128,251,141,246,239,227,225,236,233, 99,  4,162,
-    199,162,209,162,216,162,227,226,229,238,231,225,236,105,128,  9,
-    224,228,229,246, 97,128,  9, 96,231,245,234,225,242,225,244,105,
-    128, 10,224,246,239,247,229,236,243,233,231,110,  3,162,243,162,
-    253,163,  4,226,229,238,231,225,236,105,128,  9,196,228,229,246,
-     97,128,  9, 68,231,245,234,225,242,225,244,105,128, 10,196,243,
-    245,240,229,242,233,239,114,128,246,241,116,  2,163, 32,163, 40,
-    226,236,239,227,107,128, 37,144,245,242,238,229,100,129,  2,121,
-    163, 50,243,245,240,229,242,233,239,114,128,  2,180,117,  4,163,
-     71,163, 82,163,107,163,154,232,233,242,225,231,225,238, 97,128,
-     48,139,235,225,244,225,235,225,238, 97,129, 48,235,163, 95,232,
-    225,236,230,247,233,228,244,104,128,255,153,112,  2,163,113,163,
-    148,229,101,  2,163,120,163,134,237,225,242,235,226,229,238,231,
-    225,236,105,128,  9,242,243,233,231,238,226,229,238,231,225,236,
-    105,128,  9,243,233,225,104,128,246,221,244,232,225,105,128, 14,
-     36,246,239,227,225,236,233, 99,  4,163,177,163,187,163,194,163,
-    205,226,229,238,231,225,236,105,128,  9,139,228,229,246, 97,128,
-      9, 11,231,245,234,225,242,225,244,105,128, 10,139,246,239,247,
-    229,236,243,233,231,110,  3,163,221,163,231,163,238,226,229,238,
-    231,225,236,105,128,  9,195,228,229,246, 97,128,  9, 67,231,245,
-    234,225,242,225,244,105,128, 10,195,115,147,  0,115,164, 35,166,
-      5,166, 16,166,142,166,181,169,123,169,134,172, 21,174,159,174,
-    205,174,232,175,167,175,234,177, 11,177, 21,177,207,178, 24,178,
-    194,178,204, 97,  9,164, 55,164, 65,164, 86,164,158,164,183,164,
-    194,164,219,164,251,165, 35,226,229,238,231,225,236,105,128,  9,
-    184,227,245,244,101,129,  1, 91,164, 74,228,239,244,225,227,227,
-    229,238,116,128, 30,101,100,  5,164, 98,164,107,164,113,164,127,
-    164,143,225,242,225,226,233, 99,128,  6, 53,229,246, 97,128,  9,
-     56,230,233,238,225,236,225,242,225,226,233, 99,128,254,186,233,
-    238,233,244,233,225,236,225,242,225,226,233, 99,128,254,187,237,
-    229,228,233,225,236,225,242,225,226,233, 99,128,254,188,231,117,
-      2,164,165,164,174,234,225,242,225,244,105,128, 10,184,242,237,
-    245,235,232,105,128, 10, 56,232,233,242,225,231,225,238, 97,128,
-     48, 85,235,225,244,225,235,225,238, 97,129, 48,181,164,207,232,
-    225,236,230,247,233,228,244,104,128,255,123,236,236,225,236,236,
-    225,232,239,245,225,236,225,249,232,229,247,225,243,225,236,236,
-    225,237,225,242,225,226,233, 99,128,253,250,237,229,235,104,130,
-      5,225,165,  6,165, 26,228,225,231,229,243,104,129,251, 65,165,
-     17,232,229,226,242,229,119,128,251, 65,232,229,226,242,229,119,
-    128,  5,225,242, 97,  5,165, 48,165,122,165,130,165,180,165,188,
-     97,  5,165, 60,165, 68,165, 76,165,107,165,115,225,244,232,225,
-    105,128, 14, 50,229,244,232,225,105,128, 14, 65,233,237,225,233,
-    109,  2,165, 86,165, 97,225,236,225,233,244,232,225,105,128, 14,
-     68,245,225,238,244,232,225,105,128, 14, 67,237,244,232,225,105,
-    128, 14, 51,244,232,225,105,128, 14, 48,229,244,232,225,105,128,
-     14, 64,105,  3,165,138,165,162,165,173,105,  2,165,144,165,155,
-    236,229,230,244,244,232,225,105,128,248,134,244,232,225,105,128,
-     14, 53,236,229,230,244,244,232,225,105,128,248,133,244,232,225,
-    105,128, 14, 52,239,244,232,225,105,128, 14, 66,117,  3,165,196,
-    165,246,165,253,101,  3,165,204,165,228,165,239,101,  2,165,210,
-    165,221,236,229,230,244,244,232,225,105,128,248,136,244,232,225,
-    105,128, 14, 55,236,229,230,244,244,232,225,105,128,248,135,244,
-    232,225,105,128, 14, 54,244,232,225,105,128, 14, 56,245,244,232,
-    225,105,128, 14, 57,226,239,240,239,237,239,230,111,128, 49, 25,
-     99,  5,166, 28,166, 49,166, 58,166,107,166,129,225,242,239,110,
-    129,  1, 97,166, 37,228,239,244,225,227,227,229,238,116,128, 30,
-    103,229,228,233,236,236, 97,128,  1, 95,232,247, 97,131,  2, 89,
-    166, 70,166, 81,166,100,227,249,242,233,236,236,233, 99,128,  4,
-    217,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233,
-     99,128,  4,219,232,239,239,107,128,  2, 90,233,242, 99,  2,166,
-    115,166,120,236,101,128, 36,226,245,237,230,236,229,120,128,  1,
-     93,239,237,237,225,225,227,227,229,238,116,128,  2, 25,228,239,
-    116,  2,166,150,166,159,225,227,227,229,238,116,128, 30, 97,226,
-    229,236,239,119,129, 30, 99,166,169,228,239,244,225,227,227,229,
-    238,116,128, 30,105,101,  9,166,201,166,217,166,252,167, 61,167,
-    164,167,191,167,216,168, 41,168, 68,225,231,245,236,236,226,229,
-    236,239,247,227,237, 98,128,  3, 60, 99,  2,166,223,166,245,239,
-    238,100,129, 32, 51,166,231,244,239,238,229,227,232,233,238,229,
-    243,101,128,  2,202,244,233,239,110,128,  0,167,229,110,  4,167,
-      7,167, 16,167, 30,167, 46,225,242,225,226,233, 99,128,  6, 51,
-    230,233,238,225,236,225,242,225,226,233, 99,128,254,178,233,238,
-    233,244,233,225,236,225,242,225,226,233, 99,128,254,179,237,229,
-    228,233,225,236,225,242,225,226,233, 99,128,254,180,231,239,108,
-    135,  5,182,167, 81,167, 95,167,100,167,109,167,124,167,140,167,
-    151, 49,  2,167, 87,167, 91, 51,128,  5,182,102,128,  5,182,178,
-     99,128,  5,182,232,229,226,242,229,119,128,  5,182,238,225,242,
-    242,239,247,232,229,226,242,229,119,128,  5,182,241,245,225,242,
-    244,229,242,232,229,226,242,229,119,128,  5,182,244,225,232,229,
-    226,242,229,119,128,  5,146,247,233,228,229,232,229,226,242,229,
-    119,128,  5,182,104,  2,167,170,167,181,225,242,237,229,238,233,
-    225,110,128,  5,125,233,242,225,231,225,238, 97,128, 48, 91,235,
-    225,244,225,235,225,238, 97,129, 48,187,167,204,232,225,236,230,
-    247,233,228,244,104,128,255,126,237,105,  2,167,223,168, 10,227,
-    239,236,239,110,131,  0, 59,167,237,167,246,168,  2,225,242,225,
-    226,233, 99,128,  6, 27,237,239,238,239,243,240,225,227,101,128,
-    255, 27,243,237,225,236,108,128,254, 84,246,239,233,227,229,228,
-    237,225,242,235,235,225,238, 97,129, 48,156,168, 29,232,225,236,
-    230,247,233,228,244,104,128,255,159,238,116,  2,168, 48,168, 58,
-    233,243,241,245,225,242,101,128, 51, 34,239,243,241,245,225,242,
-    101,128, 51, 35,246,229,110,142,  0, 55,168,102,168,111,168,121,
-    168,151,168,158,168,168,168,193,168,220,168,254,169, 10,169, 21,
-    169, 54,169, 62,169, 73,225,242,225,226,233, 99,128,  6,103,226,
-    229,238,231,225,236,105,128,  9,237,227,233,242,227,236,101,129,
-     36,102,168,132,233,238,246,229,242,243,229,243,225,238,243,243,
-    229,242,233,102,128, 39,144,228,229,246, 97,128,  9,109,229,233,
-    231,232,244,232,115,128, 33, 94,231,117,  2,168,175,168,184,234,
-    225,242,225,244,105,128, 10,237,242,237,245,235,232,105,128, 10,
-    109,232, 97,  2,168,200,168,211,227,235,225,242,225,226,233, 99,
-    128,  6,103,238,231,250,232,239,117,128, 48, 39,105,  2,168,226,
-    168,244,228,229,239,231,242,225,240,232,233,227,240,225,242,229,
-    110,128, 50, 38,238,230,229,242,233,239,114,128, 32,135,237,239,
-    238,239,243,240,225,227,101,128,255, 23,239,236,228,243,244,249,
-    236,101,128,247, 55,112,  2,169, 27,169, 34,225,242,229,110,128,
-     36,122,229,114,  2,169, 41,169, 47,233,239,100,128, 36,142,243,
-    233,225,110,128,  6,247,242,239,237,225,110,128, 33,118,243,245,
-    240,229,242,233,239,114,128, 32,119,116,  2,169, 79,169,117,229,
-    229,110,  2,169, 87,169, 96,227,233,242,227,236,101,128, 36,112,
-    112,  2,169,102,169,109,225,242,229,110,128, 36,132,229,242,233,
-    239,100,128, 36,152,232,225,105,128, 14, 87,230,244,232,249,240,
-    232,229,110,128,  0,173,104,  7,169,150,170,124,170,135,170,149,
-    171, 94,171,107,172, 15, 97,  6,169,164,169,175,169,185,169,196,
-    170, 83,170,108,225,242,237,229,238,233,225,110,128,  5,119,226,
-    229,238,231,225,236,105,128,  9,182,227,249,242,233,236,236,233,
-     99,128,  4, 72,100,  2,169,202,170, 42,228, 97,  4,169,213,169,
-    222,169,253,170, 11,225,242,225,226,233, 99,128,  6, 81,228,225,
-    237,237, 97,  2,169,232,169,241,225,242,225,226,233, 99,128,252,
-     97,244,225,238,225,242,225,226,233, 99,128,252, 94,230,225,244,
-    232,225,225,242,225,226,233, 99,128,252, 96,235,225,243,242, 97,
-      2,170, 21,170, 30,225,242,225,226,233, 99,128,252, 98,244,225,
-    238,225,242,225,226,233, 99,128,252, 95,101,132, 37,146,170, 54,
-    170, 61,170, 69,170, 78,228,225,242,107,128, 37,147,236,233,231,
-    232,116,128, 37,145,237,229,228,233,245,109,128, 37,146,246, 97,
-    128,  9, 54,231,117,  2,170, 90,170, 99,234,225,242,225,244,105,
-    128, 10,182,242,237,245,235,232,105,128, 10, 54,236,243,232,229,
-    236,229,244,232,229,226,242,229,119,128,  5,147,226,239,240,239,
-    237,239,230,111,128, 49, 21,227,232,225,227,249,242,233,236,236,
-    233, 99,128,  4, 73,101,  4,170,159,170,224,170,234,170,251,229,
-    110,  4,170,170,170,179,170,193,170,209,225,242,225,226,233, 99,
-    128,  6, 52,230,233,238,225,236,225,242,225,226,233, 99,128,254,
-    182,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,254,
-    183,237,229,228,233,225,236,225,242,225,226,233, 99,128,254,184,
-    233,227,239,240,244,233, 99,128,  3,227,241,229,108,129, 32,170,
-    170,242,232,229,226,242,229,119,128, 32,170,246, 97,134,  5,176,
-    171, 12,171, 27,171, 41,171, 50,171, 65,171, 81, 49,  2,171, 18,
-    171, 23,177, 53,128,  5,176, 53,128,  5,176, 50,  2,171, 33,171,
-     37, 50,128,  5,176,101,128,  5,176,232,229,226,242,229,119,128,
-      5,176,238,225,242,242,239,247,232,229,226,242,229,119,128,  5,
-    176,241,245,225,242,244,229,242,232,229,226,242,229,119,128,  5,
-    176,247,233,228,229,232,229,226,242,229,119,128,  5,176,232,225,
-    227,249,242,233,236,236,233, 99,128,  4,187,105,  2,171,113,171,
-    124,237,225,227,239,240,244,233, 99,128,  3,237,110,131,  5,233,
-    171,134,171,217,171,226,100,  2,171,140,171,206,225,231,229,243,
-    104,130,251, 73,171,152,171,161,232,229,226,242,229,119,128,251,
-     73,115,  2,171,167,171,187,232,233,238,228,239,116,129,251, 44,
-    171,178,232,229,226,242,229,119,128,251, 44,233,238,228,239,116,
-    129,251, 45,171,197,232,229,226,242,229,119,128,251, 45,239,244,
-    232,229,226,242,229,119,128,  5,193,232,229,226,242,229,119,128,
-      5,233,115,  2,171,232,171,252,232,233,238,228,239,116,129,251,
-     42,171,243,232,229,226,242,229,119,128,251, 42,233,238,228,239,
-    116,129,251, 43,172,  6,232,229,226,242,229,119,128,251, 43,239,
-    239,107,128,  2,130,105,  8,172, 39,172, 83,172, 94,172,119,172,
-    149,172,157,172,170,173, 85,231,237, 97,131,  3,195,172, 51,172,
-     55,172, 63, 49,128,  3,194,230,233,238,225,108,128,  3,194,236,
-    245,238,225,244,229,243,249,237,226,239,236,231,242,229,229,107,
-    128,  3,242,232,233,242,225,231,225,238, 97,128, 48, 87,235,225,
-    244,225,235,225,238, 97,129, 48,183,172,107,232,225,236,230,247,
-    233,228,244,104,128,255,124,236,245,113,  2,172,127,172,136,232,
-    229,226,242,229,119,128,  5,189,236,229,230,244,232,229,226,242,
-    229,119,128,  5,189,237,233,236,225,114,128, 34, 60,238,228,239,
-    244,232,229,226,242,229,119,128,  5,194,239,115,  6,172,185,172,
-    220,172,252,173, 24,173, 38,173, 70, 97,  2,172,191,172,206,227,
-    233,242,227,236,229,235,239,242,229,225,110,128, 50,116,240,225,
-    242,229,238,235,239,242,229,225,110,128, 50, 20,227,105,  2,172,
-    227,172,239,229,245,227,235,239,242,229,225,110,128, 49,126,242,
-    227,236,229,235,239,242,229,225,110,128, 50,102,107,  2,173,  2,
-    173, 16,233,249,229,239,235,235,239,242,229,225,110,128, 49,122,
-    239,242,229,225,110,128, 49, 69,238,233,229,245,238,235,239,242,
-    229,225,110,128, 49,123,112,  2,173, 44,173, 57,225,242,229,238,
-    235,239,242,229,225,110,128, 50,  6,233,229,245,240,235,239,242,
-    229,225,110,128, 49,125,244,233,235,229,245,244,235,239,242,229,
-    225,110,128, 49,124,120,141,  0, 54,173,115,173,124,173,134,173,
-    164,173,171,173,196,173,223,174,  1,174, 13,174, 24,174, 57,174,
-     65,174, 76,225,242,225,226,233, 99,128,  6,102,226,229,238,231,
-    225,236,105,128,  9,236,227,233,242,227,236,101,129, 36,101,173,
-    145,233,238,246,229,242,243,229,243,225,238,243,243,229,242,233,
-    102,128, 39,143,228,229,246, 97,128,  9,108,231,117,  2,173,178,
-    173,187,234,225,242,225,244,105,128, 10,236,242,237,245,235,232,
-    105,128, 10,108,232, 97,  2,173,203,173,214,227,235,225,242,225,
-    226,233, 99,128,  6,102,238,231,250,232,239,117,128, 48, 38,105,
-      2,173,229,173,247,228,229,239,231,242,225,240,232,233,227,240,
-    225,242,229,110,128, 50, 37,238,230,229,242,233,239,114,128, 32,
-    134,237,239,238,239,243,240,225,227,101,128,255, 22,239,236,228,
-    243,244,249,236,101,128,247, 54,112,  2,174, 30,174, 37,225,242,
-    229,110,128, 36,121,229,114,  2,174, 44,174, 50,233,239,100,128,
-     36,141,243,233,225,110,128,  6,246,242,239,237,225,110,128, 33,
-    117,243,245,240,229,242,233,239,114,128, 32,118,116,  2,174, 82,
-    174,153,229,229,110,  2,174, 90,174,132, 99,  2,174, 96,174,104,
-    233,242,227,236,101,128, 36,111,245,242,242,229,238,227,249,228,
-    229,238,239,237,233,238,225,244,239,242,226,229,238,231,225,236,
-    105,128,  9,249,112,  2,174,138,174,145,225,242,229,110,128, 36,
-    131,229,242,233,239,100,128, 36,151,232,225,105,128, 14, 86,108,
-      2,174,165,174,185,225,243,104,129,  0, 47,174,173,237,239,238,
-    239,243,240,225,227,101,128,255, 15,239,238,103,129,  1,127,174,
-    193,228,239,244,225,227,227,229,238,116,128, 30,155,109,  2,174,
-    211,174,221,233,236,229,230,225,227,101,128, 38, 58,239,238,239,
-    243,240,225,227,101,128,255, 83,111,  6,174,246,175, 40,175, 51,
-    175, 76,175,121,175,132,102,  2,174,252,175, 10,240,225,243,245,
-    241,232,229,226,242,229,119,128,  5,195,116,  2,175, 16,175, 25,
-    232,249,240,232,229,110,128,  0,173,243,233,231,238,227,249,242,
-    233,236,236,233, 99,128,  4, 76,232,233,242,225,231,225,238, 97,
-    128, 48, 93,235,225,244,225,235,225,238, 97,129, 48,189,175, 64,
-    232,225,236,230,247,233,228,244,104,128,255,127,236,233,228,245,
-    115,  2,175, 86,175,103,236,239,238,231,239,246,229,242,236,225,
-    249,227,237, 98,128,  3, 56,243,232,239,242,244,239,246,229,242,
-    236,225,249,227,237, 98,128,  3, 55,242,245,243,233,244,232,225,
-    105,128, 14, 41,115,  3,175,140,175,150,175,158,225,236,225,244,
-    232,225,105,128, 14, 40,239,244,232,225,105,128, 14, 11,245,225,
-    244,232,225,105,128, 14, 42,240, 97,  3,175,176,175,196,175,228,
-    227,101,129,  0, 32,175,183,232,225,227,235,225,242,225,226,233,
-     99,128,  0, 32,228,101,129, 38, 96,175,203,243,245,233,116,  2,
-    175,212,175,220,226,236,225,227,107,128, 38, 96,247,232,233,244,
-    101,128, 38,100,242,229,110,128, 36,174,241,245,225,242,101, 11,
-    176,  6,176, 17,176, 31,176, 56,176, 73,176, 99,176,114,176,147,
-    176,174,176,230,176,245,226,229,236,239,247,227,237, 98,128,  3,
-     59, 99,  2,176, 23,176, 27, 99,128, 51,196,109,128, 51,157,228,
-    233,225,231,239,238,225,236,227,242,239,243,243,232,225,244,227,
-    232,230,233,236,108,128, 37,169,232,239,242,233,250,239,238,244,
-    225,236,230,233,236,108,128, 37,164,107,  2,176, 79,176, 83,103,
-    128, 51,143,109,129, 51,158,176, 89,227,225,240,233,244,225,108,
-    128, 51,206,108,  2,176,105,176,109,110,128, 51,209,239,103,128,
-     51,210,109,  4,176,124,176,128,176,133,176,137,103,128, 51,142,
-    233,108,128, 51,213,109,128, 51,156,243,241,245,225,242,229,100,
-    128, 51,161,239,242,244,232,239,231,239,238,225,236,227,242,239,
-    243,243,232,225,244,227,232,230,233,236,108,128, 37,166,245,240,
-    240,229,114,  2,176,184,176,207,236,229,230,244,244,239,236,239,
-    247,229,242,242,233,231,232,244,230,233,236,108,128, 37,167,242,
-    233,231,232,244,244,239,236,239,247,229,242,236,229,230,244,230,
-    233,236,108,128, 37,168,246,229,242,244,233,227,225,236,230,233,
-    236,108,128, 37,165,247,232,233,244,229,247,233,244,232,243,237,
-    225,236,236,226,236,225,227,107,128, 37,163,242,243,241,245,225,
-    242,101,128, 51,219,115,  2,177, 27,177,197, 97,  4,177, 37,177,
-     47,177, 54,177, 65,226,229,238,231,225,236,105,128,  9,183,228,
-    229,246, 97,128,  9, 55,231,245,234,225,242,225,244,105,128, 10,
-    183,238,103,  8,177, 84,177, 98,177,112,177,126,177,141,177,155,
-    177,169,177,182,227,233,229,245,227,235,239,242,229,225,110,128,
-     49, 73,232,233,229,245,232,235,239,242,229,225,110,128, 49,133,
-    233,229,245,238,231,235,239,242,229,225,110,128, 49,128,235,233,
-    249,229,239,235,235,239,242,229,225,110,128, 49, 50,238,233,229,
-    245,238,235,239,242,229,225,110,128, 49,101,240,233,229,245,240,
-    235,239,242,229,225,110,128, 49, 67,243,233,239,243,235,239,242,
-    229,225,110,128, 49, 70,244,233,235,229,245,244,235,239,242,229,
-    225,110,128, 49, 56,245,240,229,242,233,239,114,128,246,242,116,
-      2,177,213,177,236,229,242,236,233,238,103,129,  0,163,177,224,
-    237,239,238,239,243,240,225,227,101,128,255,225,242,239,235,101,
-      2,177,245,178,  6,236,239,238,231,239,246,229,242,236,225,249,
-    227,237, 98,128,  3, 54,243,232,239,242,244,239,246,229,242,236,
-    225,249,227,237, 98,128,  3, 53,117,  7,178, 40,178, 72,178, 94,
-    178,105,178,146,178,156,178,160,226,243,229,116,130, 34,130,178,
-     51,178, 62,238,239,244,229,241,245,225,108,128, 34,138,239,242,
-    229,241,245,225,108,128, 34,134, 99,  2,178, 78,178, 86,227,229,
-    229,228,115,128, 34,123,232,244,232,225,116,128, 34, 11,232,233,
-    242,225,231,225,238, 97,128, 48, 89,107,  2,178,111,178,135,225,
-    244,225,235,225,238, 97,129, 48,185,178,123,232,225,236,230,247,
-    233,228,244,104,128,255,125,245,238,225,242,225,226,233, 99,128,
-      6, 82,237,237,225,244,233,239,110,128, 34, 17,110,128, 38, 60,
-    240,229,242,243,229,116,130, 34,131,178,173,178,184,238,239,244,
-    229,241,245,225,108,128, 34,139,239,242,229,241,245,225,108,128,
-     34,135,246,243,241,245,225,242,101,128, 51,220,249,239,245,247,
-    225,229,242,225,243,241,245,225,242,101,128, 51,124,116,144,  0,
-    116,179,  1,180, 10,180, 31,180,174,180,214,183,  6,186,144,187,
-    219,187,231,187,243,189, 20,189, 45,189,131,190, 55,190,239,191,
-     73, 97, 10,179, 23,179, 33,179, 54,179, 61,179, 86,179,164,179,
-    181,179,206,179,220,179,224,226,229,238,231,225,236,105,128,  9,
-    164,227,107,  2,179, 40,179, 47,228,239,247,110,128, 34,164,236,
-    229,230,116,128, 34,163,228,229,246, 97,128,  9, 36,231,117,  2,
-    179, 68,179, 77,234,225,242,225,244,105,128, 10,164,242,237,245,
-    235,232,105,128, 10, 36,104,  4,179, 96,179,105,179,119,179,149,
-    225,242,225,226,233, 99,128,  6, 55,230,233,238,225,236,225,242,
-    225,226,233, 99,128,254,194,105,  2,179,125,179,140,238,233,244,
-    233,225,236,225,242,225,226,233, 99,128,254,195,242,225,231,225,
-    238, 97,128, 48, 95,237,229,228,233,225,236,225,242,225,226,233,
-     99,128,254,196,233,243,249,239,245,229,242,225,243,241,245,225,
-    242,101,128, 51,125,235,225,244,225,235,225,238, 97,129, 48,191,
-    179,194,232,225,236,230,247,233,228,244,104,128,255,128,244,247,
-    229,229,236,225,242,225,226,233, 99,128,  6, 64,117,128,  3,196,
-    118,130,  5,234,179,232,180,  1,228,225,231,229,115,129,251, 74,
-    179,242,104,129,251, 74,179,248,232,229,226,242,229,119,128,251,
-     74,232,229,226,242,229,119,128,  5,234, 98,  2,180, 16,180, 21,
-    225,114,128,  1,103,239,240,239,237,239,230,111,128, 49, 10, 99,
-      6,180, 45,180, 52,180, 59,180, 68,180,134,180,161,225,242,239,
-    110,128,  1,101,227,245,242,108,128,  2,168,229,228,233,236,236,
-     97,128,  1, 99,232,229,104,  4,180, 80,180, 89,180,103,180,119,
-    225,242,225,226,233, 99,128,  6,134,230,233,238,225,236,225,242,
-    225,226,233, 99,128,251,123,233,238,233,244,233,225,236,225,242,
-    225,226,233, 99,128,251,124,237,229,228,233,225,236,225,242,225,
-    226,233, 99,128,251,125,233,242, 99,  2,180,142,180,147,236,101,
-    128, 36,227,245,237,230,236,229,248,226,229,236,239,119,128, 30,
-    113,239,237,237,225,225,227,227,229,238,116,128,  1, 99,100,  2,
-    180,180,180,190,233,229,242,229,243,233,115,128, 30,151,239,116,
-      2,180,197,180,206,225,227,227,229,238,116,128, 30,107,226,229,
-    236,239,119,128, 30,109,101,  9,180,234,180,245,181,  9,182, 19,
-    182, 44,182,108,182,175,182,180,182,232,227,249,242,233,236,236,
-    233, 99,128,  4, 66,228,229,243,227,229,238,228,229,242,227,249,
-    242,233,236,236,233, 99,128,  4,173,104,  7,181, 25,181, 34,181,
-     48,181, 88,181,118,181,159,182,  1,225,242,225,226,233, 99,128,
-      6, 42,230,233,238,225,236,225,242,225,226,233, 99,128,254,150,
-    232,225,232,105,  2,181, 57,181, 72,238,233,244,233,225,236,225,
-    242,225,226,233, 99,128,252,162,243,239,236,225,244,229,228,225,
-    242,225,226,233, 99,128,252, 12,105,  2,181, 94,181,109,238,233,
-    244,233,225,236,225,242,225,226,233, 99,128,254,151,242,225,231,
-    225,238, 97,128, 48,102,234,229,229,237,105,  2,181,128,181,143,
-    238,233,244,233,225,236,225,242,225,226,233, 99,128,252,161,243,
-    239,236,225,244,229,228,225,242,225,226,233, 99,128,252, 11,109,
-      2,181,165,181,199,225,242,226,245,244, 97,  2,181,176,181,185,
-    225,242,225,226,233, 99,128,  6, 41,230,233,238,225,236,225,242,
-    225,226,233, 99,128,254,148,101,  2,181,205,181,218,228,233,225,
-    236,225,242,225,226,233, 99,128,254,152,229,237,105,  2,181,226,
-    181,241,238,233,244,233,225,236,225,242,225,226,233, 99,128,252,
-    164,243,239,236,225,244,229,228,225,242,225,226,233, 99,128,252,
-     14,238,239,239,238,230,233,238,225,236,225,242,225,226,233, 99,
-    128,252,115,235,225,244,225,235,225,238, 97,129, 48,198,182, 32,
-    232,225,236,230,247,233,228,244,104,128,255,131,108,  2,182, 50,
-    182, 69,229,240,232,239,238,101,129, 33, 33,182, 61,226,236,225,
-    227,107,128, 38, 14,233,243,232, 97,  2,182, 78,182, 93,231,229,
-    228,239,236,225,232,229,226,242,229,119,128,  5,160,241,229,244,
-    225,238,225,232,229,226,242,229,119,128,  5,169,110,  4,182,118,
-    182,127,182,146,182,167,227,233,242,227,236,101,128, 36,105,233,
-    228,229,239,231,242,225,240,232,233,227,240,225,242,229,110,128,
-     50, 41,112,  2,182,152,182,159,225,242,229,110,128, 36,125,229,
-    242,233,239,100,128, 36,145,242,239,237,225,110,128, 33,121,243,
-    104,128,  2,167,116,131,  5,216,182,190,182,210,182,219,228,225,
-    231,229,243,104,129,251, 56,182,201,232,229,226,242,229,119,128,
-    251, 56,232,229,226,242,229,119,128,  5,216,243,229,227,249,242,
-    233,236,236,233, 99,128,  4,181,246,233,114,  2,182,240,182,249,
-    232,229,226,242,229,119,128,  5,155,236,229,230,244,232,229,226,
-    242,229,119,128,  5,155,104,  6,183, 20,183,172,184, 38,184,170,
-    185, 77,186,134, 97,  5,183, 32,183, 42,183, 49,183, 74,183,103,
-    226,229,238,231,225,236,105,128,  9,165,228,229,246, 97,128,  9,
-     37,231,117,  2,183, 56,183, 65,234,225,242,225,244,105,128, 10,
-    165,242,237,245,235,232,105,128, 10, 37,108,  2,183, 80,183, 89,
-    225,242,225,226,233, 99,128,  6, 48,230,233,238,225,236,225,242,
-    225,226,233, 99,128,254,172,238,244,232,225,235,232,225,116,  3,
-    183,118,183,149,183,156,236,239,119,  2,183,126,183,137,236,229,
-    230,244,244,232,225,105,128,248,152,242,233,231,232,244,244,232,
-    225,105,128,248,151,244,232,225,105,128, 14, 76,245,240,240,229,
-    242,236,229,230,244,244,232,225,105,128,248,150,101,  3,183,180,
-    183,244,184, 11,104,  4,183,190,183,199,183,213,183,229,225,242,
-    225,226,233, 99,128,  6, 43,230,233,238,225,236,225,242,225,226,
-    233, 99,128,254,154,233,238,233,244,233,225,236,225,242,225,226,
-    233, 99,128,254,155,237,229,228,233,225,236,225,242,225,226,233,
-     99,128,254,156,242,101,  2,183,251,184,  4,229,248,233,243,244,
-    115,128, 34,  3,230,239,242,101,128, 34, 52,244, 97,130,  3,184,
-    184, 20,184, 24, 49,128,  3,209,243,249,237,226,239,236,231,242,
-    229,229,107,128,  3,209,105,  2,184, 44,184,130,229,245,244,104,
-      4,184, 57,184, 92,184,107,184,116, 97,  2,184, 63,184, 78,227,
-    233,242,227,236,229,235,239,242,229,225,110,128, 50,121,240,225,
-    242,229,238,235,239,242,229,225,110,128, 50, 25,227,233,242,227,
-    236,229,235,239,242,229,225,110,128, 50,107,235,239,242,229,225,
-    110,128, 49, 76,240,225,242,229,238,235,239,242,229,225,110,128,
-     50, 11,242,244,229,229,110,  2,184,140,184,149,227,233,242,227,
-    236,101,128, 36,108,112,  2,184,155,184,162,225,242,229,110,128,
-     36,128,229,242,233,239,100,128, 36,148,111,  6,184,184,184,201,
-    184,206,184,220,184,225,185, 22,238,225,238,231,237,239,238,244,
-    232,239,244,232,225,105,128, 14, 17,239,107,128,  1,173,240,232,
-    245,244,232,225,239,244,232,225,105,128, 14, 18,242,110,128,  0,
-    254,244,104,  3,184,234,185,  2,185, 12, 97,  2,184,240,184,250,
-    232,225,238,244,232,225,105,128, 14, 23,238,244,232,225,105,128,
-     14, 16,239,238,231,244,232,225,105,128, 14, 24,245,238,231,244,
-    232,225,105,128, 14, 22,245,243,225,238,100,  2,185, 32,185, 43,
-    227,249,242,233,236,236,233, 99,128,  4,130,243,243,229,240,225,
-    242,225,244,239,114,  2,185, 58,185, 67,225,242,225,226,233, 99,
-    128,  6,108,240,229,242,243,233,225,110,128,  6,108,242,229,101,
-    144,  0, 51,185,115,185,124,185,134,185,164,185,171,185,181,185,
-    206,185,233,186, 11,186, 23,186, 42,186, 53,186, 86,186,108,186,
-    116,186,127,225,242,225,226,233, 99,128,  6, 99,226,229,238,231,
-    225,236,105,128,  9,233,227,233,242,227,236,101,129, 36, 98,185,
-    145,233,238,246,229,242,243,229,243,225,238,243,243,229,242,233,
-    102,128, 39,140,228,229,246, 97,128,  9,105,229,233,231,232,244,
-    232,115,128, 33, 92,231,117,  2,185,188,185,197,234,225,242,225,
-    244,105,128, 10,233,242,237,245,235,232,105,128, 10,105,232, 97,
-      2,185,213,185,224,227,235,225,242,225,226,233, 99,128,  6, 99,
-    238,231,250,232,239,117,128, 48, 35,105,  2,185,239,186,  1,228,
-    229,239,231,242,225,240,232,233,227,240,225,242,229,110,128, 50,
-     34,238,230,229,242,233,239,114,128, 32,131,237,239,238,239,243,
-    240,225,227,101,128,255, 19,238,245,237,229,242,225,244,239,242,
-    226,229,238,231,225,236,105,128,  9,246,239,236,228,243,244,249,
-    236,101,128,247, 51,112,  2,186, 59,186, 66,225,242,229,110,128,
-     36,118,229,114,  2,186, 73,186, 79,233,239,100,128, 36,138,243,
-    233,225,110,128,  6,243,241,245,225,242,244,229,242,115,129,  0,
-    190,186, 99,229,237,228,225,243,104,128,246,222,242,239,237,225,
-    110,128, 33,114,243,245,240,229,242,233,239,114,128,  0,179,244,
-    232,225,105,128, 14, 83,250,243,241,245,225,242,101,128, 51,148,
-    105,  7,186,160,186,171,187, 30,187,128,187,140,187,189,187,206,
-    232,233,242,225,231,225,238, 97,128, 48, 97,107,  2,186,177,186,
-    201,225,244,225,235,225,238, 97,129, 48,193,186,189,232,225,236,
-    230,247,233,228,244,104,128,255,129,229,245,116,  4,186,213,186,
-    248,187,  7,187, 16, 97,  2,186,219,186,234,227,233,242,227,236,
-    229,235,239,242,229,225,110,128, 50,112,240,225,242,229,238,235,
-    239,242,229,225,110,128, 50, 16,227,233,242,227,236,229,235,239,
-    242,229,225,110,128, 50, 98,235,239,242,229,225,110,128, 49, 55,
-    240,225,242,229,238,235,239,242,229,225,110,128, 50,  2,236,228,
-    101,133,  2,220,187, 46,187, 57,187, 74,187, 86,187,114,226,229,
-    236,239,247,227,237, 98,128,  3, 48, 99,  2,187, 63,187, 68,237,
-     98,128,  3,  3,239,237, 98,128,  3,  3,228,239,245,226,236,229,
-    227,237, 98,128,  3, 96,111,  2,187, 92,187,102,240,229,242,225,
-    244,239,114,128, 34, 60,246,229,242,236,225,249,227,237, 98,128,
-      3, 52,246,229,242,244,233,227,225,236,227,237, 98,128,  3, 62,
-    237,229,243,227,233,242,227,236,101,128, 34,151,112,  2,187,146,
-    187,176,229,232, 97,  2,187,154,187,163,232,229,226,242,229,119,
-    128,  5,150,236,229,230,244,232,229,226,242,229,119,128,  5,150,
-    240,233,231,245,242,237,245,235,232,105,128, 10,112,244,236,239,
-    227,249,242,233,236,236,233,227,227,237, 98,128,  4,131,247,238,
-    225,242,237,229,238,233,225,110,128,  5,127,236,233,238,229,226,
-    229,236,239,119,128, 30,111,237,239,238,239,243,240,225,227,101,
-    128,255, 84,111,  7,188,  3,188, 14,188, 25,188, 50,188,170,188,
-    182,189, 10,225,242,237,229,238,233,225,110,128,  5,105,232,233,
-    242,225,231,225,238, 97,128, 48,104,235,225,244,225,235,225,238,
-     97,129, 48,200,188, 38,232,225,236,230,247,233,228,244,104,128,
-    255,132,110,  3,188, 58,188,156,188,161,101,  4,188, 68,188,137,
-    188,144,188,150,226,225,114,  4,188, 80,188,109,188,119,188,128,
-    229,248,244,242, 97,  2,188, 90,188,100,232,233,231,232,237,239,
-    100,128,  2,229,236,239,247,237,239,100,128,  2,233,232,233,231,
-    232,237,239,100,128,  2,230,236,239,247,237,239,100,128,  2,232,
-    237,233,228,237,239,100,128,  2,231,230,233,246,101,128,  1,189,
-    243,233,120,128,  1,133,244,247,111,128,  1,168,239,115,128,  3,
-    132,243,241,245,225,242,101,128, 51, 39,240,225,244,225,235,244,
-    232,225,105,128, 14, 15,242,244,239,233,243,229,243,232,229,236,
-    236,226,242,225,227,235,229,116,  2,188,205,188,235,236,229,230,
-    116,130, 48, 20,188,216,188,224,243,237,225,236,108,128,254, 93,
-    246,229,242,244,233,227,225,108,128,254, 57,242,233,231,232,116,
-    130, 48, 21,188,247,188,255,243,237,225,236,108,128,254, 94,246,
-    229,242,244,233,227,225,108,128,254, 58,244,225,239,244,232,225,
-    105,128, 14, 21,240, 97,  2,189, 27,189, 39,236,225,244,225,236,
-    232,239,239,107,128,  1,171,242,229,110,128, 36,175,114,  3,189,
-     53,189, 84,189, 99,225,228,229,237,225,242,107,129, 33, 34,189,
-     65,115,  2,189, 71,189, 77,225,238,115,128,248,234,229,242,233,
-    102,128,246,219,229,244,242,239,230,236,229,248,232,239,239,107,
-    128,  2,136,233,225,103,  4,189,111,189,116,189,121,189,126,228,
-    110,128, 37,188,236,102,128, 37,196,242,116,128, 37,186,245,112,
-    128, 37,178,115,132,  2,166,189,143,189,182,190, 32,190, 45,225,
-    228,105,130,  5,230,189,153,189,173,228,225,231,229,243,104,129,
-    251, 70,189,164,232,229,226,242,229,119,128,251, 70,232,229,226,
-    242,229,119,128,  5,230,101,  2,189,188,189,199,227,249,242,233,
-    236,236,233, 99,128,  4, 70,242,101,134,  5,181,189,216,189,230,
-    189,235,189,244,190,  3,190, 19, 49,  2,189,222,189,226, 50,128,
-      5,181,101,128,  5,181,178, 98,128,  5,181,232,229,226,242,229,
-    119,128,  5,181,238,225,242,242,239,247,232,229,226,242,229,119,
-    128,  5,181,241,245,225,242,244,229,242,232,229,226,242,229,119,
-    128,  5,181,247,233,228,229,232,229,226,242,229,119,128,  5,181,
-    232,229,227,249,242,233,236,236,233, 99,128,  4, 91,245,240,229,
-    242,233,239,114,128,246,243,116,  4,190, 65,190,115,190,180,190,
-    231, 97,  3,190, 73,190, 83,190, 90,226,229,238,231,225,236,105,
-    128,  9,159,228,229,246, 97,128,  9, 31,231,117,  2,190, 97,190,
-    106,234,225,242,225,244,105,128, 10,159,242,237,245,235,232,105,
-    128, 10, 31,229,104,  4,190,126,190,135,190,149,190,165,225,242,
-    225,226,233, 99,128,  6,121,230,233,238,225,236,225,242,225,226,
-    233, 99,128,251,103,233,238,233,244,233,225,236,225,242,225,226,
-    233, 99,128,251,104,237,229,228,233,225,236,225,242,225,226,233,
-     99,128,251,105,232, 97,  3,190,189,190,199,190,206,226,229,238,
-    231,225,236,105,128,  9,160,228,229,246, 97,128,  9, 32,231,117,
-      2,190,213,190,222,234,225,242,225,244,105,128, 10,160,242,237,
-    245,235,232,105,128, 10, 32,245,242,238,229,100,128,  2,135,117,
-      3,190,247,191,  2,191, 27,232,233,242,225,231,225,238, 97,128,
-     48,100,235,225,244,225,235,225,238, 97,129, 48,196,191, 15,232,
-    225,236,230,247,233,228,244,104,128,255,130,243,237,225,236,108,
-      2,191, 37,191, 48,232,233,242,225,231,225,238, 97,128, 48, 99,
-    235,225,244,225,235,225,238, 97,129, 48,195,191, 61,232,225,236,
-    230,247,233,228,244,104,128,255,111,119,  2,191, 79,191,184,101,
-      2,191, 85,191,133,236,246,101,  3,191, 95,191,104,191,125,227,
-    233,242,227,236,101,128, 36,107,112,  2,191,110,191,117,225,242,
-    229,110,128, 36,127,229,242,233,239,100,128, 36,147,242,239,237,
-    225,110,128, 33,123,238,244,121,  3,191,143,191,152,191,163,227,
-    233,242,227,236,101,128, 36,115,232,225,238,231,250,232,239,117,
-    128, 83, 68,112,  2,191,169,191,176,225,242,229,110,128, 36,135,
-    229,242,233,239,100,128, 36,155,111,142,  0, 50,191,216,191,225,
-    191,235,192,  9,192, 61,192, 86,192,113,192,147,192,159,192,178,
-    192,189,192,222,192,230,192,254,225,242,225,226,233, 99,128,  6,
-     98,226,229,238,231,225,236,105,128,  9,232,227,233,242,227,236,
-    101,129, 36, 97,191,246,233,238,246,229,242,243,229,243,225,238,
-    243,243,229,242,233,102,128, 39,139,100,  2,192, 15,192, 21,229,
-    246, 97,128,  9,104,239,116,  2,192, 28,192, 39,229,238,236,229,
-    225,228,229,114,128, 32, 37,236,229,225,228,229,114,129, 32, 37,
-    192, 50,246,229,242,244,233,227,225,108,128,254, 48,231,117,  2,
-    192, 68,192, 77,234,225,242,225,244,105,128, 10,232,242,237,245,
-    235,232,105,128, 10,104,232, 97,  2,192, 93,192,104,227,235,225,
-    242,225,226,233, 99,128,  6, 98,238,231,250,232,239,117,128, 48,
-     34,105,  2,192,119,192,137,228,229,239,231,242,225,240,232,233,
-    227,240,225,242,229,110,128, 50, 33,238,230,229,242,233,239,114,
-    128, 32,130,237,239,238,239,243,240,225,227,101,128,255, 18,238,
-    245,237,229,242,225,244,239,242,226,229,238,231,225,236,105,128,
-      9,245,239,236,228,243,244,249,236,101,128,247, 50,112,  2,192,
-    195,192,202,225,242,229,110,128, 36,117,229,114,  2,192,209,192,
-    215,233,239,100,128, 36,137,243,233,225,110,128,  6,242,242,239,
-    237,225,110,128, 33,113,115,  2,192,236,192,244,244,242,239,235,
-    101,128,  1,187,245,240,229,242,233,239,114,128,  0,178,244,104,
-      2,193,  5,193, 10,225,105,128, 14, 82,233,242,228,115,128, 33,
-     84,117,145,  0,117,193, 55,193, 63,193,104,193,161,194, 43,194,
-     80,194,203,194,219,195, 14,195, 84,195,165,195,174,196, 37,196,
-     61,196,169,196,197,197, 55,225,227,245,244,101,128,  0,250, 98,
-      4,193, 73,193, 78,193, 87,193, 97,225,114,128,  2,137,229,238,
-    231,225,236,105,128,  9,137,239,240,239,237,239,230,111,128, 49,
-     40,242,229,246,101,128,  1,109, 99,  3,193,112,193,119,193,151,
-    225,242,239,110,128,  1,212,233,242, 99,  2,193,127,193,132,236,
-    101,128, 36,228,245,237,230,236,229,120,129,  0,251,193,143,226,
-    229,236,239,119,128, 30,119,249,242,233,236,236,233, 99,128,  4,
-     67,100,  5,193,173,193,184,193,207,193,213,194, 33,225,244,244,
-    225,228,229,246, 97,128,  9, 81,226,108,  2,193,191,193,199,225,
-    227,245,244,101,128,  1,113,231,242,225,246,101,128,  2, 21,229,
-    246, 97,128,  9,  9,233,229,242,229,243,233,115,133,  0,252,193,
-    233,193,241,193,249,194, 16,194, 24,225,227,245,244,101,128,  1,
-    216,226,229,236,239,119,128, 30,115, 99,  2,193,255,194,  6,225,
-    242,239,110,128,  1,218,249,242,233,236,236,233, 99,128,  4,241,
-    231,242,225,246,101,128,  1,220,237,225,227,242,239,110,128,  1,
-    214,239,244,226,229,236,239,119,128, 30,229,103,  2,194, 49,194,
-     56,242,225,246,101,128,  0,249,117,  2,194, 62,194, 71,234,225,
-    242,225,244,105,128, 10,137,242,237,245,235,232,105,128, 10,  9,
-    104,  3,194, 88,194, 98,194,176,233,242,225,231,225,238, 97,128,
-     48, 70,111,  2,194,104,194,114,239,235,225,226,239,246,101,128,
-     30,231,242,110,133,  1,176,194,129,194,137,194,148,194,156,194,
-    168,225,227,245,244,101,128, 30,233,228,239,244,226,229,236,239,
-    119,128, 30,241,231,242,225,246,101,128, 30,235,232,239,239,235,
-    225,226,239,246,101,128, 30,237,244,233,236,228,101,128, 30,239,
-    245,238,231,225,242,245,237,236,225,245,116,129,  1,113,194,192,
-    227,249,242,233,236,236,233, 99,128,  4,243,233,238,246,229,242,
-    244,229,228,226,242,229,246,101,128,  2, 23,107,  3,194,227,194,
-    251,195,  6,225,244,225,235,225,238, 97,129, 48,166,194,239,232,
-    225,236,230,247,233,228,244,104,128,255,115,227,249,242,233,236,
-    236,233, 99,128,  4,121,239,242,229,225,110,128, 49, 92,109,  2,
-    195, 20,195, 73, 97,  2,195, 26,195, 59,227,242,239,110,130,  1,
-    107,195, 37,195, 48,227,249,242,233,236,236,233, 99,128,  4,239,
-    228,233,229,242,229,243,233,115,128, 30,123,244,242,225,231,245,
-    242,237,245,235,232,105,128, 10, 65,239,238,239,243,240,225,227,
-    101,128,255, 85,110,  2,195, 90,195,145,228,229,242,243,227,239,
-    242,101,132,  0, 95,195,109,195,115,195,127,195,138,228,226,108,
-    128, 32, 23,237,239,238,239,243,240,225,227,101,128,255, 63,246,
-    229,242,244,233,227,225,108,128,254, 51,247,225,246,121,128,254,
-     79,105,  2,195,151,195,156,239,110,128, 34, 42,246,229,242,243,
-    225,108,128, 34,  0,239,231,239,238,229,107,128,  1,115,112,  5,
-    195,186,195,193,195,201,195,216,196, 11,225,242,229,110,128, 36,
-    176,226,236,239,227,107,128, 37,128,240,229,242,228,239,244,232,
-    229,226,242,229,119,128,  5,196,243,233,236,239,110,131,  3,197,
-    195,230,195,251,196,  3,228,233,229,242,229,243,233,115,129,  3,
-    203,195,243,244,239,238,239,115,128,  3,176,236,225,244,233,110,
-    128,  2,138,244,239,238,239,115,128,  3,205,244,225,227,107,  2,
-    196, 20,196, 31,226,229,236,239,247,227,237, 98,128,  3, 29,237,
-    239,100,128,  2,212,114,  2,196, 43,196, 55,225,231,245,242,237,
-    245,235,232,105,128, 10,115,233,238,103,128,  1,111,115,  3,196,
-     69,196, 84,196,129,232,239,242,244,227,249,242,233,236,236,233,
-     99,128,  4, 94,237,225,236,108,  2,196, 93,196,104,232,233,242,
-    225,231,225,238, 97,128, 48, 69,235,225,244,225,235,225,238, 97,
-    129, 48,165,196,117,232,225,236,230,247,233,228,244,104,128,255,
-    105,244,242,225,233,231,232,116,  2,196,141,196,152,227,249,242,
-    233,236,236,233, 99,128,  4,175,243,244,242,239,235,229,227,249,
-    242,233,236,236,233, 99,128,  4,177,244,233,236,228,101,130,  1,
-    105,196,181,196,189,225,227,245,244,101,128, 30,121,226,229,236,
-    239,119,128, 30,117,117,  5,196,209,196,219,196,226,196,251,197,
-     11,226,229,238,231,225,236,105,128,  9,138,228,229,246, 97,128,
-      9, 10,231,117,  2,196,233,196,242,234,225,242,225,244,105,128,
-     10,138,242,237,245,235,232,105,128, 10, 10,237,225,244,242,225,
-    231,245,242,237,245,235,232,105,128, 10, 66,246,239,247,229,236,
-    243,233,231,110,  3,197, 27,197, 37,197, 44,226,229,238,231,225,
-    236,105,128,  9,194,228,229,246, 97,128,  9, 66,231,245,234,225,
-    242,225,244,105,128, 10,194,246,239,247,229,236,243,233,231,110,
-      3,197, 71,197, 81,197, 88,226,229,238,231,225,236,105,128,  9,
-    193,228,229,246, 97,128,  9, 65,231,245,234,225,242,225,244,105,
-    128, 10,193,118,139,  0,118,197,125,198, 17,198, 26,198, 37,198,
-    222,198,229,199, 71,199, 83,199,183,199,191,199,212, 97,  4,197,
-    135,197,142,197,167,197,178,228,229,246, 97,128,  9, 53,231,117,
-      2,197,149,197,158,234,225,242,225,244,105,128, 10,181,242,237,
-    245,235,232,105,128, 10, 53,235,225,244,225,235,225,238, 97,128,
-     48,247,118,132,  5,213,197,190,197,217,197,249,198,  5,228,225,
-    231,229,243,104,130,251, 53,197,203,197,208,182, 53,128,251, 53,
-    232,229,226,242,229,119,128,251, 53,104,  2,197,223,197,231,229,
-    226,242,229,119,128,  5,213,239,236,225,109,129,251, 75,197,240,
-    232,229,226,242,229,119,128,251, 75,246,225,246,232,229,226,242,
-    229,119,128,  5,240,249,239,228,232,229,226,242,229,119,128,  5,
-    241,227,233,242,227,236,101,128, 36,229,228,239,244,226,229,236,
-    239,119,128, 30,127,101,  6,198, 51,198, 62,198,126,198,137,198,
-    143,198,210,227,249,242,233,236,236,233, 99,128,  4, 50,104,  4,
-    198, 72,198, 81,198, 95,198,111,225,242,225,226,233, 99,128,  6,
-    164,230,233,238,225,236,225,242,225,226,233, 99,128,251,107,233,
-    238,233,244,233,225,236,225,242,225,226,233, 99,128,251,108,237,
-    229,228,233,225,236,225,242,225,226,233, 99,128,251,109,235,225,
-    244,225,235,225,238, 97,128, 48,249,238,245,115,128, 38, 64,242,
-    244,233,227,225,108,  2,198,154,198,160,226,225,114,128,  0,124,
-    236,233,238,101,  4,198,173,198,184,198,195,198,204,225,226,239,
-    246,229,227,237, 98,128,  3, 13,226,229,236,239,247,227,237, 98,
-    128,  3, 41,236,239,247,237,239,100,128,  2,204,237,239,100,128,
-      2,200,247,225,242,237,229,238,233,225,110,128,  5,126,232,239,
-    239,107,128,  2,139,105,  3,198,237,198,248,199, 31,235,225,244,
-    225,235,225,238, 97,128, 48,248,242,225,237, 97,  3,199,  3,199,
-     13,199, 20,226,229,238,231,225,236,105,128,  9,205,228,229,246,
-     97,128,  9, 77,231,245,234,225,242,225,244,105,128, 10,205,243,
-    225,242,231, 97,  3,199, 43,199, 53,199, 60,226,229,238,231,225,
-    236,105,128,  9,131,228,229,246, 97,128,  9,  3,231,245,234,225,
-    242,225,244,105,128, 10,131,237,239,238,239,243,240,225,227,101,
-    128,255, 86,111,  3,199, 91,199,102,199,172,225,242,237,229,238,
-    233,225,110,128,  5,120,233,227,229,100,  2,199,111,199,147,233,
-    244,229,242,225,244,233,239,110,  2,199,125,199,136,232,233,242,
-    225,231,225,238, 97,128, 48,158,235,225,244,225,235,225,238, 97,
-    128, 48,254,237,225,242,235,235,225,238, 97,129, 48,155,199,160,
-    232,225,236,230,247,233,228,244,104,128,255,158,235,225,244,225,
-    235,225,238, 97,128, 48,250,240,225,242,229,110,128, 36,177,116,
-      2,199,197,199,204,233,236,228,101,128, 30,125,245,242,238,229,
-    100,128,  2,140,117,  2,199,218,199,229,232,233,242,225,231,225,
-    238, 97,128, 48,148,235,225,244,225,235,225,238, 97,128, 48,244,
-    119,143,  0,119,200, 18,200,251,201,  5,201, 28,201, 68,201,135,
-    201,143,203,114,203,155,203,167,203,242,203,250,204,  1,204, 12,
-    204, 21, 97,  8,200, 36,200, 43,200, 53,200, 64,200,102,200,134,
-    200,146,200,182,227,245,244,101,128, 30,131,229,235,239,242,229,
-    225,110,128, 49, 89,232,233,242,225,231,225,238, 97,128, 48,143,
-    107,  2,200, 70,200, 94,225,244,225,235,225,238, 97,129, 48,239,
-    200, 82,232,225,236,230,247,233,228,244,104,128,255,156,239,242,
-    229,225,110,128, 49, 88,243,237,225,236,108,  2,200,112,200,123,
-    232,233,242,225,231,225,238, 97,128, 48,142,235,225,244,225,235,
-    225,238, 97,128, 48,238,244,244,239,243,241,245,225,242,101,128,
-     51, 87,118,  2,200,152,200,160,229,228,225,243,104,128, 48, 28,
-    249,245,238,228,229,242,243,227,239,242,229,246,229,242,244,233,
-    227,225,108,128,254, 52,119,  3,200,190,200,199,200,213,225,242,
-    225,226,233, 99,128,  6, 72,230,233,238,225,236,225,242,225,226,
-    233, 99,128,254,238,232,225,237,250,225,225,226,239,246,101,  2,
-    200,228,200,237,225,242,225,226,233, 99,128,  6, 36,230,233,238,
-    225,236,225,242,225,226,233, 99,128,254,134,226,243,241,245,225,
-    242,101,128, 51,221,227,233,242, 99,  2,201, 14,201, 19,236,101,
-    128, 36,230,245,237,230,236,229,120,128,  1,117,100,  2,201, 34,
-    201, 44,233,229,242,229,243,233,115,128, 30,133,239,116,  2,201,
-     51,201, 60,225,227,227,229,238,116,128, 30,135,226,229,236,239,
-    119,128, 30,137,101,  4,201, 78,201, 89,201,101,201,125,232,233,
-    242,225,231,225,238, 97,128, 48,145,233,229,242,243,244,242,225,
-    243,115,128, 33, 24,107,  2,201,107,201,117,225,244,225,235,225,
-    238, 97,128, 48,241,239,242,229,225,110,128, 49, 94,239,235,239,
-    242,229,225,110,128, 49, 93,231,242,225,246,101,128, 30,129,232,
-    233,244,101,  8,201,164,201,173,202,  1,202, 91,202,175,202,220,
-    203, 16,203, 72,226,245,236,236,229,116,128, 37,230, 99,  2,201,
-    179,201,199,233,242,227,236,101,129, 37,203,201,189,233,238,246,
-    229,242,243,101,128, 37,217,239,242,238,229,242,226,242,225,227,
-    235,229,116,  2,201,216,201,236,236,229,230,116,129, 48, 14,201,
-    225,246,229,242,244,233,227,225,108,128,254, 67,242,233,231,232,
-    116,129, 48, 15,201,246,246,229,242,244,233,227,225,108,128,254,
-     68,100,  2,202,  7,202, 48,233,225,237,239,238,100,129, 37,199,
-    202, 18,227,239,238,244,225,233,238,233,238,231,226,236,225,227,
-    235,243,237,225,236,236,228,233,225,237,239,238,100,128, 37,200,
-    239,247,238,240,239,233,238,244,233,238,103,  2,202, 64,202, 80,
-    243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37,191,
-    244,242,233,225,238,231,236,101,128, 37,189,236,101,  2,202, 98,
-    202,140,230,244,240,239,233,238,244,233,238,103,  2,202,113,202,
-    129,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37,
-    195,244,242,233,225,238,231,236,101,128, 37,193,238,244,233,227,
-    245,236,225,242,226,242,225,227,235,229,116,  2,202,160,202,167,
-    236,229,230,116,128, 48, 22,242,233,231,232,116,128, 48, 23,242,
-    233,231,232,244,240,239,233,238,244,233,238,103,  2,202,193,202,
-    209,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37,
-    185,244,242,233,225,238,231,236,101,128, 37,183,115,  3,202,228,
-    203,  2,203, 10,109,  2,202,234,202,246,225,236,236,243,241,245,
-    225,242,101,128, 37,171,233,236,233,238,231,230,225,227,101,128,
-     38, 58,241,245,225,242,101,128, 37,161,244,225,114,128, 38,  6,
-    116,  2,203, 22,203, 33,229,236,229,240,232,239,238,101,128, 38,
-     15,239,242,244,239,233,243,229,243,232,229,236,236,226,242,225,
-    227,235,229,116,  2,203, 57,203, 64,236,229,230,116,128, 48, 24,
-    242,233,231,232,116,128, 48, 25,245,240,240,239,233,238,244,233,
-    238,103,  2,203, 87,203,103,243,237,225,236,236,244,242,233,225,
-    238,231,236,101,128, 37,181,244,242,233,225,238,231,236,101,128,
-     37,179,105,  2,203,120,203,131,232,233,242,225,231,225,238, 97,
-    128, 48,144,107,  2,203,137,203,147,225,244,225,235,225,238, 97,
-    128, 48,240,239,242,229,225,110,128, 49, 95,237,239,238,239,243,
-    240,225,227,101,128,255, 87,111,  4,203,177,203,188,203,213,203,
-    231,232,233,242,225,231,225,238, 97,128, 48,146,235,225,244,225,
-    235,225,238, 97,129, 48,242,203,201,232,225,236,230,247,233,228,
-    244,104,128,255,102,110,129, 32,169,203,219,237,239,238,239,243,
-    240,225,227,101,128,255,230,247,225,229,238,244,232,225,105,128,
-     14, 39,240,225,242,229,110,128, 36,178,242,233,238,103,128, 30,
-    152,243,245,240,229,242,233,239,114,128,  2,183,244,245,242,238,
-    229,100,128,  2,141,249,238,110,128,  1,191,120,137,  0,120,204,
-     49,204, 60,204, 71,204, 80,204,107,204,120,204,124,204,136,204,
-    144,225,226,239,246,229,227,237, 98,128,  3, 61,226,239,240,239,
-    237,239,230,111,128, 49, 18,227,233,242,227,236,101,128, 36,231,
-    100,  2,204, 86,204, 96,233,229,242,229,243,233,115,128, 30,141,
-    239,244,225,227,227,229,238,116,128, 30,139,229,232,225,242,237,
-    229,238,233,225,110,128,  5,109,105,128,  3,190,237,239,238,239,
-    243,240,225,227,101,128,255, 88,240,225,242,229,110,128, 36,179,
-    243,245,240,229,242,233,239,114,128,  2,227,121,143,  0,121,204,
-    189,205,148,205,171,205,211,207,177,207,185,207,202,208, 10,208,
-     22,209, 19,209, 59,209, 71,209, 82,209,103,210, 76, 97, 11,204,
-    213,204,225,204,235,204,242,204,249,205,  3,205, 28,205, 39,205,
-     77,205, 90,205,136,225,228,239,243,241,245,225,242,101,128, 51,
-     78,226,229,238,231,225,236,105,128,  9,175,227,245,244,101,128,
-      0,253,228,229,246, 97,128,  9, 47,229,235,239,242,229,225,110,
-    128, 49, 82,231,117,  2,205, 10,205, 19,234,225,242,225,244,105,
-    128, 10,175,242,237,245,235,232,105,128, 10, 47,232,233,242,225,
-    231,225,238, 97,128, 48,132,107,  2,205, 45,205, 69,225,244,225,
-    235,225,238, 97,129, 48,228,205, 57,232,225,236,230,247,233,228,
-    244,104,128,255,148,239,242,229,225,110,128, 49, 81,237,225,235,
-    235,225,238,244,232,225,105,128, 14, 78,243,237,225,236,108,  2,
-    205,100,205,111,232,233,242,225,231,225,238, 97,128, 48,131,235,
-    225,244,225,235,225,238, 97,129, 48,227,205,124,232,225,236,230,
-    247,233,228,244,104,128,255,108,244,227,249,242,233,236,236,233,
-     99,128,  4, 99,227,233,242, 99,  2,205,157,205,162,236,101,128,
-     36,232,245,237,230,236,229,120,128,  1,119,100,  2,205,177,205,
-    187,233,229,242,229,243,233,115,128,  0,255,239,116,  2,205,194,
-    205,203,225,227,227,229,238,116,128, 30,143,226,229,236,239,119,
-    128, 30,245,101,  7,205,227,206,235,206,244,207,  6,207, 38,207,
-    114,207,165,104,  8,205,245,205,254,206, 32,206, 46,206,119,206,
-    135,206,194,206,212,225,242,225,226,233, 99,128,  6, 74,226,225,
-    242,242,229,101,  2,206,  9,206, 18,225,242,225,226,233, 99,128,
-      6,210,230,233,238,225,236,225,242,225,226,233, 99,128,251,175,
-    230,233,238,225,236,225,242,225,226,233, 99,128,254,242,232,225,
-    237,250,225,225,226,239,246,101,  4,206, 65,206, 74,206, 88,206,
-    104,225,242,225,226,233, 99,128,  6, 38,230,233,238,225,236,225,
-    242,225,226,233, 99,128,254,138,233,238,233,244,233,225,236,225,
-    242,225,226,233, 99,128,254,139,237,229,228,233,225,236,225,242,
-    225,226,233, 99,128,254,140,233,238,233,244,233,225,236,225,242,
-    225,226,233, 99,128,254,243,237,101,  2,206,142,206,155,228,233,
-    225,236,225,242,225,226,233, 99,128,254,244,229,237,105,  2,206,
-    163,206,178,238,233,244,233,225,236,225,242,225,226,233, 99,128,
-    252,221,243,239,236,225,244,229,228,225,242,225,226,233, 99,128,
-    252, 88,238,239,239,238,230,233,238,225,236,225,242,225,226,233,
-     99,128,252,148,244,232,242,229,229,228,239,244,243,226,229,236,
-    239,247,225,242,225,226,233, 99,128,  6,209,235,239,242,229,225,
-    110,128, 49, 86,110,129,  0,165,206,250,237,239,238,239,243,240,
-    225,227,101,128,255,229,111,  2,207, 12,207, 21,235,239,242,229,
-    225,110,128, 49, 85,242,233,238,232,233,229,245,232,235,239,242,
-    229,225,110,128, 49,134,114,  3,207, 46,207, 82,207, 94,225,232,
-    226,229,238,249,239,237,111,  2,207, 60,207, 69,232,229,226,242,
-    229,119,128,  5,170,236,229,230,244,232,229,226,242,229,119,128,
-      5,170,233,227,249,242,233,236,236,233, 99,128,  4, 75,245,228,
+    141,228,229,246, 97,128,  9,106,231,117,  2, 92, 47, 92, 56,234,
+    225,242,225,244,105,128, 10,234,242,237,245,235,232,105,128, 10,
+    106,232, 97,  2, 92, 72, 92, 83,227,235,225,242,225,226,233, 99,
+    128,  6,100,238,231,250,232,239,117,128, 48, 36,105,  2, 92, 98,
+     92,116,228,229,239,231,242,225,240,232,233,227,240,225,242,229,
+    110,128, 50, 35,238,230,229,242,233,239,114,128, 32,132,237,239,
+    238,239,243,240,225,227,101,128,255, 20,238,245,237,229,242,225,
+    244,239,242,226,229,238,231,225,236,105,128,  9,247,239,236,228,
+    243,244,249,236,101,128,247, 52,112,  2, 92,174, 92,181,225,242,
+    229,110,128, 36,119,229,114,  2, 92,188, 92,194,233,239,100,128,
+     36,139,243,233,225,110,128,  6,244,242,239,237,225,110,128, 33,
+    115,243,245,240,229,242,233,239,114,128, 32,116,116,  2, 92,226,
+     93,  8,229,229,110,  2, 92,234, 92,243,227,233,242,227,236,101,
+    128, 36,109,112,  2, 92,249, 93,  0,225,242,229,110,128, 36,129,
+    229,242,233,239,100,128, 36,149,104,  2, 93, 14, 93, 19,225,105,
+    128, 14, 84,244,239,238,229,227,232,233,238,229,243,101,128,  2,
+    203,240,225,242,229,110,128, 36,161,242, 97,  2, 93, 48, 93, 56,
+    227,244,233,239,110,128, 32, 68,238, 99,128, 32,163,103,144,  0,
+    103, 93, 97, 94, 43, 94, 66, 94,127, 94,144, 95, 65, 96, 58, 96,
+    143, 96,156, 97, 14, 97, 39, 97, 67, 97, 89, 98, 34, 98, 56, 98,
+    158, 97,  9, 93,117, 93,127, 93,134, 93,141, 93,205, 93,230, 93,
+    241, 93,252, 94, 30,226,229,238,231,225,236,105,128,  9,151,227,
+    245,244,101,128,  1,245,228,229,246, 97,128,  9, 23,102,  4, 93,
+    151, 93,160, 93,174, 93,190,225,242,225,226,233, 99,128,  6,175,
+    230,233,238,225,236,225,242,225,226,233, 99,128,251,147,233,238,
+    233,244,233,225,236,225,242,225,226,233, 99,128,251,148,237,229,
+    228,233,225,236,225,242,225,226,233, 99,128,251,149,231,117,  2,
+     93,212, 93,221,234,225,242,225,244,105,128, 10,151,242,237,245,
+    235,232,105,128, 10, 23,232,233,242,225,231,225,238, 97,128, 48,
+     76,235,225,244,225,235,225,238, 97,128, 48,172,237,237, 97,130,
+      3,179, 94,  6, 94, 19,236,225,244,233,238,243,237,225,236,108,
+    128,  2, 99,243,245,240,229,242,233,239,114,128,  2,224,238,231,
+    233,225,227,239,240,244,233, 99,128,  3,235, 98,  2, 94, 49, 94,
+     59,239,240,239,237,239,230,111,128, 49, 13,242,229,246,101,128,
+      1, 31, 99,  4, 94, 76, 94, 83, 94, 92, 94,114,225,242,239,110,
+    128,  1,231,229,228,233,236,236, 97,128,  1, 35,233,242, 99,  2,
+     94,100, 94,105,236,101,128, 36,214,245,237,230,236,229,120,128,
+      1, 29,239,237,237,225,225,227,227,229,238,116,128,  1, 35,228,
+    239,116,129,  1, 33, 94,135,225,227,227,229,238,116,128,  1, 33,
+    101,  6, 94,158, 94,169, 94,180, 94,191, 94,210, 95, 56,227,249,
+    242,233,236,236,233, 99,128,  4, 51,232,233,242,225,231,225,238,
+     97,128, 48, 82,235,225,244,225,235,225,238, 97,128, 48,178,239,
+    237,229,244,242,233,227,225,236,236,249,229,241,245,225,108,128,
+     34, 81,114,  3, 94,218, 95, 11, 95, 21,229,243,104,  3, 94,228,
+     94,243, 94,252,225,227,227,229,238,244,232,229,226,242,229,119,
+    128,  5,156,232,229,226,242,229,119,128,  5,243,237,245,241,228,
+    225,237,232,229,226,242,229,119,128,  5,157,237,225,238,228,226,
+    236,115,128,  0,223,243,232,225,249,233,109,  2, 95, 32, 95, 47,
+    225,227,227,229,238,244,232,229,226,242,229,119,128,  5,158,232,
+    229,226,242,229,119,128,  5,244,244,225,237,225,242,107,128, 48,
+     19,104,  5, 95, 77, 95,210, 96, 17, 96, 42, 96, 48, 97,  4, 95,
+     87, 95, 97, 95,120, 95,145,226,229,238,231,225,236,105,128,  9,
+    152,100,  2, 95,103, 95,114,225,242,237,229,238,233,225,110,128,
+      5,114,229,246, 97,128,  9, 24,231,117,  2, 95,127, 95,136,234,
+    225,242,225,244,105,128, 10,152,242,237,245,235,232,105,128, 10,
+     24,233,110,  4, 95,156, 95,165, 95,179, 95,195,225,242,225,226,
+    233, 99,128,  6, 58,230,233,238,225,236,225,242,225,226,233, 99,
+    128,254,206,233,238,233,244,233,225,236,225,242,225,226,233, 99,
+    128,254,207,237,229,228,233,225,236,225,242,225,226,233, 99,128,
+    254,208,101,  3, 95,218, 95,239, 96,  0,237,233,228,228,236,229,
+    232,239,239,235,227,249,242,233,236,236,233, 99,128,  4,149,243,
+    244,242,239,235,229,227,249,242,233,236,236,233, 99,128,  4,147,
+    245,240,244,245,242,238,227,249,242,233,236,236,233, 99,128,  4,
+    145,232, 97,  2, 96, 24, 96, 31,228,229,246, 97,128,  9, 90,231,
+    245,242,237,245,235,232,105,128, 10, 90,239,239,107,128,  2, 96,
+    250,243,241,245,225,242,101,128, 51,147,105,  3, 96, 66, 96, 77,
+     96, 88,232,233,242,225,231,225,238, 97,128, 48, 78,235,225,244,
+    225,235,225,238, 97,128, 48,174,109,  2, 96, 94, 96,105,225,242,
+    237,229,238,233,225,110,128,  5, 99,229,108,130,  5,210, 96,114,
+     96,134,228,225,231,229,243,104,129,251, 50, 96,125,232,229,226,
+    242,229,119,128,251, 50,232,229,226,242,229,119,128,  5,210,234,
+    229,227,249,242,233,236,236,233, 99,128,  4, 83,236,239,244,244,
+    225,108,  2, 96,167, 96,184,233,238,246,229,242,244,229,228,243,
+    244,242,239,235,101,128,  1,190,243,244,239,112,132,  2,148, 96,
+    199, 96,210, 96,216, 96,248,233,238,246,229,242,244,229,100,128,
+      2,150,237,239,100,128,  2,192,242,229,246,229,242,243,229,100,
+    130,  2,149, 96,231, 96,237,237,239,100,128,  2,193,243,245,240,
+    229,242,233,239,114,128,  2,228,243,244,242,239,235,101,129,  2,
+    161, 97,  3,242,229,246,229,242,243,229,100,128,  2,162,109,  2,
+     97, 20, 97, 28,225,227,242,239,110,128, 30, 33,239,238,239,243,
+    240,225,227,101,128,255, 71,111,  2, 97, 45, 97, 56,232,233,242,
+    225,231,225,238, 97,128, 48, 84,235,225,244,225,235,225,238, 97,
+    128, 48,180,240, 97,  2, 97, 74, 97, 80,242,229,110,128, 36,162,
+    243,241,245,225,242,101,128, 51,172,114,  2, 97, 95, 97,192, 97,
+      2, 97,101, 97,109,228,233,229,238,116,128, 34,  7,246,101,134,
+      0, 96, 97,126, 97,137, 97,154, 97,161, 97,170, 97,182,226,229,
+    236,239,247,227,237, 98,128,  3, 22, 99,  2, 97,143, 97,148,237,
+     98,128,  3,  0,239,237, 98,128,  3,  0,228,229,246, 97,128,  9,
+     83,236,239,247,237,239,100,128,  2,206,237,239,238,239,243,240,
+    225,227,101,128,255, 64,244,239,238,229,227,237, 98,128,  3, 64,
+    229,225,244,229,114,132,  0, 62, 97,208, 97,227, 97,239, 98, 26,
+    229,241,245,225,108,129, 34,101, 97,218,239,242,236,229,243,115,
+    128, 34,219,237,239,238,239,243,240,225,227,101,128,255, 30,111,
+      2, 97,245, 98, 15,114,  2, 97,251, 98,  8,229,241,245,233,246,
+    225,236,229,238,116,128, 34,115,236,229,243,115,128, 34,119,246,
+    229,242,229,241,245,225,108,128, 34,103,243,237,225,236,108,128,
+    254,101,115,  2, 98, 40, 98, 48,227,242,233,240,116,128,  2, 97,
+    244,242,239,235,101,128,  1,229,117,  4, 98, 66, 98, 77, 98,134,
+     98,145,232,233,242,225,231,225,238, 97,128, 48, 80,233,108,  2,
+     98, 84, 98,109,236,229,237,239,116,  2, 98, 94, 98,101,236,229,
+    230,116,128,  0,171,242,233,231,232,116,128,  0,187,243,233,238,
+    231,108,  2, 98,119, 98,126,236,229,230,116,128, 32, 57,242,233,
+    231,232,116,128, 32, 58,235,225,244,225,235,225,238, 97,128, 48,
+    176,242,225,237,245,243,241,245,225,242,101,128, 51, 24,249,243,
+    241,245,225,242,101,128, 51,201,104,144,  0,104, 98,204,101, 90,
+    101,125,101,162,101,202,103, 90,103,110,104, 75,104, 87,104, 99,
+    105,167,105,175,105,186,105,195,106, 19,106, 23, 97, 13, 98,232,
+     99, 15, 99, 25, 99, 55, 99, 80, 99,158, 99,170, 99,195, 99,210,
+     99,239, 99,252,100, 54,100, 63, 97,  2, 98,238, 99,  1,226,235,
+    232,225,243,233,225,238,227,249,242,233,236,236,233, 99,128,  4,
+    169,236,244,239,238,229,225,242,225,226,233, 99,128,  6,193,226,
+    229,238,231,225,236,105,128,  9,185,228,101,  2, 99, 32, 99, 50,
+    243,227,229,238,228,229,242,227,249,242,233,236,236,233, 99,128,
+      4,179,246, 97,128,  9, 57,231,117,  2, 99, 62, 99, 71,234,225,
+    242,225,244,105,128, 10,185,242,237,245,235,232,105,128, 10, 57,
+    104,  4, 99, 90, 99, 99, 99,113, 99,143,225,242,225,226,233, 99,
+    128,  6, 45,230,233,238,225,236,225,242,225,226,233, 99,128,254,
+    162,105,  2, 99,119, 99,134,238,233,244,233,225,236,225,242,225,
+    226,233, 99,128,254,163,242,225,231,225,238, 97,128, 48,111,237,
+    229,228,233,225,236,225,242,225,226,233, 99,128,254,164,233,244,
+    245,243,241,245,225,242,101,128, 51, 42,235,225,244,225,235,225,
+    238, 97,129, 48,207, 99,183,232,225,236,230,247,233,228,244,104,
+    128,255,138,236,225,238,244,231,245,242,237,245,235,232,105,128,
+     10, 77,237,250, 97,  2, 99,218, 99,227,225,242,225,226,233, 99,
+    128,  6, 33,236,239,247,225,242,225,226,233, 99,128,  6, 33,238,
+    231,245,236,230,233,236,236,229,114,128, 49,100,114,  2,100,  2,
+    100, 18,228,243,233,231,238,227,249,242,233,236,236,233, 99,128,
+      4, 74,240,239,239,110,  2,100, 27,100, 40,236,229,230,244,226,
+    225,242,226,245,112,128, 33,188,242,233,231,232,244,226,225,242,
+    226,245,112,128, 33,192,243,241,245,225,242,101,128, 51,202,244,
+    225,102,  3,100, 73,100,165,101,  0,240,225,244,225,104,134,  5,
+    178,100, 93,100, 98,100,112,100,121,100,136,100,152,177, 54,128,
+      5,178, 50,  2,100,104,100,108, 51,128,  5,178,102,128,  5,178,
+    232,229,226,242,229,119,128,  5,178,238,225,242,242,239,247,232,
+    229,226,242,229,119,128,  5,178,241,245,225,242,244,229,242,232,
+    229,226,242,229,119,128,  5,178,247,233,228,229,232,229,226,242,
+    229,119,128,  5,178,241,225,237,225,244,115,135,  5,179,100,188,
+    100,193,100,198,100,203,100,212,100,227,100,243,177, 98,128,  5,
+    179,178, 56,128,  5,179,179, 52,128,  5,179,232,229,226,242,229,
+    119,128,  5,179,238,225,242,242,239,247,232,229,226,242,229,119,
+    128,  5,179,241,245,225,242,244,229,242,232,229,226,242,229,119,
+    128,  5,179,247,233,228,229,232,229,226,242,229,119,128,  5,179,
+    243,229,231,239,108,135,  5,177,101, 22,101, 27,101, 32,101, 37,
+    101, 46,101, 61,101, 77,177, 55,128,  5,177,178, 52,128,  5,177,
+    179, 48,128,  5,177,232,229,226,242,229,119,128,  5,177,238,225,
+    242,242,239,247,232,229,226,242,229,119,128,  5,177,241,245,225,
+    242,244,229,242,232,229,226,242,229,119,128,  5,177,247,233,228,
+    229,232,229,226,242,229,119,128,  5,177, 98,  3,101, 98,101,103,
+    101,113,225,114,128,  1, 39,239,240,239,237,239,230,111,128, 49,
+     15,242,229,246,229,226,229,236,239,119,128, 30, 43, 99,  2,101,
+    131,101,140,229,228,233,236,236, 97,128, 30, 41,233,242, 99,  2,
+    101,148,101,153,236,101,128, 36,215,245,237,230,236,229,120,128,
+      1, 37,100,  2,101,168,101,178,233,229,242,229,243,233,115,128,
+     30, 39,239,116,  2,101,185,101,194,225,227,227,229,238,116,128,
+     30, 35,226,229,236,239,119,128, 30, 37,101,136,  5,212,101,222,
+    101,255,102, 19,102,248,103,  8,103, 53,103, 62,103, 75,225,242,
+    116,129, 38,101,101,230,243,245,233,116,  2,101,239,101,247,226,
+    236,225,227,107,128, 38,101,247,232,233,244,101,128, 38, 97,228,
+    225,231,229,243,104,129,251, 52,102, 10,232,229,226,242,229,119,
+    128,251, 52,104,  6,102, 33,102, 61,102, 69,102,119,102,165,102,
+    214, 97,  2,102, 39,102, 53,236,244,239,238,229,225,242,225,226,
+    233, 99,128,  6,193,242,225,226,233, 99,128,  6, 71,229,226,242,
+    229,119,128,  5,212,230,233,238,225,236, 97,  2,102, 80,102,111,
+    236,116,  2,102, 87,102, 99,239,238,229,225,242,225,226,233, 99,
+    128,251,167,244,247,239,225,242,225,226,233, 99,128,254,234,242,
+    225,226,233, 99,128,254,234,232,225,237,250,225,225,226,239,246,
+    101,  2,102,134,102,148,230,233,238,225,236,225,242,225,226,233,
+     99,128,251,165,233,243,239,236,225,244,229,228,225,242,225,226,
+    233, 99,128,251,164,105,  2,102,171,102,205,238,233,244,233,225,
+    236, 97,  2,102,183,102,197,236,244,239,238,229,225,242,225,226,
+    233, 99,128,251,168,242,225,226,233, 99,128,254,235,242,225,231,
+    225,238, 97,128, 48,120,237,229,228,233,225,236, 97,  2,102,226,
+    102,240,236,244,239,238,229,225,242,225,226,233, 99,128,251,169,
+    242,225,226,233, 99,128,254,236,233,243,229,233,229,242,225,243,
+    241,245,225,242,101,128, 51,123,107,  2,103, 14,103, 38,225,244,
+    225,235,225,238, 97,129, 48,216,103, 26,232,225,236,230,247,233,
+    228,244,104,128,255,141,245,244,225,225,242,245,243,241,245,225,
+    242,101,128, 51, 54,238,231,232,239,239,107,128,  2,103,242,245,
+    244,245,243,241,245,225,242,101,128, 51, 57,116,129,  5,215,103,
+     81,232,229,226,242,229,119,128,  5,215,232,239,239,107,129,  2,
+    102,103, 99,243,245,240,229,242,233,239,114,128,  2,177,105,  4,
+    103,120,103,205,103,216,103,241,229,245,104,  4,103,132,103,167,
+    103,182,103,191, 97,  2,103,138,103,153,227,233,242,227,236,229,
+    235,239,242,229,225,110,128, 50,123,240,225,242,229,238,235,239,
+    242,229,225,110,128, 50, 27,227,233,242,227,236,229,235,239,242,
+    229,225,110,128, 50,109,235,239,242,229,225,110,128, 49, 78,240,
+    225,242,229,238,235,239,242,229,225,110,128, 50, 13,232,233,242,
+    225,231,225,238, 97,128, 48,114,235,225,244,225,235,225,238, 97,
+    129, 48,210,103,229,232,225,236,230,247,233,228,244,104,128,255,
+    139,242,233,113,134,  5,180,104,  3,104,  8,104, 22,104, 31,104,
+     46,104, 62,177, 52,128,  5,180, 50,  2,104, 14,104, 18, 49,128,
+      5,180,100,128,  5,180,232,229,226,242,229,119,128,  5,180,238,
+    225,242,242,239,247,232,229,226,242,229,119,128,  5,180,241,245,
+    225,242,244,229,242,232,229,226,242,229,119,128,  5,180,247,233,
+    228,229,232,229,226,242,229,119,128,  5,180,236,233,238,229,226,
+    229,236,239,119,128, 30,150,237,239,238,239,243,240,225,227,101,
+    128,255, 72,111,  9,104,119,104,130,104,154,104,179,105, 11,105,
+     24,105,110,105,150,105,161,225,242,237,229,238,233,225,110,128,
+      5,112,232,105,  2,104,137,104,145,240,244,232,225,105,128, 14,
+     43,242,225,231,225,238, 97,128, 48,123,235,225,244,225,235,225,
+    238, 97,129, 48,219,104,167,232,225,236,230,247,233,228,244,104,
+    128,255,142,236,225,109,135,  5,185,104,199,104,204,104,209,104,
+    214,104,223,104,238,104,254,177, 57,128,  5,185,178, 54,128,  5,
+    185,179, 50,128,  5,185,232,229,226,242,229,119,128,  5,185,238,
+    225,242,242,239,247,232,229,226,242,229,119,128,  5,185,241,245,
+    225,242,244,229,242,232,229,226,242,229,119,128,  5,185,247,233,
+    228,229,232,229,226,242,229,119,128,  5,185,238,239,235,232,245,
+    235,244,232,225,105,128, 14, 46,111,  2,105, 30,105,100,107,  4,
+    105, 40,105, 52,105, 58,105, 80,225,226,239,246,229,227,239,237,
+     98,128,  3,  9,227,237, 98,128,  3,  9,240,225,236,225,244,225,
+    236,233,250,229,228,226,229,236,239,247,227,237, 98,128,  3, 33,
+    242,229,244,242,239,230,236,229,248,226,229,236,239,247,227,237,
+     98,128,  3, 34,238,243,241,245,225,242,101,128, 51, 66,114,  2,
+    105,116,105,143,105,  2,105,122,105,131,227,239,240,244,233, 99,
+    128,  3,233,250,239,238,244,225,236,226,225,114,128, 32, 21,238,
+    227,237, 98,128,  3, 27,244,243,240,242,233,238,231,115,128, 38,
+    104,245,243,101,128, 35,  2,240,225,242,229,110,128, 36,163,243,
+    245,240,229,242,233,239,114,128,  2,176,244,245,242,238,229,100,
+    128,  2,101,117,  4,105,205,105,216,105,229,105,254,232,233,242,
+    225,231,225,238, 97,128, 48,117,233,233,244,239,243,241,245,225,
+    242,101,128, 51, 51,235,225,244,225,235,225,238, 97,129, 48,213,
+    105,242,232,225,236,230,247,233,228,244,104,128,255,140,238,231,
+    225,242,245,237,236,225,245,116,129,  2,221,106, 13,227,237, 98,
+    128,  3, 11,118,128,  1,149,249,240,232,229,110,132,  0, 45,106,
+     39,106, 50,106, 62,106, 85,233,238,230,229,242,233,239,114,128,
+    246,229,237,239,238,239,243,240,225,227,101,128,255, 13,115,  2,
+    106, 68,106, 75,237,225,236,108,128,254, 99,245,240,229,242,233,
+    239,114,128,246,230,244,247,111,128, 32, 16,105,149,  0,105,106,
+    137,106,160,106,194,106,241,110,123,110,243,111, 24,111, 51,111,
+    213,111,217,111,255,112, 21,112,105,113, 14,113, 89,113, 97,113,
+    110,113,197,113,254,114, 26,114, 70,225, 99,  2,106,144,106,150,
+    245,244,101,128,  0,237,249,242,233,236,236,233, 99,128,  4, 79,
+     98,  3,106,168,106,177,106,187,229,238,231,225,236,105,128,  9,
+    135,239,240,239,237,239,230,111,128, 49, 39,242,229,246,101,128,
+      1, 45, 99,  3,106,202,106,209,106,231,225,242,239,110,128,  1,
+    208,233,242, 99,  2,106,217,106,222,236,101,128, 36,216,245,237,
+    230,236,229,120,128,  0,238,249,242,233,236,236,233, 99,128,  4,
+     86,100,  4,106,251,107,  5,110, 80,110,113,226,236,231,242,225,
+    246,101,128,  2,  9,101,  2,107, 11,110, 75,239,231,242,225,240,
+    104,  7,107, 32,107, 46,107, 59,109,244,110, 19,110, 32,110, 44,
+    229,225,242,244,232,227,233,242,227,236,101,128, 50,143,230,233,
+    242,229,227,233,242,227,236,101,128, 50,139,233, 99, 14,107, 90,
+    107,106,107,205,108,  3,108, 69,108, 98,108,114,108,171,108,220,
+    108,232,109,  3,109, 70,109,208,109,237,225,236,236,233,225,238,
+    227,229,240,225,242,229,110,128, 50, 63, 99,  4,107,116,107,127,
+    107,141,107,148,225,236,236,240,225,242,229,110,128, 50, 58,229,
+    238,244,242,229,227,233,242,227,236,101,128, 50,165,236,239,243,
+    101,128, 48,  6,111,  3,107,156,107,171,107,191,237,237, 97,129,
+     48,  1,107,164,236,229,230,116,128,255,100,238,231,242,225,244,
+    245,236,225,244,233,239,238,240,225,242,229,110,128, 50, 55,242,
+    242,229,227,244,227,233,242,227,236,101,128, 50,163,101,  3,107,
+    213,107,225,107,242,225,242,244,232,240,225,242,229,110,128, 50,
+     47,238,244,229,242,240,242,233,243,229,240,225,242,229,110,128,
+     50, 61,248,227,229,236,236,229,238,244,227,233,242,227,236,101,
+    128, 50,157,102,  2,108,  9,108, 24,229,243,244,233,246,225,236,
+    240,225,242,229,110,128, 50, 64,105,  2,108, 30,108, 59,238,225,
+    238,227,233,225,108,  2,108, 42,108, 51,227,233,242,227,236,101,
+    128, 50,150,240,225,242,229,110,128, 50, 54,242,229,240,225,242,
+    229,110,128, 50, 43,104,  2,108, 75,108, 86,225,246,229,240,225,
+    242,229,110,128, 50, 50,233,231,232,227,233,242,227,236,101,128,
+     50,164,233,244,229,242,225,244,233,239,238,237,225,242,107,128,
+     48,  5,108,  3,108,122,108,148,108,160,225,226,239,114,  2,108,
+    131,108,140,227,233,242,227,236,101,128, 50,152,240,225,242,229,
+    110,128, 50, 56,229,230,244,227,233,242,227,236,101,128, 50,167,
+    239,247,227,233,242,227,236,101,128, 50,166,109,  2,108,177,108,
+    209,101,  2,108,183,108,198,228,233,227,233,238,229,227,233,242,
+    227,236,101,128, 50,169,244,225,236,240,225,242,229,110,128, 50,
+     46,239,239,238,240,225,242,229,110,128, 50, 42,238,225,237,229,
+    240,225,242,229,110,128, 50, 52,112,  2,108,238,108,246,229,242,
+    233,239,100,128, 48,  2,242,233,238,244,227,233,242,227,236,101,
+    128, 50,158,114,  2,109,  9,109, 57,101,  3,109, 17,109, 28,109,
+     43,225,227,232,240,225,242,229,110,128, 50, 67,240,242,229,243,
+    229,238,244,240,225,242,229,110,128, 50, 57,243,239,245,242,227,
+    229,240,225,242,229,110,128, 50, 62,233,231,232,244,227,233,242,
+    227,236,101,128, 50,168,115,  5,109, 82,109,111,109,125,109,150,
+    109,178,101,  2,109, 88,109,101,227,242,229,244,227,233,242,227,
+    236,101,128, 50,153,236,230,240,225,242,229,110,128, 50, 66,239,
+    227,233,229,244,249,240,225,242,229,110,128, 50, 51,112,  2,109,
+    131,109,137,225,227,101,128, 48,  0,229,227,233,225,236,240,225,
+    242,229,110,128, 50, 53,116,  2,109,156,109,167,239,227,235,240,
+    225,242,229,110,128, 50, 49,245,228,249,240,225,242,229,110,128,
+     50, 59,117,  2,109,184,109,193,238,240,225,242,229,110,128, 50,
+     48,240,229,242,246,233,243,229,240,225,242,229,110,128, 50, 60,
+    119,  2,109,214,109,226,225,244,229,242,240,225,242,229,110,128,
+     50, 44,239,239,228,240,225,242,229,110,128, 50, 45,250,229,242,
+    111,128, 48,  7,109,  2,109,250,110,  7,229,244,225,236,227,233,
+    242,227,236,101,128, 50,142,239,239,238,227,233,242,227,236,101,
+    128, 50,138,238,225,237,229,227,233,242,227,236,101,128, 50,148,
+    243,245,238,227,233,242,227,236,101,128, 50,144,119,  2,110, 50,
+    110, 63,225,244,229,242,227,233,242,227,236,101,128, 50,140,239,
+    239,228,227,233,242,227,236,101,128, 50,141,246, 97,128,  9,  7,
+    233,229,242,229,243,233,115,130,  0,239,110, 94,110,102,225,227,
+    245,244,101,128, 30, 47,227,249,242,233,236,236,233, 99,128,  4,
+    229,239,244,226,229,236,239,119,128, 30,203,101,  3,110,131,110,
+    147,110,158,226,242,229,246,229,227,249,242,233,236,236,233, 99,
+    128,  4,215,227,249,242,233,236,236,233, 99,128,  4, 53,245,238,
+    103,  4,110,170,110,205,110,220,110,229, 97,  2,110,176,110,191,
+    227,233,242,227,236,229,235,239,242,229,225,110,128, 50,117,240,
+    225,242,229,238,235,239,242,229,225,110,128, 50, 21,227,233,242,
+    227,236,229,235,239,242,229,225,110,128, 50,103,235,239,242,229,
+    225,110,128, 49, 71,240,225,242,229,238,235,239,242,229,225,110,
+    128, 50,  7,103,  2,110,249,111,  0,242,225,246,101,128,  0,236,
+    117,  2,111,  6,111, 15,234,225,242,225,244,105,128, 10,135,242,
+    237,245,235,232,105,128, 10,  7,104,  2,111, 30,111, 40,233,242,
+    225,231,225,238, 97,128, 48, 68,239,239,235,225,226,239,246,101,
+    128, 30,201,105,  8,111, 69,111, 79,111, 90,111, 97,111,122,111,
+    138,111,153,111,169,226,229,238,231,225,236,105,128,  9,136,227,
+    249,242,233,236,236,233, 99,128,  4, 56,228,229,246, 97,128,  9,
+      8,231,117,  2,111,104,111,113,234,225,242,225,244,105,128, 10,
+    136,242,237,245,235,232,105,128, 10,  8,237,225,244,242,225,231,
+    245,242,237,245,235,232,105,128, 10, 64,238,246,229,242,244,229,
+    228,226,242,229,246,101,128,  2, 11,243,232,239,242,244,227,249,
+    242,233,236,236,233, 99,128,  4, 57,246,239,247,229,236,243,233,
+    231,110,  3,111,185,111,195,111,202,226,229,238,231,225,236,105,
+    128,  9,192,228,229,246, 97,128,  9, 64,231,245,234,225,242,225,
+    244,105,128, 10,192,106,128,  1, 51,107,  2,111,223,111,247,225,
+    244,225,235,225,238, 97,129, 48,164,111,235,232,225,236,230,247,
+    233,228,244,104,128,255,114,239,242,229,225,110,128, 49, 99,108,
+      2,112,  5,112, 10,228,101,128,  2,220,245,249,232,229,226,242,
+    229,119,128,  5,172,109,  2,112, 27,112, 94, 97,  3,112, 35,112,
+     55,112, 80,227,242,239,110,129,  1, 43,112, 44,227,249,242,233,
+    236,236,233, 99,128,  4,227,231,229,239,242,225,240,240,242,239,
+    248,233,237,225,244,229,236,249,229,241,245,225,108,128, 34, 83,
+    244,242,225,231,245,242,237,245,235,232,105,128, 10, 63,239,238,
+    239,243,240,225,227,101,128,255, 73,110,  5,112,117,112,127,112,
+    136,112,148,112,232,227,242,229,237,229,238,116,128, 34,  6,230,
+    233,238,233,244,121,128, 34, 30,233,225,242,237,229,238,233,225,
+    110,128,  5,107,116,  2,112,154,112,222,101,  2,112,160,112,211,
+    231,242,225,108,131, 34, 43,112,173,112,191,112,196, 98,  2,112,
+    179,112,187,239,244,244,239,109,128, 35, 33,116,128, 35, 33,229,
+    120,128,248,245,116,  2,112,202,112,207,239,112,128, 35, 32,112,
+    128, 35, 32,242,243,229,227,244,233,239,110,128, 34, 41,233,243,
+    241,245,225,242,101,128, 51,  5,118,  3,112,240,112,249,113,  2,
+    226,245,236,236,229,116,128, 37,216,227,233,242,227,236,101,128,
+     37,217,243,237,233,236,229,230,225,227,101,128, 38, 59,111,  3,
+    113, 22,113, 33,113, 41,227,249,242,233,236,236,233, 99,128,  4,
+     81,231,239,238,229,107,128,  1, 47,244, 97,131,  3,185,113, 52,
+    113, 73,113, 81,228,233,229,242,229,243,233,115,129,  3,202,113,
+     65,244,239,238,239,115,128,  3,144,236,225,244,233,110,128,  2,
+    105,244,239,238,239,115,128,  3,175,240,225,242,229,110,128, 36,
+    164,242,233,231,245,242,237,245,235,232,105,128, 10,114,115,  4,
+    113,120,113,165,113,179,113,187,237,225,236,108,  2,113,129,113,
+    140,232,233,242,225,231,225,238, 97,128, 48, 67,235,225,244,225,
+    235,225,238, 97,129, 48,163,113,153,232,225,236,230,247,233,228,
+    244,104,128,255,104,243,232,225,242,226,229,238,231,225,236,105,
+    128,  9,250,244,242,239,235,101,128,  2,104,245,240,229,242,233,
+    239,114,128,246,237,116,  2,113,203,113,237,229,242,225,244,233,
+    239,110,  2,113,215,113,226,232,233,242,225,231,225,238, 97,128,
+     48,157,235,225,244,225,235,225,238, 97,128, 48,253,233,236,228,
+    101,129,  1, 41,113,246,226,229,236,239,119,128, 30, 45,117,  2,
+    114,  4,114, 15,226,239,240,239,237,239,230,111,128, 49, 41,227,
+    249,242,233,236,236,233, 99,128,  4, 78,246,239,247,229,236,243,
+    233,231,110,  3,114, 42,114, 52,114, 59,226,229,238,231,225,236,
+    105,128,  9,191,228,229,246, 97,128,  9, 63,231,245,234,225,242,
+    225,244,105,128, 10,191,250,232,233,244,243, 97,  2,114, 81,114,
+     92,227,249,242,233,236,236,233, 99,128,  4,117,228,226,236,231,
+    242,225,246,229,227,249,242,233,236,236,233, 99,128,  4,119,106,
+    138,  0,106,114,135,114,198,114,209,115,  3,115, 19,115,132,115,
+    201,115,206,115,218,115,226, 97,  4,114,145,114,156,114,166,114,
+    173,225,242,237,229,238,233,225,110,128,  5,113,226,229,238,231,
+    225,236,105,128,  9,156,228,229,246, 97,128,  9, 28,231,117,  2,
+    114,180,114,189,234,225,242,225,244,105,128, 10,156,242,237,245,
+    235,232,105,128, 10, 28,226,239,240,239,237,239,230,111,128, 49,
+     16, 99,  3,114,217,114,224,114,246,225,242,239,110,128,  1,240,
+    233,242, 99,  2,114,232,114,237,236,101,128, 36,217,245,237,230,
+    236,229,120,128,  1, 53,242,239,243,243,229,228,244,225,233,108,
+    128,  2,157,228,239,244,236,229,243,243,243,244,242,239,235,101,
+    128,  2, 95,101,  3,115, 27,115, 38,115,103,227,249,242,233,236,
+    236,233, 99,128,  4, 88,229,109,  4,115, 49,115, 58,115, 72,115,
+     88,225,242,225,226,233, 99,128,  6, 44,230,233,238,225,236,225,
+    242,225,226,233, 99,128,254,158,233,238,233,244,233,225,236,225,
+    242,225,226,233, 99,128,254,159,237,229,228,233,225,236,225,242,
+    225,226,233, 99,128,254,160,104,  2,115,109,115,118,225,242,225,
+    226,233, 99,128,  6,152,230,233,238,225,236,225,242,225,226,233,
+     99,128,251,139,104,  2,115,138,115,188, 97,  3,115,146,115,156,
+    115,163,226,229,238,231,225,236,105,128,  9,157,228,229,246, 97,
+    128,  9, 29,231,117,  2,115,170,115,179,234,225,242,225,244,105,
+    128, 10,157,242,237,245,235,232,105,128, 10, 29,229,232,225,242,
+    237,229,238,233,225,110,128,  5,123,233,115,128, 48,  4,237,239,
+    238,239,243,240,225,227,101,128,255, 74,240,225,242,229,110,128,
+     36,165,243,245,240,229,242,233,239,114,128,  2,178,107,146,  0,
+    107,116, 21,118,110,118,121,118,183,118,194,119, 28,119, 42,120,
+    150,121, 90,121,103,121,129,121,178,122, 60,122, 82,122, 95,122,
+    118,122,160,122,170, 97, 12,116, 47,116, 79,116,101,116,131,116,
+    245,117, 14,117, 44,117, 69,117,175,117,189,118, 56,118, 85, 98,
+      2,116, 53,116, 70,225,243,232,235,233,242,227,249,242,233,236,
+    236,233, 99,128,  4,161,229,238,231,225,236,105,128,  9,149, 99,
+      2,116, 85,116, 91,245,244,101,128, 30, 49,249,242,233,236,236,
+    233, 99,128,  4, 58,228,101,  2,116,108,116,126,243,227,229,238,
+    228,229,242,227,249,242,233,236,236,233, 99,128,  4,155,246, 97,
+    128,  9, 21,102,135,  5,219,116,149,116,158,116,178,116,192,116,
+    201,116,217,116,232,225,242,225,226,233, 99,128,  6, 67,228,225,
+    231,229,243,104,129,251, 59,116,169,232,229,226,242,229,119,128,
+    251, 59,230,233,238,225,236,225,242,225,226,233, 99,128,254,218,
+    232,229,226,242,229,119,128,  5,219,233,238,233,244,233,225,236,
+    225,242,225,226,233, 99,128,254,219,237,229,228,233,225,236,225,
+    242,225,226,233, 99,128,254,220,242,225,230,229,232,229,226,242,
+    229,119,128,251, 77,231,117,  2,116,252,117,  5,234,225,242,225,
+    244,105,128, 10,149,242,237,245,235,232,105,128, 10, 21,104,  2,
+    117, 20,117, 30,233,242,225,231,225,238, 97,128, 48, 75,239,239,
+    235,227,249,242,233,236,236,233, 99,128,  4,196,235,225,244,225,
+    235,225,238, 97,129, 48,171,117, 57,232,225,236,230,247,233,228,
+    244,104,128,255,118,112,  2,117, 75,117, 96,240, 97,129,  3,186,
+    117, 82,243,249,237,226,239,236,231,242,229,229,107,128,  3,240,
+    249,229,239,245,110,  3,117,108,117,122,117,156,237,233,229,245,
+    237,235,239,242,229,225,110,128, 49,113,112,  2,117,128,117,143,
+    232,233,229,245,240,232,235,239,242,229,225,110,128, 49,132,233,
+    229,245,240,235,239,242,229,225,110,128, 49,120,243,243,225,238,
+    231,240,233,229,245,240,235,239,242,229,225,110,128, 49,121,242,
+    239,242,233,233,243,241,245,225,242,101,128, 51, 13,115,  5,117,
+    201,117,245,118,  4,118, 12,118, 40,232,233,228,225,225,245,244,
+    111,  2,117,214,117,223,225,242,225,226,233, 99,128,  6, 64,238,
+    239,243,233,228,229,226,229,225,242,233,238,231,225,242,225,226,
+    233, 99,128,  6, 64,237,225,236,236,235,225,244,225,235,225,238,
+     97,128, 48,245,241,245,225,242,101,128, 51,132,242, 97,  2,118,
+     19,118, 28,225,242,225,226,233, 99,128,  6, 80,244,225,238,225,
+    242,225,226,233, 99,128,  6, 77,244,242,239,235,229,227,249,242,
+    233,236,236,233, 99,128,  4,159,244,225,232,233,242,225,240,242,
+    239,236,239,238,231,237,225,242,235,232,225,236,230,247,233,228,
+    244,104,128,255,112,246,229,242,244,233,227,225,236,243,244,242,
+    239,235,229,227,249,242,233,236,236,233, 99,128,  4,157,226,239,
+    240,239,237,239,230,111,128, 49, 14, 99,  4,118,131,118,153,118,
+    162,118,170, 97,  2,118,137,118,147,236,243,241,245,225,242,101,
+    128, 51,137,242,239,110,128,  1,233,229,228,233,236,236, 97,128,
+      1, 55,233,242,227,236,101,128, 36,218,239,237,237,225,225,227,
+    227,229,238,116,128,  1, 55,228,239,244,226,229,236,239,119,128,
+     30, 51,101,  4,118,204,118,231,119,  0,119, 12,104,  2,118,210,
+    118,221,225,242,237,229,238,233,225,110,128,  5,132,233,242,225,
+    231,225,238, 97,128, 48, 81,235,225,244,225,235,225,238, 97,129,
+     48,177,118,244,232,225,236,230,247,233,228,244,104,128,255,121,
+    238,225,242,237,229,238,233,225,110,128,  5,111,243,237,225,236,
+    236,235,225,244,225,235,225,238, 97,128, 48,246,231,242,229,229,
+    238,236,225,238,228,233, 99,128,  1, 56,104,  6,119, 56,119,185,
+    119,196,119,221,120, 52,120,140, 97,  5,119, 68,119, 78,119, 89,
+    119, 96,119,121,226,229,238,231,225,236,105,128,  9,150,227,249,
+    242,233,236,236,233, 99,128,  4, 69,228,229,246, 97,128,  9, 22,
+    231,117,  2,119,103,119,112,234,225,242,225,244,105,128, 10,150,
+    242,237,245,235,232,105,128, 10, 22,104,  4,119,131,119,140,119,
+    154,119,170,225,242,225,226,233, 99,128,  6, 46,230,233,238,225,
+    236,225,242,225,226,233, 99,128,254,166,233,238,233,244,233,225,
+    236,225,242,225,226,233, 99,128,254,167,237,229,228,233,225,236,
+    225,242,225,226,233, 99,128,254,168,229,233,227,239,240,244,233,
+     99,128,  3,231,232, 97,  2,119,203,119,210,228,229,246, 97,128,
+      9, 89,231,245,242,237,245,235,232,105,128, 10, 89,233,229,245,
+    235,104,  4,119,235,120, 14,120, 29,120, 38, 97,  2,119,241,120,
+      0,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,120,
+    240,225,242,229,238,235,239,242,229,225,110,128, 50, 24,227,233,
+    242,227,236,229,235,239,242,229,225,110,128, 50,106,235,239,242,
+    229,225,110,128, 49, 75,240,225,242,229,238,235,239,242,229,225,
+    110,128, 50, 10,111,  4,120, 62,120,111,120,121,120,126,235,104,
+      4,120, 73,120, 82,120, 91,120,101,225,233,244,232,225,105,128,
+     14,  2,239,238,244,232,225,105,128, 14,  5,245,225,244,244,232,
+    225,105,128, 14,  3,247,225,233,244,232,225,105,128, 14,  4,237,
+    245,244,244,232,225,105,128, 14, 91,239,107,128,  1,153,242,225,
+    235,232,225,238,231,244,232,225,105,128, 14,  6,250,243,241,245,
+    225,242,101,128, 51,145,105,  4,120,160,120,171,120,196,120,245,
+    232,233,242,225,231,225,238, 97,128, 48, 77,235,225,244,225,235,
+    225,238, 97,129, 48,173,120,184,232,225,236,230,247,233,228,244,
+    104,128,255,119,242,111,  3,120,205,120,220,120,236,231,245,242,
+    225,237,245,243,241,245,225,242,101,128, 51, 21,237,229,229,244,
+    239,242,245,243,241,245,225,242,101,128, 51, 22,243,241,245,225,
+    242,101,128, 51, 20,249,229,239,107,  5,121,  4,121, 39,121, 54,
+    121, 63,121, 77, 97,  2,121, 10,121, 25,227,233,242,227,236,229,
+    235,239,242,229,225,110,128, 50,110,240,225,242,229,238,235,239,
+    242,229,225,110,128, 50, 14,227,233,242,227,236,229,235,239,242,
+    229,225,110,128, 50, 96,235,239,242,229,225,110,128, 49, 49,240,
+    225,242,229,238,235,239,242,229,225,110,128, 50,  0,243,233,239,
+    243,235,239,242,229,225,110,128, 49, 51,234,229,227,249,242,233,
+    236,236,233, 99,128,  4, 92,108,  2,121,109,121,120,233,238,229,
+    226,229,236,239,119,128, 30, 53,243,241,245,225,242,101,128, 51,
+    152,109,  3,121,137,121,151,121,162,227,245,226,229,228,243,241,
+    245,225,242,101,128, 51,166,239,238,239,243,240,225,227,101,128,
+    255, 75,243,241,245,225,242,229,228,243,241,245,225,242,101,128,
+     51,162,111,  5,121,190,121,216,121,254,122, 10,122, 24,104,  2,
+    121,196,121,206,233,242,225,231,225,238, 97,128, 48, 83,237,243,
+    241,245,225,242,101,128, 51,192,235, 97,  2,121,223,121,231,233,
+    244,232,225,105,128, 14,  1,244,225,235,225,238, 97,129, 48,179,
+    121,242,232,225,236,230,247,233,228,244,104,128,255,122,239,240,
+    239,243,241,245,225,242,101,128, 51, 30,240,240,225,227,249,242,
+    233,236,236,233, 99,128,  4,129,114,  2,122, 30,122, 50,229,225,
+    238,243,244,225,238,228,225,242,228,243,249,237,226,239,108,128,
+     50,127,239,238,233,243,227,237, 98,128,  3, 67,240, 97,  2,122,
+     67,122, 73,242,229,110,128, 36,166,243,241,245,225,242,101,128,
+     51,170,243,233,227,249,242,233,236,236,233, 99,128,  4,111,116,
+      2,122,101,122,110,243,241,245,225,242,101,128, 51,207,245,242,
+    238,229,100,128,  2,158,117,  2,122,124,122,135,232,233,242,225,
+    231,225,238, 97,128, 48, 79,235,225,244,225,235,225,238, 97,129,
+     48,175,122,148,232,225,236,230,247,233,228,244,104,128,255,120,
+    246,243,241,245,225,242,101,128, 51,184,247,243,241,245,225,242,
+    101,128, 51,190,108,146,  0,108,122,220,124,247,125, 20,125, 86,
+    125,124,126, 20,126, 29,126, 45,126, 69,126, 87,126,205,126,246,
+    127,125,127,133,127,166,127,175,127,183,127,245, 97,  7,122,236,
+    122,246,122,253,123,  4,123, 29,123, 45,124,235,226,229,238,231,
+    225,236,105,128,  9,178,227,245,244,101,128,  1, 58,228,229,246,
+     97,128,  9, 50,231,117,  2,123, 11,123, 20,234,225,242,225,244,
+    105,128, 10,178,242,237,245,235,232,105,128, 10, 50,235,235,232,
+    225,238,231,249,225,239,244,232,225,105,128, 14, 69,109, 10,123,
+     67,124,  6,124, 23,124, 61,124, 75,124, 94,124,110,124,130,124,
+    150,124,173, 97,  2,123, 73,123,254,236,229,102,  4,123, 85,123,
+     99,123,191,123,208,230,233,238,225,236,225,242,225,226,233, 99,
+    128,254,252,232,225,237,250, 97,  2,123,109,123,150,225,226,239,
+    246,101,  2,123,119,123,133,230,233,238,225,236,225,242,225,226,
+    233, 99,128,254,248,233,243,239,236,225,244,229,228,225,242,225,
+    226,233, 99,128,254,247,226,229,236,239,119,  2,123,160,123,174,
+    230,233,238,225,236,225,242,225,226,233, 99,128,254,250,233,243,
+    239,236,225,244,229,228,225,242,225,226,233, 99,128,254,249,233,
+    243,239,236,225,244,229,228,225,242,225,226,233, 99,128,254,251,
+    237,225,228,228,225,225,226,239,246,101,  2,123,223,123,237,230,
+    233,238,225,236,225,242,225,226,233, 99,128,254,246,233,243,239,
+    236,225,244,229,228,225,242,225,226,233, 99,128,254,245,242,225,
+    226,233, 99,128,  6, 68,226,228, 97,129,  3,187,124, 14,243,244,
+    242,239,235,101,128,  1,155,229,100,130,  5,220,124, 32,124, 52,
+    228,225,231,229,243,104,129,251, 60,124, 43,232,229,226,242,229,
+    119,128,251, 60,232,229,226,242,229,119,128,  5,220,230,233,238,
+    225,236,225,242,225,226,233, 99,128,254,222,232,225,232,233,238,
+    233,244,233,225,236,225,242,225,226,233, 99,128,252,202,233,238,
+    233,244,233,225,236,225,242,225,226,233, 99,128,254,223,234,229,
+    229,237,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,
+    252,201,235,232,225,232,233,238,233,244,233,225,236,225,242,225,
+    226,233, 99,128,252,203,236,225,237,232,229,232,233,243,239,236,
+    225,244,229,228,225,242,225,226,233, 99,128,253,242,237,101,  2,
+    124,180,124,193,228,233,225,236,225,242,225,226,233, 99,128,254,
+    224,229,109,  2,124,200,124,219,232,225,232,233,238,233,244,233,
+    225,236,225,242,225,226,233, 99,128,253,136,233,238,233,244,233,
+    225,236,225,242,225,226,233, 99,128,252,204,242,231,229,227,233,
+    242,227,236,101,128, 37,239, 98,  3,124,255,125,  4,125, 10,225,
+    114,128,  1,154,229,236,116,128,  2,108,239,240,239,237,239,230,
+    111,128, 49, 12, 99,  4,125, 30,125, 37,125, 46,125, 73,225,242,
+    239,110,128,  1, 62,229,228,233,236,236, 97,128,  1, 60,233,242,
+     99,  2,125, 54,125, 59,236,101,128, 36,219,245,237,230,236,229,
+    248,226,229,236,239,119,128, 30, 61,239,237,237,225,225,227,227,
+    229,238,116,128,  1, 60,228,239,116,130,  1, 64,125, 96,125,105,
+    225,227,227,229,238,116,128,  1, 64,226,229,236,239,119,129, 30,
+     55,125,115,237,225,227,242,239,110,128, 30, 57,101,  3,125,132,
+    125,170,126, 15,230,116,  2,125,139,125,155,225,238,231,236,229,
+    225,226,239,246,229,227,237, 98,128,  3, 26,244,225,227,235,226,
+    229,236,239,247,227,237, 98,128,  3, 24,243,115,132,  0, 60,125,
+    183,125,205,125,217,126,  7,229,241,245,225,108,129, 34,100,125,
+    193,239,242,231,242,229,225,244,229,114,128, 34,218,237,239,238,
+    239,243,240,225,227,101,128,255, 28,111,  2,125,223,125,252,114,
+      2,125,229,125,242,229,241,245,233,246,225,236,229,238,116,128,
+     34,114,231,242,229,225,244,229,114,128, 34,118,246,229,242,229,
+    241,245,225,108,128, 34,102,243,237,225,236,108,128,254,100,250,
+    104,128,  2,110,230,226,236,239,227,107,128, 37,140,232,239,239,
+    235,242,229,244,242,239,230,236,229,120,128,  2,109,105,  2,126,
+     51,126, 56,242, 97,128, 32,164,247,238,225,242,237,229,238,233,
+    225,110,128,  5,108,106,129,  1,201,126, 75,229,227,249,242,233,
+    236,236,233, 99,128,  4, 89,108,132,246,192,126, 99,126,123,126,
+    134,126,143, 97,  2,126,105,126,112,228,229,246, 97,128,  9, 51,
+    231,245,234,225,242,225,244,105,128, 10,179,233,238,229,226,229,
+    236,239,119,128, 30, 59,236,225,228,229,246, 97,128,  9, 52,246,
+    239,227,225,236,233, 99,  3,126,157,126,167,126,174,226,229,238,
+    231,225,236,105,128,  9,225,228,229,246, 97,128,  9, 97,246,239,
+    247,229,236,243,233,231,110,  2,126,188,126,198,226,229,238,231,
+    225,236,105,128,  9,227,228,229,246, 97,128,  9, 99,109,  3,126,
+    213,126,226,126,237,233,228,228,236,229,244,233,236,228,101,128,
+      2,107,239,238,239,243,240,225,227,101,128,255, 76,243,241,245,
+    225,242,101,128, 51,208,111,  6,127,  4,127, 16,127, 58,127, 69,
+    127, 75,127,117,227,232,245,236,225,244,232,225,105,128, 14, 44,
+    231,233,227,225,108,  3,127, 28,127, 34,127, 53,225,238,100,128,
+     34, 39,238,239,116,129,  0,172,127, 42,242,229,246,229,242,243,
+    229,100,128, 35, 16,239,114,128, 34, 40,236,233,238,231,244,232,
+    225,105,128, 14, 37,238,231,115,128,  1,127,247,236,233,238,101,
+      2,127, 85,127,108, 99,  2,127, 91,127,103,229,238,244,229,242,
+    236,233,238,101,128,254, 78,237, 98,128,  3, 50,228,225,243,232,
+    229,100,128,254, 77,250,229,238,231,101,128, 37,202,240,225,242,
+    229,110,128, 36,167,115,  3,127,141,127,148,127,156,236,225,243,
+    104,128,  1, 66,241,245,225,242,101,128, 33, 19,245,240,229,242,
+    233,239,114,128,246,238,244,243,232,225,228,101,128, 37,145,245,
+    244,232,225,105,128, 14, 38,246,239,227,225,236,233, 99,  3,127,
+    197,127,207,127,214,226,229,238,231,225,236,105,128,  9,140,228,
+    229,246, 97,128,  9, 12,246,239,247,229,236,243,233,231,110,  2,
+    127,228,127,238,226,229,238,231,225,236,105,128,  9,226,228,229,
+    246, 97,128,  9, 98,248,243,241,245,225,242,101,128, 51,211,109,
+    144,  0,109,128, 35,130,144,130,169,130,196,130,221,132, 18,132,
+     40,133, 95,133,125,133,174,134, 25,134, 47,134, 72,134, 81,135,
+    108,135,136, 97, 12,128, 61,128, 71,128,135,128,142,128,167,128,
+    215,130, 51,130, 76,130, 81,130, 95,130,107,130,112,226,229,238,
+    231,225,236,105,128,  9,174, 99,  2,128, 77,128,129,242,239,110,
+    132,  0,175,128, 91,128,102,128,108,128,117,226,229,236,239,247,
+    227,237, 98,128,  3, 49,227,237, 98,128,  3,  4,236,239,247,237,
+    239,100,128,  2,205,237,239,238,239,243,240,225,227,101,128,255,
+    227,245,244,101,128, 30, 63,228,229,246, 97,128,  9, 46,231,117,
+      2,128,149,128,158,234,225,242,225,244,105,128, 10,174,242,237,
+    245,235,232,105,128, 10, 46,104,  2,128,173,128,205,225,240,225,
+    235,104,  2,128,183,128,192,232,229,226,242,229,119,128,  5,164,
+    236,229,230,244,232,229,226,242,229,119,128,  5,164,233,242,225,
+    231,225,238, 97,128, 48,126,105,  5,128,227,129, 40,129,103,129,
+    133,130, 39,227,232,225,244,244,225,247, 97,  3,128,242,129, 17,
+    129, 24,236,239,119,  2,128,250,129,  5,236,229,230,244,244,232,
+    225,105,128,248,149,242,233,231,232,244,244,232,225,105,128,248,
+    148,244,232,225,105,128, 14, 75,245,240,240,229,242,236,229,230,
+    244,244,232,225,105,128,248,147,229,107,  3,129, 49,129, 80,129,
+     87,236,239,119,  2,129, 57,129, 68,236,229,230,244,244,232,225,
+    105,128,248,140,242,233,231,232,244,244,232,225,105,128,248,139,
+    244,232,225,105,128, 14, 72,245,240,240,229,242,236,229,230,244,
+    244,232,225,105,128,248,138,232,225,238,225,235,225,116,  2,129,
+    115,129,126,236,229,230,244,244,232,225,105,128,248,132,244,232,
+    225,105,128, 14, 49,116,  3,129,141,129,169,129,232,225,233,235,
+    232,117,  2,129,151,129,162,236,229,230,244,244,232,225,105,128,
+    248,137,244,232,225,105,128, 14, 71,232,111,  3,129,178,129,209,
+    129,216,236,239,119,  2,129,186,129,197,236,229,230,244,244,232,
+    225,105,128,248,143,242,233,231,232,244,244,232,225,105,128,248,
+    142,244,232,225,105,128, 14, 73,245,240,240,229,242,236,229,230,
+    244,244,232,225,105,128,248,141,242,105,  3,129,241,130, 16,130,
+     23,236,239,119,  2,129,249,130,  4,236,229,230,244,244,232,225,
+    105,128,248,146,242,233,231,232,244,244,232,225,105,128,248,145,
+    244,232,225,105,128, 14, 74,245,240,240,229,242,236,229,230,244,
+    244,232,225,105,128,248,144,249,225,237,239,235,244,232,225,105,
+    128, 14, 70,235,225,244,225,235,225,238, 97,129, 48,222,130, 64,
+    232,225,236,230,247,233,228,244,104,128,255,143,236,101,128, 38,
+     66,238,243,249,239,238,243,241,245,225,242,101,128, 51, 71,241,
+    225,230,232,229,226,242,229,119,128,  5,190,242,115,128, 38, 66,
+    115,  2,130,118,130,136,239,242,225,227,233,242,227,236,229,232,
+    229,226,242,229,119,128,  5,175,241,245,225,242,101,128, 51,131,
+     98,  2,130,150,130,160,239,240,239,237,239,230,111,128, 49,  7,
+    243,241,245,225,242,101,128, 51,212, 99,  2,130,175,130,183,233,
+    242,227,236,101,128, 36,220,245,226,229,228,243,241,245,225,242,
+    101,128, 51,165,228,239,116,  2,130,204,130,213,225,227,227,229,
+    238,116,128, 30, 65,226,229,236,239,119,128, 30, 67,101,  7,130,
+    237,131,108,131,119,131,134,131,159,131,196,131,208,101,  2,130,
+    243,131, 95,109,  4,130,253,131,  6,131, 20,131, 36,225,242,225,
+    226,233, 99,128,  6, 69,230,233,238,225,236,225,242,225,226,233,
+     99,128,254,226,233,238,233,244,233,225,236,225,242,225,226,233,
+     99,128,254,227,237,101,  2,131, 43,131, 56,228,233,225,236,225,
+    242,225,226,233, 99,128,254,228,229,237,105,  2,131, 64,131, 79,
+    238,233,244,233,225,236,225,242,225,226,233, 99,128,252,209,243,
+    239,236,225,244,229,228,225,242,225,226,233, 99,128,252, 72,244,
+    239,242,245,243,241,245,225,242,101,128, 51, 77,232,233,242,225,
+    231,225,238, 97,128, 48,129,233,250,233,229,242,225,243,241,245,
+    225,242,101,128, 51,126,235,225,244,225,235,225,238, 97,129, 48,
+    225,131,147,232,225,236,230,247,233,228,244,104,128,255,146,109,
+    130,  5,222,131,167,131,187,228,225,231,229,243,104,129,251, 62,
+    131,178,232,229,226,242,229,119,128,251, 62,232,229,226,242,229,
+    119,128,  5,222,238,225,242,237,229,238,233,225,110,128,  5,116,
+    242,235,232, 97,  3,131,219,131,228,132,  5,232,229,226,242,229,
+    119,128,  5,165,235,229,230,245,236, 97,  2,131,239,131,248,232,
+    229,226,242,229,119,128,  5,166,236,229,230,244,232,229,226,242,
+    229,119,128,  5,166,236,229,230,244,232,229,226,242,229,119,128,
+      5,165,104,  2,132, 24,132, 30,239,239,107,128,  2,113,250,243,
+    241,245,225,242,101,128, 51,146,105,  6,132, 54,132, 91,132,228,
+    132,239,133,  8,133, 65,228,100,  2,132, 61,132, 86,236,229,228,
+    239,244,235,225,244,225,235,225,238,225,232,225,236,230,247,233,
+    228,244,104,128,255,101,239,116,128,  0,183,229,245,109,  5,132,
+    105,132,140,132,155,132,164,132,215, 97,  2,132,111,132,126,227,
+    233,242,227,236,229,235,239,242,229,225,110,128, 50,114,240,225,
+    242,229,238,235,239,242,229,225,110,128, 50, 18,227,233,242,227,
+    236,229,235,239,242,229,225,110,128, 50,100,235,239,242,229,225,
+    110,128, 49, 65,112,  2,132,170,132,202, 97,  2,132,176,132,190,
+    238,243,233,239,243,235,239,242,229,225,110,128, 49,112,242,229,
+    238,235,239,242,229,225,110,128, 50,  4,233,229,245,240,235,239,
+    242,229,225,110,128, 49,110,243,233,239,243,235,239,242,229,225,
+    110,128, 49,111,232,233,242,225,231,225,238, 97,128, 48,127,235,
+    225,244,225,235,225,238, 97,129, 48,223,132,252,232,225,236,230,
+    247,233,228,244,104,128,255,144,238,117,  2,133, 15,133, 60,115,
+    132, 34, 18,133, 27,133, 38,133, 47,133, 53,226,229,236,239,247,
+    227,237, 98,128,  3, 32,227,233,242,227,236,101,128, 34,150,237,
+    239,100,128,  2,215,240,236,245,115,128, 34, 19,244,101,128, 32,
+     50,242,105,  2,133, 72,133, 86,226,225,225,242,245,243,241,245,
+    225,242,101,128, 51, 74,243,241,245,225,242,101,128, 51, 73,108,
+      2,133,101,133,116,239,238,231,236,229,231,244,245,242,238,229,
+    100,128,  2,112,243,241,245,225,242,101,128, 51,150,109,  3,133,
+    133,133,147,133,158,227,245,226,229,228,243,241,245,225,242,101,
+    128, 51,163,239,238,239,243,240,225,227,101,128,255, 77,243,241,
+    245,225,242,229,228,243,241,245,225,242,101,128, 51,159,111,  5,
+    133,186,133,212,133,237,133,247,134,  0,104,  2,133,192,133,202,
+    233,242,225,231,225,238, 97,128, 48,130,237,243,241,245,225,242,
+    101,128, 51,193,235,225,244,225,235,225,238, 97,129, 48,226,133,
+    225,232,225,236,230,247,233,228,244,104,128,255,147,236,243,241,
+    245,225,242,101,128, 51,214,237,225,244,232,225,105,128, 14, 33,
+    246,229,242,243,243,241,245,225,242,101,129, 51,167,134, 15,228,
+    243,241,245,225,242,101,128, 51,168,240, 97,  2,134, 32,134, 38,
+    242,229,110,128, 36,168,243,241,245,225,242,101,128, 51,171,115,
+      2,134, 53,134, 62,243,241,245,225,242,101,128, 51,179,245,240,
+    229,242,233,239,114,128,246,239,244,245,242,238,229,100,128,  2,
+    111,117,141,  0,181,134,111,134,115,134,125,134,149,134,159,134,
+    181,134,192,134,217,134,240,134,250,135, 24,135, 88,135, 98, 49,
+    128,  0,181,225,243,241,245,225,242,101,128, 51,130,227,104,  2,
+    134,132,134,142,231,242,229,225,244,229,114,128, 34,107,236,229,
+    243,115,128, 34,106,230,243,241,245,225,242,101,128, 51,140,103,
+      2,134,165,134,172,242,229,229,107,128,  3,188,243,241,245,225,
+    242,101,128, 51,141,232,233,242,225,231,225,238, 97,128, 48,128,
+    235,225,244,225,235,225,238, 97,129, 48,224,134,205,232,225,236,
+    230,247,233,228,244,104,128,255,145,108,  2,134,223,134,232,243,
+    241,245,225,242,101,128, 51,149,244,233,240,236,121,128,  0,215,
+    237,243,241,245,225,242,101,128, 51,155,238,225,104,  2,135,  2,
+    135, 11,232,229,226,242,229,119,128,  5,163,236,229,230,244,232,
+    229,226,242,229,119,128,  5,163,115,  2,135, 30,135, 79,233, 99,
+      3,135, 39,135, 56,135, 67,225,236,238,239,244,101,129, 38,106,
+    135, 50,228,226,108,128, 38,107,230,236,225,244,243,233,231,110,
+    128, 38,109,243,232,225,242,240,243,233,231,110,128, 38,111,243,
+    241,245,225,242,101,128, 51,178,246,243,241,245,225,242,101,128,
+     51,182,247,243,241,245,225,242,101,128, 51,188,118,  2,135,114,
+    135,127,237,229,231,225,243,241,245,225,242,101,128, 51,185,243,
+    241,245,225,242,101,128, 51,183,119,  2,135,142,135,155,237,229,
+    231,225,243,241,245,225,242,101,128, 51,191,243,241,245,225,242,
+    101,128, 51,189,110,150,  0,110,135,212,136, 90,136,114,136,180,
+    136,205,137,  7,137, 17,137, 84,137,127,139,161,139,179,139,204,
+    139,235,140,  5,140, 70,142, 52,142, 60,142, 85,142, 93,143, 61,
+    143, 71,143, 81, 97,  8,135,230,135,250,136,  1,136,  8,136, 33,
+    136, 44,136, 69,136, 81, 98,  2,135,236,135,245,229,238,231,225,
+    236,105,128,  9,168,236, 97,128, 34,  7,227,245,244,101,128,  1,
+     68,228,229,246, 97,128,  9, 40,231,117,  2,136, 15,136, 24,234,
+    225,242,225,244,105,128, 10,168,242,237,245,235,232,105,128, 10,
+     40,232,233,242,225,231,225,238, 97,128, 48,106,235,225,244,225,
+    235,225,238, 97,129, 48,202,136, 57,232,225,236,230,247,233,228,
+    244,104,128,255,133,240,239,243,244,242,239,240,232,101,128,  1,
+     73,243,241,245,225,242,101,128, 51,129, 98,  2,136, 96,136,106,
+    239,240,239,237,239,230,111,128, 49, 11,243,240,225,227,101,128,
+      0,160, 99,  4,136,124,136,131,136,140,136,167,225,242,239,110,
+    128,  1, 72,229,228,233,236,236, 97,128,  1, 70,233,242, 99,  2,
+    136,148,136,153,236,101,128, 36,221,245,237,230,236,229,248,226,
+    229,236,239,119,128, 30, 75,239,237,237,225,225,227,227,229,238,
+    116,128,  1, 70,228,239,116,  2,136,188,136,197,225,227,227,229,
+    238,116,128, 30, 69,226,229,236,239,119,128, 30, 71,101,  3,136,
+    213,136,224,136,249,232,233,242,225,231,225,238, 97,128, 48,109,
+    235,225,244,225,235,225,238, 97,129, 48,205,136,237,232,225,236,
+    230,247,233,228,244,104,128,255,136,247,243,232,229,241,229,236,
+    243,233,231,110,128, 32,170,230,243,241,245,225,242,101,128, 51,
+    139,103,  2,137, 23,137, 73, 97,  3,137, 31,137, 41,137, 48,226,
+    229,238,231,225,236,105,128,  9,153,228,229,246, 97,128,  9, 25,
+    231,117,  2,137, 55,137, 64,234,225,242,225,244,105,128, 10,153,
+    242,237,245,235,232,105,128, 10, 25,239,238,231,245,244,232,225,
+    105,128, 14,  7,104,  2,137, 90,137,100,233,242,225,231,225,238,
+     97,128, 48,147,239,239,107,  2,137,108,137,115,236,229,230,116,
+    128,  2,114,242,229,244,242,239,230,236,229,120,128,  2,115,105,
+      4,137,137,138, 50,138, 61,138,119,229,245,110,  7,137,155,137,
+    190,137,222,137,236,137,245,138, 22,138, 35, 97,  2,137,161,137,
+    176,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,111,
+    240,225,242,229,238,235,239,242,229,225,110,128, 50, 15,227,105,
+      2,137,197,137,209,229,245,227,235,239,242,229,225,110,128, 49,
+     53,242,227,236,229,235,239,242,229,225,110,128, 50, 97,232,233,
+    229,245,232,235,239,242,229,225,110,128, 49, 54,235,239,242,229,
+    225,110,128, 49, 52,240, 97,  2,137,252,138, 10,238,243,233,239,
+    243,235,239,242,229,225,110,128, 49,104,242,229,238,235,239,242,
+    229,225,110,128, 50,  1,243,233,239,243,235,239,242,229,225,110,
+    128, 49,103,244,233,235,229,245,244,235,239,242,229,225,110,128,
+     49,102,232,233,242,225,231,225,238, 97,128, 48,107,107,  2,138,
+     67,138, 91,225,244,225,235,225,238, 97,129, 48,203,138, 79,232,
+    225,236,230,247,233,228,244,104,128,255,134,232,225,232,233,116,
+      2,138,101,138,112,236,229,230,244,244,232,225,105,128,248,153,
+    244,232,225,105,128, 14, 77,238,101,141,  0, 57,138,150,138,159,
+    138,169,138,199,138,206,138,231,139,  2,139, 36,139, 48,139, 59,
+    139, 92,139,100,139,111,225,242,225,226,233, 99,128,  6,105,226,
+    229,238,231,225,236,105,128,  9,239,227,233,242,227,236,101,129,
+     36,104,138,180,233,238,246,229,242,243,229,243,225,238,243,243,
+    229,242,233,102,128, 39,146,228,229,246, 97,128,  9,111,231,117,
+      2,138,213,138,222,234,225,242,225,244,105,128, 10,239,242,237,
+    245,235,232,105,128, 10,111,232, 97,  2,138,238,138,249,227,235,
+    225,242,225,226,233, 99,128,  6,105,238,231,250,232,239,117,128,
+     48, 41,105,  2,139,  8,139, 26,228,229,239,231,242,225,240,232,
+    233,227,240,225,242,229,110,128, 50, 40,238,230,229,242,233,239,
+    114,128, 32,137,237,239,238,239,243,240,225,227,101,128,255, 25,
+    239,236,228,243,244,249,236,101,128,247, 57,112,  2,139, 65,139,
+     72,225,242,229,110,128, 36,124,229,114,  2,139, 79,139, 85,233,
+    239,100,128, 36,144,243,233,225,110,128,  6,249,242,239,237,225,
+    110,128, 33,120,243,245,240,229,242,233,239,114,128, 32,121,116,
+      2,139,117,139,155,229,229,110,  2,139,125,139,134,227,233,242,
+    227,236,101,128, 36,114,112,  2,139,140,139,147,225,242,229,110,
+    128, 36,134,229,242,233,239,100,128, 36,154,232,225,105,128, 14,
+     89,106,129,  1,204,139,167,229,227,249,242,233,236,236,233, 99,
+    128,  4, 90,235,225,244,225,235,225,238, 97,129, 48,243,139,192,
+    232,225,236,230,247,233,228,244,104,128,255,157,108,  2,139,210,
+    139,224,229,231,242,233,231,232,244,236,239,238,103,128,  1,158,
+    233,238,229,226,229,236,239,119,128, 30, 73,109,  2,139,241,139,
+    252,239,238,239,243,240,225,227,101,128,255, 78,243,241,245,225,
+    242,101,128, 51,154,110,  2,140, 11,140, 61, 97,  3,140, 19,140,
+     29,140, 36,226,229,238,231,225,236,105,128,  9,163,228,229,246,
+     97,128,  9, 35,231,117,  2,140, 43,140, 52,234,225,242,225,244,
+    105,128, 10,163,242,237,245,235,232,105,128, 10, 35,238,225,228,
+    229,246, 97,128,  9, 41,111,  6,140, 84,140, 95,140,120,140,161,
+    141,113,142, 40,232,233,242,225,231,225,238, 97,128, 48,110,235,
+    225,244,225,235,225,238, 97,129, 48,206,140,108,232,225,236,230,
+    247,233,228,244,104,128,255,137,110,  3,140,128,140,144,140,153,
+    226,242,229,225,235,233,238,231,243,240,225,227,101,128,  0,160,
+    229,238,244,232,225,105,128, 14, 19,245,244,232,225,105,128, 14,
+     25,239,110,  7,140,178,140,187,140,201,140,235,140,251,141, 36,
+    141, 95,225,242,225,226,233, 99,128,  6, 70,230,233,238,225,236,
+    225,242,225,226,233, 99,128,254,230,231,232,245,238,238, 97,  2,
+    140,212,140,221,225,242,225,226,233, 99,128,  6,186,230,233,238,
+    225,236,225,242,225,226,233, 99,128,251,159,233,238,233,244,233,
+    225,236,225,242,225,226,233, 99,128,254,231,234,229,229,237,105,
+      2,141,  5,141, 20,238,233,244,233,225,236,225,242,225,226,233,
+     99,128,252,210,243,239,236,225,244,229,228,225,242,225,226,233,
+     99,128,252, 75,237,101,  2,141, 43,141, 56,228,233,225,236,225,
+    242,225,226,233, 99,128,254,232,229,237,105,  2,141, 64,141, 79,
+    238,233,244,233,225,236,225,242,225,226,233, 99,128,252,213,243,
+    239,236,225,244,229,228,225,242,225,226,233, 99,128,252, 78,238,
+    239,239,238,230,233,238,225,236,225,242,225,226,233, 99,128,252,
+    141,116,  7,141,129,141,140,141,169,141,204,141,216,141,236,142,
+      6,227,239,238,244,225,233,238,115,128, 34, 12,101,  2,141,146,
+    141,162,236,229,237,229,238,116,129, 34,  9,141,157,239,102,128,
+     34,  9,241,245,225,108,128, 34, 96,231,242,229,225,244,229,114,
+    129, 34,111,141,181,238,239,114,  2,141,189,141,197,229,241,245,
+    225,108,128, 34,113,236,229,243,115,128, 34,121,233,228,229,238,
+    244,233,227,225,108,128, 34, 98,236,229,243,115,129, 34,110,141,
+    225,238,239,242,229,241,245,225,108,128, 34,112,112,  2,141,242,
+    141,252,225,242,225,236,236,229,108,128, 34, 38,242,229,227,229,
+    228,229,115,128, 34,128,243,117,  3,142, 15,142, 22,142, 31,226,
+    243,229,116,128, 34,132,227,227,229,229,228,115,128, 34,129,240,
+    229,242,243,229,116,128, 34,133,247,225,242,237,229,238,233,225,
+    110,128,  5,118,240,225,242,229,110,128, 36,169,115,  2,142, 66,
+    142, 75,243,241,245,225,242,101,128, 51,177,245,240,229,242,233,
+    239,114,128, 32,127,244,233,236,228,101,128,  0,241,117,132,  3,
+    189,142,105,142,116,142,197,143, 24,232,233,242,225,231,225,238,
+     97,128, 48,108,107,  2,142,122,142,146,225,244,225,235,225,238,
+     97,129, 48,204,142,134,232,225,236,230,247,233,228,244,104,128,
+    255,135,244, 97,  3,142,155,142,165,142,172,226,229,238,231,225,
+    236,105,128,  9,188,228,229,246, 97,128,  9, 60,231,117,  2,142,
+    179,142,188,234,225,242,225,244,105,128, 10,188,242,237,245,235,
+    232,105,128, 10, 60,109,  2,142,203,142,237,226,229,242,243,233,
+    231,110,130,  0, 35,142,217,142,229,237,239,238,239,243,240,225,
+    227,101,128,255,  3,243,237,225,236,108,128,254, 95,229,114,  2,
+    142,244,143, 20,225,236,243,233,231,110,  2,142,255,143,  7,231,
+    242,229,229,107,128,  3,116,236,239,247,229,242,231,242,229,229,
+    107,128,  3,117,111,128, 33, 22,110,130,  5,224,143, 32,143, 52,
+    228,225,231,229,243,104,129,251, 64,143, 43,232,229,226,242,229,
+    119,128,251, 64,232,229,226,242,229,119,128,  5,224,246,243,241,
+    245,225,242,101,128, 51,181,247,243,241,245,225,242,101,128, 51,
+    187,249, 97,  3,143, 90,143,100,143,107,226,229,238,231,225,236,
+    105,128,  9,158,228,229,246, 97,128,  9, 30,231,117,  2,143,114,
+    143,123,234,225,242,225,244,105,128, 10,158,242,237,245,235,232,
+    105,128, 10, 30,111,147,  0,111,143,174,143,196,144, 18,144,188,
+    145,  4,145, 19,145, 59,145,182,145,203,145,241,145,252,146,174,
+    148,  8,148, 72,148,105,148,151,149, 24,149, 71,149, 83, 97,  2,
+    143,180,143,187,227,245,244,101,128,  0,243,238,231,244,232,225,
+    105,128, 14, 45, 98,  4,143,206,143,248,144,  1,144, 11,225,242,
+    242,229,100,130,  2,117,143,218,143,229,227,249,242,233,236,236,
+    233, 99,128,  4,233,228,233,229,242,229,243,233,243,227,249,242,
+    233,236,236,233, 99,128,  4,235,229,238,231,225,236,105,128,  9,
+    147,239,240,239,237,239,230,111,128, 49, 27,242,229,246,101,128,
+      1, 79, 99,  3,144, 26,144, 99,144,178, 97,  2,144, 32,144, 93,
+    238,228,242, 97,  3,144, 43,144, 50,144, 61,228,229,246, 97,128,
+      9, 17,231,245,234,225,242,225,244,105,128, 10,145,246,239,247,
+    229,236,243,233,231,110,  2,144, 75,144, 82,228,229,246, 97,128,
+      9, 73,231,245,234,225,242,225,244,105,128, 10,201,242,239,110,
+    128,  1,210,233,242, 99,  2,144,107,144,112,236,101,128, 36,222,
+    245,237,230,236,229,120,133,  0,244,144,131,144,139,144,150,144,
+    158,144,170,225,227,245,244,101,128, 30,209,228,239,244,226,229,
+    236,239,119,128, 30,217,231,242,225,246,101,128, 30,211,232,239,
+    239,235,225,226,239,246,101,128, 30,213,244,233,236,228,101,128,
+     30,215,249,242,233,236,236,233, 99,128,  4, 62,100,  4,144,198,
+    144,221,144,227,144,250,226,108,  2,144,205,144,213,225,227,245,
+    244,101,128,  1, 81,231,242,225,246,101,128,  2, 13,229,246, 97,
+    128,  9, 19,233,229,242,229,243,233,115,129,  0,246,144,239,227,
+    249,242,233,236,236,233, 99,128,  4,231,239,244,226,229,236,239,
+    119,128, 30,205,101,129,  1, 83,145, 10,235,239,242,229,225,110,
+    128, 49, 90,103,  3,145, 27,145, 42,145, 49,239,238,229,107,129,
+      2,219,145, 36,227,237, 98,128,  3, 40,242,225,246,101,128,  0,
+    242,245,234,225,242,225,244,105,128, 10,147,104,  4,145, 69,145,
+     80,145, 90,145,168,225,242,237,229,238,233,225,110,128,  5,133,
+    233,242,225,231,225,238, 97,128, 48, 74,111,  2,145, 96,145,106,
+    239,235,225,226,239,246,101,128, 30,207,242,110,133,  1,161,145,
+    121,145,129,145,140,145,148,145,160,225,227,245,244,101,128, 30,
+    219,228,239,244,226,229,236,239,119,128, 30,227,231,242,225,246,
+    101,128, 30,221,232,239,239,235,225,226,239,246,101,128, 30,223,
+    244,233,236,228,101,128, 30,225,245,238,231,225,242,245,237,236,
+    225,245,116,128,  1, 81,105,129,  1,163,145,188,238,246,229,242,
+    244,229,228,226,242,229,246,101,128,  2, 15,107,  2,145,209,145,
+    233,225,244,225,235,225,238, 97,129, 48,170,145,221,232,225,236,
+    230,247,233,228,244,104,128,255,117,239,242,229,225,110,128, 49,
+     87,236,229,232,229,226,242,229,119,128,  5,171,109,  6,146, 10,
+    146, 38,146, 45,146,134,146,145,146,163,225,227,242,239,110,130,
+      1, 77,146, 22,146, 30,225,227,245,244,101,128, 30, 83,231,242,
+    225,246,101,128, 30, 81,228,229,246, 97,128,  9, 80,229,231, 97,
+    133,  3,201,146, 61,146, 65,146, 76,146, 90,146,106, 49,128,  3,
+    214,227,249,242,233,236,236,233, 99,128,  4, 97,236,225,244,233,
+    238,227,236,239,243,229,100,128,  2,119,242,239,245,238,228,227,
+    249,242,233,236,236,233, 99,128,  4,123,116,  2,146,112,146,127,
+    233,244,236,239,227,249,242,233,236,236,233, 99,128,  4,125,239,
+    238,239,115,128,  3,206,231,245,234,225,242,225,244,105,128, 10,
+    208,233,227,242,239,110,129,  3,191,146,155,244,239,238,239,115,
+    128,  3,204,239,238,239,243,240,225,227,101,128,255, 79,238,101,
+    145,  0, 49,146,213,146,222,146,232,147,  6,147, 31,147, 40,147,
+     49,147, 74,147,108,147,142,147,154,147,173,147,184,147,217,147,
+    227,147,235,147,246,225,242,225,226,233, 99,128,  6, 97,226,229,
+    238,231,225,236,105,128,  9,231,227,233,242,227,236,101,129, 36,
+     96,146,243,233,238,246,229,242,243,229,243,225,238,243,243,229,
+    242,233,102,128, 39,138,100,  2,147, 12,147, 18,229,246, 97,128,
+      9,103,239,244,229,238,236,229,225,228,229,114,128, 32, 36,229,
+    233,231,232,244,104,128, 33, 91,230,233,244,244,229,100,128,246,
+    220,231,117,  2,147, 56,147, 65,234,225,242,225,244,105,128, 10,
+    231,242,237,245,235,232,105,128, 10,103,232, 97,  3,147, 83,147,
+     94,147, 99,227,235,225,242,225,226,233, 99,128,  6, 97,236,102,
+    128,  0,189,238,231,250,232,239,117,128, 48, 33,105,  2,147,114,
+    147,132,228,229,239,231,242,225,240,232,233,227,240,225,242,229,
+    110,128, 50, 32,238,230,229,242,233,239,114,128, 32,129,237,239,
+    238,239,243,240,225,227,101,128,255, 17,238,245,237,229,242,225,
+    244,239,242,226,229,238,231,225,236,105,128,  9,244,239,236,228,
+    243,244,249,236,101,128,247, 49,112,  2,147,190,147,197,225,242,
+    229,110,128, 36,116,229,114,  2,147,204,147,210,233,239,100,128,
+     36,136,243,233,225,110,128,  6,241,241,245,225,242,244,229,114,
+    128,  0,188,242,239,237,225,110,128, 33,112,243,245,240,229,242,
+    233,239,114,128,  0,185,244,104,  2,147,253,148,  2,225,105,128,
+     14, 81,233,242,100,128, 33, 83,111,  3,148, 16,148, 50,148, 66,
+    103,  2,148, 22,148, 40,239,238,229,107,129,  1,235,148, 31,237,
+    225,227,242,239,110,128,  1,237,245,242,237,245,235,232,105,128,
+     10, 19,237,225,244,242,225,231,245,242,237,245,235,232,105,128,
+     10, 75,240,229,110,128,  2, 84,112,  3,148, 80,148, 87,148, 98,
+    225,242,229,110,128, 36,170,229,238,226,245,236,236,229,116,128,
+     37,230,244,233,239,110,128, 35, 37,114,  2,148,111,148,140,100,
+      2,148,117,148,128,230,229,237,233,238,233,238,101,128,  0,170,
+    237,225,243,227,245,236,233,238,101,128,  0,186,244,232,239,231,
+    239,238,225,108,128, 34, 31,115,  5,148,163,148,195,148,212,149,
+      1,149, 14,232,239,242,116,  2,148,172,148,179,228,229,246, 97,
+    128,  9, 18,246,239,247,229,236,243,233,231,238,228,229,246, 97,
+    128,  9, 74,236,225,243,104,129,  0,248,148,204,225,227,245,244,
+    101,128,  1,255,237,225,236,108,  2,148,221,148,232,232,233,242,
+    225,231,225,238, 97,128, 48, 73,235,225,244,225,235,225,238, 97,
+    129, 48,169,148,245,232,225,236,230,247,233,228,244,104,128,255,
+    107,244,242,239,235,229,225,227,245,244,101,128,  1,255,245,240,
+    229,242,233,239,114,128,246,240,116,  2,149, 30,149, 41,227,249,
+    242,233,236,236,233, 99,128,  4,127,233,236,228,101,130,  0,245,
+    149, 52,149, 60,225,227,245,244,101,128, 30, 77,228,233,229,242,
+    229,243,233,115,128, 30, 79,245,226,239,240,239,237,239,230,111,
+    128, 49, 33,118,  2,149, 89,149,170,229,114,  2,149, 96,149,162,
+    236,233,238,101,131, 32, 62,149,109,149,132,149,155, 99,  2,149,
+    115,149,127,229,238,244,229,242,236,233,238,101,128,254, 74,237,
+     98,128,  3,  5,100,  2,149,138,149,146,225,243,232,229,100,128,
+    254, 73,226,236,247,225,246,121,128,254, 76,247,225,246,121,128,
+    254, 75,243,227,239,242,101,128,  0,175,239,247,229,236,243,233,
+    231,110,  3,149,185,149,195,149,202,226,229,238,231,225,236,105,
+    128,  9,203,228,229,246, 97,128,  9, 75,231,245,234,225,242,225,
+    244,105,128, 10,203,112,145,  0,112,149,251,152,123,152,134,152,
+    143,152,155,154, 80,154, 90,155, 82,156,101,156,191,156,217,157,
+     92,157,100,158,  2,158, 60,158, 88,158, 98, 97, 14,150, 25,150,
+     57,150, 67,150, 74,150, 81,150,129,150,140,150,154,150,165,150,
+    212,150,226,151,238,152, 21,152,111, 97,  2,150, 31,150, 43,237,
+    240,243,243,241,245,225,242,101,128, 51,128,243,229,238,244,239,
+    243,241,245,225,242,101,128, 51, 43,226,229,238,231,225,236,105,
+    128,  9,170,227,245,244,101,128, 30, 85,228,229,246, 97,128,  9,
+     42,103,  2,150, 87,150,105,101,  2,150, 93,150,100,228,239,247,
+    110,128, 33,223,245,112,128, 33,222,117,  2,150,111,150,120,234,
+    225,242,225,244,105,128, 10,170,242,237,245,235,232,105,128, 10,
+     42,232,233,242,225,231,225,238, 97,128, 48,113,233,249,225,238,
+    238,239,233,244,232,225,105,128, 14, 47,235,225,244,225,235,225,
+    238, 97,128, 48,209,108,  2,150,171,150,196,225,244,225,236,233,
+    250,225,244,233,239,238,227,249,242,233,236,236,233,227,227,237,
+     98,128,  4,132,239,227,232,235,225,227,249,242,233,236,236,233,
+     99,128,  4,192,238,243,233,239,243,235,239,242,229,225,110,128,
+     49,127,114,  3,150,234,150,255,151,227, 97,  2,150,240,150,248,
+    231,242,225,240,104,128,  0,182,236,236,229,108,128, 34, 37,229,
+    110,  2,151,  6,151,116,236,229,230,116,136,  0, 40,151, 29,151,
+     44,151, 49,151, 54,151, 65,151, 77,151,100,151,105,225,236,244,
+    239,238,229,225,242,225,226,233, 99,128,253, 62,226,116,128,248,
+    237,229,120,128,248,236,233,238,230,229,242,233,239,114,128, 32,
+    141,237,239,238,239,243,240,225,227,101,128,255,  8,115,  2,151,
+     83,151, 90,237,225,236,108,128,254, 89,245,240,229,242,233,239,
+    114,128, 32,125,244,112,128,248,235,246,229,242,244,233,227,225,
+    108,128,254, 53,242,233,231,232,116,136,  0, 41,151,140,151,155,
+    151,160,151,165,151,176,151,188,151,211,151,216,225,236,244,239,
+    238,229,225,242,225,226,233, 99,128,253, 63,226,116,128,248,248,
+    229,120,128,248,247,233,238,230,229,242,233,239,114,128, 32,142,
+    237,239,238,239,243,240,225,227,101,128,255,  9,115,  2,151,194,
+    151,201,237,225,236,108,128,254, 90,245,240,229,242,233,239,114,
+    128, 32,126,244,112,128,248,246,246,229,242,244,233,227,225,108,
+    128,254, 54,244,233,225,236,228,233,230,102,128, 34,  2,115,  3,
+    151,246,152,  1,152, 13,229,241,232,229,226,242,229,119,128,  5,
+    192,232,244,225,232,229,226,242,229,119,128,  5,153,241,245,225,
+    242,101,128, 51,169,244,225,104,134,  5,183,152, 39,152, 53,152,
+     58,152, 67,152, 82,152, 98, 49,  2,152, 45,152, 49, 49,128,  5,
+    183,100,128,  5,183,178, 97,128,  5,183,232,229,226,242,229,119,
+    128,  5,183,238,225,242,242,239,247,232,229,226,242,229,119,128,
+      5,183,241,245,225,242,244,229,242,232,229,226,242,229,119,128,
+      5,183,247,233,228,229,232,229,226,242,229,119,128,  5,183,250,
+    229,242,232,229,226,242,229,119,128,  5,161,226,239,240,239,237,
+    239,230,111,128, 49,  6,227,233,242,227,236,101,128, 36,223,228,
+    239,244,225,227,227,229,238,116,128, 30, 87,101,137,  5,228,152,
+    177,152,188,152,208,152,220,152,240,153, 86,153, 97,153,118,154,
+     73,227,249,242,233,236,236,233, 99,128,  4, 63,228,225,231,229,
+    243,104,129,251, 68,152,199,232,229,226,242,229,119,128,251, 68,
+    229,250,233,243,241,245,225,242,101,128, 51, 59,230,233,238,225,
+    236,228,225,231,229,243,232,232,229,226,242,229,119,128,251, 67,
+    104,  5,152,252,153, 19,153, 27,153, 41,153, 71,225,114,  2,153,
+      3,153, 10,225,226,233, 99,128,  6,126,237,229,238,233,225,110,
+    128,  5,122,229,226,242,229,119,128,  5,228,230,233,238,225,236,
+    225,242,225,226,233, 99,128,251, 87,105,  2,153, 47,153, 62,238,
+    233,244,233,225,236,225,242,225,226,233, 99,128,251, 88,242,225,
+    231,225,238, 97,128, 48,122,237,229,228,233,225,236,225,242,225,
+    226,233, 99,128,251, 89,235,225,244,225,235,225,238, 97,128, 48,
+    218,237,233,228,228,236,229,232,239,239,235,227,249,242,233,236,
+    236,233, 99,128,  4,167,114,  5,153,130,153,142,153,184,154, 49,
+    154, 62,225,230,229,232,229,226,242,229,119,128,251, 78,227,229,
+    238,116,131,  0, 37,153,155,153,164,153,176,225,242,225,226,233,
+     99,128,  6,106,237,239,238,239,243,240,225,227,101,128,255,  5,
+    243,237,225,236,108,128,254,106,105,  2,153,190,154, 31,239,100,
+    134,  0, 46,153,207,153,218,153,229,153,241,153,252,154,  8,225,
+    242,237,229,238,233,225,110,128,  5,137,227,229,238,244,229,242,
+    229,100,128,  0,183,232,225,236,230,247,233,228,244,104,128,255,
+     97,233,238,230,229,242,233,239,114,128,246,231,237,239,238,239,
+    243,240,225,227,101,128,255, 14,115,  2,154, 14,154, 21,237,225,
+    236,108,128,254, 82,245,240,229,242,233,239,114,128,246,232,243,
+    240,239,237,229,238,233,231,242,229,229,235,227,237, 98,128,  3,
+     66,240,229,238,228,233,227,245,236,225,114,128, 34,165,244,232,
+    239,245,243,225,238,100,128, 32, 48,243,229,244, 97,128, 32,167,
+    230,243,241,245,225,242,101,128, 51,138,104,  3,154, 98,154,148,
+    155, 29, 97,  3,154,106,154,116,154,123,226,229,238,231,225,236,
+    105,128,  9,171,228,229,246, 97,128,  9, 43,231,117,  2,154,130,
+    154,139,234,225,242,225,244,105,128, 10,171,242,237,245,235,232,
+    105,128, 10, 43,105,133,  3,198,154,162,154,166,154,252,155,  4,
+    155, 15, 49,128,  3,213,229,245,240,104,  4,154,179,154,214,154,
+    229,154,238, 97,  2,154,185,154,200,227,233,242,227,236,229,235,
+    239,242,229,225,110,128, 50,122,240,225,242,229,238,235,239,242,
+    229,225,110,128, 50, 26,227,233,242,227,236,229,235,239,242,229,
+    225,110,128, 50,108,235,239,242,229,225,110,128, 49, 77,240,225,
+    242,229,238,235,239,242,229,225,110,128, 50, 12,236,225,244,233,
+    110,128,  2,120,238,244,232,245,244,232,225,105,128, 14, 58,243,
+    249,237,226,239,236,231,242,229,229,107,128,  3,213,111,  3,155,
+     37,155, 42,155, 68,239,107,128,  1,165,240,104,  2,155, 49,155,
+     58,225,238,244,232,225,105,128, 14, 30,245,238,231,244,232,225,
+    105,128, 14, 28,243,225,237,240,232,225,239,244,232,225,105,128,
+     14, 32,105,133,  3,192,155, 96,156, 52,156, 63,156, 74,156, 88,
+    229,245,112,  6,155,112,155,147,155,179,155,207,155,221,156, 17,
+     97,  2,155,118,155,133,227,233,242,227,236,229,235,239,242,229,
+    225,110,128, 50,115,240,225,242,229,238,235,239,242,229,225,110,
+    128, 50, 19,227,105,  2,155,154,155,166,229,245,227,235,239,242,
+    229,225,110,128, 49,118,242,227,236,229,235,239,242,229,225,110,
+    128, 50,101,107,  2,155,185,155,199,233,249,229,239,235,235,239,
+    242,229,225,110,128, 49,114,239,242,229,225,110,128, 49, 66,240,
+    225,242,229,238,235,239,242,229,225,110,128, 50,  5,243,233,239,
+    115,  2,155,230,156,  2,107,  2,155,236,155,250,233,249,229,239,
+    235,235,239,242,229,225,110,128, 49,116,239,242,229,225,110,128,
+     49, 68,244,233,235,229,245,244,235,239,242,229,225,110,128, 49,
+    117,116,  2,156, 23,156, 38,232,233,229,245,244,232,235,239,242,
+    229,225,110,128, 49,119,233,235,229,245,244,235,239,242,229,225,
+    110,128, 49,115,232,233,242,225,231,225,238, 97,128, 48,116,235,
+    225,244,225,235,225,238, 97,128, 48,212,243,249,237,226,239,236,
+    231,242,229,229,107,128,  3,214,247,242,225,242,237,229,238,233,
+    225,110,128,  5,131,236,245,115,132,  0, 43,156,115,156,126,156,
+    135,156,168,226,229,236,239,247,227,237, 98,128,  3, 31,227,233,
+    242,227,236,101,128, 34,149,109,  2,156,141,156,148,233,238,245,
+    115,128,  0,177,111,  2,156,154,156,158,100,128,  2,214,238,239,
+    243,240,225,227,101,128,255, 11,115,  2,156,174,156,181,237,225,
+    236,108,128,254, 98,245,240,229,242,233,239,114,128, 32,122,109,
+      2,156,197,156,208,239,238,239,243,240,225,227,101,128,255, 80,
+    243,241,245,225,242,101,128, 51,216,111,  5,156,229,156,240,157,
+     51,157, 62,157, 72,232,233,242,225,231,225,238, 97,128, 48,125,
+    233,238,244,233,238,231,233,238,228,229,120,  4,157,  4,157, 16,
+    157, 28,157, 41,228,239,247,238,247,232,233,244,101,128, 38, 31,
+    236,229,230,244,247,232,233,244,101,128, 38, 28,242,233,231,232,
+    244,247,232,233,244,101,128, 38, 30,245,240,247,232,233,244,101,
+    128, 38, 29,235,225,244,225,235,225,238, 97,128, 48,221,240,236,
+    225,244,232,225,105,128, 14, 27,243,244,225,236,237,225,242,107,
+    129, 48, 18,157, 85,230,225,227,101,128, 48, 32,240,225,242,229,
+    110,128, 36,171,114,  3,157,108,157,134,157,159,101,  2,157,114,
+    157,122,227,229,228,229,115,128, 34,122,243,227,242,233,240,244,
+    233,239,110,128, 33, 30,233,237,101,  2,157,142,157,148,237,239,
+    100,128,  2,185,242,229,246,229,242,243,229,100,128, 32, 53,111,
+      4,157,169,157,176,157,186,157,199,228,245,227,116,128, 34, 15,
+    234,229,227,244,233,246,101,128, 35,  5,236,239,238,231,229,228,
+    235,225,238, 97,128, 48,252,112,  2,157,205,157,242,101,  2,157,
+    211,157,218,236,236,239,114,128, 35, 24,242,243,117,  2,157,226,
+    157,233,226,243,229,116,128, 34,130,240,229,242,243,229,116,128,
+     34,131,239,242,244,233,239,110,129, 34, 55,157,253,225,108,128,
+     34, 29,115,  2,158,  8,158, 51,105,130,  3,200,158, 16,158, 27,
+    227,249,242,233,236,236,233, 99,128,  4,113,236,233,240,238,229,
+    245,237,225,244,225,227,249,242,233,236,236,233,227,227,237, 98,
+    128,  4,134,243,241,245,225,242,101,128, 51,176,117,  2,158, 66,
+    158, 77,232,233,242,225,231,225,238, 97,128, 48,119,235,225,244,
+    225,235,225,238, 97,128, 48,215,246,243,241,245,225,242,101,128,
+     51,180,247,243,241,245,225,242,101,128, 51,186,113,136,  0,113,
+    158,128,159,177,159,188,159,197,159,204,159,216,159,254,160,  6,
+     97,  4,158,138,158,161,158,225,159,160,100,  2,158,144,158,150,
+    229,246, 97,128,  9, 88,237,225,232,229,226,242,229,119,128,  5,
+    168,102,  4,158,171,158,180,158,194,158,210,225,242,225,226,233,
+     99,128,  6, 66,230,233,238,225,236,225,242,225,226,233, 99,128,
+    254,214,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,
+    254,215,237,229,228,233,225,236,225,242,225,226,233, 99,128,254,
+    216,237,225,244,115,136,  5,184,158,248,159, 12,159, 26,159, 31,
+    159, 36,159, 45,159, 60,159,147, 49,  3,159,  0,159,  4,159,  8,
+     48,128,  5,184, 97,128,  5,184, 99,128,  5,184, 50,  2,159, 18,
+    159, 22, 55,128,  5,184, 57,128,  5,184,179, 51,128,  5,184,228,
+    101,128,  5,184,232,229,226,242,229,119,128,  5,184,238,225,242,
+    242,239,247,232,229,226,242,229,119,128,  5,184,113,  2,159, 66,
+    159,132,225,244,225,110,  4,159, 79,159, 88,159,103,159,119,232,
+    229,226,242,229,119,128,  5,184,238,225,242,242,239,247,232,229,
+    226,242,229,119,128,  5,184,241,245,225,242,244,229,242,232,229,
+    226,242,229,119,128,  5,184,247,233,228,229,232,229,226,242,229,
+    119,128,  5,184,245,225,242,244,229,242,232,229,226,242,229,119,
+    128,  5,184,247,233,228,229,232,229,226,242,229,119,128,  5,184,
+    242,238,229,249,240,225,242,225,232,229,226,242,229,119,128,  5,
+    159,226,239,240,239,237,239,230,111,128, 49, 17,227,233,242,227,
+    236,101,128, 36,224,232,239,239,107,128,  2,160,237,239,238,239,
+    243,240,225,227,101,128,255, 81,239,102,130,  5,231,159,225,159,
+    245,228,225,231,229,243,104,129,251, 71,159,236,232,229,226,242,
+    229,119,128,251, 71,232,229,226,242,229,119,128,  5,231,240,225,
+    242,229,110,128, 36,172,117,  4,160, 16,160, 28,160,117,160,204,
+    225,242,244,229,242,238,239,244,101,128, 38,105,226,245,244,115,
+    135,  5,187,160, 49,160, 54,160, 59,160, 64,160, 73,160, 88,160,
+    104,177, 56,128,  5,187,178, 53,128,  5,187,179, 49,128,  5,187,
+    232,229,226,242,229,119,128,  5,187,238,225,242,242,239,247,232,
+    229,226,242,229,119,128,  5,187,241,245,225,242,244,229,242,232,
+    229,226,242,229,119,128,  5,187,247,233,228,229,232,229,226,242,
+    229,119,128,  5,187,229,243,244,233,239,110,133,  0, 63,160,136,
+    160,159,160,176,160,184,160,196,225,114,  2,160,143,160,150,225,
+    226,233, 99,128,  6, 31,237,229,238,233,225,110,128,  5, 94,228,
+    239,247,110,129,  0,191,160,168,243,237,225,236,108,128,247,191,
+    231,242,229,229,107,128,  3,126,237,239,238,239,243,240,225,227,
+    101,128,255, 31,243,237,225,236,108,128,247, 63,239,244,101,  4,
+    160,216,161, 31,161, 51,161, 80,228,226,108,133,  0, 34,160,232,
+    160,239,160,246,161,  2,161, 23,226,225,243,101,128, 32, 30,236,
+    229,230,116,128, 32, 28,237,239,238,239,243,240,225,227,101,128,
+    255,  2,240,242,233,237,101,129, 48, 30,161, 12,242,229,246,229,
+    242,243,229,100,128, 48, 29,242,233,231,232,116,128, 32, 29,236,
+    229,230,116,129, 32, 24,161, 40,242,229,246,229,242,243,229,100,
+    128, 32, 27,114,  2,161, 57,161, 67,229,246,229,242,243,229,100,
+    128, 32, 27,233,231,232,116,129, 32, 25,161, 76,110,128,  1, 73,
+    243,233,238,231,108,  2,161, 90,161, 97,226,225,243,101,128, 32,
+     26,101,129,  0, 39,161,103,237,239,238,239,243,240,225,227,101,
+    128,255,  7,114,145,  0,114,161,153,162,157,162,168,162,215,163,
+     10,164, 27,164, 51,164,146,166,180,166,217,166,229,167, 27,167,
+     35,167,197,167,208,167,243,168, 87, 97, 11,161,177,161,188,161,
+    198,161,205,162, 14,162, 30,162, 55,162, 66,162, 91,162,114,162,
+    151,225,242,237,229,238,233,225,110,128,  5,124,226,229,238,231,
+    225,236,105,128,  9,176,227,245,244,101,128,  1, 85,100,  4,161,
+    215,161,221,161,235,162,  5,229,246, 97,128,  9, 48,233,227,225,
+    108,129, 34, 26,161,230,229,120,128,248,229,239,246,229,242,243,
+    243,241,245,225,242,101,129, 51,174,161,251,228,243,241,245,225,
+    242,101,128, 51,175,243,241,245,225,242,101,128, 51,173,230,101,
+    129,  5,191,162, 21,232,229,226,242,229,119,128,  5,191,231,117,
+      2,162, 37,162, 46,234,225,242,225,244,105,128, 10,176,242,237,
+    245,235,232,105,128, 10, 48,232,233,242,225,231,225,238, 97,128,
+     48,137,235,225,244,225,235,225,238, 97,129, 48,233,162, 79,232,
+    225,236,230,247,233,228,244,104,128,255,151,236,239,247,229,242,
+    228,233,225,231,239,238,225,236,226,229,238,231,225,236,105,128,
+      9,241,109,  2,162,120,162,143,233,228,228,236,229,228,233,225,
+    231,239,238,225,236,226,229,238,231,225,236,105,128,  9,240,243,
+    232,239,242,110,128,  2,100,244,233,111,128, 34, 54,226,239,240,
+    239,237,239,230,111,128, 49, 22, 99,  4,162,178,162,185,162,194,
+    162,202,225,242,239,110,128,  1, 89,229,228,233,236,236, 97,128,
+      1, 87,233,242,227,236,101,128, 36,225,239,237,237,225,225,227,
+    227,229,238,116,128,  1, 87,100,  2,162,221,162,231,226,236,231,
+    242,225,246,101,128,  2, 17,239,116,  2,162,238,162,247,225,227,
+    227,229,238,116,128, 30, 89,226,229,236,239,119,129, 30, 91,163,
+      1,237,225,227,242,239,110,128, 30, 93,101,  6,163, 24,163, 69,
+    163,104,163,159,163,184,163,217,102,  2,163, 30,163, 43,229,242,
+    229,238,227,229,237,225,242,107,128, 32, 59,236,229,248,243,117,
+      2,163, 53,163, 60,226,243,229,116,128, 34,134,240,229,242,243,
+    229,116,128, 34,135,231,233,243,244,229,114,  2,163, 80,163, 85,
+    229,100,128,  0,174,115,  2,163, 91,163, 97,225,238,115,128,248,
+    232,229,242,233,102,128,246,218,104,  3,163,112,163,135,163,149,
+    225,114,  2,163,119,163,126,225,226,233, 99,128,  6, 49,237,229,
+    238,233,225,110,128,  5,128,230,233,238,225,236,225,242,225,226,
+    233, 99,128,254,174,233,242,225,231,225,238, 97,128, 48,140,235,
+    225,244,225,235,225,238, 97,129, 48,236,163,172,232,225,236,230,
+    247,233,228,244,104,128,255,154,243,104,130,  5,232,163,193,163,
+    208,228,225,231,229,243,232,232,229,226,242,229,119,128,251, 72,
+    232,229,226,242,229,119,128,  5,232,118,  3,163,225,163,238,164,
+     14,229,242,243,229,228,244,233,236,228,101,128, 34, 61,233, 97,
+      2,163,245,163,254,232,229,226,242,229,119,128,  5,151,237,245,
+    231,242,225,243,232,232,229,226,242,229,119,128,  5,151,236,239,
+    231,233,227,225,236,238,239,116,128, 35, 16,230,233,243,232,232,
+    239,239,107,129,  2,126,164, 40,242,229,246,229,242,243,229,100,
+    128,  2,127,104,  2,164, 57,164, 80, 97,  2,164, 63,164, 73,226,
+    229,238,231,225,236,105,128,  9,221,228,229,246, 97,128,  9, 93,
+    111,131,  3,193,164, 90,164,119,164,133,239,107,129,  2,125,164,
+     97,244,245,242,238,229,100,129,  2,123,164,108,243,245,240,229,
+    242,233,239,114,128,  2,181,243,249,237,226,239,236,231,242,229,
+    229,107,128,  3,241,244,233,227,232,239,239,235,237,239,100,128,
+      2,222,105,  6,164,160,165,204,165,250,166,  5,166, 30,166,166,
+    229,245,108,  9,164,182,164,217,164,232,164,246,165, 36,165, 50,
+    165,136,165,149,165,184, 97,  2,164,188,164,203,227,233,242,227,
+    236,229,235,239,242,229,225,110,128, 50,113,240,225,242,229,238,
+    235,239,242,229,225,110,128, 50, 17,227,233,242,227,236,229,235,
+    239,242,229,225,110,128, 50, 99,232,233,229,245,232,235,239,242,
+    229,225,110,128, 49, 64,107,  2,164,252,165, 28,233,249,229,239,
+    107,  2,165,  6,165, 15,235,239,242,229,225,110,128, 49, 58,243,
+    233,239,243,235,239,242,229,225,110,128, 49,105,239,242,229,225,
+    110,128, 49, 57,237,233,229,245,237,235,239,242,229,225,110,128,
+     49, 59,112,  3,165, 58,165, 90,165,105, 97,  2,165, 64,165, 78,
+    238,243,233,239,243,235,239,242,229,225,110,128, 49,108,242,229,
+    238,235,239,242,229,225,110,128, 50,  3,232,233,229,245,240,232,
+    235,239,242,229,225,110,128, 49, 63,233,229,245,112,  2,165,114,
+    165,123,235,239,242,229,225,110,128, 49, 60,243,233,239,243,235,
+    239,242,229,225,110,128, 49,107,243,233,239,243,235,239,242,229,
+    225,110,128, 49, 61,116,  2,165,155,165,170,232,233,229,245,244,
+    232,235,239,242,229,225,110,128, 49, 62,233,235,229,245,244,235,
+    239,242,229,225,110,128, 49,106,249,229,239,242,233,238,232,233,
+    229,245,232,235,239,242,229,225,110,128, 49,109,231,232,116,  2,
+    165,212,165,220,225,238,231,236,101,128, 34, 31,116,  2,165,226,
+    165,240,225,227,235,226,229,236,239,247,227,237, 98,128,  3, 25,
+    242,233,225,238,231,236,101,128, 34,191,232,233,242,225,231,225,
+    238, 97,128, 48,138,235,225,244,225,235,225,238, 97,129, 48,234,
+    166, 18,232,225,236,230,247,233,228,244,104,128,255,152,110,  2,
+    166, 36,166,152,103,131,  2,218,166, 46,166, 57,166, 63,226,229,
+    236,239,247,227,237, 98,128,  3, 37,227,237, 98,128,  3, 10,232,
+    225,236,102,  2,166, 72,166,118,236,229,230,116,131,  2,191,166,
+     85,166, 96,166,107,225,242,237,229,238,233,225,110,128,  5, 89,
+    226,229,236,239,247,227,237, 98,128,  3, 28,227,229,238,244,229,
+    242,229,100,128,  2,211,242,233,231,232,116,130,  2,190,166,130,
+    166,141,226,229,236,239,247,227,237, 98,128,  3, 57,227,229,238,
+    244,229,242,229,100,128,  2,210,246,229,242,244,229,228,226,242,
+    229,246,101,128,  2, 19,244,244,239,242,245,243,241,245,225,242,
+    101,128, 51, 81,108,  2,166,186,166,197,233,238,229,226,229,236,
+    239,119,128, 30, 95,239,238,231,236,229,103,129,  2,124,166,208,
+    244,245,242,238,229,100,128,  2,122,237,239,238,239,243,240,225,
+    227,101,128,255, 82,111,  3,166,237,166,248,167, 17,232,233,242,
+    225,231,225,238, 97,128, 48,141,235,225,244,225,235,225,238, 97,
+    129, 48,237,167,  5,232,225,236,230,247,233,228,244,104,128,255,
+    155,242,245,225,244,232,225,105,128, 14, 35,240,225,242,229,110,
+    128, 36,173,114,  3,167, 43,167, 79,167,109, 97,  3,167, 51,167,
+     61,167, 68,226,229,238,231,225,236,105,128,  9,220,228,229,246,
+     97,128,  9, 49,231,245,242,237,245,235,232,105,128, 10, 92,229,
+    104,  2,167, 86,167, 95,225,242,225,226,233, 99,128,  6,145,230,
+    233,238,225,236,225,242,225,226,233, 99,128,251,141,246,239,227,
+    225,236,233, 99,  4,167,125,167,135,167,142,167,153,226,229,238,
+    231,225,236,105,128,  9,224,228,229,246, 97,128,  9, 96,231,245,
+    234,225,242,225,244,105,128, 10,224,246,239,247,229,236,243,233,
+    231,110,  3,167,169,167,179,167,186,226,229,238,231,225,236,105,
+    128,  9,196,228,229,246, 97,128,  9, 68,231,245,234,225,242,225,
+    244,105,128, 10,196,243,245,240,229,242,233,239,114,128,246,241,
+    116,  2,167,214,167,222,226,236,239,227,107,128, 37,144,245,242,
+    238,229,100,129,  2,121,167,232,243,245,240,229,242,233,239,114,
+    128,  2,180,117,  4,167,253,168,  8,168, 33,168, 80,232,233,242,
+    225,231,225,238, 97,128, 48,139,235,225,244,225,235,225,238, 97,
+    129, 48,235,168, 21,232,225,236,230,247,233,228,244,104,128,255,
+    153,112,  2,168, 39,168, 74,229,101,  2,168, 46,168, 60,237,225,
+    242,235,226,229,238,231,225,236,105,128,  9,242,243,233,231,238,
+    226,229,238,231,225,236,105,128,  9,243,233,225,104,128,246,221,
+    244,232,225,105,128, 14, 36,246,239,227,225,236,233, 99,  4,168,
+    103,168,113,168,120,168,131,226,229,238,231,225,236,105,128,  9,
+    139,228,229,246, 97,128,  9, 11,231,245,234,225,242,225,244,105,
+    128, 10,139,246,239,247,229,236,243,233,231,110,  3,168,147,168,
+    157,168,164,226,229,238,231,225,236,105,128,  9,195,228,229,246,
+     97,128,  9, 67,231,245,234,225,242,225,244,105,128, 10,195,115,
+    147,  0,115,168,217,170,187,170,198,171, 68,171,107,174, 49,174,
+     60,176,203,179, 85,179,131,179,158,180, 93,180,160,181,193,181,
+    203,182,133,182,206,183,120,183,130, 97,  9,168,237,168,247,169,
+     12,169, 84,169,109,169,120,169,145,169,177,169,217,226,229,238,
+    231,225,236,105,128,  9,184,227,245,244,101,129,  1, 91,169,  0,
+    228,239,244,225,227,227,229,238,116,128, 30,101,100,  5,169, 24,
+    169, 33,169, 39,169, 53,169, 69,225,242,225,226,233, 99,128,  6,
+     53,229,246, 97,128,  9, 56,230,233,238,225,236,225,242,225,226,
+    233, 99,128,254,186,233,238,233,244,233,225,236,225,242,225,226,
+    233, 99,128,254,187,237,229,228,233,225,236,225,242,225,226,233,
+     99,128,254,188,231,117,  2,169, 91,169,100,234,225,242,225,244,
+    105,128, 10,184,242,237,245,235,232,105,128, 10, 56,232,233,242,
+    225,231,225,238, 97,128, 48, 85,235,225,244,225,235,225,238, 97,
+    129, 48,181,169,133,232,225,236,230,247,233,228,244,104,128,255,
+    123,236,236,225,236,236,225,232,239,245,225,236,225,249,232,229,
+    247,225,243,225,236,236,225,237,225,242,225,226,233, 99,128,253,
+    250,237,229,235,104,130,  5,225,169,188,169,208,228,225,231,229,
+    243,104,129,251, 65,169,199,232,229,226,242,229,119,128,251, 65,
+    232,229,226,242,229,119,128,  5,225,242, 97,  5,169,230,170, 48,
+    170, 56,170,106,170,114, 97,  5,169,242,169,250,170,  2,170, 33,
+    170, 41,225,244,232,225,105,128, 14, 50,229,244,232,225,105,128,
+     14, 65,233,237,225,233,109,  2,170, 12,170, 23,225,236,225,233,
+    244,232,225,105,128, 14, 68,245,225,238,244,232,225,105,128, 14,
+     67,237,244,232,225,105,128, 14, 51,244,232,225,105,128, 14, 48,
+    229,244,232,225,105,128, 14, 64,105,  3,170, 64,170, 88,170, 99,
+    105,  2,170, 70,170, 81,236,229,230,244,244,232,225,105,128,248,
+    134,244,232,225,105,128, 14, 53,236,229,230,244,244,232,225,105,
+    128,248,133,244,232,225,105,128, 14, 52,239,244,232,225,105,128,
+     14, 66,117,  3,170,122,170,172,170,179,101,  3,170,130,170,154,
+    170,165,101,  2,170,136,170,147,236,229,230,244,244,232,225,105,
+    128,248,136,244,232,225,105,128, 14, 55,236,229,230,244,244,232,
+    225,105,128,248,135,244,232,225,105,128, 14, 54,244,232,225,105,
+    128, 14, 56,245,244,232,225,105,128, 14, 57,226,239,240,239,237,
+    239,230,111,128, 49, 25, 99,  5,170,210,170,231,170,240,171, 33,
+    171, 55,225,242,239,110,129,  1, 97,170,219,228,239,244,225,227,
+    227,229,238,116,128, 30,103,229,228,233,236,236, 97,128,  1, 95,
+    232,247, 97,131,  2, 89,170,252,171,  7,171, 26,227,249,242,233,
+    236,236,233, 99,128,  4,217,228,233,229,242,229,243,233,243,227,
+    249,242,233,236,236,233, 99,128,  4,219,232,239,239,107,128,  2,
+     90,233,242, 99,  2,171, 41,171, 46,236,101,128, 36,226,245,237,
+    230,236,229,120,128,  1, 93,239,237,237,225,225,227,227,229,238,
+    116,128,  2, 25,228,239,116,  2,171, 76,171, 85,225,227,227,229,
+    238,116,128, 30, 97,226,229,236,239,119,129, 30, 99,171, 95,228,
+    239,244,225,227,227,229,238,116,128, 30,105,101,  9,171,127,171,
+    143,171,178,171,243,172, 90,172,117,172,142,172,223,172,250,225,
+    231,245,236,236,226,229,236,239,247,227,237, 98,128,  3, 60, 99,
+      2,171,149,171,171,239,238,100,129, 32, 51,171,157,244,239,238,
+    229,227,232,233,238,229,243,101,128,  2,202,244,233,239,110,128,
+      0,167,229,110,  4,171,189,171,198,171,212,171,228,225,242,225,
+    226,233, 99,128,  6, 51,230,233,238,225,236,225,242,225,226,233,
+     99,128,254,178,233,238,233,244,233,225,236,225,242,225,226,233,
+     99,128,254,179,237,229,228,233,225,236,225,242,225,226,233, 99,
+    128,254,180,231,239,108,135,  5,182,172,  7,172, 21,172, 26,172,
+     35,172, 50,172, 66,172, 77, 49,  2,172, 13,172, 17, 51,128,  5,
+    182,102,128,  5,182,178, 99,128,  5,182,232,229,226,242,229,119,
+    128,  5,182,238,225,242,242,239,247,232,229,226,242,229,119,128,
+      5,182,241,245,225,242,244,229,242,232,229,226,242,229,119,128,
+      5,182,244,225,232,229,226,242,229,119,128,  5,146,247,233,228,
+    229,232,229,226,242,229,119,128,  5,182,104,  2,172, 96,172,107,
+    225,242,237,229,238,233,225,110,128,  5,125,233,242,225,231,225,
+    238, 97,128, 48, 91,235,225,244,225,235,225,238, 97,129, 48,187,
+    172,130,232,225,236,230,247,233,228,244,104,128,255,126,237,105,
+      2,172,149,172,192,227,239,236,239,110,131,  0, 59,172,163,172,
+    172,172,184,225,242,225,226,233, 99,128,  6, 27,237,239,238,239,
+    243,240,225,227,101,128,255, 27,243,237,225,236,108,128,254, 84,
+    246,239,233,227,229,228,237,225,242,235,235,225,238, 97,129, 48,
+    156,172,211,232,225,236,230,247,233,228,244,104,128,255,159,238,
+    116,  2,172,230,172,240,233,243,241,245,225,242,101,128, 51, 34,
+    239,243,241,245,225,242,101,128, 51, 35,246,229,110,142,  0, 55,
+    173, 28,173, 37,173, 47,173, 77,173, 84,173, 94,173,119,173,146,
+    173,180,173,192,173,203,173,236,173,244,173,255,225,242,225,226,
+    233, 99,128,  6,103,226,229,238,231,225,236,105,128,  9,237,227,
+    233,242,227,236,101,129, 36,102,173, 58,233,238,246,229,242,243,
+    229,243,225,238,243,243,229,242,233,102,128, 39,144,228,229,246,
+     97,128,  9,109,229,233,231,232,244,232,115,128, 33, 94,231,117,
+      2,173,101,173,110,234,225,242,225,244,105,128, 10,237,242,237,
+    245,235,232,105,128, 10,109,232, 97,  2,173,126,173,137,227,235,
+    225,242,225,226,233, 99,128,  6,103,238,231,250,232,239,117,128,
+     48, 39,105,  2,173,152,173,170,228,229,239,231,242,225,240,232,
+    233,227,240,225,242,229,110,128, 50, 38,238,230,229,242,233,239,
+    114,128, 32,135,237,239,238,239,243,240,225,227,101,128,255, 23,
+    239,236,228,243,244,249,236,101,128,247, 55,112,  2,173,209,173,
+    216,225,242,229,110,128, 36,122,229,114,  2,173,223,173,229,233,
+    239,100,128, 36,142,243,233,225,110,128,  6,247,242,239,237,225,
+    110,128, 33,118,243,245,240,229,242,233,239,114,128, 32,119,116,
+      2,174,  5,174, 43,229,229,110,  2,174, 13,174, 22,227,233,242,
+    227,236,101,128, 36,112,112,  2,174, 28,174, 35,225,242,229,110,
+    128, 36,132,229,242,233,239,100,128, 36,152,232,225,105,128, 14,
+     87,230,244,232,249,240,232,229,110,128,  0,173,104,  7,174, 76,
+    175, 50,175, 61,175, 75,176, 20,176, 33,176,197, 97,  6,174, 90,
+    174,101,174,111,174,122,175,  9,175, 34,225,242,237,229,238,233,
+    225,110,128,  5,119,226,229,238,231,225,236,105,128,  9,182,227,
+    249,242,233,236,236,233, 99,128,  4, 72,100,  2,174,128,174,224,
+    228, 97,  4,174,139,174,148,174,179,174,193,225,242,225,226,233,
+     99,128,  6, 81,228,225,237,237, 97,  2,174,158,174,167,225,242,
+    225,226,233, 99,128,252, 97,244,225,238,225,242,225,226,233, 99,
+    128,252, 94,230,225,244,232,225,225,242,225,226,233, 99,128,252,
+     96,235,225,243,242, 97,  2,174,203,174,212,225,242,225,226,233,
+     99,128,252, 98,244,225,238,225,242,225,226,233, 99,128,252, 95,
+    101,132, 37,146,174,236,174,243,174,251,175,  4,228,225,242,107,
+    128, 37,147,236,233,231,232,116,128, 37,145,237,229,228,233,245,
+    109,128, 37,146,246, 97,128,  9, 54,231,117,  2,175, 16,175, 25,
+    234,225,242,225,244,105,128, 10,182,242,237,245,235,232,105,128,
+     10, 54,236,243,232,229,236,229,244,232,229,226,242,229,119,128,
+      5,147,226,239,240,239,237,239,230,111,128, 49, 21,227,232,225,
+    227,249,242,233,236,236,233, 99,128,  4, 73,101,  4,175, 85,175,
+    150,175,160,175,177,229,110,  4,175, 96,175,105,175,119,175,135,
+    225,242,225,226,233, 99,128,  6, 52,230,233,238,225,236,225,242,
+    225,226,233, 99,128,254,182,233,238,233,244,233,225,236,225,242,
+    225,226,233, 99,128,254,183,237,229,228,233,225,236,225,242,225,
+    226,233, 99,128,254,184,233,227,239,240,244,233, 99,128,  3,227,
+    241,229,108,129, 32,170,175,168,232,229,226,242,229,119,128, 32,
+    170,246, 97,134,  5,176,175,194,175,209,175,223,175,232,175,247,
+    176,  7, 49,  2,175,200,175,205,177, 53,128,  5,176, 53,128,  5,
+    176, 50,  2,175,215,175,219, 50,128,  5,176,101,128,  5,176,232,
+    229,226,242,229,119,128,  5,176,238,225,242,242,239,247,232,229,
+    226,242,229,119,128,  5,176,241,245,225,242,244,229,242,232,229,
+    226,242,229,119,128,  5,176,247,233,228,229,232,229,226,242,229,
+    119,128,  5,176,232,225,227,249,242,233,236,236,233, 99,128,  4,
+    187,105,  2,176, 39,176, 50,237,225,227,239,240,244,233, 99,128,
+      3,237,110,131,  5,233,176, 60,176,143,176,152,100,  2,176, 66,
+    176,132,225,231,229,243,104,130,251, 73,176, 78,176, 87,232,229,
+    226,242,229,119,128,251, 73,115,  2,176, 93,176,113,232,233,238,
+    228,239,116,129,251, 44,176,104,232,229,226,242,229,119,128,251,
+     44,233,238,228,239,116,129,251, 45,176,123,232,229,226,242,229,
+    119,128,251, 45,239,244,232,229,226,242,229,119,128,  5,193,232,
+    229,226,242,229,119,128,  5,233,115,  2,176,158,176,178,232,233,
+    238,228,239,116,129,251, 42,176,169,232,229,226,242,229,119,128,
+    251, 42,233,238,228,239,116,129,251, 43,176,188,232,229,226,242,
+    229,119,128,251, 43,239,239,107,128,  2,130,105,  8,176,221,177,
+      9,177, 20,177, 45,177, 75,177, 83,177, 96,178, 11,231,237, 97,
+    131,  3,195,176,233,176,237,176,245, 49,128,  3,194,230,233,238,
+    225,108,128,  3,194,236,245,238,225,244,229,243,249,237,226,239,
+    236,231,242,229,229,107,128,  3,242,232,233,242,225,231,225,238,
+     97,128, 48, 87,235,225,244,225,235,225,238, 97,129, 48,183,177,
+     33,232,225,236,230,247,233,228,244,104,128,255,124,236,245,113,
+      2,177, 53,177, 62,232,229,226,242,229,119,128,  5,189,236,229,
+    230,244,232,229,226,242,229,119,128,  5,189,237,233,236,225,114,
+    128, 34, 60,238,228,239,244,232,229,226,242,229,119,128,  5,194,
+    239,115,  6,177,111,177,146,177,178,177,206,177,220,177,252, 97,
+      2,177,117,177,132,227,233,242,227,236,229,235,239,242,229,225,
+    110,128, 50,116,240,225,242,229,238,235,239,242,229,225,110,128,
+     50, 20,227,105,  2,177,153,177,165,229,245,227,235,239,242,229,
+    225,110,128, 49,126,242,227,236,229,235,239,242,229,225,110,128,
+     50,102,107,  2,177,184,177,198,233,249,229,239,235,235,239,242,
+    229,225,110,128, 49,122,239,242,229,225,110,128, 49, 69,238,233,
+    229,245,238,235,239,242,229,225,110,128, 49,123,112,  2,177,226,
+    177,239,225,242,229,238,235,239,242,229,225,110,128, 50,  6,233,
+    229,245,240,235,239,242,229,225,110,128, 49,125,244,233,235,229,
+    245,244,235,239,242,229,225,110,128, 49,124,120,141,  0, 54,178,
+     41,178, 50,178, 60,178, 90,178, 97,178,122,178,149,178,183,178,
+    195,178,206,178,239,178,247,179,  2,225,242,225,226,233, 99,128,
+      6,102,226,229,238,231,225,236,105,128,  9,236,227,233,242,227,
+    236,101,129, 36,101,178, 71,233,238,246,229,242,243,229,243,225,
+    238,243,243,229,242,233,102,128, 39,143,228,229,246, 97,128,  9,
+    108,231,117,  2,178,104,178,113,234,225,242,225,244,105,128, 10,
+    236,242,237,245,235,232,105,128, 10,108,232, 97,  2,178,129,178,
+    140,227,235,225,242,225,226,233, 99,128,  6,102,238,231,250,232,
+    239,117,128, 48, 38,105,  2,178,155,178,173,228,229,239,231,242,
+    225,240,232,233,227,240,225,242,229,110,128, 50, 37,238,230,229,
+    242,233,239,114,128, 32,134,237,239,238,239,243,240,225,227,101,
+    128,255, 22,239,236,228,243,244,249,236,101,128,247, 54,112,  2,
+    178,212,178,219,225,242,229,110,128, 36,121,229,114,  2,178,226,
+    178,232,233,239,100,128, 36,141,243,233,225,110,128,  6,246,242,
+    239,237,225,110,128, 33,117,243,245,240,229,242,233,239,114,128,
+     32,118,116,  2,179,  8,179, 79,229,229,110,  2,179, 16,179, 58,
+     99,  2,179, 22,179, 30,233,242,227,236,101,128, 36,111,245,242,
+    242,229,238,227,249,228,229,238,239,237,233,238,225,244,239,242,
+    226,229,238,231,225,236,105,128,  9,249,112,  2,179, 64,179, 71,
+    225,242,229,110,128, 36,131,229,242,233,239,100,128, 36,151,232,
+    225,105,128, 14, 86,108,  2,179, 91,179,111,225,243,104,129,  0,
+     47,179, 99,237,239,238,239,243,240,225,227,101,128,255, 15,239,
+    238,103,129,  1,127,179,119,228,239,244,225,227,227,229,238,116,
+    128, 30,155,109,  2,179,137,179,147,233,236,229,230,225,227,101,
+    128, 38, 58,239,238,239,243,240,225,227,101,128,255, 83,111,  6,
+    179,172,179,222,179,233,180,  2,180, 47,180, 58,102,  2,179,178,
+    179,192,240,225,243,245,241,232,229,226,242,229,119,128,  5,195,
+    116,  2,179,198,179,207,232,249,240,232,229,110,128,  0,173,243,
+    233,231,238,227,249,242,233,236,236,233, 99,128,  4, 76,232,233,
+    242,225,231,225,238, 97,128, 48, 93,235,225,244,225,235,225,238,
+     97,129, 48,189,179,246,232,225,236,230,247,233,228,244,104,128,
+    255,127,236,233,228,245,115,  2,180, 12,180, 29,236,239,238,231,
+    239,246,229,242,236,225,249,227,237, 98,128,  3, 56,243,232,239,
+    242,244,239,246,229,242,236,225,249,227,237, 98,128,  3, 55,242,
+    245,243,233,244,232,225,105,128, 14, 41,115,  3,180, 66,180, 76,
+    180, 84,225,236,225,244,232,225,105,128, 14, 40,239,244,232,225,
+    105,128, 14, 11,245,225,244,232,225,105,128, 14, 42,240, 97,  3,
+    180,102,180,122,180,154,227,101,129,  0, 32,180,109,232,225,227,
+    235,225,242,225,226,233, 99,128,  0, 32,228,101,129, 38, 96,180,
+    129,243,245,233,116,  2,180,138,180,146,226,236,225,227,107,128,
+     38, 96,247,232,233,244,101,128, 38,100,242,229,110,128, 36,174,
+    241,245,225,242,101, 11,180,188,180,199,180,213,180,238,180,255,
+    181, 25,181, 40,181, 73,181,100,181,156,181,171,226,229,236,239,
+    247,227,237, 98,128,  3, 59, 99,  2,180,205,180,209, 99,128, 51,
+    196,109,128, 51,157,228,233,225,231,239,238,225,236,227,242,239,
+    243,243,232,225,244,227,232,230,233,236,108,128, 37,169,232,239,
+    242,233,250,239,238,244,225,236,230,233,236,108,128, 37,164,107,
+      2,181,  5,181,  9,103,128, 51,143,109,129, 51,158,181, 15,227,
+    225,240,233,244,225,108,128, 51,206,108,  2,181, 31,181, 35,110,
+    128, 51,209,239,103,128, 51,210,109,  4,181, 50,181, 54,181, 59,
+    181, 63,103,128, 51,142,233,108,128, 51,213,109,128, 51,156,243,
+    241,245,225,242,229,100,128, 51,161,239,242,244,232,239,231,239,
+    238,225,236,227,242,239,243,243,232,225,244,227,232,230,233,236,
+    108,128, 37,166,245,240,240,229,114,  2,181,110,181,133,236,229,
+    230,244,244,239,236,239,247,229,242,242,233,231,232,244,230,233,
+    236,108,128, 37,167,242,233,231,232,244,244,239,236,239,247,229,
+    242,236,229,230,244,230,233,236,108,128, 37,168,246,229,242,244,
+    233,227,225,236,230,233,236,108,128, 37,165,247,232,233,244,229,
+    247,233,244,232,243,237,225,236,236,226,236,225,227,107,128, 37,
+    163,242,243,241,245,225,242,101,128, 51,219,115,  2,181,209,182,
+    123, 97,  4,181,219,181,229,181,236,181,247,226,229,238,231,225,
+    236,105,128,  9,183,228,229,246, 97,128,  9, 55,231,245,234,225,
+    242,225,244,105,128, 10,183,238,103,  8,182, 10,182, 24,182, 38,
+    182, 52,182, 67,182, 81,182, 95,182,108,227,233,229,245,227,235,
+    239,242,229,225,110,128, 49, 73,232,233,229,245,232,235,239,242,
+    229,225,110,128, 49,133,233,229,245,238,231,235,239,242,229,225,
+    110,128, 49,128,235,233,249,229,239,235,235,239,242,229,225,110,
+    128, 49, 50,238,233,229,245,238,235,239,242,229,225,110,128, 49,
+    101,240,233,229,245,240,235,239,242,229,225,110,128, 49, 67,243,
+    233,239,243,235,239,242,229,225,110,128, 49, 70,244,233,235,229,
+    245,244,235,239,242,229,225,110,128, 49, 56,245,240,229,242,233,
+    239,114,128,246,242,116,  2,182,139,182,162,229,242,236,233,238,
+    103,129,  0,163,182,150,237,239,238,239,243,240,225,227,101,128,
+    255,225,242,239,235,101,  2,182,171,182,188,236,239,238,231,239,
+    246,229,242,236,225,249,227,237, 98,128,  3, 54,243,232,239,242,
+    244,239,246,229,242,236,225,249,227,237, 98,128,  3, 53,117,  7,
+    182,222,182,254,183, 20,183, 31,183, 72,183, 82,183, 86,226,243,
+    229,116,130, 34,130,182,233,182,244,238,239,244,229,241,245,225,
+    108,128, 34,138,239,242,229,241,245,225,108,128, 34,134, 99,  2,
+    183,  4,183, 12,227,229,229,228,115,128, 34,123,232,244,232,225,
+    116,128, 34, 11,232,233,242,225,231,225,238, 97,128, 48, 89,107,
+      2,183, 37,183, 61,225,244,225,235,225,238, 97,129, 48,185,183,
+     49,232,225,236,230,247,233,228,244,104,128,255,125,245,238,225,
+    242,225,226,233, 99,128,  6, 82,237,237,225,244,233,239,110,128,
+     34, 17,110,128, 38, 60,240,229,242,243,229,116,130, 34,131,183,
+     99,183,110,238,239,244,229,241,245,225,108,128, 34,139,239,242,
+    229,241,245,225,108,128, 34,135,246,243,241,245,225,242,101,128,
+     51,220,249,239,245,247,225,229,242,225,243,241,245,225,242,101,
+    128, 51,124,116,144,  0,116,183,183,184,192,184,213,185,100,185,
+    140,187,188,191, 70,192,145,192,157,192,169,193,202,193,227,194,
+     57,194,237,195,165,195,255, 97, 10,183,205,183,215,183,236,183,
+    243,184, 12,184, 90,184,107,184,132,184,146,184,150,226,229,238,
+    231,225,236,105,128,  9,164,227,107,  2,183,222,183,229,228,239,
+    247,110,128, 34,164,236,229,230,116,128, 34,163,228,229,246, 97,
+    128,  9, 36,231,117,  2,183,250,184,  3,234,225,242,225,244,105,
+    128, 10,164,242,237,245,235,232,105,128, 10, 36,104,  4,184, 22,
+    184, 31,184, 45,184, 75,225,242,225,226,233, 99,128,  6, 55,230,
+    233,238,225,236,225,242,225,226,233, 99,128,254,194,105,  2,184,
+     51,184, 66,238,233,244,233,225,236,225,242,225,226,233, 99,128,
+    254,195,242,225,231,225,238, 97,128, 48, 95,237,229,228,233,225,
+    236,225,242,225,226,233, 99,128,254,196,233,243,249,239,245,229,
+    242,225,243,241,245,225,242,101,128, 51,125,235,225,244,225,235,
+    225,238, 97,129, 48,191,184,120,232,225,236,230,247,233,228,244,
+    104,128,255,128,244,247,229,229,236,225,242,225,226,233, 99,128,
+      6, 64,117,128,  3,196,118,130,  5,234,184,158,184,183,228,225,
+    231,229,115,129,251, 74,184,168,104,129,251, 74,184,174,232,229,
+    226,242,229,119,128,251, 74,232,229,226,242,229,119,128,  5,234,
+     98,  2,184,198,184,203,225,114,128,  1,103,239,240,239,237,239,
+    230,111,128, 49, 10, 99,  6,184,227,184,234,184,241,184,250,185,
+     60,185, 87,225,242,239,110,128,  1,101,227,245,242,108,128,  2,
+    168,229,228,233,236,236, 97,128,  1, 99,232,229,104,  4,185,  6,
+    185, 15,185, 29,185, 45,225,242,225,226,233, 99,128,  6,134,230,
+    233,238,225,236,225,242,225,226,233, 99,128,251,123,233,238,233,
+    244,233,225,236,225,242,225,226,233, 99,128,251,124,237,229,228,
+    233,225,236,225,242,225,226,233, 99,128,251,125,233,242, 99,  2,
+    185, 68,185, 73,236,101,128, 36,227,245,237,230,236,229,248,226,
+    229,236,239,119,128, 30,113,239,237,237,225,225,227,227,229,238,
+    116,128,  1, 99,100,  2,185,106,185,116,233,229,242,229,243,233,
+    115,128, 30,151,239,116,  2,185,123,185,132,225,227,227,229,238,
+    116,128, 30,107,226,229,236,239,119,128, 30,109,101,  9,185,160,
+    185,171,185,191,186,201,186,226,187, 34,187,101,187,106,187,158,
+    227,249,242,233,236,236,233, 99,128,  4, 66,228,229,243,227,229,
+    238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,173,104,
+      7,185,207,185,216,185,230,186, 14,186, 44,186, 85,186,183,225,
+    242,225,226,233, 99,128,  6, 42,230,233,238,225,236,225,242,225,
+    226,233, 99,128,254,150,232,225,232,105,  2,185,239,185,254,238,
+    233,244,233,225,236,225,242,225,226,233, 99,128,252,162,243,239,
+    236,225,244,229,228,225,242,225,226,233, 99,128,252, 12,105,  2,
+    186, 20,186, 35,238,233,244,233,225,236,225,242,225,226,233, 99,
+    128,254,151,242,225,231,225,238, 97,128, 48,102,234,229,229,237,
+    105,  2,186, 54,186, 69,238,233,244,233,225,236,225,242,225,226,
+    233, 99,128,252,161,243,239,236,225,244,229,228,225,242,225,226,
+    233, 99,128,252, 11,109,  2,186, 91,186,125,225,242,226,245,244,
+     97,  2,186,102,186,111,225,242,225,226,233, 99,128,  6, 41,230,
+    233,238,225,236,225,242,225,226,233, 99,128,254,148,101,  2,186,
+    131,186,144,228,233,225,236,225,242,225,226,233, 99,128,254,152,
+    229,237,105,  2,186,152,186,167,238,233,244,233,225,236,225,242,
+    225,226,233, 99,128,252,164,243,239,236,225,244,229,228,225,242,
+    225,226,233, 99,128,252, 14,238,239,239,238,230,233,238,225,236,
+    225,242,225,226,233, 99,128,252,115,235,225,244,225,235,225,238,
+     97,129, 48,198,186,214,232,225,236,230,247,233,228,244,104,128,
+    255,131,108,  2,186,232,186,251,229,240,232,239,238,101,129, 33,
+     33,186,243,226,236,225,227,107,128, 38, 14,233,243,232, 97,  2,
+    187,  4,187, 19,231,229,228,239,236,225,232,229,226,242,229,119,
+    128,  5,160,241,229,244,225,238,225,232,229,226,242,229,119,128,
+      5,169,110,  4,187, 44,187, 53,187, 72,187, 93,227,233,242,227,
+    236,101,128, 36,105,233,228,229,239,231,242,225,240,232,233,227,
+    240,225,242,229,110,128, 50, 41,112,  2,187, 78,187, 85,225,242,
+    229,110,128, 36,125,229,242,233,239,100,128, 36,145,242,239,237,
+    225,110,128, 33,121,243,104,128,  2,167,116,131,  5,216,187,116,
+    187,136,187,145,228,225,231,229,243,104,129,251, 56,187,127,232,
+    229,226,242,229,119,128,251, 56,232,229,226,242,229,119,128,  5,
+    216,243,229,227,249,242,233,236,236,233, 99,128,  4,181,246,233,
+    114,  2,187,166,187,175,232,229,226,242,229,119,128,  5,155,236,
+    229,230,244,232,229,226,242,229,119,128,  5,155,104,  6,187,202,
+    188, 98,188,220,189, 96,190,  3,191, 60, 97,  5,187,214,187,224,
+    187,231,188,  0,188, 29,226,229,238,231,225,236,105,128,  9,165,
+    228,229,246, 97,128,  9, 37,231,117,  2,187,238,187,247,234,225,
+    242,225,244,105,128, 10,165,242,237,245,235,232,105,128, 10, 37,
+    108,  2,188,  6,188, 15,225,242,225,226,233, 99,128,  6, 48,230,
+    233,238,225,236,225,242,225,226,233, 99,128,254,172,238,244,232,
+    225,235,232,225,116,  3,188, 44,188, 75,188, 82,236,239,119,  2,
+    188, 52,188, 63,236,229,230,244,244,232,225,105,128,248,152,242,
+    233,231,232,244,244,232,225,105,128,248,151,244,232,225,105,128,
+     14, 76,245,240,240,229,242,236,229,230,244,244,232,225,105,128,
+    248,150,101,  3,188,106,188,170,188,193,104,  4,188,116,188,125,
+    188,139,188,155,225,242,225,226,233, 99,128,  6, 43,230,233,238,
+    225,236,225,242,225,226,233, 99,128,254,154,233,238,233,244,233,
+    225,236,225,242,225,226,233, 99,128,254,155,237,229,228,233,225,
+    236,225,242,225,226,233, 99,128,254,156,242,101,  2,188,177,188,
+    186,229,248,233,243,244,115,128, 34,  3,230,239,242,101,128, 34,
+     52,244, 97,130,  3,184,188,202,188,206, 49,128,  3,209,243,249,
+    237,226,239,236,231,242,229,229,107,128,  3,209,105,  2,188,226,
+    189, 56,229,245,244,104,  4,188,239,189, 18,189, 33,189, 42, 97,
+      2,188,245,189,  4,227,233,242,227,236,229,235,239,242,229,225,
+    110,128, 50,121,240,225,242,229,238,235,239,242,229,225,110,128,
+     50, 25,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,
+    107,235,239,242,229,225,110,128, 49, 76,240,225,242,229,238,235,
+    239,242,229,225,110,128, 50, 11,242,244,229,229,110,  2,189, 66,
+    189, 75,227,233,242,227,236,101,128, 36,108,112,  2,189, 81,189,
+     88,225,242,229,110,128, 36,128,229,242,233,239,100,128, 36,148,
+    111,  6,189,110,189,127,189,132,189,146,189,151,189,204,238,225,
+    238,231,237,239,238,244,232,239,244,232,225,105,128, 14, 17,239,
+    107,128,  1,173,240,232,245,244,232,225,239,244,232,225,105,128,
+     14, 18,242,110,128,  0,254,244,104,  3,189,160,189,184,189,194,
+     97,  2,189,166,189,176,232,225,238,244,232,225,105,128, 14, 23,
+    238,244,232,225,105,128, 14, 16,239,238,231,244,232,225,105,128,
+     14, 24,245,238,231,244,232,225,105,128, 14, 22,245,243,225,238,
+    100,  2,189,214,189,225,227,249,242,233,236,236,233, 99,128,  4,
+    130,243,243,229,240,225,242,225,244,239,114,  2,189,240,189,249,
+    225,242,225,226,233, 99,128,  6,108,240,229,242,243,233,225,110,
+    128,  6,108,242,229,101,144,  0, 51,190, 41,190, 50,190, 60,190,
+     90,190, 97,190,107,190,132,190,159,190,193,190,205,190,224,190,
+    235,191, 12,191, 34,191, 42,191, 53,225,242,225,226,233, 99,128,
+      6, 99,226,229,238,231,225,236,105,128,  9,233,227,233,242,227,
+    236,101,129, 36, 98,190, 71,233,238,246,229,242,243,229,243,225,
+    238,243,243,229,242,233,102,128, 39,140,228,229,246, 97,128,  9,
+    105,229,233,231,232,244,232,115,128, 33, 92,231,117,  2,190,114,
+    190,123,234,225,242,225,244,105,128, 10,233,242,237,245,235,232,
+    105,128, 10,105,232, 97,  2,190,139,190,150,227,235,225,242,225,
+    226,233, 99,128,  6, 99,238,231,250,232,239,117,128, 48, 35,105,
+      2,190,165,190,183,228,229,239,231,242,225,240,232,233,227,240,
+    225,242,229,110,128, 50, 34,238,230,229,242,233,239,114,128, 32,
+    131,237,239,238,239,243,240,225,227,101,128,255, 19,238,245,237,
+    229,242,225,244,239,242,226,229,238,231,225,236,105,128,  9,246,
+    239,236,228,243,244,249,236,101,128,247, 51,112,  2,190,241,190,
+    248,225,242,229,110,128, 36,118,229,114,  2,190,255,191,  5,233,
+    239,100,128, 36,138,243,233,225,110,128,  6,243,241,245,225,242,
+    244,229,242,115,129,  0,190,191, 25,229,237,228,225,243,104,128,
+    246,222,242,239,237,225,110,128, 33,114,243,245,240,229,242,233,
+    239,114,128,  0,179,244,232,225,105,128, 14, 83,250,243,241,245,
+    225,242,101,128, 51,148,105,  7,191, 86,191, 97,191,212,192, 54,
+    192, 66,192,115,192,132,232,233,242,225,231,225,238, 97,128, 48,
+     97,107,  2,191,103,191,127,225,244,225,235,225,238, 97,129, 48,
+    193,191,115,232,225,236,230,247,233,228,244,104,128,255,129,229,
+    245,116,  4,191,139,191,174,191,189,191,198, 97,  2,191,145,191,
+    160,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,112,
+    240,225,242,229,238,235,239,242,229,225,110,128, 50, 16,227,233,
+    242,227,236,229,235,239,242,229,225,110,128, 50, 98,235,239,242,
+    229,225,110,128, 49, 55,240,225,242,229,238,235,239,242,229,225,
+    110,128, 50,  2,236,228,101,133,  2,220,191,228,191,239,192,  0,
+    192, 12,192, 40,226,229,236,239,247,227,237, 98,128,  3, 48, 99,
+      2,191,245,191,250,237, 98,128,  3,  3,239,237, 98,128,  3,  3,
+    228,239,245,226,236,229,227,237, 98,128,  3, 96,111,  2,192, 18,
+    192, 28,240,229,242,225,244,239,114,128, 34, 60,246,229,242,236,
+    225,249,227,237, 98,128,  3, 52,246,229,242,244,233,227,225,236,
+    227,237, 98,128,  3, 62,237,229,243,227,233,242,227,236,101,128,
+     34,151,112,  2,192, 72,192,102,229,232, 97,  2,192, 80,192, 89,
+    232,229,226,242,229,119,128,  5,150,236,229,230,244,232,229,226,
+    242,229,119,128,  5,150,240,233,231,245,242,237,245,235,232,105,
+    128, 10,112,244,236,239,227,249,242,233,236,236,233,227,227,237,
+     98,128,  4,131,247,238,225,242,237,229,238,233,225,110,128,  5,
+    127,236,233,238,229,226,229,236,239,119,128, 30,111,237,239,238,
+    239,243,240,225,227,101,128,255, 84,111,  7,192,185,192,196,192,
+    207,192,232,193, 96,193,108,193,192,225,242,237,229,238,233,225,
+    110,128,  5,105,232,233,242,225,231,225,238, 97,128, 48,104,235,
+    225,244,225,235,225,238, 97,129, 48,200,192,220,232,225,236,230,
+    247,233,228,244,104,128,255,132,110,  3,192,240,193, 82,193, 87,
+    101,  4,192,250,193, 63,193, 70,193, 76,226,225,114,  4,193,  6,
+    193, 35,193, 45,193, 54,229,248,244,242, 97,  2,193, 16,193, 26,
+    232,233,231,232,237,239,100,128,  2,229,236,239,247,237,239,100,
+    128,  2,233,232,233,231,232,237,239,100,128,  2,230,236,239,247,
+    237,239,100,128,  2,232,237,233,228,237,239,100,128,  2,231,230,
+    233,246,101,128,  1,189,243,233,120,128,  1,133,244,247,111,128,
+      1,168,239,115,128,  3,132,243,241,245,225,242,101,128, 51, 39,
+    240,225,244,225,235,244,232,225,105,128, 14, 15,242,244,239,233,
+    243,229,243,232,229,236,236,226,242,225,227,235,229,116,  2,193,
+    131,193,161,236,229,230,116,130, 48, 20,193,142,193,150,243,237,
+    225,236,108,128,254, 93,246,229,242,244,233,227,225,108,128,254,
+     57,242,233,231,232,116,130, 48, 21,193,173,193,181,243,237,225,
+    236,108,128,254, 94,246,229,242,244,233,227,225,108,128,254, 58,
+    244,225,239,244,232,225,105,128, 14, 21,240, 97,  2,193,209,193,
+    221,236,225,244,225,236,232,239,239,107,128,  1,171,242,229,110,
+    128, 36,175,114,  3,193,235,194, 10,194, 25,225,228,229,237,225,
+    242,107,129, 33, 34,193,247,115,  2,193,253,194,  3,225,238,115,
+    128,248,234,229,242,233,102,128,246,219,229,244,242,239,230,236,
+    229,248,232,239,239,107,128,  2,136,233,225,103,  4,194, 37,194,
+     42,194, 47,194, 52,228,110,128, 37,188,236,102,128, 37,196,242,
+    116,128, 37,186,245,112,128, 37,178,115,132,  2,166,194, 69,194,
+    108,194,214,194,227,225,228,105,130,  5,230,194, 79,194, 99,228,
+    225,231,229,243,104,129,251, 70,194, 90,232,229,226,242,229,119,
+    128,251, 70,232,229,226,242,229,119,128,  5,230,101,  2,194,114,
+    194,125,227,249,242,233,236,236,233, 99,128,  4, 70,242,101,134,
+      5,181,194,142,194,156,194,161,194,170,194,185,194,201, 49,  2,
+    194,148,194,152, 50,128,  5,181,101,128,  5,181,178, 98,128,  5,
+    181,232,229,226,242,229,119,128,  5,181,238,225,242,242,239,247,
+    232,229,226,242,229,119,128,  5,181,241,245,225,242,244,229,242,
+    232,229,226,242,229,119,128,  5,181,247,233,228,229,232,229,226,
+    242,229,119,128,  5,181,232,229,227,249,242,233,236,236,233, 99,
+    128,  4, 91,245,240,229,242,233,239,114,128,246,243,116,  4,194,
+    247,195, 41,195,106,195,157, 97,  3,194,255,195,  9,195, 16,226,
+    229,238,231,225,236,105,128,  9,159,228,229,246, 97,128,  9, 31,
+    231,117,  2,195, 23,195, 32,234,225,242,225,244,105,128, 10,159,
+    242,237,245,235,232,105,128, 10, 31,229,104,  4,195, 52,195, 61,
+    195, 75,195, 91,225,242,225,226,233, 99,128,  6,121,230,233,238,
+    225,236,225,242,225,226,233, 99,128,251,103,233,238,233,244,233,
+    225,236,225,242,225,226,233, 99,128,251,104,237,229,228,233,225,
+    236,225,242,225,226,233, 99,128,251,105,232, 97,  3,195,115,195,
+    125,195,132,226,229,238,231,225,236,105,128,  9,160,228,229,246,
+     97,128,  9, 32,231,117,  2,195,139,195,148,234,225,242,225,244,
+    105,128, 10,160,242,237,245,235,232,105,128, 10, 32,245,242,238,
+    229,100,128,  2,135,117,  3,195,173,195,184,195,209,232,233,242,
+    225,231,225,238, 97,128, 48,100,235,225,244,225,235,225,238, 97,
+    129, 48,196,195,197,232,225,236,230,247,233,228,244,104,128,255,
+    130,243,237,225,236,108,  2,195,219,195,230,232,233,242,225,231,
+    225,238, 97,128, 48, 99,235,225,244,225,235,225,238, 97,129, 48,
+    195,195,243,232,225,236,230,247,233,228,244,104,128,255,111,119,
+      2,196,  5,196,110,101,  2,196, 11,196, 59,236,246,101,  3,196,
+     21,196, 30,196, 51,227,233,242,227,236,101,128, 36,107,112,  2,
+    196, 36,196, 43,225,242,229,110,128, 36,127,229,242,233,239,100,
+    128, 36,147,242,239,237,225,110,128, 33,123,238,244,121,  3,196,
+     69,196, 78,196, 89,227,233,242,227,236,101,128, 36,115,232,225,
+    238,231,250,232,239,117,128, 83, 68,112,  2,196, 95,196,102,225,
+    242,229,110,128, 36,135,229,242,233,239,100,128, 36,155,111,142,
+      0, 50,196,142,196,151,196,161,196,191,196,243,197, 12,197, 39,
+    197, 73,197, 85,197,104,197,115,197,148,197,156,197,180,225,242,
+    225,226,233, 99,128,  6, 98,226,229,238,231,225,236,105,128,  9,
+    232,227,233,242,227,236,101,129, 36, 97,196,172,233,238,246,229,
+    242,243,229,243,225,238,243,243,229,242,233,102,128, 39,139,100,
+      2,196,197,196,203,229,246, 97,128,  9,104,239,116,  2,196,210,
+    196,221,229,238,236,229,225,228,229,114,128, 32, 37,236,229,225,
+    228,229,114,129, 32, 37,196,232,246,229,242,244,233,227,225,108,
+    128,254, 48,231,117,  2,196,250,197,  3,234,225,242,225,244,105,
+    128, 10,232,242,237,245,235,232,105,128, 10,104,232, 97,  2,197,
+     19,197, 30,227,235,225,242,225,226,233, 99,128,  6, 98,238,231,
+    250,232,239,117,128, 48, 34,105,  2,197, 45,197, 63,228,229,239,
+    231,242,225,240,232,233,227,240,225,242,229,110,128, 50, 33,238,
+    230,229,242,233,239,114,128, 32,130,237,239,238,239,243,240,225,
+    227,101,128,255, 18,238,245,237,229,242,225,244,239,242,226,229,
+    238,231,225,236,105,128,  9,245,239,236,228,243,244,249,236,101,
+    128,247, 50,112,  2,197,121,197,128,225,242,229,110,128, 36,117,
+    229,114,  2,197,135,197,141,233,239,100,128, 36,137,243,233,225,
+    110,128,  6,242,242,239,237,225,110,128, 33,113,115,  2,197,162,
+    197,170,244,242,239,235,101,128,  1,187,245,240,229,242,233,239,
+    114,128,  0,178,244,104,  2,197,187,197,192,225,105,128, 14, 82,
+    233,242,228,115,128, 33, 84,117,145,  0,117,197,237,197,245,198,
+     30,198, 87,198,225,199,  6,199,129,199,145,199,196,200, 10,200,
+     91,200,100,200,219,200,243,201, 95,201,123,201,237,225,227,245,
+    244,101,128,  0,250, 98,  4,197,255,198,  4,198, 13,198, 23,225,
+    114,128,  2,137,229,238,231,225,236,105,128,  9,137,239,240,239,
+    237,239,230,111,128, 49, 40,242,229,246,101,128,  1,109, 99,  3,
+    198, 38,198, 45,198, 77,225,242,239,110,128,  1,212,233,242, 99,
+      2,198, 53,198, 58,236,101,128, 36,228,245,237,230,236,229,120,
+    129,  0,251,198, 69,226,229,236,239,119,128, 30,119,249,242,233,
+    236,236,233, 99,128,  4, 67,100,  5,198, 99,198,110,198,133,198,
+    139,198,215,225,244,244,225,228,229,246, 97,128,  9, 81,226,108,
+      2,198,117,198,125,225,227,245,244,101,128,  1,113,231,242,225,
+    246,101,128,  2, 21,229,246, 97,128,  9,  9,233,229,242,229,243,
+    233,115,133,  0,252,198,159,198,167,198,175,198,198,198,206,225,
+    227,245,244,101,128,  1,216,226,229,236,239,119,128, 30,115, 99,
+      2,198,181,198,188,225,242,239,110,128,  1,218,249,242,233,236,
+    236,233, 99,128,  4,241,231,242,225,246,101,128,  1,220,237,225,
+    227,242,239,110,128,  1,214,239,244,226,229,236,239,119,128, 30,
+    229,103,  2,198,231,198,238,242,225,246,101,128,  0,249,117,  2,
+    198,244,198,253,234,225,242,225,244,105,128, 10,137,242,237,245,
+    235,232,105,128, 10,  9,104,  3,199, 14,199, 24,199,102,233,242,
+    225,231,225,238, 97,128, 48, 70,111,  2,199, 30,199, 40,239,235,
+    225,226,239,246,101,128, 30,231,242,110,133,  1,176,199, 55,199,
+     63,199, 74,199, 82,199, 94,225,227,245,244,101,128, 30,233,228,
+    239,244,226,229,236,239,119,128, 30,241,231,242,225,246,101,128,
+     30,235,232,239,239,235,225,226,239,246,101,128, 30,237,244,233,
+    236,228,101,128, 30,239,245,238,231,225,242,245,237,236,225,245,
+    116,129,  1,113,199,118,227,249,242,233,236,236,233, 99,128,  4,
+    243,233,238,246,229,242,244,229,228,226,242,229,246,101,128,  2,
+     23,107,  3,199,153,199,177,199,188,225,244,225,235,225,238, 97,
+    129, 48,166,199,165,232,225,236,230,247,233,228,244,104,128,255,
+    115,227,249,242,233,236,236,233, 99,128,  4,121,239,242,229,225,
+    110,128, 49, 92,109,  2,199,202,199,255, 97,  2,199,208,199,241,
+    227,242,239,110,130,  1,107,199,219,199,230,227,249,242,233,236,
+    236,233, 99,128,  4,239,228,233,229,242,229,243,233,115,128, 30,
+    123,244,242,225,231,245,242,237,245,235,232,105,128, 10, 65,239,
+    238,239,243,240,225,227,101,128,255, 85,110,  2,200, 16,200, 71,
+    228,229,242,243,227,239,242,101,132,  0, 95,200, 35,200, 41,200,
+     53,200, 64,228,226,108,128, 32, 23,237,239,238,239,243,240,225,
+    227,101,128,255, 63,246,229,242,244,233,227,225,108,128,254, 51,
+    247,225,246,121,128,254, 79,105,  2,200, 77,200, 82,239,110,128,
+     34, 42,246,229,242,243,225,108,128, 34,  0,239,231,239,238,229,
+    107,128,  1,115,112,  5,200,112,200,119,200,127,200,142,200,193,
+    225,242,229,110,128, 36,176,226,236,239,227,107,128, 37,128,240,
+    229,242,228,239,244,232,229,226,242,229,119,128,  5,196,243,233,
+    236,239,110,131,  3,197,200,156,200,177,200,185,228,233,229,242,
+    229,243,233,115,129,  3,203,200,169,244,239,238,239,115,128,  3,
+    176,236,225,244,233,110,128,  2,138,244,239,238,239,115,128,  3,
+    205,244,225,227,107,  2,200,202,200,213,226,229,236,239,247,227,
+    237, 98,128,  3, 29,237,239,100,128,  2,212,114,  2,200,225,200,
+    237,225,231,245,242,237,245,235,232,105,128, 10,115,233,238,103,
+    128,  1,111,115,  3,200,251,201, 10,201, 55,232,239,242,244,227,
+    249,242,233,236,236,233, 99,128,  4, 94,237,225,236,108,  2,201,
+     19,201, 30,232,233,242,225,231,225,238, 97,128, 48, 69,235,225,
+    244,225,235,225,238, 97,129, 48,165,201, 43,232,225,236,230,247,
+    233,228,244,104,128,255,105,244,242,225,233,231,232,116,  2,201,
+     67,201, 78,227,249,242,233,236,236,233, 99,128,  4,175,243,244,
+    242,239,235,229,227,249,242,233,236,236,233, 99,128,  4,177,244,
+    233,236,228,101,130,  1,105,201,107,201,115,225,227,245,244,101,
+    128, 30,121,226,229,236,239,119,128, 30,117,117,  5,201,135,201,
+    145,201,152,201,177,201,193,226,229,238,231,225,236,105,128,  9,
+    138,228,229,246, 97,128,  9, 10,231,117,  2,201,159,201,168,234,
+    225,242,225,244,105,128, 10,138,242,237,245,235,232,105,128, 10,
+     10,237,225,244,242,225,231,245,242,237,245,235,232,105,128, 10,
+     66,246,239,247,229,236,243,233,231,110,  3,201,209,201,219,201,
+    226,226,229,238,231,225,236,105,128,  9,194,228,229,246, 97,128,
+      9, 66,231,245,234,225,242,225,244,105,128, 10,194,246,239,247,
+    229,236,243,233,231,110,  3,201,253,202,  7,202, 14,226,229,238,
+    231,225,236,105,128,  9,193,228,229,246, 97,128,  9, 65,231,245,
+    234,225,242,225,244,105,128, 10,193,118,139,  0,118,202, 51,202,
+    199,202,208,202,219,203,148,203,155,203,253,204,  9,204,109,204,
+    117,204,138, 97,  4,202, 61,202, 68,202, 93,202,104,228,229,246,
+     97,128,  9, 53,231,117,  2,202, 75,202, 84,234,225,242,225,244,
+    105,128, 10,181,242,237,245,235,232,105,128, 10, 53,235,225,244,
+    225,235,225,238, 97,128, 48,247,118,132,  5,213,202,116,202,143,
+    202,175,202,187,228,225,231,229,243,104,130,251, 53,202,129,202,
+    134,182, 53,128,251, 53,232,229,226,242,229,119,128,251, 53,104,
+      2,202,149,202,157,229,226,242,229,119,128,  5,213,239,236,225,
+    109,129,251, 75,202,166,232,229,226,242,229,119,128,251, 75,246,
+    225,246,232,229,226,242,229,119,128,  5,240,249,239,228,232,229,
+    226,242,229,119,128,  5,241,227,233,242,227,236,101,128, 36,229,
+    228,239,244,226,229,236,239,119,128, 30,127,101,  6,202,233,202,
+    244,203, 52,203, 63,203, 69,203,136,227,249,242,233,236,236,233,
+     99,128,  4, 50,104,  4,202,254,203,  7,203, 21,203, 37,225,242,
+    225,226,233, 99,128,  6,164,230,233,238,225,236,225,242,225,226,
+    233, 99,128,251,107,233,238,233,244,233,225,236,225,242,225,226,
+    233, 99,128,251,108,237,229,228,233,225,236,225,242,225,226,233,
+     99,128,251,109,235,225,244,225,235,225,238, 97,128, 48,249,238,
+    245,115,128, 38, 64,242,244,233,227,225,108,  2,203, 80,203, 86,
+    226,225,114,128,  0,124,236,233,238,101,  4,203, 99,203,110,203,
+    121,203,130,225,226,239,246,229,227,237, 98,128,  3, 13,226,229,
+    236,239,247,227,237, 98,128,  3, 41,236,239,247,237,239,100,128,
+      2,204,237,239,100,128,  2,200,247,225,242,237,229,238,233,225,
+    110,128,  5,126,232,239,239,107,128,  2,139,105,  3,203,163,203,
+    174,203,213,235,225,244,225,235,225,238, 97,128, 48,248,242,225,
+    237, 97,  3,203,185,203,195,203,202,226,229,238,231,225,236,105,
+    128,  9,205,228,229,246, 97,128,  9, 77,231,245,234,225,242,225,
+    244,105,128, 10,205,243,225,242,231, 97,  3,203,225,203,235,203,
+    242,226,229,238,231,225,236,105,128,  9,131,228,229,246, 97,128,
+      9,  3,231,245,234,225,242,225,244,105,128, 10,131,237,239,238,
+    239,243,240,225,227,101,128,255, 86,111,  3,204, 17,204, 28,204,
+     98,225,242,237,229,238,233,225,110,128,  5,120,233,227,229,100,
+      2,204, 37,204, 73,233,244,229,242,225,244,233,239,110,  2,204,
+     51,204, 62,232,233,242,225,231,225,238, 97,128, 48,158,235,225,
+    244,225,235,225,238, 97,128, 48,254,237,225,242,235,235,225,238,
+     97,129, 48,155,204, 86,232,225,236,230,247,233,228,244,104,128,
+    255,158,235,225,244,225,235,225,238, 97,128, 48,250,240,225,242,
+    229,110,128, 36,177,116,  2,204,123,204,130,233,236,228,101,128,
+     30,125,245,242,238,229,100,128,  2,140,117,  2,204,144,204,155,
+    232,233,242,225,231,225,238, 97,128, 48,148,235,225,244,225,235,
+    225,238, 97,128, 48,244,119,143,  0,119,204,200,205,177,205,187,
+    205,210,205,250,206, 61,206, 69,208, 40,208, 81,208, 93,208,168,
+    208,176,208,183,208,194,208,203, 97,  8,204,218,204,225,204,235,
+    204,246,205, 28,205, 60,205, 72,205,108,227,245,244,101,128, 30,
+    131,229,235,239,242,229,225,110,128, 49, 89,232,233,242,225,231,
+    225,238, 97,128, 48,143,107,  2,204,252,205, 20,225,244,225,235,
+    225,238, 97,129, 48,239,205,  8,232,225,236,230,247,233,228,244,
+    104,128,255,156,239,242,229,225,110,128, 49, 88,243,237,225,236,
+    108,  2,205, 38,205, 49,232,233,242,225,231,225,238, 97,128, 48,
+    142,235,225,244,225,235,225,238, 97,128, 48,238,244,244,239,243,
+    241,245,225,242,101,128, 51, 87,118,  2,205, 78,205, 86,229,228,
+    225,243,104,128, 48, 28,249,245,238,228,229,242,243,227,239,242,
+    229,246,229,242,244,233,227,225,108,128,254, 52,119,  3,205,116,
+    205,125,205,139,225,242,225,226,233, 99,128,  6, 72,230,233,238,
+    225,236,225,242,225,226,233, 99,128,254,238,232,225,237,250,225,
+    225,226,239,246,101,  2,205,154,205,163,225,242,225,226,233, 99,
+    128,  6, 36,230,233,238,225,236,225,242,225,226,233, 99,128,254,
+    134,226,243,241,245,225,242,101,128, 51,221,227,233,242, 99,  2,
+    205,196,205,201,236,101,128, 36,230,245,237,230,236,229,120,128,
+      1,117,100,  2,205,216,205,226,233,229,242,229,243,233,115,128,
+     30,133,239,116,  2,205,233,205,242,225,227,227,229,238,116,128,
+     30,135,226,229,236,239,119,128, 30,137,101,  4,206,  4,206, 15,
+    206, 27,206, 51,232,233,242,225,231,225,238, 97,128, 48,145,233,
+    229,242,243,244,242,225,243,115,128, 33, 24,107,  2,206, 33,206,
+     43,225,244,225,235,225,238, 97,128, 48,241,239,242,229,225,110,
+    128, 49, 94,239,235,239,242,229,225,110,128, 49, 93,231,242,225,
+    246,101,128, 30,129,232,233,244,101,  8,206, 90,206, 99,206,183,
+    207, 17,207,101,207,146,207,198,207,254,226,245,236,236,229,116,
+    128, 37,230, 99,  2,206,105,206,125,233,242,227,236,101,129, 37,
+    203,206,115,233,238,246,229,242,243,101,128, 37,217,239,242,238,
+    229,242,226,242,225,227,235,229,116,  2,206,142,206,162,236,229,
+    230,116,129, 48, 14,206,151,246,229,242,244,233,227,225,108,128,
+    254, 67,242,233,231,232,116,129, 48, 15,206,172,246,229,242,244,
+    233,227,225,108,128,254, 68,100,  2,206,189,206,230,233,225,237,
+    239,238,100,129, 37,199,206,200,227,239,238,244,225,233,238,233,
+    238,231,226,236,225,227,235,243,237,225,236,236,228,233,225,237,
+    239,238,100,128, 37,200,239,247,238,240,239,233,238,244,233,238,
+    103,  2,206,246,207,  6,243,237,225,236,236,244,242,233,225,238,
+    231,236,101,128, 37,191,244,242,233,225,238,231,236,101,128, 37,
+    189,236,101,  2,207, 24,207, 66,230,244,240,239,233,238,244,233,
+    238,103,  2,207, 39,207, 55,243,237,225,236,236,244,242,233,225,
+    238,231,236,101,128, 37,195,244,242,233,225,238,231,236,101,128,
+     37,193,238,244,233,227,245,236,225,242,226,242,225,227,235,229,
+    116,  2,207, 86,207, 93,236,229,230,116,128, 48, 22,242,233,231,
+    232,116,128, 48, 23,242,233,231,232,244,240,239,233,238,244,233,
+    238,103,  2,207,119,207,135,243,237,225,236,236,244,242,233,225,
+    238,231,236,101,128, 37,185,244,242,233,225,238,231,236,101,128,
+     37,183,115,  3,207,154,207,184,207,192,109,  2,207,160,207,172,
+    225,236,236,243,241,245,225,242,101,128, 37,171,233,236,233,238,
+    231,230,225,227,101,128, 38, 58,241,245,225,242,101,128, 37,161,
+    244,225,114,128, 38,  6,116,  2,207,204,207,215,229,236,229,240,
+    232,239,238,101,128, 38, 15,239,242,244,239,233,243,229,243,232,
+    229,236,236,226,242,225,227,235,229,116,  2,207,239,207,246,236,
+    229,230,116,128, 48, 24,242,233,231,232,116,128, 48, 25,245,240,
+    240,239,233,238,244,233,238,103,  2,208, 13,208, 29,243,237,225,
+    236,236,244,242,233,225,238,231,236,101,128, 37,181,244,242,233,
+    225,238,231,236,101,128, 37,179,105,  2,208, 46,208, 57,232,233,
+    242,225,231,225,238, 97,128, 48,144,107,  2,208, 63,208, 73,225,
+    244,225,235,225,238, 97,128, 48,240,239,242,229,225,110,128, 49,
+     95,237,239,238,239,243,240,225,227,101,128,255, 87,111,  4,208,
+    103,208,114,208,139,208,157,232,233,242,225,231,225,238, 97,128,
+     48,146,235,225,244,225,235,225,238, 97,129, 48,242,208,127,232,
+    225,236,230,247,233,228,244,104,128,255,102,110,129, 32,169,208,
+    145,237,239,238,239,243,240,225,227,101,128,255,230,247,225,229,
+    238,244,232,225,105,128, 14, 39,240,225,242,229,110,128, 36,178,
+    242,233,238,103,128, 30,152,243,245,240,229,242,233,239,114,128,
+      2,183,244,245,242,238,229,100,128,  2,141,249,238,110,128,  1,
+    191,120,137,  0,120,208,231,208,242,208,253,209,  6,209, 33,209,
+     46,209, 50,209, 62,209, 70,225,226,239,246,229,227,237, 98,128,
+      3, 61,226,239,240,239,237,239,230,111,128, 49, 18,227,233,242,
+    227,236,101,128, 36,231,100,  2,209, 12,209, 22,233,229,242,229,
+    243,233,115,128, 30,141,239,244,225,227,227,229,238,116,128, 30,
+    139,229,232,225,242,237,229,238,233,225,110,128,  5,109,105,128,
+      3,190,237,239,238,239,243,240,225,227,101,128,255, 88,240,225,
+    242,229,110,128, 36,179,243,245,240,229,242,233,239,114,128,  2,
+    227,121,143,  0,121,209,115,210, 74,210, 97,210,137,212,103,212,
+    111,212,128,212,192,212,204,213,201,213,241,213,253,214,  8,214,
+     29,215,  2, 97, 11,209,139,209,151,209,161,209,168,209,175,209,
+    185,209,210,209,221,210,  3,210, 16,210, 62,225,228,239,243,241,
+    245,225,242,101,128, 51, 78,226,229,238,231,225,236,105,128,  9,
+    175,227,245,244,101,128,  0,253,228,229,246, 97,128,  9, 47,229,
+    235,239,242,229,225,110,128, 49, 82,231,117,  2,209,192,209,201,
+    234,225,242,225,244,105,128, 10,175,242,237,245,235,232,105,128,
+     10, 47,232,233,242,225,231,225,238, 97,128, 48,132,107,  2,209,
+    227,209,251,225,244,225,235,225,238, 97,129, 48,228,209,239,232,
+    225,236,230,247,233,228,244,104,128,255,148,239,242,229,225,110,
+    128, 49, 81,237,225,235,235,225,238,244,232,225,105,128, 14, 78,
+    243,237,225,236,108,  2,210, 26,210, 37,232,233,242,225,231,225,
+    238, 97,128, 48,131,235,225,244,225,235,225,238, 97,129, 48,227,
+    210, 50,232,225,236,230,247,233,228,244,104,128,255,108,244,227,
+    249,242,233,236,236,233, 99,128,  4, 99,227,233,242, 99,  2,210,
+     83,210, 88,236,101,128, 36,232,245,237,230,236,229,120,128,  1,
+    119,100,  2,210,103,210,113,233,229,242,229,243,233,115,128,  0,
+    255,239,116,  2,210,120,210,129,225,227,227,229,238,116,128, 30,
+    143,226,229,236,239,119,128, 30,245,101,  7,210,153,211,161,211,
+    170,211,188,211,220,212, 40,212, 91,104,  8,210,171,210,180,210,
+    214,210,228,211, 45,211, 61,211,120,211,138,225,242,225,226,233,
+     99,128,  6, 74,226,225,242,242,229,101,  2,210,191,210,200,225,
+    242,225,226,233, 99,128,  6,210,230,233,238,225,236,225,242,225,
+    226,233, 99,128,251,175,230,233,238,225,236,225,242,225,226,233,
+     99,128,254,242,232,225,237,250,225,225,226,239,246,101,  4,210,
+    247,211,  0,211, 14,211, 30,225,242,225,226,233, 99,128,  6, 38,
+    230,233,238,225,236,225,242,225,226,233, 99,128,254,138,233,238,
+    233,244,233,225,236,225,242,225,226,233, 99,128,254,139,237,229,
+    228,233,225,236,225,242,225,226,233, 99,128,254,140,233,238,233,
+    244,233,225,236,225,242,225,226,233, 99,128,254,243,237,101,  2,
+    211, 68,211, 81,228,233,225,236,225,242,225,226,233, 99,128,254,
+    244,229,237,105,  2,211, 89,211,104,238,233,244,233,225,236,225,
+    242,225,226,233, 99,128,252,221,243,239,236,225,244,229,228,225,
+    242,225,226,233, 99,128,252, 88,238,239,239,238,230,233,238,225,
+    236,225,242,225,226,233, 99,128,252,148,244,232,242,229,229,228,
+    239,244,243,226,229,236,239,247,225,242,225,226,233, 99,128,  6,
+    209,235,239,242,229,225,110,128, 49, 86,110,129,  0,165,211,176,
+    237,239,238,239,243,240,225,227,101,128,255,229,111,  2,211,194,
+    211,203,235,239,242,229,225,110,128, 49, 85,242,233,238,232,233,
+    229,245,232,235,239,242,229,225,110,128, 49,134,114,  3,211,228,
+    212,  8,212, 20,225,232,226,229,238,249,239,237,111,  2,211,242,
+    211,251,232,229,226,242,229,119,128,  5,170,236,229,230,244,232,
+    229,226,242,229,119,128,  5,170,233,227,249,242,233,236,236,233,
+     99,128,  4, 75,245,228,233,229,242,229,243,233,243,227,249,242,
+    233,236,236,233, 99,128,  4,249,243,233,229,245,238,103,  3,212,
+     53,212, 62,212, 78,235,239,242,229,225,110,128, 49,129,240,225,
+    238,243,233,239,243,235,239,242,229,225,110,128, 49,131,243,233,
+    239,243,235,239,242,229,225,110,128, 49,130,244,233,246,232,229,
+    226,242,229,119,128,  5,154,231,242,225,246,101,128, 30,243,232,
+    239,239,107,129,  1,180,212,120,225,226,239,246,101,128, 30,247,
+    105,  5,212,140,212,151,212,162,212,171,212,179,225,242,237,229,
+    238,233,225,110,128,  5,117,227,249,242,233,236,236,233, 99,128,
+      4, 87,235,239,242,229,225,110,128, 49, 98,238,249,225,238,103,
+    128, 38, 47,247,238,225,242,237,229,238,233,225,110,128,  5,130,
+    237,239,238,239,243,240,225,227,101,128,255, 89,111,  7,212,220,
+    213, 34,213, 45,213, 55,213, 93,213,139,213,148,100,131,  5,217,
+    212,230,212,250,213,  3,228,225,231,229,243,104,129,251, 57,212,
+    241,232,229,226,242,229,119,128,251, 57,232,229,226,242,229,119,
+    128,  5,217,249,239,100,  2,213, 11,213, 20,232,229,226,242,229,
+    119,128,  5,242,240,225,244,225,232,232,229,226,242,229,119,128,
+    251, 31,232,233,242,225,231,225,238, 97,128, 48,136,233,235,239,
+    242,229,225,110,128, 49,137,107,  2,213, 61,213, 85,225,244,225,
+    235,225,238, 97,129, 48,232,213, 73,232,225,236,230,247,233,228,
+    244,104,128,255,150,239,242,229,225,110,128, 49, 91,243,237,225,
+    236,108,  2,213,103,213,114,232,233,242,225,231,225,238, 97,128,
+     48,135,235,225,244,225,235,225,238, 97,129, 48,231,213,127,232,
+    225,236,230,247,233,228,244,104,128,255,110,244,231,242,229,229,
+    107,128,  3,243,121,  2,213,154,213,191, 97,  2,213,160,213,170,
+    229,235,239,242,229,225,110,128, 49,136,107,  2,213,176,213,184,
+    239,242,229,225,110,128, 49,135,244,232,225,105,128, 14, 34,233,
+    238,231,244,232,225,105,128, 14, 13,112,  2,213,207,213,214,225,
+    242,229,110,128, 36,180,239,231,229,231,242,225,237,237,229,238,
+    105,129,  3,122,213,230,231,242,229,229,235,227,237, 98,128,  3,
+     69,114,129,  1,166,213,247,233,238,103,128, 30,153,243,245,240,
+    229,242,233,239,114,128,  2,184,116,  2,214, 14,214, 21,233,236,
+    228,101,128, 30,249,245,242,238,229,100,128,  2,142,117,  5,214,
+     41,214, 52,214, 62,214,100,214,232,232,233,242,225,231,225,238,
+     97,128, 48,134,233,235,239,242,229,225,110,128, 49,140,107,  2,
+    214, 68,214, 92,225,244,225,235,225,238, 97,129, 48,230,214, 80,
+    232,225,236,230,247,233,228,244,104,128,255,149,239,242,229,225,
+    110,128, 49, 96,115,  3,214,108,214,146,214,187,226,233,103,  2,
+    214,116,214,127,227,249,242,233,236,236,233, 99,128,  4,107,233,
+    239,244,233,230,233,229,228,227,249,242,233,236,236,233, 99,128,
+      4,109,236,233,244,244,236,101,  2,214,157,214,168,227,249,242,
+    233,236,236,233, 99,128,  4,103,233,239,244,233,230,233,229,228,
+    227,249,242,233,236,236,233, 99,128,  4,105,237,225,236,108,  2,
+    214,196,214,207,232,233,242,225,231,225,238, 97,128, 48,133,235,
+    225,244,225,235,225,238, 97,129, 48,229,214,220,232,225,236,230,
+    247,233,228,244,104,128,255,109,249,101,  2,214,239,214,248,235,
+    239,242,229,225,110,128, 49,139,239,235,239,242,229,225,110,128,
+     49,138,249, 97,  2,215,  9,215, 19,226,229,238,231,225,236,105,
+    128,  9,223,228,229,246, 97,128,  9, 95,122,142,  0,122,215, 58,
+    216, 66,216, 77,216,120,216,147,217,182,218, 34,218, 76,218, 88,
+    218,100,218,128,218,136,218,152,218,161, 97, 10,215, 80,215, 91,
+    215, 98,215,105,215,116,215,194,215,224,215,235,216, 15,216, 27,
+    225,242,237,229,238,233,225,110,128,  5,102,227,245,244,101,128,
+      1,122,228,229,246, 97,128,  9, 91,231,245,242,237,245,235,232,
+    105,128, 10, 91,104,  4,215,126,215,135,215,149,215,179,225,242,
+    225,226,233, 99,128,  6, 56,230,233,238,225,236,225,242,225,226,
+    233, 99,128,254,198,105,  2,215,155,215,170,238,233,244,233,225,
+    236,225,242,225,226,233, 99,128,254,199,242,225,231,225,238, 97,
+    128, 48, 86,237,229,228,233,225,236,225,242,225,226,233, 99,128,
+    254,200,233,110,  2,215,201,215,210,225,242,225,226,233, 99,128,
+      6, 50,230,233,238,225,236,225,242,225,226,233, 99,128,254,176,
+    235,225,244,225,235,225,238, 97,128, 48,182,241,229,102,  2,215,
+    243,216,  1,231,225,228,239,236,232,229,226,242,229,119,128,  5,
+    149,241,225,244,225,238,232,229,226,242,229,119,128,  5,148,242,
+    241,225,232,229,226,242,229,119,128,  5,152,249,233,110,130,  5,
+    214,216, 37,216, 57,228,225,231,229,243,104,129,251, 54,216, 48,
+    232,229,226,242,229,119,128,251, 54,232,229,226,242,229,119,128,
+      5,214,226,239,240,239,237,239,230,111,128, 49, 23, 99,  3,216,
+     85,216, 92,216,114,225,242,239,110,128,  1,126,233,242, 99,  2,
+    216,100,216,105,236,101,128, 36,233,245,237,230,236,229,120,128,
+     30,145,245,242,108,128,  2,145,228,239,116,130,  1,124,216,130,
+    216,139,225,227,227,229,238,116,128,  1,124,226,229,236,239,119,
+    128, 30,147,101,  6,216,161,216,172,216,215,216,226,216,237,217,
+    177,227,249,242,233,236,236,233, 99,128,  4, 55,100,  2,216,178,
+    216,197,229,243,227,229,238,228,229,242,227,249,242,233,236,236,
+    233, 99,128,  4,153,233,229,242,229,243,233,243,227,249,242,233,
+    236,236,233, 99,128,  4,223,232,233,242,225,231,225,238, 97,128,
+     48, 92,235,225,244,225,235,225,238, 97,128, 48,188,242,111,140,
+      0, 48,217, 10,217, 19,217, 29,217, 36,217, 61,217, 74,217, 85,
+    217, 97,217,108,217,118,217,129,217,136,225,242,225,226,233, 99,
+    128,  6, 96,226,229,238,231,225,236,105,128,  9,230,228,229,246,
+     97,128,  9,102,231,117,  2,217, 43,217, 52,234,225,242,225,244,
+    105,128, 10,230,242,237,245,235,232,105,128, 10,102,232,225,227,
+    235,225,242,225,226,233, 99,128,  6, 96,233,238,230,229,242,233,
+    239,114,128, 32,128,237,239,238,239,243,240,225,227,101,128,255,
+     16,239,236,228,243,244,249,236,101,128,247, 48,240,229,242,243,
+    233,225,110,128,  6,240,243,245,240,229,242,233,239,114,128, 32,
+    112,244,232,225,105,128, 14, 80,247,233,228,244,104,  3,217,148,
+    217,157,217,169,234,239,233,238,229,114,128,254,255,238,239,238,
+    234,239,233,238,229,114,128, 32, 12,243,240,225,227,101,128, 32,
+     11,244, 97,128,  3,182,104,  2,217,188,217,199,226,239,240,239,
+    237,239,230,111,128, 49, 19,101,  4,217,209,217,220,217,236,217,
+    247,225,242,237,229,238,233,225,110,128,  5,106,226,242,229,246,
+    229,227,249,242,233,236,236,233, 99,128,  4,194,227,249,242,233,
+    236,236,233, 99,128,  4, 54,100,  2,217,253,218, 16,229,243,227,
+    229,238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,151,
     233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128,
     233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128,
-      4,249,243,233,229,245,238,103,  3,207,127,207,136,207,152,235,
-    239,242,229,225,110,128, 49,129,240,225,238,243,233,239,243,235,
-    239,242,229,225,110,128, 49,131,243,233,239,243,235,239,242,229,
-    225,110,128, 49,130,244,233,246,232,229,226,242,229,119,128,  5,
-    154,231,242,225,246,101,128, 30,243,232,239,239,107,129,  1,180,
-    207,194,225,226,239,246,101,128, 30,247,105,  5,207,214,207,225,
-    207,236,207,245,207,253,225,242,237,229,238,233,225,110,128,  5,
-    117,227,249,242,233,236,236,233, 99,128,  4, 87,235,239,242,229,
-    225,110,128, 49, 98,238,249,225,238,103,128, 38, 47,247,238,225,
-    242,237,229,238,233,225,110,128,  5,130,237,239,238,239,243,240,
-    225,227,101,128,255, 89,111,  7,208, 38,208,108,208,119,208,129,
-    208,167,208,213,208,222,100,131,  5,217,208, 48,208, 68,208, 77,
-    228,225,231,229,243,104,129,251, 57,208, 59,232,229,226,242,229,
-    119,128,251, 57,232,229,226,242,229,119,128,  5,217,249,239,100,
-      2,208, 85,208, 94,232,229,226,242,229,119,128,  5,242,240,225,
-    244,225,232,232,229,226,242,229,119,128,251, 31,232,233,242,225,
-    231,225,238, 97,128, 48,136,233,235,239,242,229,225,110,128, 49,
-    137,107,  2,208,135,208,159,225,244,225,235,225,238, 97,129, 48,
-    232,208,147,232,225,236,230,247,233,228,244,104,128,255,150,239,
-    242,229,225,110,128, 49, 91,243,237,225,236,108,  2,208,177,208,
-    188,232,233,242,225,231,225,238, 97,128, 48,135,235,225,244,225,
-    235,225,238, 97,129, 48,231,208,201,232,225,236,230,247,233,228,
-    244,104,128,255,110,244,231,242,229,229,107,128,  3,243,121,  2,
-    208,228,209,  9, 97,  2,208,234,208,244,229,235,239,242,229,225,
-    110,128, 49,136,107,  2,208,250,209,  2,239,242,229,225,110,128,
-     49,135,244,232,225,105,128, 14, 34,233,238,231,244,232,225,105,
-    128, 14, 13,112,  2,209, 25,209, 32,225,242,229,110,128, 36,180,
-    239,231,229,231,242,225,237,237,229,238,105,129,  3,122,209, 48,
-    231,242,229,229,235,227,237, 98,128,  3, 69,114,129,  1,166,209,
-     65,233,238,103,128, 30,153,243,245,240,229,242,233,239,114,128,
-      2,184,116,  2,209, 88,209, 95,233,236,228,101,128, 30,249,245,
-    242,238,229,100,128,  2,142,117,  5,209,115,209,126,209,136,209,
-    174,210, 50,232,233,242,225,231,225,238, 97,128, 48,134,233,235,
-    239,242,229,225,110,128, 49,140,107,  2,209,142,209,166,225,244,
-    225,235,225,238, 97,129, 48,230,209,154,232,225,236,230,247,233,
-    228,244,104,128,255,149,239,242,229,225,110,128, 49, 96,115,  3,
-    209,182,209,220,210,  5,226,233,103,  2,209,190,209,201,227,249,
-    242,233,236,236,233, 99,128,  4,107,233,239,244,233,230,233,229,
-    228,227,249,242,233,236,236,233, 99,128,  4,109,236,233,244,244,
-    236,101,  2,209,231,209,242,227,249,242,233,236,236,233, 99,128,
-      4,103,233,239,244,233,230,233,229,228,227,249,242,233,236,236,
-    233, 99,128,  4,105,237,225,236,108,  2,210, 14,210, 25,232,233,
-    242,225,231,225,238, 97,128, 48,133,235,225,244,225,235,225,238,
-     97,129, 48,229,210, 38,232,225,236,230,247,233,228,244,104,128,
-    255,109,249,101,  2,210, 57,210, 66,235,239,242,229,225,110,128,
-     49,139,239,235,239,242,229,225,110,128, 49,138,249, 97,  2,210,
-     83,210, 93,226,229,238,231,225,236,105,128,  9,223,228,229,246,
-     97,128,  9, 95,122,142,  0,122,210,132,211,140,211,151,211,194,
-    211,221,213,  0,213,108,213,150,213,162,213,174,213,202,213,210,
-    213,226,213,235, 97, 10,210,154,210,165,210,172,210,179,210,190,
-    211, 12,211, 42,211, 53,211, 89,211,101,225,242,237,229,238,233,
-    225,110,128,  5,102,227,245,244,101,128,  1,122,228,229,246, 97,
-    128,  9, 91,231,245,242,237,245,235,232,105,128, 10, 91,104,  4,
-    210,200,210,209,210,223,210,253,225,242,225,226,233, 99,128,  6,
-     56,230,233,238,225,236,225,242,225,226,233, 99,128,254,198,105,
-      2,210,229,210,244,238,233,244,233,225,236,225,242,225,226,233,
-     99,128,254,199,242,225,231,225,238, 97,128, 48, 86,237,229,228,
-    233,225,236,225,242,225,226,233, 99,128,254,200,233,110,  2,211,
-     19,211, 28,225,242,225,226,233, 99,128,  6, 50,230,233,238,225,
-    236,225,242,225,226,233, 99,128,254,176,235,225,244,225,235,225,
-    238, 97,128, 48,182,241,229,102,  2,211, 61,211, 75,231,225,228,
-    239,236,232,229,226,242,229,119,128,  5,149,241,225,244,225,238,
-    232,229,226,242,229,119,128,  5,148,242,241,225,232,229,226,242,
-    229,119,128,  5,152,249,233,110,130,  5,214,211,111,211,131,228,
-    225,231,229,243,104,129,251, 54,211,122,232,229,226,242,229,119,
-    128,251, 54,232,229,226,242,229,119,128,  5,214,226,239,240,239,
-    237,239,230,111,128, 49, 23, 99,  3,211,159,211,166,211,188,225,
-    242,239,110,128,  1,126,233,242, 99,  2,211,174,211,179,236,101,
-    128, 36,233,245,237,230,236,229,120,128, 30,145,245,242,108,128,
-      2,145,228,239,116,130,  1,124,211,204,211,213,225,227,227,229,
-    238,116,128,  1,124,226,229,236,239,119,128, 30,147,101,  6,211,
-    235,211,246,212, 33,212, 44,212, 55,212,251,227,249,242,233,236,
-    236,233, 99,128,  4, 55,100,  2,211,252,212, 15,229,243,227,229,
-    238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,153,233,
-    229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128,  4,
-    223,232,233,242,225,231,225,238, 97,128, 48, 92,235,225,244,225,
-    235,225,238, 97,128, 48,188,242,111,140,  0, 48,212, 84,212, 93,
-    212,103,212,110,212,135,212,148,212,159,212,171,212,182,212,192,
-    212,203,212,210,225,242,225,226,233, 99,128,  6, 96,226,229,238,
-    231,225,236,105,128,  9,230,228,229,246, 97,128,  9,102,231,117,
-      2,212,117,212,126,234,225,242,225,244,105,128, 10,230,242,237,
-    245,235,232,105,128, 10,102,232,225,227,235,225,242,225,226,233,
-     99,128,  6, 96,233,238,230,229,242,233,239,114,128, 32,128,237,
-    239,238,239,243,240,225,227,101,128,255, 16,239,236,228,243,244,
-    249,236,101,128,247, 48,240,229,242,243,233,225,110,128,  6,240,
-    243,245,240,229,242,233,239,114,128, 32,112,244,232,225,105,128,
-     14, 80,247,233,228,244,104,  3,212,222,212,231,212,243,234,239,
-    233,238,229,114,128,254,255,238,239,238,234,239,233,238,229,114,
-    128, 32, 12,243,240,225,227,101,128, 32, 11,244, 97,128,  3,182,
-    104,  2,213,  6,213, 17,226,239,240,239,237,239,230,111,128, 49,
-     19,101,  4,213, 27,213, 38,213, 54,213, 65,225,242,237,229,238,
-    233,225,110,128,  5,106,226,242,229,246,229,227,249,242,233,236,
-    236,233, 99,128,  4,194,227,249,242,233,236,236,233, 99,128,  4,
-     54,100,  2,213, 71,213, 90,229,243,227,229,238,228,229,242,227,
-    249,242,233,236,236,233, 99,128,  4,151,233,229,242,229,243,233,
-    243,227,249,242,233,236,236,233, 99,128,  4,221,105,  3,213,116,
-    213,127,213,138,232,233,242,225,231,225,238, 97,128, 48, 88,235,
-    225,244,225,235,225,238, 97,128, 48,184,238,239,242,232,229,226,
-    242,229,119,128,  5,174,236,233,238,229,226,229,236,239,119,128,
-     30,149,237,239,238,239,243,240,225,227,101,128,255, 90,111,  2,
-    213,180,213,191,232,233,242,225,231,225,238, 97,128, 48, 94,235,
-    225,244,225,235,225,238, 97,128, 48,190,240,225,242,229,110,128,
-     36,181,242,229,244,242,239,230,236,229,248,232,239,239,107,128,
-      2,144,243,244,242,239,235,101,128,  1,182,117,  2,213,241,213,
-    252,232,233,242,225,231,225,238, 97,128, 48, 90,235,225,244,225,
-    235,225,238, 97,128, 48,186
+      4,221,105,  3,218, 42,218, 53,218, 64,232,233,242,225,231,225,
+    238, 97,128, 48, 88,235,225,244,225,235,225,238, 97,128, 48,184,
+    238,239,242,232,229,226,242,229,119,128,  5,174,236,233,238,229,
+    226,229,236,239,119,128, 30,149,237,239,238,239,243,240,225,227,
+    101,128,255, 90,111,  2,218,106,218,117,232,233,242,225,231,225,
+    238, 97,128, 48, 94,235,225,244,225,235,225,238, 97,128, 48,190,
+    240,225,242,229,110,128, 36,181,242,229,244,242,239,230,236,229,
+    248,232,239,239,107,128,  2,144,243,244,242,239,235,101,128,  1,
+    182,117,  2,218,167,218,178,232,233,242,225,231,225,238, 97,128,
+     48, 90,235,225,244,225,235,225,238, 97,128, 48,186
   };
 
 
   };
 
 
index 06bd161..4cd39a8 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
 #
 
 
-# Copyright 1996-2000, 2001, 2003 by
+# Copyright 1996-2000, 2001, 2003, 2011 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -25,14 +25,15 @@ PSNAMES_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR))
 
 # PSNames driver sources (i.e., C files)
 #
 
 # PSNames driver sources (i.e., C files)
 #
-PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c
+PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c \
+                   $(PSNAMES_DIR)/pspic.c
 
 
 # PSNames driver headers
 #
 PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \
 
 
 # PSNames driver headers
 #
 PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \
-                 $(PSNAMES_DIR)/pstables.h  \
-                 $(PSNAMES_DIR)/psnamerr.h
+                 $(PSNAMES_DIR)/psnamerr.h  \
+                 $(PSNAMES_DIR)/pstables.h
 
 
 # PSNames driver object(s)
 
 
 # PSNames driver object(s)
diff --git a/reactos/lib/3rdparty/freetype/src/raster/Jamfile b/reactos/lib/3rdparty/freetype/src/raster/Jamfile
deleted file mode 100644 (file)
index 4f60e87..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/raster Jamfile
-#
-# Copyright 2001 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) raster ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = ftraster ftrend1 rastpic ;
-  }
-  else
-  {
-    _sources = raster ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/raster Jamfile
index 7773924..703155a 100644 (file)
     return ( s > 0 ) ? d : -d;
   }
 
     return ( s > 0 ) ? d : -d;
   }
 
+
+  static FT_Long
+  FT_MulDiv_No_Round( FT_Long  a,
+                      FT_Long  b,
+                      FT_Long  c )
+  {
+    FT_Int   s;
+    FT_Long  d;
+
+
+    s = 1;
+    if ( a < 0 ) { a = -a; s = -1; }
+    if ( b < 0 ) { b = -b; s = -s; }
+    if ( c < 0 ) { c = -c; s = -s; }
+
+    d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c
+                         : 0x7FFFFFFFL );
+
+    return ( s > 0 ) ? d : -d;
+  }
+
 #endif /* __FTMISC_H__ */
 
 
 #endif /* __FTMISC_H__ */
 
 
index 9638dfb..bbd503d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType glyph rasterizer (body).                                */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType glyph rasterizer (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2005, 2007, 2008, 2009, 2010 by       */
+/*  Copyright 1996-2003, 2005, 2007-2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -60,7 +60,7 @@
 
 #include <ft2build.h>
 #include "ftraster.h"
 
 #include <ft2build.h>
 #include "ftraster.h"
-#include FT_INTERNAL_CALC_H   /* for FT_MulDiv only */
+#include FT_INTERNAL_CALC_H   /* for FT_MulDiv and FT_MulDiv_No_Round */
 
 #include "rastpic.h"
 
 
 #include "rastpic.h"
 
 
 #ifdef _STANDALONE_
 
 
 #ifdef _STANDALONE_
 
+  /* Auxiliary macros for token concatenation. */
+#define FT_ERR_XCAT( x, y )  x ## y
+#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )
 
   /* This macro is used to indicate that a function parameter is unused. */
   /* Its purpose is simply to reduce compiler warnings.  Note also that  */
 
   /* This macro is used to indicate that a function parameter is unused. */
   /* Its purpose is simply to reduce compiler warnings.  Note also that  */
 #define FT_UNUSED( x )  (x) = (x)
 
   /* Disable the tracing mechanism for simplicity -- developers can      */
 #define FT_UNUSED( x )  (x) = (x)
 
   /* Disable the tracing mechanism for simplicity -- developers can      */
-  /* activate it easily by redefining these two macros.                  */
+  /* activate it easily by redefining these macros.                      */
 #ifndef FT_ERROR
 #define FT_ERROR( x )  do { } while ( 0 )     /* nothing */
 #endif
 #ifndef FT_ERROR
 #define FT_ERROR( x )  do { } while ( 0 )     /* nothing */
 #endif
 #define FT_TRACE6( x )  do { } while ( 0 )    /* nothing */
 #endif
 
 #define FT_TRACE6( x )  do { } while ( 0 )    /* nothing */
 #endif
 
+#ifndef FT_THROW
+#define FT_THROW( e )  FT_ERR_CAT( Raster_Err_, e )
+#endif
+
 #define Raster_Err_None          0
 #define Raster_Err_Not_Ini      -1
 #define Raster_Err_Overflow     -2
 #define Raster_Err_None          0
 #define Raster_Err_Not_Ini      -1
 #define Raster_Err_Overflow     -2
 
 
 #include FT_INTERNAL_OBJECTS_H
 
 
 #include FT_INTERNAL_OBJECTS_H
-#include FT_INTERNAL_DEBUG_H        /* for FT_TRACE() and FT_ERROR() */
+#include FT_INTERNAL_DEBUG_H       /* for FT_TRACE, FT_ERROR, and FT_THROW */
 
 #include "rasterrs.h"
 
 
 #include "rasterrs.h"
 
-#define Raster_Err_None         Raster_Err_Ok
+#define Raster_Err_None         FT_Err_Ok
 #define Raster_Err_Not_Ini      Raster_Err_Raster_Uninitialized
 #define Raster_Err_Overflow     Raster_Err_Raster_Overflow
 #define Raster_Err_Neg_Height   Raster_Err_Raster_Negative_Height
 #define Raster_Err_Not_Ini      Raster_Err_Raster_Uninitialized
 #define Raster_Err_Overflow     Raster_Err_Raster_Overflow
 #define Raster_Err_Neg_Height   Raster_Err_Raster_Negative_Height
   /* On the other hand, SMulDiv means `Slow MulDiv', and is used typically */
   /* for clipping computations.  It simply uses the FT_MulDiv() function   */
   /* defined in `ftcalc.h'.                                                */
   /* On the other hand, SMulDiv means `Slow MulDiv', and is used typically */
   /* for clipping computations.  It simply uses the FT_MulDiv() function   */
   /* defined in `ftcalc.h'.                                                */
-#define SMulDiv  FT_MulDiv
+#define SMulDiv           FT_MulDiv
+#define SMulDiv_No_Round  FT_MulDiv_No_Round
 
   /* The rasterizer is a very general purpose component; please leave */
   /* the following redefinitions there (you never know your target    */
 
   /* The rasterizer is a very general purpose component; please leave */
   /* the following redefinitions there (you never know your target    */
   typedef short           Short;
   typedef unsigned short  UShort, *PUShort;
   typedef long            Long, *PLong;
   typedef short           Short;
   typedef unsigned short  UShort, *PUShort;
   typedef long            Long, *PLong;
+  typedef unsigned long   ULong;
 
   typedef unsigned char   Byte, *PByte;
   typedef char            Bool;
 
   typedef unsigned char   Byte, *PByte;
   typedef char            Bool;
 
   /* Simple record used to implement a stack of bands, required */
   /* by the sub-banding mechanism                               */
 
   /* Simple record used to implement a stack of bands, required */
   /* by the sub-banding mechanism                               */
-  typedef struct  TBand_
+  typedef struct  black_TBand_
   {
     Short  y_min;   /* band's minimum */
     Short  y_max;   /* band's maximum */
 
   {
     Short  y_min;   /* band's minimum */
     Short  y_max;   /* band's maximum */
 
-  } TBand;
+  } black_TBand;
 
 
 #define AlignProfileSize \
   ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) )
 
 
 
 
 #define AlignProfileSize \
   ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) )
 
 
+#undef RAS_ARG
+#undef RAS_ARGS
+#undef RAS_VAR
+#undef RAS_VARS
+
 #ifdef FT_STATIC_RASTER
 
 
 #ifdef FT_STATIC_RASTER
 
 
 #else /* !FT_STATIC_RASTER */
 
 
 #else /* !FT_STATIC_RASTER */
 
 
-#define RAS_ARGS       PWorker    worker,
-#define RAS_ARG        PWorker    worker
+#define RAS_ARGS       black_PWorker  worker,
+#define RAS_ARG        black_PWorker  worker
 
 #define RAS_VARS       worker,
 #define RAS_VAR        worker
 
 #define RAS_VARS       worker,
 #define RAS_VAR        worker
 #endif /* !FT_STATIC_RASTER */
 
 
 #endif /* !FT_STATIC_RASTER */
 
 
-  typedef struct TWorker_  TWorker, *PWorker;
+  typedef struct black_TWorker_  black_TWorker, *black_PWorker;
 
 
   /* prototypes used for sweep function dispatch */
 
 
   /* prototypes used for sweep function dispatch */
 
 
   /* NOTE: These operations are only valid on 2's complement processors */
 
 
   /* NOTE: These operations are only valid on 2's complement processors */
+#undef FLOOR
+#undef CEILING
+#undef TRUNC
+#undef SCALED
 
 #define FLOOR( x )    ( (x) & -ras.precision )
 #define CEILING( x )  ( ( (x) + ras.precision - 1 ) & -ras.precision )
 
 #define FLOOR( x )    ( (x) & -ras.precision )
 #define CEILING( x )  ( ( (x) + ras.precision - 1 ) & -ras.precision )
-#define TRUNC( x )    ( (signed long)(x) >> ras.precision_bits )
+#define TRUNC( x )    ( (Long)(x) >> ras.precision_bits )
 #define FRAC( x )     ( (x) & ( ras.precision - 1 ) )
 #define FRAC( x )     ( (x) & ( ras.precision - 1 ) )
-#define SCALED( x )   ( ( (x) << ras.scale_shift ) - ras.precision_half )
+#define SCALED( x )   ( ( (ULong)(x) << ras.scale_shift ) - ras.precision_half )
 
 
-#define IS_BOTTOM_OVERSHOOT( x )  ( CEILING( x ) - x >= ras.precision_half )
-#define IS_TOP_OVERSHOOT( x )     ( x - FLOOR( x ) >= ras.precision_half )
+#define IS_BOTTOM_OVERSHOOT( x ) \
+          (Bool)( CEILING( x ) - x >= ras.precision_half )
+#define IS_TOP_OVERSHOOT( x )    \
+          (Bool)( x - FLOOR( x ) >= ras.precision_half )
 
   /* The most used variables are positioned at the top of the structure. */
   /* Thus, their offset can be coded with less opcodes, resulting in a   */
   /* smaller executable.                                                 */
 
 
   /* The most used variables are positioned at the top of the structure. */
   /* Thus, their offset can be coded with less opcodes, resulting in a   */
   /* smaller executable.                                                 */
 
-  struct  TWorker_
+  struct  black_TWorker_
   {
     Int         precision_bits;     /* precision related variables         */
     Int         precision;
   {
     Int         precision_bits;     /* precision related variables         */
     Int         precision;
 
     TPoint      arcs[3 * MaxBezier + 1]; /* The Bezier stack               */
 
 
     TPoint      arcs[3 * MaxBezier + 1]; /* The Bezier stack               */
 
-    TBand       band_stack[16];     /* band stack used for sub-banding     */
-    Int         band_top;           /* band stack top                      */
+    black_TBand  band_stack[16];    /* band stack used for sub-banding     */
+    Int          band_top;          /* band stack top                      */
 
 #ifdef FT_RASTER_OPTION_ANTI_ALIASING
 
 
 #ifdef FT_RASTER_OPTION_ANTI_ALIASING
 
   };
 
 
   };
 
 
-  typedef struct  TRaster_
+  typedef struct  black_TRaster_
   {
   {
-    char*    buffer;
-    long     buffer_size;
-    void*    memory;
-    PWorker  worker;
-    Byte     grays[5];
-    Short    gray_width;
+    char*          buffer;
+    long           buffer_size;
+    void*          memory;
+    black_PWorker  worker;
+    Byte           grays[5];
+    Short          gray_width;
 
 
-  } TRaster, *PRaster;
+  } black_TRaster, *black_PRaster;
 
 #ifdef FT_STATIC_RASTER
 
 
 #ifdef FT_STATIC_RASTER
 
-  static TWorker  cur_ras;
+  static black_TWorker  cur_ras;
 #define ras  cur_ras
 
 #else /* !FT_STATIC_RASTER */
 #define ras  cur_ras
 
 #else /* !FT_STATIC_RASTER */
   /*    Set precision variables according to param flag.                   */
   /*                                                                       */
   /* <Input>                                                               */
   /*    Set precision variables according to param flag.                   */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    High :: Set to True for high precision (typically for ppem < 18),  */
+  /*    High :: Set to True for high precision (typically for ppem < 24),  */
   /*            false otherwise.                                           */
   /*                                                                       */
   static void
   Set_High_Precision( RAS_ARGS Int  High )
   {
   /*            false otherwise.                                           */
   /*                                                                       */
   static void
   Set_High_Precision( RAS_ARGS Int  High )
   {
+    /*
+     * `precision_step' is used in `Bezier_Up' to decide when to split a
+     * given y-monotonous Bezier arc that crosses a scanline before
+     * approximating it as a straight segment.  The default value of 32 (for
+     * low accuracy) corresponds to
+     *
+     *   32 / 64 == 0.5 pixels ,
+     *
+     * while for the high accuracy case we have
+     *
+     *   256/ (1 << 12) = 0.0625 pixels .
+     *
+     * `precision_jitter' is an epsilon threshold used in
+     * `Vertical_Sweep_Span' to deal with small imperfections in the Bezier
+     * decomposition (after all, we are working with approximations only);
+     * it avoids switching on additional pixels which would cause artifacts
+     * otherwise.
+     *
+     * The value of `precision_jitter' has been determined heuristically.
+     *
+     */
+
     if ( High )
     {
       ras.precision_bits   = 12;
       ras.precision_step   = 256;
     if ( High )
     {
       ras.precision_bits   = 12;
       ras.precision_step   = 256;
-      ras.precision_jitter = 50;
+      ras.precision_jitter = 30;
     }
     else
     {
     }
     else
     {
 
     if ( ras.top >= ras.maxBuff )
     {
 
     if ( ras.top >= ras.maxBuff )
     {
-      ras.error = Raster_Err_Overflow;
+      ras.error = FT_THROW( Overflow );
       return FAILURE;
     }
 
       return FAILURE;
     }
 
 
     default:
       FT_ERROR(( "New_Profile: invalid profile direction\n" ));
 
     default:
       FT_ERROR(( "New_Profile: invalid profile direction\n" ));
-      ras.error = Raster_Err_Invalid;
+      ras.error = FT_THROW( Invalid );
       return FAILURE;
     }
 
       return FAILURE;
     }
 
   static Bool
   End_Profile( RAS_ARGS Bool  overshoot )
   {
   static Bool
   End_Profile( RAS_ARGS Bool  overshoot )
   {
-    Long      h;
-    PProfile  oldProfile;
+    Long  h;
 
 
     h = (Long)( ras.top - ras.cProfile->offset );
 
 
     h = (Long)( ras.top - ras.cProfile->offset );
     if ( h < 0 )
     {
       FT_ERROR(( "End_Profile: negative height encountered\n" ));
     if ( h < 0 )
     {
       FT_ERROR(( "End_Profile: negative height encountered\n" ));
-      ras.error = Raster_Err_Neg_Height;
+      ras.error = FT_THROW( Neg_Height );
       return FAILURE;
     }
 
     if ( h > 0 )
     {
       return FAILURE;
     }
 
     if ( h > 0 )
     {
+      PProfile  oldProfile;
+
+
       FT_TRACE6(( "Ending profile %p, start = %ld, height = %ld\n",
                   ras.cProfile, ras.cProfile->start, h ));
 
       FT_TRACE6(( "Ending profile %p, start = %ld, height = %ld\n",
                   ras.cProfile, ras.cProfile->start, h ));
 
     if ( ras.top >= ras.maxBuff )
     {
       FT_TRACE1(( "overflow in End_Profile\n" ));
     if ( ras.top >= ras.maxBuff )
     {
       FT_TRACE1(( "overflow in End_Profile\n" ));
-      ras.error = Raster_Err_Overflow;
+      ras.error = FT_THROW( Overflow );
       return FAILURE;
     }
 
       return FAILURE;
     }
 
   Insert_Y_Turn( RAS_ARGS Int  y )
   {
     PLong  y_turns;
   Insert_Y_Turn( RAS_ARGS Int  y )
   {
     PLong  y_turns;
-    Int    y2, n;
+    Int    n;
 
 
     n       = ras.numTurns - 1;
 
 
     n       = ras.numTurns - 1;
     if ( n >= 0 && y > y_turns[n] )
       while ( n >= 0 )
       {
     if ( n >= 0 && y > y_turns[n] )
       while ( n >= 0 )
       {
-        y2 = (Int)y_turns[n];
+        Int  y2 = (Int)y_turns[n];
+
+
         y_turns[n] = y;
         y = y2;
         n--;
         y_turns[n] = y;
         y = y2;
         n--;
       ras.maxBuff--;
       if ( ras.maxBuff <= ras.top )
       {
       ras.maxBuff--;
       if ( ras.maxBuff <= ras.top )
       {
-        ras.error = Raster_Err_Overflow;
+        ras.error = FT_THROW( Overflow );
         return FAILURE;
       }
       ras.numTurns++;
         return FAILURE;
       }
       ras.numTurns++;
   static Bool
   Finalize_Profile_Table( RAS_ARG )
   {
   static Bool
   Finalize_Profile_Table( RAS_ARG )
   {
-    Int       bottom, top;
     UShort    n;
     PProfile  p;
 
     UShort    n;
     PProfile  p;
 
     {
       while ( n > 0 )
       {
     {
       while ( n > 0 )
       {
+        Int  bottom, top;
+
+
         if ( n > 1 )
           p->link = (PProfile)( p->offset + p->height );
         else
         if ( n > 1 )
           p->link = (PProfile)( p->offset + p->height );
         else
     size = e2 - e1 + 1;
     if ( ras.top + size >= ras.maxBuff )
     {
     size = e2 - e1 + 1;
     if ( ras.top + size >= ras.maxBuff )
     {
-      ras.error = Raster_Err_Overflow;
+      ras.error = FT_THROW( Overflow );
       return FAILURE;
     }
 
     if ( Dx > 0 )
     {
       return FAILURE;
     }
 
     if ( Dx > 0 )
     {
-      Ix = SMulDiv( ras.precision, Dx, Dy);
+      Ix = SMulDiv_No_Round( ras.precision, Dx, Dy );
       Rx = ( ras.precision * Dx ) % Dy;
       Dx = 1;
     }
     else
     {
       Rx = ( ras.precision * Dx ) % Dy;
       Dx = 1;
     }
     else
     {
-      Ix = SMulDiv( ras.precision, -Dx, Dy) * -1;
-      Rx =    ( ras.precision * -Dx ) % Dy;
+      Ix = -SMulDiv_No_Round( ras.precision, -Dx, Dy );
+      Rx = ( ras.precision * -Dx ) % Dy;
       Dx = -1;
     }
 
       Dx = -1;
     }
 
     if ( ( top + TRUNC( e2 - e ) + 1 ) >= ras.maxBuff )
     {
       ras.top   = top;
     if ( ( top + TRUNC( e2 - e ) + 1 ) >= ras.maxBuff )
     {
       ras.top   = top;
-      ras.error = Raster_Err_Overflow;
+      ras.error = FT_THROW( Overflow );
       return FAILURE;
     }
 
       return FAILURE;
     }
 
     return SUCCESS;
 
   Invalid_Outline:
     return SUCCESS;
 
   Invalid_Outline:
-    ras.error = Raster_Err_Invalid;
+    ras.error = FT_THROW( Invalid );
 
   Fail:
     return FAILURE;
 
   Fail:
     return FAILURE;
     int       i;
     unsigned  start;
 
     int       i;
     unsigned  start;
 
-    PProfile  lastProfile;
-
 
     ras.fProfile = NULL;
     ras.joint    = FALSE;
 
     ras.fProfile = NULL;
     ras.joint    = FALSE;
 
     for ( i = 0; i < ras.outline.n_contours; i++ )
     {
 
     for ( i = 0; i < ras.outline.n_contours; i++ )
     {
-      Bool  o;
+      PProfile  lastProfile;
+      Bool      o;
 
 
       ras.state    = Unknown_State;
 
 
       ras.state    = Unknown_State;
                                 PProfile    right )
   {
     Long   e1, e2;
                                 PProfile    right )
   {
     Long   e1, e2;
-    int    c1, c2;
-    Byte   f1, f2;
     Byte*  target;
 
     FT_UNUSED( y );
     Byte*  target;
 
     FT_UNUSED( y );
 
     if ( e2 >= 0 && e1 < ras.bWidth )
     {
 
     if ( e2 >= 0 && e1 < ras.bWidth )
     {
+      int   c1, c2;
+      Byte  f1, f2;
+
+
       if ( e1 < 0 )
         e1 = 0;
       if ( e2 >= ras.bWidth )
       if ( e1 < 0 )
         e1 = 0;
       if ( e2 >= ras.bWidth )
           return;  /* no drop-out control */
         }
 
           return;  /* no drop-out control */
         }
 
+        /* undocumented but confirmed: If the drop-out would result in a  */
+        /* pixel outside of the bounding box, use the pixel inside of the */
+        /* bounding box instead                                           */
+        if ( pxl < 0 )
+          pxl = e1;
+        else if ( TRUNC( pxl ) >= ras.bWidth )
+          pxl = e2;
+
         /* check that the other pixel isn't set */
         e1 = pxl == e1 ? e2 : e1;
 
         /* check that the other pixel isn't set */
         e1 = pxl == e1 ? e2 : e1;
 
                                   PProfile    left,
                                   PProfile    right )
   {
                                   PProfile    left,
                                   PProfile    right )
   {
-    Long   e1, e2;
-    PByte  bits;
-    Byte   f1;
-
     FT_UNUSED( left );
     FT_UNUSED( right );
 
 
     if ( x2 - x1 < ras.precision )
     {
     FT_UNUSED( left );
     FT_UNUSED( right );
 
 
     if ( x2 - x1 < ras.precision )
     {
+      Long  e1, e2;
+
+
       e1 = CEILING( x1 );
       e2 = FLOOR  ( x2 );
 
       if ( e1 == e2 )
       {
       e1 = CEILING( x1 );
       e2 = FLOOR  ( x2 );
 
       if ( e1 == e2 )
       {
+        Byte   f1;
+        PByte  bits;
+
+
         bits = ras.bTarget + ( y >> 3 );
         f1   = (Byte)( 0x80 >> ( y & 7 ) );
 
         bits = ras.bTarget + ( y >> 3 );
         f1   = (Byte)( 0x80 >> ( y & 7 ) );
 
           return;  /* no drop-out control */
         }
 
           return;  /* no drop-out control */
         }
 
+        /* undocumented but confirmed: If the drop-out would result in a  */
+        /* pixel outside of the bounding box, use the pixel inside of the */
+        /* bounding box instead                                           */
+        if ( pxl < 0 )
+          pxl = e1;
+        else if ( TRUNC( pxl ) >= ras.target.rows )
+          pxl = e2;
+
         /* check that the other pixel isn't set */
         e1 = pxl == e1 ? e2 : e1;
 
         /* check that the other pixel isn't set */
         e1 = pxl == e1 ? e2 : e1;
 
   static void
   Vertical_Gray_Sweep_Step( RAS_ARG )
   {
   static void
   Vertical_Gray_Sweep_Step( RAS_ARG )
   {
-    Int     c1, c2;
-    PByte   pix, bit, bit2;
     short*  count = (short*)count_table;
     Byte*   grays;
 
     short*  count = (short*)count_table;
     Byte*   grays;
 
 
     if ( ras.traceOfs > ras.gray_width )
     {
 
     if ( ras.traceOfs > ras.gray_width )
     {
+      PByte  pix;
+
+
       pix   = ras.gTarget + ras.traceG + ras.gray_min_x * 4;
       grays = ras.grays;
 
       pix   = ras.gTarget + ras.traceG + ras.gray_min_x * 4;
       grays = ras.grays;
 
         Int   last_bit   = last_pixel & 3;
         Bool  over       = 0;
 
         Int   last_bit   = last_pixel & 3;
         Bool  over       = 0;
 
+        Int    c1, c2;
+        PByte  bit, bit2;
+
 
         if ( ras.gray_max_x >= last_cell && last_bit != 3 )
         {
 
         if ( ras.gray_max_x >= last_cell && last_bit != 3 )
         {
   {
     Long   e1, e2;
     PByte  pixel;
   {
     Long   e1, e2;
     PByte  pixel;
-    Byte   color;
 
 
     /* During the horizontal sweep, we only take care of drop-outs */
 
 
     /* During the horizontal sweep, we only take care of drop-outs */
 
     if ( e1 >= 0 )
     {
 
     if ( e1 >= 0 )
     {
+      Byte  color;
+
+
       if ( x2 - x1 >= ras.precision_half )
         color = ras.grays[2];
       else
       if ( x2 - x1 >= ras.precision_half )
         color = ras.grays[2];
       else
     /* check the Y-turns */
     if ( ras.numTurns == 0 )
     {
     /* check the Y-turns */
     if ( ras.numTurns == 0 )
     {
-      ras.error = Raster_Err_Invalid;
+      ras.error = FT_THROW( Invalid );
       return FAILURE;
     }
 
       return FAILURE;
     }
 
         if ( ras.band_top >= 7 || k < i )
         {
           ras.band_top = 0;
         if ( ras.band_top >= 7 || k < i )
         {
           ras.band_top = 0;
-          ras.error    = Raster_Err_Invalid;
+          ras.error    = FT_THROW( Invalid );
 
           return ras.error;
         }
 
           return ras.error;
         }
   {
     FT_UNUSED_RASTER;
 
   {
     FT_UNUSED_RASTER;
 
-    return Raster_Err_Unsupported;
+    return FT_THROW( Unsupported );
   }
 
 #endif /* !FT_RASTER_OPTION_ANTI_ALIASING */
 
 
   static void
   }
 
 #endif /* !FT_RASTER_OPTION_ANTI_ALIASING */
 
 
   static void
-  ft_black_init( PRaster  raster )
+  ft_black_init( black_PRaster  raster )
   {
 #ifdef FT_RASTER_OPTION_ANTI_ALIASING
     FT_UInt  n;
   {
 #ifdef FT_RASTER_OPTION_ANTI_ALIASING
     FT_UInt  n;
   ft_black_new( void*       memory,
                 FT_Raster  *araster )
   {
   ft_black_new( void*       memory,
                 FT_Raster  *araster )
   {
-     static TRaster  the_raster;
+     static black_TRaster  the_raster;
      FT_UNUSED( memory );
 
 
      FT_UNUSED( memory );
 
 
 
 
   static int
 
 
   static int
-  ft_black_new( FT_Memory   memory,
-                PRaster    *araster )
+  ft_black_new( FT_Memory       memory,
+                black_PRaster  *araster )
   {
   {
-    FT_Error  error;
-    PRaster   raster = NULL;
+    FT_Error       error;
+    black_PRaster  raster = NULL;
 
 
     *araster = 0;
 
 
     *araster = 0;
 
 
   static void
 
 
   static void
-  ft_black_done( PRaster  raster )
+  ft_black_done( black_PRaster  raster )
   {
     FT_Memory  memory = (FT_Memory)raster->memory;
   {
     FT_Memory  memory = (FT_Memory)raster->memory;
+
+
     FT_FREE( raster );
   }
 
     FT_FREE( raster );
   }
 
 
 
   static void
 
 
   static void
-  ft_black_reset( PRaster  raster,
-                  char*    pool_base,
-                  long     pool_size )
+  ft_black_reset( black_PRaster  raster,
+                  char*          pool_base,
+                  long           pool_size )
   {
     if ( raster )
     {
   {
     if ( raster )
     {
-      if ( pool_base && pool_size >= (long)sizeof(TWorker) + 2048 )
+      if ( pool_base && pool_size >= (long)sizeof ( black_TWorker ) + 2048 )
       {
       {
-        PWorker  worker = (PWorker)pool_base;
+        black_PWorker  worker = (black_PWorker)pool_base;
 
 
         raster->buffer      = pool_base + ( ( sizeof ( *worker ) + 7 ) & ~7 );
 
 
         raster->buffer      = pool_base + ( ( sizeof ( *worker ) + 7 ) & ~7 );
-        raster->buffer_size = pool_base + pool_size - (char*)raster->buffer;
+        raster->buffer_size = (long)( pool_base + pool_size -
+                                        (char*)raster->buffer );
         raster->worker      = worker;
       }
       else
         raster->worker      = worker;
       }
       else
 
 
   static void
 
 
   static void
-  ft_black_set_mode( PRaster        raster,
+  ft_black_set_mode( black_PRaster  raster,
                      unsigned long  mode,
                      const char*    palette )
   {
                      unsigned long  mode,
                      const char*    palette )
   {
 
 
   static int
 
 
   static int
-  ft_black_render( PRaster                  raster,
+  ft_black_render( black_PRaster            raster,
                    const FT_Raster_Params*  params )
   {
     const FT_Outline*  outline    = (const FT_Outline*)params->source;
     const FT_Bitmap*   target_map = params->target;
                    const FT_Raster_Params*  params )
   {
     const FT_Outline*  outline    = (const FT_Outline*)params->source;
     const FT_Bitmap*   target_map = params->target;
-    PWorker            worker;
+    black_PWorker      worker;
 
 
     if ( !raster || !raster->buffer || !raster->buffer_size )
 
 
     if ( !raster || !raster->buffer || !raster->buffer_size )
-      return Raster_Err_Not_Ini;
+      return FT_THROW( Not_Ini );
 
     if ( !outline )
 
     if ( !outline )
-      return Raster_Err_Invalid;
+      return FT_THROW( Invalid );
 
     /* return immediately if the outline is empty */
     if ( outline->n_points == 0 || outline->n_contours <= 0 )
       return Raster_Err_None;
 
     if ( !outline->contours || !outline->points )
 
     /* return immediately if the outline is empty */
     if ( outline->n_points == 0 || outline->n_contours <= 0 )
       return Raster_Err_None;
 
     if ( !outline->contours || !outline->points )
-      return Raster_Err_Invalid;
+      return FT_THROW( Invalid );
 
     if ( outline->n_points !=
            outline->contours[outline->n_contours - 1] + 1 )
 
     if ( outline->n_points !=
            outline->contours[outline->n_contours - 1] + 1 )
-      return Raster_Err_Invalid;
+      return FT_THROW( Invalid );
 
     worker = raster->worker;
 
     /* this version of the raster does not support direct rendering, sorry */
     if ( params->flags & FT_RASTER_FLAG_DIRECT )
 
     worker = raster->worker;
 
     /* this version of the raster does not support direct rendering, sorry */
     if ( params->flags & FT_RASTER_FLAG_DIRECT )
-      return Raster_Err_Unsupported;
+      return FT_THROW( Unsupported );
 
     if ( !target_map )
 
     if ( !target_map )
-      return Raster_Err_Invalid;
+      return FT_THROW( Invalid );
 
     /* nothing to do */
     if ( !target_map->width || !target_map->rows )
       return Raster_Err_None;
 
     if ( !target_map->buffer )
 
     /* nothing to do */
     if ( !target_map->width || !target_map->rows )
       return Raster_Err_None;
 
     if ( !target_map->buffer )
-      return Raster_Err_Invalid;
+      return FT_THROW( Invalid );
 
     ras.outline = *outline;
     ras.target  = *target_map;
 
     ras.outline = *outline;
     ras.target  = *target_map;
index 1ed8af6..aa7f6d5 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType glyph rasterizer interface (body).                      */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType glyph rasterizer interface (body).                      */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2005, 2006 by                         */
+/*  Copyright 1996-2003, 2005, 2006, 2011, 2013 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -17,6 +17,7 @@
 
 
 #include <ft2build.h>
 
 
 #include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_OUTLINE_H
 #include "ftrend1.h"
 #include FT_INTERNAL_OBJECTS_H
 #include FT_OUTLINE_H
 #include "ftrend1.h"
@@ -37,7 +38,7 @@
                                                library->raster_pool,
                                                library->raster_pool_size );
 
                                                library->raster_pool,
                                                library->raster_pool_size );
 
-    return Raster_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
                         const FT_Matrix*  matrix,
                         const FT_Vector*  delta )
   {
                         const FT_Matrix*  matrix,
                         const FT_Vector*  delta )
   {
-    FT_Error error = Raster_Err_Ok;
+    FT_Error error = FT_Err_Ok;
 
 
     if ( slot->format != render->glyph_format )
     {
 
 
     if ( slot->format != render->glyph_format )
     {
-      error = Raster_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
     /* check glyph image format */
     if ( slot->format != render->glyph_format )
     {
     /* check glyph image format */
     if ( slot->format != render->glyph_format )
     {
-      error = Raster_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
     {
       /* raster1 is only capable of producing monochrome bitmaps */
       if ( render->clazz == &ft_raster1_renderer_class )
     {
       /* raster1 is only capable of producing monochrome bitmaps */
       if ( render->clazz == &ft_raster1_renderer_class )
-        return Raster_Err_Cannot_Render_Glyph;
+        return FT_THROW( Cannot_Render_Glyph );
     }
     else
     {
       /* raster5 is only capable of producing 5-gray-levels bitmaps */
       if ( render->clazz == &ft_raster5_renderer_class )
     }
     else
     {
       /* raster5 is only capable of producing 5-gray-levels bitmaps */
       if ( render->clazz == &ft_raster5_renderer_class )
-        return Raster_Err_Cannot_Render_Glyph;
+        return FT_THROW( Cannot_Render_Glyph );
     }
 #else /* FT_CONFIG_OPTION_PIC */
     /* When PIC is enabled, we cannot get to the class object      */
     }
 #else /* FT_CONFIG_OPTION_PIC */
     /* When PIC is enabled, we cannot get to the class object      */
     {
       /* raster1 is only capable of producing monochrome bitmaps */
       if ( render->clazz->root.module_name[6] == '1' )
     {
       /* raster1 is only capable of producing monochrome bitmaps */
       if ( render->clazz->root.module_name[6] == '1' )
-        return Raster_Err_Cannot_Render_Glyph;
+        return FT_THROW( Cannot_Render_Glyph );
     }
     else
     {
       /* raster5 is only capable of producing 5-gray-levels bitmaps */
       if ( render->clazz->root.module_name[6] == '5' )
     }
     else
     {
       /* raster5 is only capable of producing 5-gray-levels bitmaps */
       if ( render->clazz->root.module_name[6] == '5' )
-        return Raster_Err_Cannot_Render_Glyph;
+        return FT_THROW( Cannot_Render_Glyph );
     }
 #endif /* FT_CONFIG_OPTION_PIC */
 
     }
 #endif /* FT_CONFIG_OPTION_PIC */
 
     /* compute the control box, and grid fit it */
     FT_Outline_Get_CBox( outline, &cbox );
 
     /* compute the control box, and grid fit it */
     FT_Outline_Get_CBox( outline, &cbox );
 
+    /* undocumented but confirmed: bbox values get rounded */
+#if 1
+    cbox.xMin = FT_PIX_ROUND( cbox.xMin );
+    cbox.yMin = FT_PIX_ROUND( cbox.yMin );
+    cbox.xMax = FT_PIX_ROUND( cbox.xMax );
+    cbox.yMax = FT_PIX_ROUND( cbox.yMax );
+#else
     cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
     cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
     cbox.xMax = FT_PIX_CEIL( cbox.xMax );
     cbox.yMax = FT_PIX_CEIL( cbox.yMax );
     cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
     cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
     cbox.xMax = FT_PIX_CEIL( cbox.xMax );
     cbox.yMax = FT_PIX_CEIL( cbox.yMax );
+#endif
 
     width  = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
     height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
 
     width  = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
     height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
+
+    if ( width > FT_USHORT_MAX || height > FT_USHORT_MAX )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
+
     bitmap = &slot->bitmap;
     memory = render->root.memory;
 
     bitmap = &slot->bitmap;
     memory = render->root.memory;
 
   }
 
 
   }
 
 
-  FT_DEFINE_RENDERER(ft_raster1_renderer_class,
-    
+  FT_DEFINE_RENDERER( ft_raster1_renderer_class,
+
       FT_MODULE_RENDERER,
       FT_MODULE_RENDERER,
-      sizeof( FT_RendererRec ),
+      sizeof ( FT_RendererRec ),
 
       "raster1",
       0x10000L,
 
       "raster1",
       0x10000L,
   /* to register it by hand in your application.  It should only be    */
   /* used for backwards-compatibility with FT 1.x anyway.              */
   /*                                                                   */
   /* to register it by hand in your application.  It should only be    */
   /* used for backwards-compatibility with FT 1.x anyway.              */
   /*                                                                   */
-  FT_DEFINE_RENDERER(ft_raster5_renderer_class,
-  
-    
+  FT_DEFINE_RENDERER( ft_raster5_renderer_class,
+
       FT_MODULE_RENDERER,
       FT_MODULE_RENDERER,
-      sizeof( FT_RendererRec ),
+      sizeof ( FT_RendererRec ),
 
       "raster5",
       0x10000L,
 
       "raster5",
       0x10000L,
index 5df9a7a..ab85c00 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    monochrome renderer error codes (specification only).                */
 /*                                                                         */
 /*                                                                         */
 /*    monochrome renderer error codes (specification only).                */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,6 +30,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  Raster_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Raster
 
 #define FT_ERR_PREFIX  Raster_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Raster
 
index e31c549..5e9f7cc 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for raster module.   */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for raster module.   */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009, 2010, 2012, 2013 by                                    */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "rastpic.h"
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "rastpic.h"
+#include "rasterrs.h"
+
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ftraster.c */
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ftraster.c */
-  void FT_Init_Class_ft_standard_raster(FT_Raster_Funcs*);
+  void
+  FT_Init_Class_ft_standard_raster( FT_Raster_Funcs*  funcs );
+
 
   void
 
   void
-  ft_raster1_renderer_class_pic_free(  FT_Library library )
+  ft_raster1_renderer_class_pic_free( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Memory memory = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Memory          memory        = library->memory;
+
+
     if ( pic_container->raster )
     {
     if ( pic_container->raster )
     {
-      RasterPIC* container = (RasterPIC*)pic_container->raster;
-      if(--container->ref_count)
+      RasterPIC*  container = (RasterPIC*)pic_container->raster;
+
+
+      if ( --container->ref_count )
         return;
       FT_FREE( container );
       pic_container->raster = NULL;
         return;
       FT_FREE( container );
       pic_container->raster = NULL;
 
 
   FT_Error
 
 
   FT_Error
-  ft_raster1_renderer_class_pic_init( FT_Library library )
+  ft_raster1_renderer_class_pic_init( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Error          error         = Raster_Err_Ok;
-    RasterPIC*        container;
-    FT_Memory         memory        = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Error           error         = FT_Err_Ok;
+    RasterPIC*         container     = NULL;
+    FT_Memory          memory        = library->memory;
 
 
 
 
-    /* since this function also serve raster5 renderer, 
-       it implements reference counting */
+    /* since this function also serves raster5 renderer, */
+    /* it implements reference counting                  */
     if ( pic_container->raster )
     {
       ((RasterPIC*)pic_container->raster)->ref_count++;
     if ( pic_container->raster )
     {
       ((RasterPIC*)pic_container->raster)->ref_count++;
     }
 
     /* allocate pointer, clear and set global container pointer */
     }
 
     /* allocate pointer, clear and set global container pointer */
-    if ( FT_ALLOC ( container, sizeof ( *container ) ) )
+    if ( FT_ALLOC( container, sizeof ( *container ) ) )
       return error;
       return error;
-    FT_MEM_SET( container, 0, sizeof(*container) );
+    FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->raster = container;
     pic_container->raster = container;
+
     container->ref_count = 1;
 
     container->ref_count = 1;
 
-    /* initialize pointer table - this is how the module usually expects this data */
-    FT_Init_Class_ft_standard_raster(&container->ft_standard_raster);
-/*Exit:*/
-    if(error)
-      ft_raster1_renderer_class_pic_free(library);
+    /* initialize pointer table -                       */
+    /* this is how the module usually expects this data */
+    FT_Init_Class_ft_standard_raster( &container->ft_standard_raster );
+
     return error;
   }
 
     return error;
   }
 
+
   /* re-route these init and free functions to the above functions */
   /* re-route these init and free functions to the above functions */
-  FT_Error ft_raster5_renderer_class_pic_init(FT_Library library)
+  FT_Error
+  ft_raster5_renderer_class_pic_init( FT_Library  library )
   {
   {
-    return ft_raster1_renderer_class_pic_init(library);
+    return ft_raster1_renderer_class_pic_init( library );
   }
   }
-  void ft_raster5_renderer_class_pic_free(FT_Library library)
+
+
+  void
+  ft_raster5_renderer_class_pic_free( FT_Library  library )
   {
   {
-    ft_raster1_renderer_class_pic_free(library);
+    ft_raster1_renderer_class_pic_free( library );
   }
 
 #endif /* FT_CONFIG_OPTION_PIC */
   }
 
 #endif /* FT_CONFIG_OPTION_PIC */
index dcd82b8..e0ddba6 100644 (file)
 #ifndef __RASTPIC_H__
 #define __RASTPIC_H__
 
 #ifndef __RASTPIC_H__
 #define __RASTPIC_H__
 
-  
+
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 #ifndef FT_CONFIG_OPTION_PIC
-#define FT_STANDARD_RASTER_GET     ft_standard_raster
+
+#define FT_STANDARD_RASTER_GET  ft_standard_raster
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 
 #else /* FT_CONFIG_OPTION_PIC */
 
-  typedef struct RasterPIC_
+  typedef struct  RasterPIC_
   {
   {
-    int ref_count;
-    FT_Raster_Funcs ft_standard_raster;
+    int              ref_count;
+    FT_Raster_Funcs  ft_standard_raster;
+
   } RasterPIC;
 
   } RasterPIC;
 
-#define GET_PIC(lib)               ((RasterPIC*)((lib)->pic_container.raster))
-#define FT_STANDARD_RASTER_GET     (GET_PIC(library)->ft_standard_raster)
+
+#define GET_PIC( lib )                                    \
+          ( (RasterPIC*)( (lib)->pic_container.raster ) )
+#define FT_STANDARD_RASTER_GET  ( GET_PIC( library )->ft_standard_raster )
+
+
+  /* see rastpic.c for the implementation */
+  void
+  ft_raster1_renderer_class_pic_free( FT_Library  library );
+
+  void
+  ft_raster5_renderer_class_pic_free( FT_Library  library );
+
+  FT_Error
+  ft_raster1_renderer_class_pic_init( FT_Library  library );
+
+  FT_Error
+  ft_raster5_renderer_class_pic_init( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
index 9703b12..0e0b5e4 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
 #
 
 
-# Copyright 1996-2000, 2001, 2003, 2008, 2009 by
+# Copyright 1996-2000, 2001, 2003, 2008, 2009, 2011 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -25,7 +25,8 @@ RASTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR))
 # raster driver sources (i.e., C files)
 #
 RASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \
 # raster driver sources (i.e., C files)
 #
 RASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \
-                  $(RASTER_DIR)/ftrend1.c
+                  $(RASTER_DIR)/ftrend1.c  \
+                  $(RASTER_DIR)/rastpic.c
 
 
 # raster driver headers
 
 
 # raster driver headers
diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/Jamfile b/reactos/lib/3rdparty/freetype/src/sfnt/Jamfile
deleted file mode 100644 (file)
index cb20b1b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/sfnt Jamfile
-#
-# Copyright 2001, 2002, 2004, 2005 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) sfnt ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = sfobjs sfdriver ttcmap ttmtx ttpost ttload ttsbit ttkern ttbdf sfntpic ;
-  }
-  else
-  {
-    _sources = sfnt ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/sfnt Jamfile
diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/pngshim.c b/reactos/lib/3rdparty/freetype/src/sfnt/pngshim.c
new file mode 100644 (file)
index 0000000..408f879
--- /dev/null
@@ -0,0 +1,336 @@
+/***************************************************************************/
+/*                                                                         */
+/*  pngshim.c                                                              */
+/*                                                                         */
+/*    PNG Bitmap glyph support.                                            */
+/*                                                                         */
+/*  Copyright 2013 by Google, Inc.                                         */
+/*  Written by Stuart Gill and Behdad Esfahbod.                            */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_STREAM_H
+#include FT_TRUETYPE_TAGS_H
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
+
+#ifdef FT_CONFIG_OPTION_USE_PNG
+
+  /* We always include <stjmp.h>, so make libpng shut up! */
+#define PNG_SKIP_SETJMP_CHECK 1
+#include <png.h>
+#include "pngshim.h"
+
+#include "sferrors.h"
+
+
+  /* This code is freely based on cairo-png.c.  There's so many ways */
+  /* to call libpng, and the way cairo does it is defacto standard.  */
+
+  static int
+  multiply_alpha( int  alpha,
+                  int  color )
+  {
+    int  temp = ( alpha * color ) + 0x80;
+
+
+    return ( temp + ( temp >> 8 ) ) >> 8;
+  }
+
+
+  /* Premultiplies data and converts RGBA bytes => native endian. */
+  static void
+  premultiply_data( png_structp    png,
+                    png_row_infop  row_info,
+                    png_bytep      data )
+  {
+    unsigned int  i;
+
+    FT_UNUSED( png );
+
+
+    for ( i = 0; i < row_info->rowbytes; i += 4 )
+    {
+      unsigned char*  base  = &data[i];
+      unsigned int    alpha = base[3];
+
+
+      if ( alpha == 0 )
+        base[0] = base[1] = base[2] = base[3] = 0;
+
+      else
+      {
+        unsigned int  red   = base[0];
+        unsigned int  green = base[1];
+        unsigned int  blue  = base[2];
+
+
+        if ( alpha != 0xFF )
+        {
+          red   = multiply_alpha( alpha, red   );
+          green = multiply_alpha( alpha, green );
+          blue  = multiply_alpha( alpha, blue  );
+        }
+
+        base[0] = blue;
+        base[1] = green;
+        base[2] = red;
+        base[3] = alpha;
+      }
+    }
+  }
+
+
+  /* Converts RGBx bytes to BGRA. */
+  static void
+  convert_bytes_to_data( png_structp    png,
+                         png_row_infop  row_info,
+                         png_bytep      data )
+  {
+    unsigned int  i;
+
+    FT_UNUSED( png );
+
+
+    for ( i = 0; i < row_info->rowbytes; i += 4 )
+    {
+      unsigned char*  base  = &data[i];
+      unsigned int    red   = base[0];
+      unsigned int    green = base[1];
+      unsigned int    blue  = base[2];
+
+
+      base[0] = blue;
+      base[1] = green;
+      base[2] = red;
+      base[3] = 0xFF;
+    }
+  }
+
+
+  /* Use error callback to avoid png writing to stderr. */
+  static void
+  error_callback( png_structp      png,
+                  png_const_charp  error_msg )
+  {
+    FT_Error*  error = png_get_error_ptr( png );
+
+    FT_UNUSED( error_msg );
+
+
+    *error = FT_THROW( Out_Of_Memory );
+#ifdef PNG_SETJMP_SUPPORTED
+    longjmp( png_jmpbuf( png ), 1 );
+#endif
+    /* if we get here, then we have no choice but to abort ... */
+  }
+
+
+  /* Use warning callback to avoid png writing to stderr. */
+  static void
+  warning_callback( png_structp      png,
+                    png_const_charp  error_msg )
+  {
+    FT_UNUSED( png );
+    FT_UNUSED( error_msg );
+
+    /* Just ignore warnings. */
+  }
+
+
+  static void
+  read_data_from_FT_Stream( png_structp  png,
+                            png_bytep    data,
+                            png_size_t   length )
+  {
+    FT_Error   error;
+    png_voidp  p      = png_get_io_ptr( png );
+    FT_Stream  stream = (FT_Stream)p;
+
+
+    if ( FT_FRAME_ENTER( length ) )
+    {
+      FT_Error*  e = png_get_error_ptr( png );
+
+
+      *e = FT_THROW( Invalid_Stream_Read );
+      png_error( png, NULL );
+
+      return;
+    }
+
+    memcpy( data, stream->cursor, length );
+
+    FT_FRAME_EXIT();
+  }
+
+
+  static FT_Error
+  Load_SBit_Png( FT_Bitmap*       map,
+                 FT_Int           x_offset,
+                 FT_Int           y_offset,
+                 FT_Int           pix_bits,
+                 TT_SBit_Metrics  metrics,
+                 FT_Memory        memory,
+                 FT_Byte*         data,
+                 FT_UInt          png_len )
+  {
+    FT_Error      error = FT_Err_Ok;
+    FT_StreamRec  stream;
+
+    png_structp  png;
+    png_infop    info;
+    png_uint_32  imgWidth, imgHeight;
+
+    int         bitdepth, color_type, interlace;
+    FT_Int      i;
+    png_byte*  *rows;
+
+
+    if ( x_offset < 0 || x_offset + metrics->width  > map->width ||
+         y_offset < 0 || y_offset + metrics->height > map->rows  ||
+         pix_bits != 32 || map->pixel_mode != FT_PIXEL_MODE_BGRA )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
+
+    FT_Stream_OpenMemory( &stream, data, png_len );
+
+    png = png_create_read_struct( PNG_LIBPNG_VER_STRING,
+                                  &error,
+                                  error_callback,
+                                  warning_callback );
+    if ( !png )
+    {
+      error = FT_THROW( Out_Of_Memory );
+      goto Exit;
+    }
+
+    info = png_create_info_struct( png );
+    if ( !info )
+    {
+      error = FT_THROW( Out_Of_Memory );
+      png_destroy_read_struct( &png, NULL, NULL );
+      goto Exit;
+    }
+
+    if ( ft_setjmp( png_jmpbuf( png ) ) )
+    {
+      error = FT_THROW( Invalid_File_Format );
+      goto DestroyExit;
+    }
+
+    png_set_read_fn( png, &stream, read_data_from_FT_Stream );
+
+    png_read_info( png, info );
+    png_get_IHDR( png, info,
+                  &imgWidth, &imgHeight,
+                  &bitdepth, &color_type, &interlace,
+                  NULL, NULL );
+
+    if ( error != FT_Err_Ok                   ||
+         (FT_Int)imgWidth  != metrics->width  ||
+         (FT_Int)imgHeight != metrics->height )
+      goto DestroyExit;
+
+    /* convert palette/gray image to rgb */
+    if ( color_type == PNG_COLOR_TYPE_PALETTE )
+      png_set_palette_to_rgb( png );
+
+    /* expand gray bit depth if needed */
+    if ( color_type == PNG_COLOR_TYPE_GRAY )
+    {
+#if PNG_LIBPNG_VER >= 10209
+      png_set_expand_gray_1_2_4_to_8( png );
+#else
+      png_set_gray_1_2_4_to_8( png );
+#endif
+    }
+
+    /* transform transparency to alpha */
+    if ( png_get_valid(png, info, PNG_INFO_tRNS ) )
+      png_set_tRNS_to_alpha( png );
+
+    if ( bitdepth == 16 )
+      png_set_strip_16( png );
+
+    if ( bitdepth < 8 )
+      png_set_packing( png );
+
+    /* convert grayscale to RGB */
+    if ( color_type == PNG_COLOR_TYPE_GRAY       ||
+         color_type == PNG_COLOR_TYPE_GRAY_ALPHA )
+      png_set_gray_to_rgb( png );
+
+    if ( interlace != PNG_INTERLACE_NONE )
+      png_set_interlace_handling( png );
+
+    png_set_filler( png, 0xFF, PNG_FILLER_AFTER );
+
+    /* recheck header after setting EXPAND options */
+    png_read_update_info(png, info );
+    png_get_IHDR( png, info,
+                  &imgWidth, &imgHeight,
+                  &bitdepth, &color_type, &interlace,
+                  NULL, NULL );
+
+    if ( bitdepth != 8                              ||
+        !( color_type == PNG_COLOR_TYPE_RGB       ||
+           color_type == PNG_COLOR_TYPE_RGB_ALPHA ) )
+    {
+      error = FT_THROW( Invalid_File_Format );
+      goto DestroyExit;
+    }
+
+    switch ( color_type )
+    {
+    default:
+      /* Shouldn't happen, but fall through. */
+
+    case PNG_COLOR_TYPE_RGB_ALPHA:
+      png_set_read_user_transform_fn( png, premultiply_data );
+      break;
+
+    case PNG_COLOR_TYPE_RGB:
+      /* Humm, this smells.  Carry on though. */
+      png_set_read_user_transform_fn( png, convert_bytes_to_data );
+      break;
+    }
+
+    if ( FT_NEW_ARRAY( rows, imgHeight ) )
+    {
+      error = FT_THROW( Out_Of_Memory );
+      goto DestroyExit;
+    }
+
+    for ( i = 0; i < (FT_Int)imgHeight; i++ )
+      rows[i] = map->buffer + ( y_offset + i ) * map->pitch + x_offset * 4;
+
+    png_read_image( png, rows );
+
+    FT_FREE( rows );
+
+    png_read_end( png, info );
+
+  DestroyExit:
+    png_destroy_read_struct( &png, &info, NULL );
+    FT_Stream_Close( &stream );
+
+  Exit:
+    return error;
+  }
+
+#endif /* FT_CONFIG_OPTION_USE_PNG */
+
+
+/* END */
@@ -1,12 +1,11 @@
 /***************************************************************************/
 /*                                                                         */
 /***************************************************************************/
 /*                                                                         */
-/*  ft2build.h                                                             */
+/*  pngshim.h                                                              */
 /*                                                                         */
 /*                                                                         */
-/*    FreeType 2 build and setup macros.                                   */
-/*    (Generic version)                                                    */
+/*    PNG Bitmap glyph support.                                            */
 /*                                                                         */
 /*                                                                         */
-/*  Copyright 1996-2001, 2003, 2006 by                                     */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*  Copyright 2013 by Google, Inc.                                         */
+/*  Written by Stuart Gill and Behdad Esfahbod.                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
- /*
-  *  This is a development version of <ft2build.h> that is used
-  *  to build the library in debug mode.  Its only difference with
-  *  the reference is that it forces the use of the local `ftoption.h'
-  *  which contains different settings for all configuration macros.
-  *
-  *  To use it, you must define the environment variable FT2_BUILD_INCLUDE
-  *  to point to the directory containing these two files (`ft2build.h' and
-  *  `ftoption.h'), then invoke Jam as usual.
-  */
+#ifndef __PNGSHIM_H__
+#define __PNGSHIM_H__
 
 
-#ifndef __FT2_BUILD_DEVEL_H__
-#define __FT2_BUILD_DEVEL_H__
 
 
-#define  FT_CONFIG_OPTIONS_H   <ftoption.h>
+#include <ft2build.h>
+#include "ttload.h"
 
 
-#include <freetype/config/ftheader.h>
 
 
-#endif /* __FT2_BUILD_DEVEL_H__ */
+FT_BEGIN_HEADER
+
+#ifdef FT_CONFIG_OPTION_USE_PNG
+
+  FT_LOCAL( FT_Error )
+  Load_SBit_Png( FT_Bitmap*       map,
+                 FT_Int           x_offset,
+                 FT_Int           y_offset,
+                 FT_Int           pix_bits,
+                 TT_SBit_Metrics  metrics,
+                 FT_Memory        memory,
+                 FT_Byte*         data,
+                 FT_UInt          png_len );
+
+#endif
+
+FT_END_HEADER
+
+#endif /* __PNGSHIM_H__ */
 
 
 /* END */
 
 
 /* END */
index abda74f..a6c956a 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
 #
 
 
-# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by
+# Copyright 1996-2000, 2002-2007, 2009, 2011, 2013 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -33,15 +33,14 @@ SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c   \
                 $(SFNT_DIR)/ttkern.c   \
                 $(SFNT_DIR)/ttbdf.c    \
                 $(SFNT_DIR)/sfobjs.c   \
                 $(SFNT_DIR)/ttkern.c   \
                 $(SFNT_DIR)/ttbdf.c    \
                 $(SFNT_DIR)/sfobjs.c   \
-                $(SFNT_DIR)/sfdriver.c
+                $(SFNT_DIR)/sfdriver.c \
+                $(SFNT_DIR)/sfntpic.c  \
+                $(SFNT_DIR)/pngshim.c
 
 # SFNT driver headers
 #
 
 # SFNT driver headers
 #
-# Note that ttsbit0.c gets #included by ttsbit.c.
-#
 SFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h)  \
 SFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h)  \
-              $(SFNT_DIR)/sferrors.h \
-              $(SFNT_DIR)/ttsbit0.c
+              $(SFNT_DIR)/sferrors.h
 
 
 # SFNT driver object(s)
 
 
 # SFNT driver object(s)
index b74679b..a368b8c 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    High-level SFNT driver interface (body).                             */
 /*                                                                         */
 /*                                                                         */
 /*    High-level SFNT driver interface (body).                             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
+/*  Copyright 1996-2007, 2009-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -50,6 +50,7 @@
 #include FT_SERVICE_SFNT_H
 #include FT_SERVICE_TT_CMAP_H
 
 #include FT_SERVICE_SFNT_H
 #include FT_SERVICE_TT_CMAP_H
 
+
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
 #define FT_COMPONENT  trace_sfdriver
 
 
 #define FT_COMPONENT  trace_sfdriver
 
 
- /*
-  *  SFNT TABLE SERVICE
-  *
-  */
 /*
+   *  SFNT TABLE SERVICE
+   *
+   */
 
   static void*
   get_sfnt_table( TT_Face      face,
 
   static void*
   get_sfnt_table( TT_Face      face,
                    FT_ULong  *offset,
                    FT_ULong  *length )
   {
                    FT_ULong  *offset,
                    FT_ULong  *length )
   {
-    if ( !tag || !offset || !length )
-      return SFNT_Err_Invalid_Argument;
+    if ( !offset || !length )
+      return FT_THROW( Invalid_Argument );
 
 
-    if ( idx >= face->num_tables )
-      return SFNT_Err_Table_Missing;
+    if ( !tag )
+      *length = face->num_tables;
+    else
+    {
+      if ( idx >= face->num_tables )
+        return FT_THROW( Table_Missing );
 
 
-    *tag    = face->dir_tables[idx].Tag;
-    *offset = face->dir_tables[idx].Offset;
-    *length = face->dir_tables[idx].Length;
+      *tag    = face->dir_tables[idx].Tag;
+      *offset = face->dir_tables[idx].Offset;
+      *length = face->dir_tables[idx].Length;
+    }
 
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-  FT_DEFINE_SERVICE_SFNT_TABLEREC(sfnt_service_sfnt_table,
+  FT_DEFINE_SERVICE_SFNT_TABLEREC(
+    sfnt_service_sfnt_table,
     (FT_SFNT_TableLoadFunc)tt_face_load_any,
     (FT_SFNT_TableGetFunc) get_sfnt_table,
     (FT_SFNT_TableLoadFunc)tt_face_load_any,
     (FT_SFNT_TableGetFunc) get_sfnt_table,
-    (FT_SFNT_TableInfoFunc)sfnt_table_info
-  )
+    (FT_SFNT_TableInfoFunc)sfnt_table_info )
 
 
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
 
 
 
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
 
- /*
-  *  GLYPH DICT SERVICE
-  *
-  */
 /*
+   *  GLYPH DICT SERVICE
+   *
+   */
 
   static FT_Error
   sfnt_get_glyph_name( TT_Face     face,
 
   static FT_Error
   sfnt_get_glyph_name( TT_Face     face,
   sfnt_get_name_index( TT_Face     face,
                        FT_String*  glyph_name )
   {
   sfnt_get_name_index( TT_Face     face,
                        FT_String*  glyph_name )
   {
-    FT_Face   root = &face->root;
-    FT_UInt   i, max_gid = FT_UINT_MAX;
+    FT_Face  root = &face->root;
+
+    FT_UInt  i, max_gid = FT_UINT_MAX;
 
 
     if ( root->num_glyphs < 0 )
       return 0;
 
 
     if ( root->num_glyphs < 0 )
       return 0;
-    else if ( ( FT_ULong ) root->num_glyphs < FT_UINT_MAX )
-      max_gid = ( FT_UInt ) root->num_glyphs;
+    else if ( (FT_ULong)root->num_glyphs < FT_UINT_MAX )
+      max_gid = (FT_UInt)root->num_glyphs;
     else
       FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08x\n",
     else
       FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08x\n",
-         FT_UINT_MAX, root->num_glyphs ));
+                  FT_UINT_MAX, root->num_glyphs ));
 
     for ( i = 0; i < max_gid; i++ )
     {
 
     for ( i = 0; i < max_gid; i++ )
     {
   }
 
 
   }
 
 
-  FT_DEFINE_SERVICE_GLYPHDICTREC(sfnt_service_glyph_dict,
+  FT_DEFINE_SERVICE_GLYPHDICTREC(
+    sfnt_service_glyph_dict,
     (FT_GlyphDict_GetNameFunc)  sfnt_get_glyph_name,
     (FT_GlyphDict_GetNameFunc)  sfnt_get_glyph_name,
-    (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index
-  )
+    (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index )
+
 
 #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
 
 
 
 #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
 
 
- /*
-  *  POSTSCRIPT NAME SERVICE
-  *
-  */
 /*
+   *  POSTSCRIPT NAME SERVICE
+   *
+   */
 
   static const char*
   sfnt_get_ps_name( TT_Face  face )
 
   static const char*
   sfnt_get_ps_name( TT_Face  face )
       FT_Memory         memory = face->root.memory;
       TT_NameEntryRec*  name   = face->name_table.names + found_win;
       FT_UInt           len    = name->stringLength / 2;
       FT_Memory         memory = face->root.memory;
       TT_NameEntryRec*  name   = face->name_table.names + found_win;
       FT_UInt           len    = name->stringLength / 2;
-      FT_Error          error  = SFNT_Err_Ok;
+      FT_Error          error  = FT_Err_Ok;
 
       FT_UNUSED( error );
 
 
       FT_UNUSED( error );
 
       FT_Memory         memory = face->root.memory;
       TT_NameEntryRec*  name   = face->name_table.names + found_apple;
       FT_UInt           len    = name->stringLength;
       FT_Memory         memory = face->root.memory;
       TT_NameEntryRec*  name   = face->name_table.names + found_apple;
       FT_UInt           len    = name->stringLength;
-      FT_Error          error  = SFNT_Err_Ok;
+      FT_Error          error  = FT_Err_Ok;
 
       FT_UNUSED( error );
 
 
       FT_UNUSED( error );
 
     return result;
   }
 
     return result;
   }
 
-  FT_DEFINE_SERVICE_PSFONTNAMEREC(sfnt_service_ps_name,
-    (FT_PsName_GetFunc)sfnt_get_ps_name
-  )
+
+  FT_DEFINE_SERVICE_PSFONTNAMEREC(
+    sfnt_service_ps_name,
+    (FT_PsName_GetFunc)sfnt_get_ps_name )
 
 
   /*
    *  TT CMAP INFO
    */
 
 
   /*
    *  TT CMAP INFO
    */
-  FT_DEFINE_SERVICE_TTCMAPSREC(tt_service_get_cmap_info,
-    (TT_CMap_Info_GetFunc)tt_get_cmap_info
-  )
+  FT_DEFINE_SERVICE_TTCMAPSREC(
+    tt_service_get_cmap_info,
+    (TT_CMap_Info_GetFunc)tt_get_cmap_info )
 
 
 #ifdef TT_CONFIG_OPTION_BDF
 
 
 #ifdef TT_CONFIG_OPTION_BDF
           *acharset_registry = registry.u.atom;
         }
         else
           *acharset_registry = registry.u.atom;
         }
         else
-          error = SFNT_Err_Invalid_Argument;
+          error = FT_THROW( Invalid_Argument );
       }
     }
 
       }
     }
 
   }
 
 
   }
 
 
-  FT_DEFINE_SERVICE_BDFRec(sfnt_service_bdf,
-    (FT_BDF_GetCharsetIdFunc) sfnt_get_charset_id,
-    (FT_BDF_GetPropertyFunc)  tt_face_find_bdf_prop
-  )
+  FT_DEFINE_SERVICE_BDFRec(
+    sfnt_service_bdf,
+    (FT_BDF_GetCharsetIdFunc)sfnt_get_charset_id,
+    (FT_BDF_GetPropertyFunc) tt_face_find_bdf_prop )
+
 
 #endif /* TT_CONFIG_OPTION_BDF */
 
 
 #endif /* TT_CONFIG_OPTION_BDF */
 
    */
 
 #if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF
    */
 
 #if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF
-  FT_DEFINE_SERVICEDESCREC5(sfnt_services,
-    FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
-    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
-    FT_SERVICE_ID_GLYPH_DICT,           &FT_SFNT_SERVICE_GLYPH_DICT_GET,
-    FT_SERVICE_ID_BDF,                  &FT_SFNT_SERVICE_BDF_GET,
-    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
-  )
+  FT_DEFINE_SERVICEDESCREC5(
+    sfnt_services,
+    FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,
+    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
+    FT_SERVICE_ID_GLYPH_DICT,           &SFNT_SERVICE_GLYPH_DICT_GET,
+    FT_SERVICE_ID_BDF,                  &SFNT_SERVICE_BDF_GET,
+    FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )
 #elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
 #elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-  FT_DEFINE_SERVICEDESCREC4(sfnt_services,
-    FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
-    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
-    FT_SERVICE_ID_GLYPH_DICT,           &FT_SFNT_SERVICE_GLYPH_DICT_GET,
-    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
-  )
+  FT_DEFINE_SERVICEDESCREC4(
+    sfnt_services,
+    FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,
+    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
+    FT_SERVICE_ID_GLYPH_DICT,           &SFNT_SERVICE_GLYPH_DICT_GET,
+    FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )
 #elif defined TT_CONFIG_OPTION_BDF
 #elif defined TT_CONFIG_OPTION_BDF
-  FT_DEFINE_SERVICEDESCREC4(sfnt_services,
-    FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
-    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
-    FT_SERVICE_ID_BDF,                  &FT_SFNT_SERVICE_BDF_GET,
-    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
-  )
+  FT_DEFINE_SERVICEDESCREC4(
+    sfnt_services,
+    FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,
+    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
+    FT_SERVICE_ID_BDF,                  &SFNT_SERVICE_BDF_GET,
+    FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )
 #else
 #else
-  FT_DEFINE_SERVICEDESCREC3(sfnt_services,
-    FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
-    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
-    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
-  )
+  FT_DEFINE_SERVICEDESCREC3(
+    sfnt_services,
+    FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,
+    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
+    FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )
 #endif
 
 
 #endif
 
 
   sfnt_get_interface( FT_Module    module,
                       const char*  module_interface )
   {
   sfnt_get_interface( FT_Module    module,
                       const char*  module_interface )
   {
-    FT_UNUSED( module );
-
-    return ft_service_list_lookup( FT_SFNT_SERVICES_GET, module_interface );
-  }
-
+    /* SFNT_SERVICES_GET derefers `library' in PIC mode */
+#ifdef FT_CONFIG_OPTION_PIC
+    FT_Library  library;
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
 
 
-  FT_CALLBACK_DEF( FT_Error )
-  tt_face_load_sfnt_header_stub( TT_Face      face,
-                                 FT_Stream    stream,
-                                 FT_Long      face_index,
-                                 SFNT_Header  header )
-  {
-    FT_UNUSED( face );
-    FT_UNUSED( stream );
-    FT_UNUSED( face_index );
-    FT_UNUSED( header );
-
-    return SFNT_Err_Unimplemented_Feature;
-  }
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  tt_face_load_directory_stub( TT_Face      face,
-                               FT_Stream    stream,
-                               SFNT_Header  header )
-  {
-    FT_UNUSED( face );
-    FT_UNUSED( stream );
-    FT_UNUSED( header );
-
-    return SFNT_Err_Unimplemented_Feature;
-  }
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  tt_face_load_hdmx_stub( TT_Face    face,
-                          FT_Stream  stream )
-  {
-    FT_UNUSED( face );
-    FT_UNUSED( stream );
-
-    return SFNT_Err_Unimplemented_Feature;
-  }
-
-
-  FT_CALLBACK_DEF( void )
-  tt_face_free_hdmx_stub( TT_Face  face )
-  {
-    FT_UNUSED( face );
-  }
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  tt_face_set_sbit_strike_stub( TT_Face    face,
-                                FT_UInt    x_ppem,
-                                FT_UInt    y_ppem,
-                                FT_ULong*  astrike_index )
-  {
-    /*
-     * We simply forge a FT_Size_Request and call the real function
-     * that does all the work.
-     *
-     * This stub might be called by libXfont in the X.Org Xserver,
-     * compiled against version 2.1.8 or newer.
-     */
-
-    FT_Size_RequestRec  req;
-
-
-    req.type           = FT_SIZE_REQUEST_TYPE_NOMINAL;
-    req.width          = (FT_F26Dot6)x_ppem;
-    req.height         = (FT_F26Dot6)y_ppem;
-    req.horiResolution = 0;
-    req.vertResolution = 0;
-
-    *astrike_index = 0x7FFFFFFFUL;
-
-    return tt_face_set_sbit_strike( face, &req, astrike_index );
-  }
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  tt_face_load_sbit_stub( TT_Face    face,
-                          FT_Stream  stream )
-  {
-    FT_UNUSED( face );
-    FT_UNUSED( stream );
-
-    /*
-     *  This function was originally implemented to load the sbit table.
-     *  However, it has been replaced by `tt_face_load_eblc', and this stub
-     *  is only there for some rogue clients which would want to call it
-     *  directly (which doesn't make much sense).
-     */
-    return SFNT_Err_Unimplemented_Feature;
-  }
-
-
-  FT_CALLBACK_DEF( void )
-  tt_face_free_sbit_stub( TT_Face  face )
-  {
-    /* nothing to do in this stub */
-    FT_UNUSED( face );
-  }
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  tt_face_load_charmap_stub( TT_Face    face,
-                             void*      cmap,
-                             FT_Stream  input )
-  {
-    FT_UNUSED( face );
-    FT_UNUSED( cmap );
-    FT_UNUSED( input );
-
-    return SFNT_Err_Unimplemented_Feature;
-  }
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  tt_face_free_charmap_stub( TT_Face  face,
-                             void*    cmap )
-  {
-    FT_UNUSED( face );
-    FT_UNUSED( cmap );
+    if ( !module )
+      return NULL;
+    library = module->library;
+    if ( !library )
+      return NULL;
+#else
+    FT_UNUSED( module );
+#endif
 
 
-    return SFNT_Err_Ok;
+    return ft_service_list_lookup( SFNT_SERVICES_GET, module_interface );
   }
 
   }
 
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-#define PUT_EMBEDDED_BITMAPS(a) a 
+#define PUT_EMBEDDED_BITMAPS( a )  a
 #else
 #else
-#define PUT_EMBEDDED_BITMAPS(a) 0 
+#define PUT_EMBEDDED_BITMAPS( a )  NULL
 #endif
 #endif
+
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-#define PUT_PS_NAMES(a) a 
+#define PUT_PS_NAMES( a )  a
 #else
 #else
-#define PUT_PS_NAMES(a) 0 
+#define PUT_PS_NAMES( a )  NULL
 #endif
 
 #endif
 
-  FT_DEFINE_SFNT_INTERFACE(sfnt_interface,
+  FT_DEFINE_SFNT_INTERFACE(
+    sfnt_interface,
     tt_face_goto_table,
 
     sfnt_init_face,
     tt_face_goto_table,
 
     sfnt_init_face,
 
     tt_face_load_any,
 
 
     tt_face_load_any,
 
-    tt_face_load_sfnt_header_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-    tt_face_load_directory_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
     tt_face_load_head,
     tt_face_load_hhea,
     tt_face_load_cmap,
     tt_face_load_head,
     tt_face_load_hhea,
     tt_face_load_cmap,
     tt_face_load_name,
     tt_face_free_name,
 
     tt_face_load_name,
     tt_face_free_name,
 
-    tt_face_load_hdmx_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-    tt_face_free_hdmx_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
     tt_face_load_kern,
     tt_face_load_gasp,
     tt_face_load_pclt,
 
     /* see `ttload.h' */
     tt_face_load_kern,
     tt_face_load_gasp,
     tt_face_load_pclt,
 
     /* see `ttload.h' */
-    PUT_EMBEDDED_BITMAPS(tt_face_load_bhed),
-
-    tt_face_set_sbit_strike_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-    tt_face_load_sbit_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-    tt_find_sbit_image, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-    tt_load_sbit_metrics, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-    PUT_EMBEDDED_BITMAPS(tt_face_load_sbit_image),
+    PUT_EMBEDDED_BITMAPS( tt_face_load_bhed ),
 
 
-    tt_face_free_sbit_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
+    PUT_EMBEDDED_BITMAPS( tt_face_load_sbit_image ),
 
     /* see `ttpost.h' */
 
     /* see `ttpost.h' */
-    PUT_PS_NAMES(tt_face_get_ps_name),
-    PUT_PS_NAMES(tt_face_free_ps_names),
-
-    tt_face_load_charmap_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-    tt_face_free_charmap_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
+    PUT_PS_NAMES( tt_face_get_ps_name   ),
+    PUT_PS_NAMES( tt_face_free_ps_names ),
 
     /* since version 2.1.8 */
 
     /* since version 2.1.8 */
-
     tt_face_get_kerning,
 
     /* since version 2.2 */
     tt_face_get_kerning,
 
     /* since version 2.2 */
-
     tt_face_load_font_dir,
     tt_face_load_hmtx,
 
     /* see `ttsbit.h' and `sfnt.h' */
     tt_face_load_font_dir,
     tt_face_load_hmtx,
 
     /* see `ttsbit.h' and `sfnt.h' */
-    PUT_EMBEDDED_BITMAPS(tt_face_load_eblc),
-    PUT_EMBEDDED_BITMAPS(tt_face_free_eblc),
+    PUT_EMBEDDED_BITMAPS( tt_face_load_eblc ),
+    PUT_EMBEDDED_BITMAPS( tt_face_free_eblc ),
 
 
-    PUT_EMBEDDED_BITMAPS(tt_face_set_sbit_strike),
-    PUT_EMBEDDED_BITMAPS(tt_face_load_strike_metrics),
+    PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike     ),
+    PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ),
 
     tt_face_get_metrics
   )
 
 
 
     tt_face_get_metrics
   )
 
 
-  FT_DEFINE_MODULE(sfnt_module_class,
-  
+  FT_DEFINE_MODULE(
+    sfnt_module_class,
+
     0,  /* not a font driver or renderer */
     0,  /* not a font driver or renderer */
-    sizeof( FT_ModuleRec ),
+    sizeof ( FT_ModuleRec ),
 
     "sfnt",     /* driver name                            */
     0x10000L,   /* driver version 1.0                     */
     0x20000L,   /* driver requires FreeType 2.0 or higher */
 
 
     "sfnt",     /* driver name                            */
     0x10000L,   /* driver version 1.0                     */
     0x20000L,   /* driver requires FreeType 2.0 or higher */
 
-    (const void*)&FT_SFNT_INTERFACE_GET,  /* module specific interface */
+    (const void*)&SFNT_INTERFACE_GET,  /* module specific interface */
 
     (FT_Module_Constructor)0,
     (FT_Module_Destructor) 0,
 
     (FT_Module_Constructor)0,
     (FT_Module_Destructor) 0,
-    (FT_Module_Requester)  sfnt_get_interface
-  )
+    (FT_Module_Requester)  sfnt_get_interface )
 
 
 /* END */
 
 
 /* END */
index 27f90de..e981e1d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    SFNT error codes (specification only).                               */
 /*                                                                         */
 /*                                                                         */
 /*    SFNT error codes (specification only).                               */
 /*                                                                         */
-/*  Copyright 2001, 2004 by                                                */
+/*  Copyright 2001, 2004, 2012, 2013 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  SFNT_Err_
 #define FT_ERR_BASE    FT_Mod_Err_SFNT
 
 #define FT_ERR_PREFIX  SFNT_Err_
 #define FT_ERR_BASE    FT_Mod_Err_SFNT
 
-#define FT_KEEP_ERR_PREFIX
-
 #include FT_ERRORS_H
 
 #endif /* __SFERRORS_H__ */
 #include FT_ERRORS_H
 
 #endif /* __SFERRORS_H__ */
index fc507b4..d62ed4e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Single object library component.                                     */
 /*                                                                         */
 /*                                                                         */
 /*    Single object library component.                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
+/*  Copyright 1996-2006, 2013 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -28,6 +28,7 @@
 #include "sfdriver.c"
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
 #include "sfdriver.c"
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+#include "pngshim.c"
 #include "ttsbit.c"
 #endif
 
 #include "ttsbit.c"
 #endif
 
index 53aca17..b3fb24b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for sfnt module.     */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for sfnt module.     */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009, 2010, 2012, 2013 by                                    */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "sfntpic.h"
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "sfntpic.h"
+#include "sferrors.h"
+
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from sfdriver.c */
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from sfdriver.c */
-  FT_Error FT_Create_Class_sfnt_services( FT_Library, FT_ServiceDescRec**);
-  void FT_Destroy_Class_sfnt_services( FT_Library, FT_ServiceDescRec*);
-  void FT_Init_Class_sfnt_service_bdf( FT_Service_BDFRec*);
-  void FT_Init_Class_sfnt_interface( FT_Library, SFNT_Interface*);
-  void FT_Init_Class_sfnt_service_glyph_dict( FT_Library, FT_Service_GlyphDictRec*);
-  void FT_Init_Class_sfnt_service_ps_name( FT_Library, FT_Service_PsFontNameRec*);
-  void FT_Init_Class_tt_service_get_cmap_info( FT_Library, FT_Service_TTCMapsRec*);
-  void FT_Init_Class_sfnt_service_sfnt_table( FT_Service_SFNT_TableRec*);
+  FT_Error
+  FT_Create_Class_sfnt_services( FT_Library           library,
+                                 FT_ServiceDescRec**  output_class );
+  void
+  FT_Destroy_Class_sfnt_services( FT_Library          library,
+                                  FT_ServiceDescRec*  clazz );
+  void
+  FT_Init_Class_sfnt_service_bdf( FT_Service_BDFRec*  clazz );
+  void
+  FT_Init_Class_sfnt_interface( FT_Library       library,
+                                SFNT_Interface*  clazz );
+  void
+  FT_Init_Class_sfnt_service_glyph_dict(
+    FT_Library                library,
+    FT_Service_GlyphDictRec*  clazz );
+  void
+  FT_Init_Class_sfnt_service_ps_name(
+    FT_Library                 library,
+    FT_Service_PsFontNameRec*  clazz );
+  void
+  FT_Init_Class_tt_service_get_cmap_info(
+    FT_Library              library,
+    FT_Service_TTCMapsRec*  clazz );
+  void
+  FT_Init_Class_sfnt_service_sfnt_table(
+    FT_Service_SFNT_TableRec*  clazz );
+
 
   /* forward declaration of PIC init functions from ttcmap.c */
 
   /* forward declaration of PIC init functions from ttcmap.c */
-  FT_Error FT_Create_Class_tt_cmap_classes( FT_Library, TT_CMap_Class**);
-  void FT_Destroy_Class_tt_cmap_classes( FT_Library, TT_CMap_Class*);
+  FT_Error
+  FT_Create_Class_tt_cmap_classes( FT_Library       library,
+                                   TT_CMap_Class**  output_class );
+  void
+  FT_Destroy_Class_tt_cmap_classes( FT_Library      library,
+                                    TT_CMap_Class*  clazz );
+
 
   void
 
   void
-  sfnt_module_class_pic_free(  FT_Library library )
+  sfnt_module_class_pic_free( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Memory memory = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Memory          memory        = library->memory;
+
+
     if ( pic_container->sfnt )
     {
     if ( pic_container->sfnt )
     {
-      sfntModulePIC* container = (sfntModulePIC*)pic_container->sfnt;
-      if(container->sfnt_services)
-        FT_Destroy_Class_sfnt_services(library, container->sfnt_services);
+      sfntModulePIC*  container = (sfntModulePIC*)pic_container->sfnt;
+
+
+      if ( container->sfnt_services )
+        FT_Destroy_Class_sfnt_services( library,
+                                        container->sfnt_services );
       container->sfnt_services = NULL;
       container->sfnt_services = NULL;
-      if(container->tt_cmap_classes)
-        FT_Destroy_Class_tt_cmap_classes(library, container->tt_cmap_classes);
+
+      if ( container->tt_cmap_classes )
+        FT_Destroy_Class_tt_cmap_classes( library,
+                                          container->tt_cmap_classes );
       container->tt_cmap_classes = NULL;
       container->tt_cmap_classes = NULL;
+
       FT_FREE( container );
       pic_container->sfnt = NULL;
     }
       FT_FREE( container );
       pic_container->sfnt = NULL;
     }
 
 
   FT_Error
 
 
   FT_Error
-  sfnt_module_class_pic_init(  FT_Library library )
+  sfnt_module_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Error           error = SFNT_Err_Ok;
-    sfntModulePIC*     container;
-    FT_Memory          memory = library->memory;
+    FT_Error           error         = FT_Err_Ok;
+    sfntModulePIC*     container     = NULL;
+    FT_Memory          memory        = library->memory;
 
 
     /* allocate pointer, clear and set global container pointer */
 
 
     /* allocate pointer, clear and set global container pointer */
-    if ( FT_ALLOC ( container, sizeof ( *container ) ) )
+    if ( FT_ALLOC( container, sizeof ( *container ) ) )
       return error;
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->sfnt = container;
 
       return error;
     FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->sfnt = container;
 
-    /* initialize pointer table - this is how the module usually expects this data */
-    error = FT_Create_Class_sfnt_services(library, &container->sfnt_services);
-    if(error) 
+    /* initialize pointer table -                       */
+    /* this is how the module usually expects this data */
+    error = FT_Create_Class_sfnt_services( library,
+                                           &container->sfnt_services );
+    if ( error )
       goto Exit;
       goto Exit;
-    error = FT_Create_Class_tt_cmap_classes(library, &container->tt_cmap_classes);
-    if(error) 
+
+    error = FT_Create_Class_tt_cmap_classes( library,
+                                             &container->tt_cmap_classes );
+    if ( error )
       goto Exit;
       goto Exit;
-    FT_Init_Class_sfnt_service_glyph_dict(library, &container->sfnt_service_glyph_dict);
-    FT_Init_Class_sfnt_service_ps_name(library, &container->sfnt_service_ps_name);
-    FT_Init_Class_tt_service_get_cmap_info(library, &container->tt_service_get_cmap_info);
-    FT_Init_Class_sfnt_service_sfnt_table(&container->sfnt_service_sfnt_table);
+
+    FT_Init_Class_sfnt_service_glyph_dict(
+      library, &container->sfnt_service_glyph_dict );
+    FT_Init_Class_sfnt_service_ps_name(
+      library, &container->sfnt_service_ps_name );
+    FT_Init_Class_tt_service_get_cmap_info(
+      library, &container->tt_service_get_cmap_info );
+    FT_Init_Class_sfnt_service_sfnt_table(
+      &container->sfnt_service_sfnt_table );
 #ifdef TT_CONFIG_OPTION_BDF
 #ifdef TT_CONFIG_OPTION_BDF
-    FT_Init_Class_sfnt_service_bdf(&container->sfnt_service_bdf);
+    FT_Init_Class_sfnt_service_bdf( &container->sfnt_service_bdf );
 #endif
 #endif
-    FT_Init_Class_sfnt_interface(library, &container->sfnt_interface);
+    FT_Init_Class_sfnt_interface( library, &container->sfnt_interface );
 
 
-Exit:
-    if(error)
-      sfnt_module_class_pic_free(library);
+  Exit:
+    if ( error )
+      sfnt_module_class_pic_free( library );
     return error;
   }
 
     return error;
   }
 
-
-
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
index 6943b42..b09a914 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for sfnt module.     */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for sfnt module.     */
 /*                                                                         */
-/*  Copyright 2009 by                                                      */
+/*  Copyright 2009, 2012 by                                                */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #ifndef __SFNTPIC_H__
 #define __SFNTPIC_H__
 
 #ifndef __SFNTPIC_H__
 #define __SFNTPIC_H__
 
-  
+
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
- #ifndef FT_CONFIG_OPTION_PIC
-#define FT_SFNT_SERVICES_GET             sfnt_services
-#define FT_SFNT_SERVICE_GLYPH_DICT_GET   sfnt_service_glyph_dict
-#define FT_SFNT_SERVICE_PS_NAME_GET      sfnt_service_ps_name
-#define FT_TT_SERVICE_GET_CMAP_INFO_GET  tt_service_get_cmap_info
-#define FT_SFNT_SERVICES_GET             sfnt_services
-#define FT_TT_CMAP_CLASSES_GET           tt_cmap_classes
-#define FT_SFNT_SERVICE_SFNT_TABLE_GET   sfnt_service_sfnt_table
-#define FT_SFNT_SERVICE_BDF_GET          sfnt_service_bdf
-#define FT_SFNT_INTERFACE_GET            sfnt_interface
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define SFNT_SERVICES_GET            sfnt_services
+#define SFNT_SERVICE_GLYPH_DICT_GET  sfnt_service_glyph_dict
+#define SFNT_SERVICE_PS_NAME_GET     sfnt_service_ps_name
+#define TT_SERVICE_CMAP_INFO_GET     tt_service_get_cmap_info
+#define SFNT_SERVICES_GET            sfnt_services
+#define TT_CMAP_CLASSES_GET          tt_cmap_classes
+#define SFNT_SERVICE_SFNT_TABLE_GET  sfnt_service_sfnt_table
+#define SFNT_SERVICE_BDF_GET         sfnt_service_bdf
+#define SFNT_INTERFACE_GET           sfnt_interface
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 
 #else /* FT_CONFIG_OPTION_PIC */
 
-/* some include files required for members of sfntModulePIC */
+  /* some include files required for members of sfntModulePIC */
 #include FT_SERVICE_GLYPH_DICT_H
 #include FT_SERVICE_POSTSCRIPT_NAME_H
 #include FT_SERVICE_SFNT_H
 #include FT_SERVICE_TT_CMAP_H
 #include FT_SERVICE_GLYPH_DICT_H
 #include FT_SERVICE_POSTSCRIPT_NAME_H
 #include FT_SERVICE_SFNT_H
 #include FT_SERVICE_TT_CMAP_H
+
 #ifdef TT_CONFIG_OPTION_BDF
 #include "ttbdf.h"
 #include FT_SERVICE_BDF_H
 #endif
 #ifdef TT_CONFIG_OPTION_BDF
 #include "ttbdf.h"
 #include FT_SERVICE_BDF_H
 #endif
+
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_SFNT_H
 #include "ttcmap.h"
 
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_SFNT_H
 #include "ttcmap.h"
 
-typedef struct sfntModulePIC_
+
+  typedef struct  sfntModulePIC_
   {
   {
-    FT_ServiceDescRec* sfnt_services;
-    FT_Service_GlyphDictRec sfnt_service_glyph_dict;
+    FT_ServiceDescRec*        sfnt_services;
+    FT_Service_GlyphDictRec   sfnt_service_glyph_dict;
     FT_Service_PsFontNameRec  sfnt_service_ps_name;
     FT_Service_PsFontNameRec  sfnt_service_ps_name;
-    FT_Service_TTCMapsRec  tt_service_get_cmap_info;
-    TT_CMap_Class* tt_cmap_classes;
-    FT_Service_SFNT_TableRec sfnt_service_sfnt_table;
+    FT_Service_TTCMapsRec     tt_service_get_cmap_info;
+    TT_CMap_Class*            tt_cmap_classes;
+    FT_Service_SFNT_TableRec  sfnt_service_sfnt_table;
 #ifdef TT_CONFIG_OPTION_BDF
 #ifdef TT_CONFIG_OPTION_BDF
-    FT_Service_BDFRec sfnt_service_bdf;
+    FT_Service_BDFRec         sfnt_service_bdf;
 #endif
 #endif
-    SFNT_Interface sfnt_interface;
+    SFNT_Interface            sfnt_interface;
+
   } sfntModulePIC;
 
   } sfntModulePIC;
 
-#define GET_PIC(lib)                      ((sfntModulePIC*)((lib)->pic_container.sfnt))
-#define FT_SFNT_SERVICES_GET              (GET_PIC(library)->sfnt_services)
-#define FT_SFNT_SERVICE_GLYPH_DICT_GET    (GET_PIC(library)->sfnt_service_glyph_dict)
-#define FT_SFNT_SERVICE_PS_NAME_GET       (GET_PIC(library)->sfnt_service_ps_name)
-#define FT_TT_SERVICE_GET_CMAP_INFO_GET   (GET_PIC(library)->tt_service_get_cmap_info)
-#define FT_SFNT_SERVICES_GET              (GET_PIC(library)->sfnt_services)
-#define FT_TT_CMAP_CLASSES_GET            (GET_PIC(library)->tt_cmap_classes)
-#define FT_SFNT_SERVICE_SFNT_TABLE_GET    (GET_PIC(library)->sfnt_service_sfnt_table)
-#define FT_SFNT_SERVICE_BDF_GET           (GET_PIC(library)->sfnt_service_bdf)
-#define FT_SFNT_INTERFACE_GET             (GET_PIC(library)->sfnt_interface)
+
+#define GET_PIC( lib )                                      \
+          ( (sfntModulePIC*)( (lib)->pic_container.sfnt ) )
+
+#define SFNT_SERVICES_GET                       \
+          ( GET_PIC( library )->sfnt_services )
+#define SFNT_SERVICE_GLYPH_DICT_GET                       \
+          ( GET_PIC( library )->sfnt_service_glyph_dict )
+#define SFNT_SERVICE_PS_NAME_GET                       \
+          ( GET_PIC( library )->sfnt_service_ps_name )
+#define TT_SERVICE_CMAP_INFO_GET                           \
+          ( GET_PIC( library )->tt_service_get_cmap_info )
+#define SFNT_SERVICES_GET                       \
+          ( GET_PIC( library )->sfnt_services )
+#define TT_CMAP_CLASSES_GET                       \
+          ( GET_PIC( library )->tt_cmap_classes )
+#define SFNT_SERVICE_SFNT_TABLE_GET                       \
+          ( GET_PIC( library )->sfnt_service_sfnt_table )
+#define SFNT_SERVICE_BDF_GET                       \
+          ( GET_PIC( library )->sfnt_service_bdf )
+#define SFNT_INTERFACE_GET                       \
+          ( GET_PIC( library )->sfnt_interface )
+
+
+  /* see sfntpic.c for the implementation */
+  void
+  sfnt_module_class_pic_free( FT_Library  library );
+
+  FT_Error
+  sfnt_module_class_pic_init( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
-/* */
+  /* */
 
 FT_END_HEADER
 
 
 FT_END_HEADER
 
index 5a1d003..f975e71 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    SFNT object management (base).                                       */
 /*                                                                         */
 /*                                                                         */
 /*    SFNT object management (base).                                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
+/*  Copyright 1996-2008, 2010-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
     for ( n = 0; n < len; n++ )
     {
       code = FT_NEXT_USHORT( read );
     for ( n = 0; n < len; n++ )
     {
       code = FT_NEXT_USHORT( read );
+
+      if ( code == 0 )
+        break;
+
       if ( code < 32 || code > 127 )
         code = '?';
 
       string[n] = (char)code;
     }
 
       if ( code < 32 || code > 127 )
         code = '?';
 
       string[n] = (char)code;
     }
 
-    string[len] = 0;
+    string[n] = 0;
 
     return string;
   }
 
     return string;
   }
     for ( n = 0; n < len; n++ )
     {
       code = *read++;
     for ( n = 0; n < len; n++ )
     {
       code = *read++;
+
+      if ( code == 0 )
+        break;
+
       if ( code < 32 || code > 127 )
         code = '?';
 
       string[n] = (char)code;
     }
 
       if ( code < 32 || code > 127 )
         code = '?';
 
       string[n] = (char)code;
     }
 
-    string[len] = 0;
+    string[n] = 0;
 
     return string;
   }
 
     return string;
   }
                     FT_String**  name )
   {
     FT_Memory         memory = face->root.memory;
                     FT_String**  name )
   {
     FT_Memory         memory = face->root.memory;
-    FT_Error          error  = SFNT_Err_Ok;
+    FT_Error          error  = FT_Err_Ok;
     FT_String*        result = NULL;
     FT_UShort         n;
     TT_NameEntryRec*  rec;
     FT_String*        result = NULL;
     FT_UShort         n;
     TT_NameEntryRec*  rec;
 
       FT_FRAME_START( 8 ),
         FT_FRAME_LONG( version ),
 
       FT_FRAME_START( 8 ),
         FT_FRAME_LONG( version ),
-        FT_FRAME_LONG( count   ),
+        FT_FRAME_LONG( count   ),  /* this is ULong in the specs */
       FT_FRAME_END
     };
 
       FT_FRAME_END
     };
 
          tag != TTAG_true    &&
          tag != TTAG_typ1    &&
          tag != 0x00020000UL )
          tag != TTAG_true    &&
          tag != TTAG_typ1    &&
          tag != 0x00020000UL )
-      return SFNT_Err_Unknown_File_Format;
+    {
+      FT_TRACE2(( "  not a font using the SFNT container format\n" ));
+      return FT_THROW( Unknown_File_Format );
+    }
 
     face->ttc_header.tag = TTAG_ttcf;
 
 
     face->ttc_header.tag = TTAG_ttcf;
 
       if ( FT_STREAM_READ_FIELDS( ttc_header_fields, &face->ttc_header ) )
         return error;
 
       if ( FT_STREAM_READ_FIELDS( ttc_header_fields, &face->ttc_header ) )
         return error;
 
+      if ( face->ttc_header.count == 0 )
+        return FT_THROW( Invalid_Table );
+
+      /* a rough size estimate: let's conservatively assume that there   */
+      /* is just a single table info in each subfont header (12 + 16*1 = */
+      /* 28 bytes), thus we have (at least) `12 + 4*count' bytes for the */
+      /* size of the TTC header plus `28*count' bytes for all subfont    */
+      /* headers                                                         */
+      if ( (FT_ULong)face->ttc_header.count > stream->size / ( 28 + 4 ) )
+        return FT_THROW( Array_Too_Large );
+
       /* now read the offsets of each font in the file */
       if ( FT_NEW_ARRAY( face->ttc_header.offsets, face->ttc_header.count ) )
         return error;
       /* now read the offsets of each font in the file */
       if ( FT_NEW_ARRAY( face->ttc_header.offsets, face->ttc_header.count ) )
         return error;
     {
       sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
       if ( !sfnt )
     {
       sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
       if ( !sfnt )
-        return SFNT_Err_Invalid_File_Format;
+      {
+        FT_ERROR(( "sfnt_init_face: cannot access `sfnt' module\n" ));
+        return FT_THROW( Missing_Module );
+      }
 
       face->sfnt       = sfnt;
       face->goto_table = sfnt->goto_table;
 
       face->sfnt       = sfnt;
       face->goto_table = sfnt->goto_table;
 
     FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS );
 
 
     FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS );
 
+    FT_TRACE2(( "SFNT driver\n" ));
+
     error = sfnt_open_font( stream, face );
     if ( error )
       return error;
     error = sfnt_open_font( stream, face );
     if ( error )
       return error;
       face_index = 0;
 
     if ( face_index >= face->ttc_header.count )
       face_index = 0;
 
     if ( face_index >= face->ttc_header.count )
-      return SFNT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( FT_STREAM_SEEK( face->ttc_header.offsets[face_index] ) )
       return error;
 
     if ( FT_STREAM_SEEK( face->ttc_header.offsets[face_index] ) )
       return error;
   }
 
 
   }
 
 
-#define LOAD_( x )                                            \
-  do {                                                        \
-    FT_TRACE2(( "`" #x "' " ));                               \
-    FT_TRACE3(( "-->\n" ));                                   \
-                                                              \
-    error = sfnt->load_##x( face, stream );                   \
-                                                              \
-    FT_TRACE2(( "%s\n", ( !error )                            \
-                        ? "loaded"                            \
-                        : ( error == SFNT_Err_Table_Missing ) \
-                          ? "missing"                         \
-                          : "failed to load" ));              \
-    FT_TRACE3(( "\n" ));                                      \
+#define LOAD_( x )                                          \
+  do {                                                      \
+    FT_TRACE2(( "`" #x "' " ));                             \
+    FT_TRACE3(( "-->\n" ));                                 \
+                                                            \
+    error = sfnt->load_ ## x( face, stream );               \
+                                                            \
+    FT_TRACE2(( "%s\n", ( !error )                          \
+                        ? "loaded"                          \
+                        : FT_ERR_EQ( error, Table_Missing ) \
+                          ? "missing"                       \
+                          : "failed to load" ));            \
+    FT_TRACE3(( "\n" ));                                    \
   } while ( 0 )
 
   } while ( 0 )
 
-#define LOADM_( x, vertical )                                 \
-  do {                                                        \
-    FT_TRACE2(( "`%s" #x "' ",                                \
-                vertical ? "vertical " : "" ));               \
-    FT_TRACE3(( "-->\n" ));                                   \
-                                                              \
-    error = sfnt->load_##x( face, stream, vertical );         \
-                                                              \
-    FT_TRACE2(( "%s\n", ( !error )                            \
-                        ? "loaded"                            \
-                        : ( error == SFNT_Err_Table_Missing ) \
-                          ? "missing"                         \
-                          : "failed to load" ));              \
-    FT_TRACE3(( "\n" ));                                      \
+#define LOADM_( x, vertical )                               \
+  do {                                                      \
+    FT_TRACE2(( "`%s" #x "' ",                              \
+                vertical ? "vertical " : "" ));             \
+    FT_TRACE3(( "-->\n" ));                                 \
+                                                            \
+    error = sfnt->load_ ## x( face, stream, vertical );     \
+                                                            \
+    FT_TRACE2(( "%s\n", ( !error )                          \
+                        ? "loaded"                          \
+                        : FT_ERR_EQ( error, Table_Missing ) \
+                          ? "missing"                       \
+                          : "failed to load" ));            \
+    FT_TRACE3(( "\n" ));                                    \
   } while ( 0 )
 
   } while ( 0 )
 
-#define GET_NAME( id, field )                                 \
-  do {                                                        \
-    error = tt_face_get_name( face, TT_NAME_ID_##id, field ); \
-    if ( error )                                              \
-      goto Exit;                                              \
+#define GET_NAME( id, field )                                   \
+  do {                                                          \
+    error = tt_face_get_name( face, TT_NAME_ID_ ## id, field ); \
+    if ( error )                                                \
+      goto Exit;                                                \
   } while ( 0 )
 
 
   } while ( 0 )
 
 
 #endif
     FT_Bool       has_outline;
     FT_Bool       is_apple_sbit;
 #endif
     FT_Bool       has_outline;
     FT_Bool       is_apple_sbit;
-    FT_Bool       ignore_preferred_family = FALSE;
+    FT_Bool       ignore_preferred_family    = FALSE;
     FT_Bool       ignore_preferred_subfamily = FALSE;
 
     SFNT_Service  sfnt = (SFNT_Service)face->sfnt;
 
     FT_UNUSED( face_index );
 
     FT_Bool       ignore_preferred_subfamily = FALSE;
 
     SFNT_Service  sfnt = (SFNT_Service)face->sfnt;
 
     FT_UNUSED( face_index );
 
+
     /* Check parameters */
     /* Check parameters */
-    
+
     {
       FT_Int  i;
 
     {
       FT_Int  i;
 
 
     /* do we have outlines in there? */
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
 
     /* do we have outlines in there? */
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
-    has_outline   = FT_BOOL( face->root.internal->incremental_interface != 0 ||
-                             tt_face_lookup_table( face, TTAG_glyf )    != 0 ||
-                             tt_face_lookup_table( face, TTAG_CFF )     != 0 );
+    has_outline = FT_BOOL( face->root.internal->incremental_interface != 0 ||
+                           tt_face_lookup_table( face, TTAG_glyf )    != 0 ||
+                           tt_face_lookup_table( face, TTAG_CFF )     != 0 );
 #else
 #else
-    has_outline   = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) != 0 ||
-                             tt_face_lookup_table( face, TTAG_CFF )  != 0 );
+    has_outline = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) != 0 ||
+                           tt_face_lookup_table( face, TTAG_CFF )  != 0 );
 #endif
 
     is_apple_sbit = 0;
 #endif
 
     is_apple_sbit = 0;
 
     if ( face->header.Units_Per_EM == 0 )
     {
 
     if ( face->header.Units_Per_EM == 0 )
     {
-      error = SFNT_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
 
       goto Exit;
     }
 
       goto Exit;
     }
       if ( !error )
       {
         LOADM_( hmtx, 0 );
       if ( !error )
       {
         LOADM_( hmtx, 0 );
-        if ( error == SFNT_Err_Table_Missing )
+        if ( FT_ERR_EQ( error, Table_Missing ) )
         {
         {
-          error = SFNT_Err_Hmtx_Table_Missing;
+          error = FT_THROW( Hmtx_Table_Missing );
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
           /* If this is an incrementally loaded font and there are */
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
           /* If this is an incrementally loaded font and there are */
                  get_glyph_metrics                                 )
           {
             face->horizontal.number_Of_HMetrics = 0;
                  get_glyph_metrics                                 )
           {
             face->horizontal.number_Of_HMetrics = 0;
-            error = SFNT_Err_Ok;
+            error                               = FT_Err_Ok;
           }
 #endif
         }
       }
           }
 #endif
         }
       }
-      else if ( error == SFNT_Err_Table_Missing )
+      else if ( FT_ERR_EQ( error, Table_Missing ) )
       {
         /* No `hhea' table necessary for SFNT Mac fonts. */
         if ( face->format_tag == TTAG_true )
         {
           FT_TRACE2(( "This is an SFNT Mac font.\n" ));
       {
         /* No `hhea' table necessary for SFNT Mac fonts. */
         if ( face->format_tag == TTAG_true )
         {
           FT_TRACE2(( "This is an SFNT Mac font.\n" ));
+
           has_outline = 0;
           has_outline = 0;
-          error = SFNT_Err_Ok;
+          error       = FT_Err_Ok;
         }
         else
         {
         }
         else
         {
-          error = SFNT_Err_Horiz_Header_Missing;
+          error = FT_THROW( Horiz_Header_Missing );
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
           /* If this is an incrementally loaded font and there are */
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
           /* If this is an incrementally loaded font and there are */
                  get_glyph_metrics                                 )
           {
             face->horizontal.number_Of_HMetrics = 0;
                  get_glyph_metrics                                 )
           {
             face->horizontal.number_Of_HMetrics = 0;
-            error = SFNT_Err_Ok;
+            error                               = FT_Err_Ok;
           }
 #endif
 
           }
 #endif
 
           face->vertical_info = 1;
       }
 
           face->vertical_info = 1;
       }
 
-      if ( error && error != SFNT_Err_Table_Missing )
+      if ( error && FT_ERR_NEQ( error, Table_Missing ) )
         goto Exit;
 
       LOAD_( os2 );
         goto Exit;
 
       LOAD_( os2 );
         /* a font which contains neither bitmaps nor outlines is */
         /* still valid (although rather useless in most cases);  */
         /* however, you can find such stripped fonts in PDFs     */
         /* a font which contains neither bitmaps nor outlines is */
         /* still valid (although rather useless in most cases);  */
         /* however, you can find such stripped fonts in PDFs     */
-        if ( error == SFNT_Err_Table_Missing )
-          error = SFNT_Err_Ok;
+        if ( FT_ERR_EQ( error, Table_Missing ) )
+          error = FT_Err_Ok;
         else
           goto Exit;
       }
         else
           goto Exit;
       }
     LOAD_( pclt );
     if ( error )
     {
     LOAD_( pclt );
     if ( error )
     {
-      if ( error != SFNT_Err_Table_Missing )
+      if ( FT_ERR_NEQ( error, Table_Missing ) )
         goto Exit;
 
       face->pclt.Version = 0;
         goto Exit;
 
       face->pclt.Version = 0;
                FT_FACE_FLAG_HORIZONTAL;   /* horizontal data   */
 
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
                FT_FACE_FLAG_HORIZONTAL;   /* horizontal data   */
 
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-      if ( psnames_error == SFNT_Err_Ok               &&
+      if ( !psnames_error                             &&
            face->postscript.FormatType != 0x00030000L )
         flags |= FT_FACE_FLAG_GLYPH_NAMES;
 #endif
            face->postscript.FormatType != 0x00030000L )
         flags |= FT_FACE_FLAG_GLYPH_NAMES;
 #endif
         FT_UInt  i, count;
 
 
         FT_UInt  i, count;
 
 
-#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
         count = face->sbit_num_strikes;
         count = face->sbit_num_strikes;
-#else
-        count = (FT_UInt)face->num_sbit_strikes;
-#endif
 
         if ( count > 0 )
         {
 
         if ( count > 0 )
         {
         /*      table cannot be used to compute the text height reliably! */
         /*                                                                */
 
         /*      table cannot be used to compute the text height reliably! */
         /*                                                                */
 
-        /* The ascender/descender/height are computed from the OS/2 table */
-        /* when found.  Otherwise, they're taken from the horizontal      */
-        /* header.                                                        */
-        /*                                                                */
+        /* The ascender and descender are taken from the `hhea' table. */
+        /* If zero, they are taken from the `OS/2' table.              */
 
         root->ascender  = face->horizontal.Ascender;
         root->descender = face->horizontal.Descender;
 
 
         root->ascender  = face->horizontal.Ascender;
         root->descender = face->horizontal.Descender;
 
-        root->height    = (FT_Short)( root->ascender - root->descender +
-                                      face->horizontal.Line_Gap );
-
-#if 0
-        /* if the line_gap is 0, we add an extra 15% to the text height --  */
-        /* this computation is based on various versions of Times New Roman */
-        if ( face->horizontal.Line_Gap == 0 )
-          root->height = (FT_Short)( ( root->height * 115 + 50 ) / 100 );
-#endif /* 0 */
+        root->height = (FT_Short)( root->ascender - root->descender +
+                                   face->horizontal.Line_Gap );
 
 
-#if 0
-        /* some fonts have the OS/2 "sTypoAscender", "sTypoDescender" & */
-        /* "sTypoLineGap" fields set to 0, like ARIALNB.TTF             */
-        if ( face->os2.version != 0xFFFFU && root->ascender )
+        if ( !( root->ascender || root->descender ) )
         {
         {
-          FT_Int  height;
-
+          if ( face->os2.version != 0xFFFFU )
+          {
+            if ( face->os2.sTypoAscender || face->os2.sTypoDescender )
+            {
+              root->ascender  = face->os2.sTypoAscender;
+              root->descender = face->os2.sTypoDescender;
 
 
-          root->ascender  =  face->os2.sTypoAscender;
-          root->descender = -face->os2.sTypoDescender;
+              root->height = (FT_Short)( root->ascender - root->descender +
+                                         face->os2.sTypoLineGap );
+            }
+            else
+            {
+              root->ascender  =  (FT_Short)face->os2.usWinAscent;
+              root->descender = -(FT_Short)face->os2.usWinDescent;
 
 
-          height = root->ascender + root->descender + face->os2.sTypoLineGap;
-          if ( height > root->height )
-            root->height = height;
+              root->height = (FT_UShort)( root->ascender - root->descender );
+            }
+          }
         }
         }
-#endif /* 0 */
 
         root->max_advance_width  = face->horizontal.advance_Width_Max;
         root->max_advance_height = (FT_Short)( face->vertical_info
 
         root->max_advance_width  = face->horizontal.advance_Width_Max;
         root->max_advance_height = (FT_Short)( face->vertical_info
     }
 
     /* freeing the horizontal metrics */
     }
 
     /* freeing the horizontal metrics */
-#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
     {
       FT_Stream  stream = FT_FACE_STREAM( face );
 
     {
       FT_Stream  stream = FT_FACE_STREAM( face );
 
       face->horz_metrics_size = 0;
       face->vert_metrics_size = 0;
     }
       face->horz_metrics_size = 0;
       face->vert_metrics_size = 0;
     }
-#else
-    FT_FREE( face->horizontal.long_metrics );
-    FT_FREE( face->horizontal.short_metrics );
-#endif
 
     /* freeing the vertical ones, if any */
     if ( face->vertical_info )
 
     /* freeing the vertical ones, if any */
     if ( face->vertical_info )
index 18845c3..9401dae 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType and OpenType embedded BDF properties (body).                */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType and OpenType embedded BDF properties (body).                */
 /*                                                                         */
-/*  Copyright 2005, 2006, 2010 by                                          */
+/*  Copyright 2005, 2006, 2010, 2013 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -74,7 +74,7 @@
          length < 8                             ||
          FT_FRAME_EXTRACT( length, bdf->table ) )
     {
          length < 8                             ||
          FT_FRAME_EXTRACT( length, bdf->table ) )
     {
-      error = SFNT_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
       goto Exit;
     }
 
       goto Exit;
     }
 
   BadTable:
     FT_FRAME_RELEASE( bdf->table );
     FT_ZERO( bdf );
   BadTable:
     FT_FRAME_RELEASE( bdf->table );
     FT_ZERO( bdf );
-    error = SFNT_Err_Invalid_Table;
+    error = FT_THROW( Invalid_Table );
     goto Exit;
   }
 
     goto Exit;
   }
 
   {
     TT_BDF     bdf   = &face->bdf;
     FT_Size    size  = FT_FACE(face)->size;
   {
     TT_BDF     bdf   = &face->bdf;
     FT_Size    size  = FT_FACE(face)->size;
-    FT_Error   error = SFNT_Err_Ok;
+    FT_Error   error = FT_Err_Ok;
     FT_Byte*   p;
     FT_UInt    count;
     FT_Byte*   strike;
     FT_Byte*   p;
     FT_UInt    count;
     FT_Byte*   strike;
     p      = bdf->table + 8;
     strike = p + 4 * count;
 
     p      = bdf->table + 8;
     strike = p + 4 * count;
 
-    error = SFNT_Err_Invalid_Argument;
+    error = FT_ERR( Invalid_Argument );
 
     if ( size == NULL || property_name == NULL )
       goto Exit;
 
     if ( size == NULL || property_name == NULL )
       goto Exit;
             {
               aprop->type   = BDF_PROPERTY_TYPE_ATOM;
               aprop->u.atom = (const char*)bdf->strings + value;
             {
               aprop->type   = BDF_PROPERTY_TYPE_ATOM;
               aprop->u.atom = (const char*)bdf->strings + value;
-              error         = SFNT_Err_Ok;
+              error         = FT_Err_Ok;
               goto Exit;
             }
             break;
               goto Exit;
             }
             break;
           case 0x02:
             aprop->type      = BDF_PROPERTY_TYPE_INTEGER;
             aprop->u.integer = (FT_Int32)value;
           case 0x02:
             aprop->type      = BDF_PROPERTY_TYPE_INTEGER;
             aprop->u.integer = (FT_Int32)value;
-            error            = SFNT_Err_Ok;
+            error            = FT_Err_Ok;
             goto Exit;
 
           case 0x03:
             aprop->type       = BDF_PROPERTY_TYPE_CARDINAL;
             aprop->u.cardinal = value;
             goto Exit;
 
           case 0x03:
             aprop->type       = BDF_PROPERTY_TYPE_CARDINAL;
             aprop->u.cardinal = value;
-            error             = SFNT_Err_Ok;
+            error             = FT_Err_Ok;
             goto Exit;
 
           default:
             goto Exit;
 
           default:
index 544750a..1507202 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType character mapping table (cmap) support (body).              */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType character mapping table (cmap) support (body).              */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by      */
+/*  Copyright 2002-2010, 2012, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -56,7 +56,7 @@
                 FT_Byte*  table )
   {
     cmap->data = table;
                 FT_Byte*  table )
   {
     cmap->data = table;
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
       }
     }
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     cmap_info->format   = 0;
     cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
 
     cmap_info->format   = 0;
     cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap0_class_rec,
-      sizeof ( TT_CMapRec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap0_class_rec,
+    sizeof ( TT_CMapRec ),
 
 
-      (FT_CMap_InitFunc)     tt_cmap_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap0_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap0_char_next,
+    (FT_CMap_InitFunc)     tt_cmap_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap0_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap0_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     0,
     0,
-    (TT_CMap_ValidateFunc)   tt_cmap0_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap0_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap0_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap0_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_0 */
 
 
 #endif /* TT_CONFIG_CMAP_FORMAT_0 */
 
       }
     }
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     cmap_info->format   = 2;
     cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
 
     cmap_info->format   = 2;
     cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap2_class_rec,
-      sizeof ( TT_CMapRec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap2_class_rec,
+    sizeof ( TT_CMapRec ),
 
 
-      (FT_CMap_InitFunc)     tt_cmap_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap2_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap2_char_next,
+    (FT_CMap_InitFunc)     tt_cmap_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap2_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap2_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     2,
     2,
-    (TT_CMap_ValidateFunc)   tt_cmap2_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap2_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap2_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap2_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_2 */
 
 
 #endif /* TT_CONFIG_CMAP_FORMAT_2 */
 
     cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;
     cmap->cur_gindex   = 0;
 
     cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;
     cmap->cur_gindex   = 0;
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     FT_UInt   length = TT_NEXT_USHORT( p );
     FT_Byte   *ends, *starts, *offsets, *deltas, *glyph_ids;
     FT_UInt   num_segs;
     FT_UInt   length = TT_NEXT_USHORT( p );
     FT_Byte   *ends, *starts, *offsets, *deltas, *glyph_ids;
     FT_UInt   num_segs;
-    FT_Error  error = SFNT_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( length < 16 )
 
 
     if ( length < 16 )
     cmap_info->format   = 4;
     cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
 
     cmap_info->format   = 4;
     cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap4_class_rec,
-      sizeof ( TT_CMap4Rec ),
-      (FT_CMap_InitFunc)     tt_cmap4_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap4_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap4_char_next,
+  FT_DEFINE_TT_CMAP(
+    tt_cmap4_class_rec,
+    sizeof ( TT_CMap4Rec ),
+    (FT_CMap_InitFunc)     tt_cmap4_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap4_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap4_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     4,
     4,
-    (TT_CMap_ValidateFunc)   tt_cmap4_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap4_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap4_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap4_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_4 */
 
 
 #endif /* TT_CONFIG_CMAP_FORMAT_4 */
 
       }
     }
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     cmap_info->format   = 6;
     cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
 
     cmap_info->format   = 6;
     cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap6_class_rec,
-      sizeof ( TT_CMapRec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap6_class_rec,
+    sizeof ( TT_CMapRec ),
 
 
-      (FT_CMap_InitFunc)     tt_cmap_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap6_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap6_char_next,
+    (FT_CMap_InitFunc)     tt_cmap_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap6_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap6_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     6,
     6,
-    (TT_CMap_ValidateFunc)   tt_cmap6_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap6_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap6_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap6_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_6 */
 
 
 #endif /* TT_CONFIG_CMAP_FORMAT_6 */
 
       }
     }
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     cmap_info->format   = 8;
     cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
 
     cmap_info->format   = 8;
     cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap8_class_rec,
-      sizeof ( TT_CMapRec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap8_class_rec,
+    sizeof ( TT_CMapRec ),
 
 
-      (FT_CMap_InitFunc)     tt_cmap_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap8_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap8_char_next,
+    (FT_CMap_InitFunc)     tt_cmap_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap8_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap8_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     8,
     8,
-    (TT_CMap_ValidateFunc)   tt_cmap8_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap8_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap8_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap8_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_8 */
 
 
 #endif /* TT_CONFIG_CMAP_FORMAT_8 */
 
       }
     }
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     cmap_info->format   = 10;
     cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
 
     cmap_info->format   = 10;
     cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap10_class_rec,
-      sizeof ( TT_CMapRec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap10_class_rec,
+    sizeof ( TT_CMapRec ),
+
+    (FT_CMap_InitFunc)     tt_cmap_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap10_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap10_char_next,
 
 
-      (FT_CMap_InitFunc)     tt_cmap_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap10_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap10_char_next,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     10,
     10,
-    (TT_CMap_ValidateFunc)   tt_cmap10_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap10_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap10_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap10_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_10 */
 
 
 #endif /* TT_CONFIG_CMAP_FORMAT_10 */
 
 
     cmap->valid      = 0;
 
 
     cmap->valid      = 0;
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
       }
     }
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     cmap_info->format   = 12;
     cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
 
     cmap_info->format   = 12;
     cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap12_class_rec,
-      sizeof ( TT_CMap12Rec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap12_class_rec,
+    sizeof ( TT_CMap12Rec ),
+
+    (FT_CMap_InitFunc)     tt_cmap12_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap12_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap12_char_next,
 
 
-      (FT_CMap_InitFunc)     tt_cmap12_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap12_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap12_char_next,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     12,
     12,
-    (TT_CMap_ValidateFunc)   tt_cmap12_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap12_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap12_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap12_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_12 */
 
 
 #endif /* TT_CONFIG_CMAP_FORMAT_12 */
 
 
     cmap->valid      = 0;
 
 
     cmap->valid      = 0;
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   tt_cmap13_validate( FT_Byte*      table,
                       FT_Validator  valid )
   {
   tt_cmap13_validate( FT_Byte*      table,
                       FT_Validator  valid )
   {
-    FT_Byte*   p;
-    FT_ULong   length;
-    FT_ULong   num_groups;
+    FT_Byte*  p;
+    FT_ULong  length;
+    FT_ULong  num_groups;
 
 
     if ( table + 16 > valid->limit )
 
 
     if ( table + 16 > valid->limit )
       }
     }
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
 
       /* if `char_code' is not in any group, then `mid' is */
       /* the group nearest to `char_code'                  */
 
       /* if `char_code' is not in any group, then `mid' is */
       /* the group nearest to `char_code'                  */
-      /*                                                   */
 
       if ( char_code > end )
       {
 
       if ( char_code > end )
       {
     cmap_info->format   = 13;
     cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
 
     cmap_info->format   = 13;
     cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap13_class_rec,
-      sizeof ( TT_CMap13Rec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap13_class_rec,
+    sizeof ( TT_CMap13Rec ),
 
 
-      (FT_CMap_InitFunc)     tt_cmap13_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap13_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap13_char_next,
+    (FT_CMap_InitFunc)     tt_cmap13_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap13_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap13_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     13,
     13,
-    (TT_CMap_ValidateFunc)   tt_cmap13_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap13_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap13_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap13_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_13 */
 
 
 #endif /* TT_CONFIG_CMAP_FORMAT_13 */
 
                     FT_UInt32  num_results,
                     FT_Memory  memory )
   {
                     FT_UInt32  num_results,
                     FT_Memory  memory )
   {
-    FT_UInt32 old_max = cmap->max_results;
-    FT_Error  error   = SFNT_Err_Ok;
+    FT_UInt32  old_max = cmap->max_results;
+    FT_Error   error   = FT_Err_Ok;
 
 
     if ( num_results > cmap->max_results )
 
 
     if ( num_results > cmap->max_results )
     cmap->cmap.data = table;
 
     table               += 6;
     cmap->cmap.data = table;
 
     table               += 6;
-    cmap->num_selectors = FT_PEEK_ULONG( table );
-    cmap->max_results   = 0;
-    cmap->results       = NULL;
+    cmap->num_selectors  = FT_PEEK_ULONG( table );
+    cmap->max_results    = 0;
+    cmap->results        = NULL;
 
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
         {
           FT_Byte*  ndp         = table + nondefOff;
           FT_ULong  numMappings = TT_NEXT_ULONG( ndp );
         {
           FT_Byte*  ndp         = table + nondefOff;
           FT_ULong  numMappings = TT_NEXT_ULONG( ndp );
-          FT_ULong  i, lastUni = 0;
+          FT_ULong  i, lastUni  = 0;
 
 
           if ( numMappings * 4 > (FT_ULong)( valid->limit - ndp ) )
 
 
           if ( numMappings * 4 > (FT_ULong)( valid->limit - ndp ) )
       }
     }
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     /* subtable 14 does not define a language field */
     cmap_info->language = 0xFFFFFFFFUL;
 
     /* subtable 14 does not define a language field */
     cmap_info->language = 0xFFFFFFFFUL;
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   tt_cmap14_char_var_index( TT_CMap    cmap,
                             TT_CMap    ucmap,
                             FT_UInt32  charcode,
   tt_cmap14_char_var_index( TT_CMap    cmap,
                             TT_CMap    ucmap,
                             FT_UInt32  charcode,
-                            FT_UInt32  variantSelector)
+                            FT_UInt32  variantSelector )
   {
     FT_Byte*  p = tt_cmap14_find_variant( cmap->data + 6, variantSelector );
     FT_ULong  defOff;
   {
     FT_Byte*  p = tt_cmap14_find_variant( cmap->data + 6, variantSelector );
     FT_ULong  defOff;
 
 
   static FT_UInt32*
 
 
   static FT_UInt32*
-  tt_cmap14_get_def_chars( TT_CMap     cmap,
-                           FT_Byte*    p,
-                           FT_Memory   memory )
+  tt_cmap14_get_def_chars( TT_CMap    cmap,
+                           FT_Byte*   p,
+                           FT_Memory  memory )
   {
     TT_CMap14   cmap14 = (TT_CMap14) cmap;
     FT_UInt32   numRanges;
   {
     TT_CMap14   cmap14 = (TT_CMap14) cmap;
     FT_UInt32   numRanges;
 
     for ( q = cmap14->results; numRanges > 0; --numRanges )
     {
 
     for ( q = cmap14->results; numRanges > 0; --numRanges )
     {
-      FT_UInt32 uni = (FT_UInt32)TT_NEXT_UINT24( p );
+      FT_UInt32  uni = (FT_UInt32)TT_NEXT_UINT24( p );
 
 
       cnt = FT_NEXT_BYTE( p ) + 1;
 
 
       cnt = FT_NEXT_BYTE( p ) + 1;
         q[0]  = uni;
         uni  += 1;
         q    += 1;
         q[0]  = uni;
         uni  += 1;
         q    += 1;
+
       } while ( --cnt != 0 );
     }
     q[0] = 0;
       } while ( --cnt != 0 );
     }
     q[0] = 0;
   }
 
 
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap14_class_rec,
-      sizeof ( TT_CMap14Rec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap14_class_rec,
+    sizeof ( TT_CMap14Rec ),
 
 
-      (FT_CMap_InitFunc)     tt_cmap14_init,
-      (FT_CMap_DoneFunc)     tt_cmap14_done,
-      (FT_CMap_CharIndexFunc)tt_cmap14_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap14_char_next,
+    (FT_CMap_InitFunc)     tt_cmap14_init,
+    (FT_CMap_DoneFunc)     tt_cmap14_done,
+    (FT_CMap_CharIndexFunc)tt_cmap14_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap14_char_next,
+
+    /* Format 14 extension functions */
+    (FT_CMap_CharVarIndexFunc)    tt_cmap14_char_var_index,
+    (FT_CMap_CharVarIsDefaultFunc)tt_cmap14_char_var_isdefault,
+    (FT_CMap_VariantListFunc)     tt_cmap14_variants,
+    (FT_CMap_CharVariantListFunc) tt_cmap14_char_variants,
+    (FT_CMap_VariantCharListFunc) tt_cmap14_variant_chars,
 
 
-      /* Format 14 extension functions */
-      (FT_CMap_CharVarIndexFunc)    tt_cmap14_char_var_index,
-      (FT_CMap_CharVarIsDefaultFunc)tt_cmap14_char_var_isdefault,
-      (FT_CMap_VariantListFunc)     tt_cmap14_variants,
-      (FT_CMap_CharVariantListFunc) tt_cmap14_char_variants,
-      (FT_CMap_VariantCharListFunc) tt_cmap14_variant_chars
-    ,
     14,
     (TT_CMap_ValidateFunc)tt_cmap14_validate,
     14,
     (TT_CMap_ValidateFunc)tt_cmap14_validate,
-    (TT_CMap_Info_GetFunc)tt_cmap14_get_info
-  )
+    (TT_CMap_Info_GetFunc)tt_cmap14_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_14 */
 
 
 #endif /* TT_CONFIG_CMAP_FORMAT_14 */
 
 
   static const TT_CMap_Class  tt_cmap_classes[] =
   {
 
   static const TT_CMap_Class  tt_cmap_classes[] =
   {
-#define TTCMAPCITEM(a) &a,
+#define TTCMAPCITEM( a )  &a,
 #include "ttcmapc.h"
     NULL,
   };
 
 #else /*FT_CONFIG_OPTION_PIC*/
 
 #include "ttcmapc.h"
     NULL,
   };
 
 #else /*FT_CONFIG_OPTION_PIC*/
 
-  void FT_Destroy_Class_tt_cmap_classes(FT_Library library, TT_CMap_Class* clazz)
+  void
+  FT_Destroy_Class_tt_cmap_classes( FT_Library      library,
+                                    TT_CMap_Class*  clazz )
   {
   {
-    FT_Memory memory = library->memory;
+    FT_Memory  memory = library->memory;
+
+
     if ( clazz )
       FT_FREE( clazz );
   }
 
     if ( clazz )
       FT_FREE( clazz );
   }
 
-  FT_Error FT_Create_Class_tt_cmap_classes(FT_Library library, TT_CMap_Class** output_class)
+
+  FT_Error
+  FT_Create_Class_tt_cmap_classes( FT_Library       library,
+                                   TT_CMap_Class**  output_class )
   {
   {
-    TT_CMap_Class*  clazz;
-    TT_CMap_ClassRec* recs;
-    FT_Error          error;
-    FT_Memory memory = library->memory;
-    int i = 0;
+    TT_CMap_Class*     clazz  = NULL;
+    TT_CMap_ClassRec*  recs;
+    FT_Error           error;
+    FT_Memory          memory = library->memory;
 
 
-#define TTCMAPCITEM(a) i++;
+    int  i = 0;
+
+
+#define TTCMAPCITEM( a ) i++;
 #include "ttcmapc.h"
 
 #include "ttcmapc.h"
 
-    /* allocate enough space for both the pointers +terminator and the class instances */
-    if ( FT_ALLOC( clazz, sizeof(*clazz)*(i+1)+sizeof(TT_CMap_ClassRec)*i ) )
+    /* allocate enough space for both the pointers */
+    /* plus terminator and the class instances     */
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * ( i + 1 ) +
+                          sizeof ( TT_CMap_ClassRec ) * i ) )
       return error;
 
     /* the location of the class instances follows the array of pointers */
       return error;
 
     /* the location of the class instances follows the array of pointers */
-    recs = (TT_CMap_ClassRec*) (((char*)clazz)+(sizeof(*clazz)*(i+1))); 
-    i=0;
+    recs = (TT_CMap_ClassRec*)( (char*)clazz +
+                                sizeof ( *clazz ) * ( i + 1 ) );
+    i    = 0;
 
 #undef TTCMAPCITEM
 
 #undef TTCMAPCITEM
-#define TTCMAPCITEM(a)           \
-    FT_Init_Class_##a(&recs[i]); \
-    clazz[i] = &recs[i];         \
+#define  TTCMAPCITEM( a )             \
+    FT_Init_Class_ ## a( &recs[i] );  \
+    clazz[i] = &recs[i];              \
     i++;
 #include "ttcmapc.h"
 
     clazz[i] = NULL;
 
     *output_class = clazz;
     i++;
 #include "ttcmapc.h"
 
     clazz[i] = NULL;
 
     *output_class = clazz;
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 #endif /*FT_CONFIG_OPTION_PIC*/
   }
 
 #endif /*FT_CONFIG_OPTION_PIC*/
 
 
     if ( !p || p + 4 > limit )
 
 
     if ( !p || p + 4 > limit )
-      return SFNT_Err_Invalid_Table;
+      return FT_THROW( Invalid_Table );
 
     /* only recognize format 0 */
     if ( TT_NEXT_USHORT( p ) != 0 )
 
     /* only recognize format 0 */
     if ( TT_NEXT_USHORT( p ) != 0 )
       FT_ERROR(( "tt_face_build_cmaps:"
                  " unsupported `cmap' table format = %d\n",
                  TT_PEEK_USHORT( p ) ));
       FT_ERROR(( "tt_face_build_cmaps:"
                  " unsupported `cmap' table format = %d\n",
                  TT_PEEK_USHORT( p ) ));
-      return SFNT_Err_Invalid_Table;
+      return FT_THROW( Invalid_Table );
     }
 
     num_cmaps = TT_NEXT_USHORT( p );
     }
 
     num_cmaps = TT_NEXT_USHORT( p );
+
 #ifdef FT_MAX_CHARMAP_CACHEABLE
     if ( num_cmaps > FT_MAX_CHARMAP_CACHEABLE )
 #ifdef FT_MAX_CHARMAP_CACHEABLE
     if ( num_cmaps > FT_MAX_CHARMAP_CACHEABLE )
-      FT_ERROR(( "tt_face_build_cmaps: too many cmap subtables(%d) "
-                 "subtable#%d and later are loaded but cannot be searched\n",
+      FT_ERROR(( "tt_face_build_cmaps: too many cmap subtables (%d)\n"
+                 "                     subtable #%d and higher are loaded"
+                 "                     but cannot be searched\n",
                  num_cmaps, FT_MAX_CHARMAP_CACHEABLE + 1 ));
 #endif
 
                  num_cmaps, FT_MAX_CHARMAP_CACHEABLE + 1 ));
 #endif
 
       {
         FT_Byte* volatile              cmap   = table + offset;
         volatile FT_UInt               format = TT_PEEK_USHORT( cmap );
       {
         FT_Byte* volatile              cmap   = table + offset;
         volatile FT_UInt               format = TT_PEEK_USHORT( cmap );
-        const TT_CMap_Class* volatile  pclazz = FT_TT_CMAP_CLASSES_GET;
+        const TT_CMap_Class* volatile  pclazz = TT_CMAP_CLASSES_GET;
         TT_CMap_Class volatile         clazz;
 
 
         TT_CMap_Class volatile         clazz;
 
 
           if ( clazz->format == format )
           {
             volatile TT_ValidatorRec  valid;
           if ( clazz->format == format )
           {
             volatile TT_ValidatorRec  valid;
-            volatile FT_Error         error = SFNT_Err_Ok;
+            volatile FT_Error         error = FT_Err_Ok;
 
 
             ft_validator_init( FT_VALIDATOR( &valid ), cmap, limit,
 
 
             ft_validator_init( FT_VALIDATOR( &valid ), cmap, limit,
 
             valid.num_glyphs = (FT_UInt)face->max_profile.numGlyphs;
 
 
             valid.num_glyphs = (FT_UInt)face->max_profile.numGlyphs;
 
-            if ( ft_setjmp(
-              *((ft_jmp_buf*)&FT_VALIDATOR( &valid )->jump_buffer) ) == 0 )
+            if ( ft_setjmp( FT_VALIDATOR( &valid )->jump_buffer) == 0 )
             {
               /* validate this cmap sub-table */
               error = clazz->validate( cmap, FT_VALIDATOR( &valid ) );
             {
               /* validate this cmap sub-table */
               error = clazz->validate( cmap, FT_VALIDATOR( &valid ) );
               FT_CMap  ttcmap;
 
 
               FT_CMap  ttcmap;
 
 
-              /* It might make sense to store the single variation selector */
-              /* cmap somewhere special.  But it would have to be in the    */
-              /* public FT_FaceRec, and we can't change that.               */
+              /* It might make sense to store the single variation         */
+              /* selector cmap somewhere special.  But it would have to be */
+              /* in the public FT_FaceRec, and we can't change that.       */
 
               if ( !FT_CMap_New( (FT_CMap_Class)clazz,
                                  cmap, &charmap, &ttcmap ) )
 
               if ( !FT_CMap_New( (FT_CMap_Class)clazz,
                                  cmap, &charmap, &ttcmap ) )
       }
     }
 
       }
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
index 15a4a21..0fde167 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType character mapping table (cmap) support (specification).     */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType character mapping table (cmap) support (specification).     */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005 by                                    */
+/*  Copyright 2002-2005, 2009, 2012 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -55,46 +55,79 @@ FT_BEGIN_HEADER
 
   } TT_CMap_ClassRec;
 
 
   } TT_CMap_ClassRec;
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define FT_DEFINE_TT_CMAP(class_, size_, init_, done_, char_index_,          \
-    char_next_, char_var_index_, char_var_default_, variant_list_,           \
-    charvariant_list_,variantchar_list_,                                     \
-    format_, validate_, get_cmap_info_)                                      \
-  FT_CALLBACK_TABLE_DEF                                                      \
-  const TT_CMap_ClassRec class_ =                                            \
-  {                                                                          \
-    {size_, init_, done_, char_index_,                                       \
-     char_next_, char_var_index_, char_var_default_, variant_list_,          \
-     charvariant_list_, variantchar_list_},                                  \
-    format_, validate_, get_cmap_info_                                       \
+#define FT_DEFINE_TT_CMAP( class_,             \
+                           size_,              \
+                           init_,              \
+                           done_,              \
+                           char_index_,        \
+                           char_next_,         \
+                           char_var_index_,    \
+                           char_var_default_,  \
+                           variant_list_,      \
+                           charvariant_list_,  \
+                           variantchar_list_,  \
+                           format_,            \
+                           validate_,          \
+                           get_cmap_info_ )    \
+  FT_CALLBACK_TABLE_DEF                        \
+  const TT_CMap_ClassRec  class_ =             \
+  {                                            \
+    { size_,                                   \
+      init_,                                   \
+      done_,                                   \
+      char_index_,                             \
+      char_next_,                              \
+      char_var_index_,                         \
+      char_var_default_,                       \
+      variant_list_,                           \
+      charvariant_list_,                       \
+      variantchar_list_                        \
+    },                                         \
+                                               \
+    format_,                                   \
+    validate_,                                 \
+    get_cmap_info_                             \
   };
 
   };
 
-#else /* FT_CONFIG_OPTION_PIC */ 
-
-#define FT_DEFINE_TT_CMAP(class_, size_, init_, done_, char_index_,          \
-    char_next_, char_var_index_, char_var_default_, variant_list_,           \
-    charvariant_list_,variantchar_list_,                                     \
-    format_, validate_, get_cmap_info_)                                      \
-  void                                                                       \
-  FT_Init_Class_##class_( TT_CMap_ClassRec*  clazz )                         \
-  {                                                                          \
-    clazz->clazz.size = size_;                                               \
-    clazz->clazz.init = init_;                                               \
-    clazz->clazz.done = done_;                                               \
-    clazz->clazz.char_index = char_index_;                                   \
-    clazz->clazz.char_next = char_next_;                                     \
-    clazz->clazz.char_var_index = char_var_index_;                           \
-    clazz->clazz.char_var_default = char_var_default_;                       \
-    clazz->clazz.variant_list = variant_list_;                               \
-    clazz->clazz.charvariant_list = charvariant_list_;                       \
-    clazz->clazz.variantchar_list = variantchar_list_;                       \
-    clazz->format = format_;                                                 \
-    clazz->validate = validate_;                                             \
-    clazz->get_cmap_info = get_cmap_info_;                                   \
-  } 
-
-#endif /* FT_CONFIG_OPTION_PIC */ 
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_TT_CMAP( class_,                      \
+                           size_,                       \
+                           init_,                       \
+                           done_,                       \
+                           char_index_,                 \
+                           char_next_,                  \
+                           char_var_index_,             \
+                           char_var_default_,           \
+                           variant_list_,               \
+                           charvariant_list_,           \
+                           variantchar_list_,           \
+                           format_,                     \
+                           validate_,                   \
+                           get_cmap_info_ )             \
+  void                                                  \
+  FT_Init_Class_ ## class_( TT_CMap_ClassRec*  clazz )  \
+  {                                                     \
+    clazz->clazz.size             = size_;              \
+    clazz->clazz.init             = init_;              \
+    clazz->clazz.done             = done_;              \
+    clazz->clazz.char_index       = char_index_;        \
+    clazz->clazz.char_next        = char_next_;         \
+    clazz->clazz.char_var_index   = char_var_index_;    \
+    clazz->clazz.char_var_default = char_var_default_;  \
+    clazz->clazz.variant_list     = variant_list_;      \
+    clazz->clazz.charvariant_list = charvariant_list_;  \
+    clazz->clazz.variantchar_list = variantchar_list_;  \
+    clazz->format                 = format_;            \
+    clazz->validate               = validate_;          \
+    clazz->get_cmap_info          = get_cmap_info_;     \
+  }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
 
   typedef struct  TT_ValidatorRec_
   {
 
   typedef struct  TT_ValidatorRec_
   {
@@ -104,7 +137,7 @@ FT_BEGIN_HEADER
   } TT_ValidatorRec, *TT_Validator;
 
 
   } TT_ValidatorRec, *TT_Validator;
 
 
-#define TT_VALIDATOR( x )          ((TT_Validator)( x ))
+#define TT_VALIDATOR( x )          ( (TT_Validator)( x ) )
 #define TT_VALID_GLYPH_COUNT( x )  TT_VALIDATOR( x )->num_glyphs
 
 
 #define TT_VALID_GLYPH_COUNT( x )  TT_VALIDATOR( x )->num_glyphs
 
 
index 4c9c6a5..2ea2043 100644 (file)
 
 
 #ifdef TT_CONFIG_CMAP_FORMAT_0
 
 
 #ifdef TT_CONFIG_CMAP_FORMAT_0
-    TTCMAPCITEM(tt_cmap0_class_rec)
+  TTCMAPCITEM( tt_cmap0_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_2
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_2
-    TTCMAPCITEM(tt_cmap2_class_rec)
+  TTCMAPCITEM( tt_cmap2_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_4
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_4
-    TTCMAPCITEM(tt_cmap4_class_rec)
+  TTCMAPCITEM( tt_cmap4_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_6
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_6
-    TTCMAPCITEM(tt_cmap6_class_rec)
+  TTCMAPCITEM( tt_cmap6_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_8
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_8
-    TTCMAPCITEM(tt_cmap8_class_rec)
+  TTCMAPCITEM( tt_cmap8_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_10
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_10
-    TTCMAPCITEM(tt_cmap10_class_rec)
+  TTCMAPCITEM( tt_cmap10_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_12
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_12
-    TTCMAPCITEM(tt_cmap12_class_rec)
+  TTCMAPCITEM( tt_cmap12_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_13
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_13
-    TTCMAPCITEM(tt_cmap13_class_rec)
+  TTCMAPCITEM( tt_cmap13_class_rec )
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_14
 #endif
 
 #ifdef TT_CONFIG_CMAP_FORMAT_14
-    TTCMAPCITEM(tt_cmap14_class_rec)
+  TTCMAPCITEM( tt_cmap14_class_rec )
 #endif
 
 #endif
 
+
   /* END */
   /* END */
index 4688898..60ee546 100644 (file)
@@ -61,7 +61,7 @@
     {
       FT_ERROR(( "tt_face_load_kern:"
                  " kerning table is too small - ignored\n" ));
     {
       FT_ERROR(( "tt_face_load_kern:"
                  " kerning table is too small - ignored\n" ));
-      error = SFNT_Err_Table_Missing;
+      error = FT_THROW( Table_Missing );
       goto Exit;
     }
 
       goto Exit;
     }
 
index 20bac73..fbe70f7 100644 (file)
@@ -5,8 +5,7 @@
 /*    Load the basic TrueType tables, i.e., tables that can be either in   */
 /*    TTF or OTF fonts (body).                                             */
 /*                                                                         */
 /*    Load the basic TrueType tables, i.e., tables that can be either in   */
 /*    TTF or OTF fonts (body).                                             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2010, 2012, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
         goto Exit;
     }
     else
         goto Exit;
     }
     else
-      error = SFNT_Err_Table_Missing;
+      error = FT_THROW( Table_Missing );
 
   Exit:
     return error;
 
   Exit:
     return error;
         if ( table.Length < 0x36 )
         {
           FT_TRACE2(( "check_table_dir: `head' table too small\n" ));
         if ( table.Length < 0x36 )
         {
           FT_TRACE2(( "check_table_dir: `head' table too small\n" ));
-          error = SFNT_Err_Table_Missing;
+          error = FT_THROW( Table_Missing );
           goto Exit;
         }
 
           goto Exit;
         }
 
         {
           FT_TRACE2(( "check_table_dir:"
                       " no magic number found in `head' table\n"));
         {
           FT_TRACE2(( "check_table_dir:"
                       " no magic number found in `head' table\n"));
-          error = SFNT_Err_Table_Missing;
+          error = FT_THROW( Table_Missing );
           goto Exit;
         }
 
           goto Exit;
         }
 
     if ( sfnt->num_tables == 0 )
     {
       FT_TRACE2(( "check_table_dir: no tables found\n" ));
     if ( sfnt->num_tables == 0 )
     {
       FT_TRACE2(( "check_table_dir: no tables found\n" ));
-      error = SFNT_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
     /* if `sing' and `meta' tables are present, there is no `head' table */
     if ( has_head || ( has_sing && has_meta ) )
     {
       goto Exit;
     }
 
     /* if `sing' and `meta' tables are present, there is no `head' table */
     if ( has_head || ( has_sing && has_meta ) )
     {
-      error = SFNT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
     else
       goto Exit;
     }
     else
 #else
       FT_TRACE2(( " neither `head' nor `sing' table found\n" ));
 #endif
 #else
       FT_TRACE2(( " neither `head' nor `sing' table found\n" ));
 #endif
-      error = SFNT_Err_Table_Missing;
+      error = FT_THROW( Table_Missing );
     }
 
   Exit:
     }
 
   Exit:
 #if 0
     if ( sfnt.search_range != 1 << ( sfnt.entry_selector + 4 )        ||
          sfnt.search_range + sfnt.range_shift != sfnt.num_tables << 4 )
 #if 0
     if ( sfnt.search_range != 1 << ( sfnt.entry_selector + 4 )        ||
          sfnt.search_range + sfnt.range_shift != sfnt.num_tables << 4 )
-      return SFNT_Err_Unknown_File_Format;
+      return FT_THROW( Unknown_File_Format );
 #endif
 
     /* load the table directory */
 #endif
 
     /* load the table directory */
     FT_TRACE2(( "-- Number of tables: %10u\n",    sfnt.num_tables ));
     FT_TRACE2(( "-- Format version:   0x%08lx\n", sfnt.format_tag ));
 
     FT_TRACE2(( "-- Number of tables: %10u\n",    sfnt.num_tables ));
     FT_TRACE2(( "-- Format version:   0x%08lx\n", sfnt.format_tag ));
 
-    /* check first */
-    error = check_table_dir( &sfnt, stream );
-    if ( error )
+    if ( sfnt.format_tag != TTAG_OTTO )
     {
     {
-      FT_TRACE2(( "tt_face_load_font_dir:"
-                  " invalid table directory for TrueType\n" ));
+      /* check first */
+      error = check_table_dir( &sfnt, stream );
+      if ( error )
+      {
+        FT_TRACE2(( "tt_face_load_font_dir:"
+                    " invalid table directory for TrueType\n" ));
 
 
-      goto Exit;
+        goto Exit;
+      }
     }
 
     face->num_tables = sfnt.num_tables;
     }
 
     face->num_tables = sfnt.num_tables;
       table = tt_face_lookup_table( face, tag );
       if ( !table )
       {
       table = tt_face_lookup_table( face, tag );
       if ( !table )
       {
-        error = SFNT_Err_Table_Missing;
+        error = FT_THROW( Table_Missing );
         goto Exit;
       }
 
         goto Exit;
       }
 
     {
       *length = size;
 
     {
       *length = size;
 
-      return SFNT_Err_Ok;
+      return FT_Err_Ok;
     }
 
     if ( length )
     }
 
     if ( length )
     FT_Error        error;
     TT_MaxProfile*  maxProfile = &face->max_profile;
 
     FT_Error        error;
     TT_MaxProfile*  maxProfile = &face->max_profile;
 
-    const FT_Frame_Field  maxp_fields[] =
+    static const FT_Frame_Field  maxp_fields[] =
     {
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_MaxProfile
     {
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_MaxProfile
       FT_FRAME_END
     };
 
       FT_FRAME_END
     };
 
-    const FT_Frame_Field  maxp_fields_extra[] =
+    static const FT_Frame_Field  maxp_fields_extra[] =
     {
       FT_FRAME_START( 26 ),
         FT_FRAME_USHORT( maxPoints ),
     {
       FT_FRAME_START( 26 ),
         FT_FRAME_USHORT( maxPoints ),
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    tt_face_load_names                                                 */
+  /*    tt_face_load_name                                                  */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Loads the name records.                                            */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Loads the name records.                                            */
     if ( storage_start > storage_limit )
     {
       FT_ERROR(( "tt_face_load_name: invalid `name' table\n" ));
     if ( storage_start > storage_limit )
     {
       FT_ERROR(( "tt_face_load_name: invalid `name' table\n" ));
-      error = SFNT_Err_Name_Table_Missing;
+      error = FT_THROW( Name_Table_Missing );
       goto Exit;
     }
 
       goto Exit;
     }
 
     FT_Error  error;
     TT_OS2*   os2;
 
     FT_Error  error;
     TT_OS2*   os2;
 
-    const FT_Frame_Field  os2_fields[] =
+    static const FT_Frame_Field  os2_fields[] =
     {
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_OS2
     {
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_OS2
       FT_FRAME_END
     };
 
       FT_FRAME_END
     };
 
-    const FT_Frame_Field  os2_fields_extra[] =
+    static const FT_Frame_Field  os2_fields_extra[] =
     {
       FT_FRAME_START( 8 ),
         FT_FRAME_ULONG( ulCodePageRange1 ),
     {
       FT_FRAME_START( 8 ),
         FT_FRAME_ULONG( ulCodePageRange1 ),
       FT_FRAME_END
     };
 
       FT_FRAME_END
     };
 
-    const FT_Frame_Field  os2_fields_extra2[] =
+    static const FT_Frame_Field  os2_fields_extra2[] =
     {
       FT_FRAME_START( 10 ),
         FT_FRAME_SHORT ( sxHeight ),
     {
       FT_FRAME_START( 10 ),
         FT_FRAME_SHORT ( sxHeight ),
     FT_TRACE3(( "isFixedPitch:   %s\n", post->isFixedPitch
                                         ? "  yes" : "   no" ));
 
     FT_TRACE3(( "isFixedPitch:   %s\n", post->isFixedPitch
                                         ? "  yes" : "   no" ));
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     FT_Memory  memory = stream->memory;
 
     FT_UInt        j,num_ranges;
     FT_Memory  memory = stream->memory;
 
     FT_UInt        j,num_ranges;
-    TT_GaspRange   gaspranges;
+    TT_GaspRange   gaspranges = NULL;
 
 
     /* the gasp table is optional */
 
 
     /* the gasp table is optional */
     if ( face->gasp.version >= 2 )
     {
       face->gasp.numRanges = 0;
     if ( face->gasp.version >= 2 )
     {
       face->gasp.numRanges = 0;
-      error = SFNT_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
       goto Exit;
     }
 
     num_ranges = face->gasp.numRanges;
     FT_TRACE3(( "numRanges: %u\n", num_ranges ));
 
       goto Exit;
     }
 
     num_ranges = face->gasp.numRanges;
     FT_TRACE3(( "numRanges: %u\n", num_ranges ));
 
-    if ( FT_QNEW_ARRAY( gaspranges, num_ranges ) ||
-         FT_FRAME_ENTER( num_ranges * 4L )      )
+    if ( FT_QNEW_ARRAY( face->gasp.gaspRanges, num_ranges ) ||
+         FT_FRAME_ENTER( num_ranges * 4L )                  )
       goto Exit;
 
       goto Exit;
 
-    face->gasp.gaspRanges = gaspranges;
+    gaspranges = face->gasp.gaspRanges;
 
     for ( j = 0; j < num_ranges; j++ )
     {
 
     for ( j = 0; j < num_ranges; j++ )
     {
index 53e6ac7..371a9ed 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Load the metrics tables common to TTF and OTF fonts (body).          */
 /*                                                                         */
 /*                                                                         */
 /*    Load the metrics tables common to TTF and OTF fonts (body).          */
 /*                                                                         */
-/*  Copyright 2006, 2007, 2008, 2009 by                                    */
+/*  Copyright 2006-2009, 2011-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #define FT_COMPONENT  trace_ttmtx
 
 
 #define FT_COMPONENT  trace_ttmtx
 
 
-  /*
-   *  Unfortunately, we can't enable our memory optimizations if
-   *  FT_CONFIG_OPTION_OLD_INTERNALS is defined.  This is because at least
-   *  one rogue client (libXfont in the X.Org XServer) is directly accessing
-   *  the metrics.
-   */
-
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -60,8 +53,6 @@
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
-#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
-
   FT_LOCAL_DEF( FT_Error )
   tt_face_load_hmtx( TT_Face    face,
                      FT_Stream  stream,
   FT_LOCAL_DEF( FT_Error )
   tt_face_load_hmtx( TT_Face    face,
                      FT_Stream  stream,
     return error;
   }
 
     return error;
   }
 
-#else /* !FT_CONFIG_OPTION_OLD_INTERNALS */
-
-  FT_LOCAL_DEF( FT_Error )
-  tt_face_load_hmtx( TT_Face    face,
-                     FT_Stream  stream,
-                     FT_Bool    vertical )
-  {
-    FT_Error   error;
-    FT_Memory  memory = stream->memory;
-
-    FT_ULong   table_len;
-    FT_Long    num_shorts, num_longs, num_shorts_checked;
-
-    TT_LongMetrics*    longs;
-    TT_ShortMetrics**  shorts;
-    FT_Byte*           p;
-
-
-    if ( vertical )
-    {
-      void*   lm = &face->vertical.long_metrics;
-      void**  sm = &face->vertical.short_metrics;
-
-
-      error = face->goto_table( face, TTAG_vmtx, stream, &table_len );
-      if ( error )
-        goto Fail;
-
-      num_longs = face->vertical.number_Of_VMetrics;
-      if ( (FT_ULong)num_longs > table_len / 4 )
-        num_longs = (FT_Long)( table_len / 4 );
-
-      face->vertical.number_Of_VMetrics = 0;
-
-      longs  = (TT_LongMetrics*)lm;
-      shorts = (TT_ShortMetrics**)sm;
-    }
-    else
-    {
-      void*   lm = &face->horizontal.long_metrics;
-      void**  sm = &face->horizontal.short_metrics;
-
-
-      error = face->goto_table( face, TTAG_hmtx, stream, &table_len );
-      if ( error )
-        goto Fail;
-
-      num_longs = face->horizontal.number_Of_HMetrics;
-      if ( (FT_ULong)num_longs > table_len / 4 )
-        num_longs = (FT_Long)( table_len / 4 );
-
-      face->horizontal.number_Of_HMetrics = 0;
-
-      longs  = (TT_LongMetrics*)lm;
-      shorts = (TT_ShortMetrics**)sm;
-    }
-
-    /* never trust derived values */
-
-    num_shorts         = face->max_profile.numGlyphs - num_longs;
-    num_shorts_checked = ( table_len - num_longs * 4L ) / 2;
-
-    if ( num_shorts < 0 )
-    {
-      FT_TRACE0(( "tt_face_load_hmtx:"
-                  " %cmtx has more metrics than glyphs.\n",
-                  vertical ? "v" : "h" ));
-
-      /* Adobe simply ignores this problem.  So we shall do the same. */
-#if 0
-      error = vertical ? SFNT_Err_Invalid_Vert_Metrics
-                       : SFNT_Err_Invalid_Horiz_Metrics;
-      goto Exit;
-#else
-      num_shorts = 0;
-#endif
-    }
-
-    if ( FT_QNEW_ARRAY( *longs,  num_longs  ) ||
-         FT_QNEW_ARRAY( *shorts, num_shorts ) )
-      goto Fail;
-
-    if ( FT_FRAME_ENTER( table_len ) )
-      goto Fail;
-
-    p = stream->cursor;
-
-    {
-      TT_LongMetrics  cur   = *longs;
-      TT_LongMetrics  limit = cur + num_longs;
-
-
-      for ( ; cur < limit; cur++ )
-      {
-        cur->advance = FT_NEXT_USHORT( p );
-        cur->bearing = FT_NEXT_SHORT( p );
-      }
-    }
-
-    /* do we have an inconsistent number of metric values? */
-    {
-      TT_ShortMetrics*  cur   = *shorts;
-      TT_ShortMetrics*  limit = cur +
-                                FT_MIN( num_shorts, num_shorts_checked );
-
-
-      for ( ; cur < limit; cur++ )
-        *cur = FT_NEXT_SHORT( p );
-
-      /* We fill up the missing left side bearings with the     */
-      /* last valid value.  Since this will occur for buggy CJK */
-      /* fonts usually only, nothing serious will happen.       */
-      if ( num_shorts > num_shorts_checked && num_shorts_checked > 0 )
-      {
-        FT_Short  val = (*shorts)[num_shorts_checked - 1];
-
-
-        limit = *shorts + num_shorts;
-        for ( ; cur < limit; cur++ )
-          *cur = val;
-      }
-    }
-
-    FT_FRAME_EXIT();
-
-    if ( vertical )
-      face->vertical.number_Of_VMetrics = (FT_UShort)num_longs;
-    else
-      face->horizontal.number_Of_HMetrics = (FT_UShort)num_longs;
-
-  Fail:
-    return error;
-  }
-
-#endif /* !FT_CONFIG_OPTION_OLD_INTERNALS */
-
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
     FT_Error        error;
     TT_HoriHeader*  header;
 
     FT_Error        error;
     TT_HoriHeader*  header;
 
-    const FT_Frame_Field  metrics_header_fields[] =
+    static const FT_Frame_Field  metrics_header_fields[] =
     {
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_HoriHeader
     {
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_HoriHeader
   /*                                                                       */
   /*    advance :: The advance width resp. advance height.                 */
   /*                                                                       */
   /*                                                                       */
   /*    advance :: The advance width resp. advance height.                 */
   /*                                                                       */
-#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
-
   FT_LOCAL_DEF( FT_Error )
   tt_face_get_metrics( TT_Face     face,
                        FT_Bool     vertical,
   FT_LOCAL_DEF( FT_Error )
   tt_face_get_metrics( TT_Face     face,
                        FT_Bool     vertical,
       *aadvance = 0;
     }
 
       *aadvance = 0;
     }
 
-    return SFNT_Err_Ok;
-  }
-
-#else /* !FT_CONFIG_OPTION_OLD_INTERNALS */
-
-  FT_LOCAL_DEF( FT_Error )
-  tt_face_get_metrics( TT_Face     face,
-                       FT_Bool     vertical,
-                       FT_UInt     gindex,
-                       FT_Short*   abearing,
-                       FT_UShort*  aadvance )
-  {
-    void*           v = &face->vertical;
-    void*           h = &face->horizontal;
-    TT_HoriHeader*  header = vertical ? (TT_HoriHeader*)v
-                                      : (TT_HoriHeader*)h;
-    TT_LongMetrics  longs_m;
-    FT_UShort       k = header->number_Of_HMetrics;
-
-
-    if ( k == 0                                         ||
-         !header->long_metrics                          ||
-         gindex >= (FT_UInt)face->max_profile.numGlyphs )
-    {
-      *abearing = *aadvance = 0;
-      return SFNT_Err_Ok;
-    }
-
-    if ( gindex < (FT_UInt)k )
-    {
-      longs_m   = (TT_LongMetrics)header->long_metrics + gindex;
-      *abearing = longs_m->bearing;
-      *aadvance = longs_m->advance;
-    }
-    else
-    {
-      *abearing = ((TT_ShortMetrics*)header->short_metrics)[gindex - k];
-      *aadvance = ((TT_LongMetrics)header->long_metrics)[k - 1].advance;
-    }
-
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
   }
 
-#endif /* !FT_CONFIG_OPTION_OLD_INTERNALS */
-
 
 /* END */
 
 /* END */
index 6f4bb1d..47a85c0 100644 (file)
@@ -5,7 +5,7 @@
 /*    Postcript name table processing for TrueType and OpenType fonts      */
 /*    (body).                                                              */
 /*                                                                         */
 /*    Postcript name table processing for TrueType and OpenType fonts      */
 /*    (body).                                                              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2006, 2007, 2008, 2009, 2010 by       */
+/*  Copyright 1996-2003, 2006-2010, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
     if ( num_glyphs > face->max_profile.numGlyphs )
     {
 
     if ( num_glyphs > face->max_profile.numGlyphs )
     {
-      error = SFNT_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
       table->glyph_indices = glyph_indices;
       table->glyph_names   = name_strings;
     }
       table->glyph_indices = glyph_indices;
       table->glyph_names   = name_strings;
     }
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
 
   Fail1:
     {
 
   Fail1:
     {
     /* check the number of glyphs */
     if ( num_glyphs > face->max_profile.numGlyphs || num_glyphs > 258 )
     {
     /* check the number of glyphs */
     if ( num_glyphs > face->max_profile.numGlyphs || num_glyphs > 258 )
     {
-      error = SFNT_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
         if ( idx < 0 || idx > num_glyphs )
         {
 
         if ( idx < 0 || idx > num_glyphs )
         {
-          error = SFNT_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
       }
           goto Fail;
         }
       }
       table->offsets    = offset_table;
     }
 
       table->offsets    = offset_table;
     }
 
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
 
   Fail:
     FT_FREE( offset_table );
 
   Fail:
     FT_FREE( offset_table );
     else if ( format == 0x00028000L )
       error = load_format_25( face, stream, post_limit );
     else
     else if ( format == 0x00028000L )
       error = load_format_25( face, stream, post_limit );
     else
-      error = SFNT_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
 
     face->postscript_names.loaded = 1;
 
 
     face->postscript_names.loaded = 1;
 
 
 
     if ( !face )
 
 
     if ( !face )
-      return SFNT_Err_Invalid_Face_Handle;
+      return FT_THROW( Invalid_Face_Handle );
 
     if ( idx >= (FT_UInt)face->max_profile.numGlyphs )
 
     if ( idx >= (FT_UInt)face->max_profile.numGlyphs )
-      return SFNT_Err_Invalid_Glyph_Index;
+      return FT_THROW( Invalid_Glyph_Index );
 
 #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
     psnames = (FT_Service_PsCMaps)face->psnames;
     if ( !psnames )
 
 #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
     psnames = (FT_Service_PsCMaps)face->psnames;
     if ( !psnames )
-      return SFNT_Err_Unimplemented_Feature;
+      return FT_THROW( Unimplemented_Feature );
 #endif
 
     names = &face->postscript_names;
 #endif
 
     names = &face->postscript_names;
     /* nothing to do for format == 0x00030000L */
 
   End:
     /* nothing to do for format == 0x00030000L */
 
   End:
-    return SFNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
index faa8f88..cd3e5a4 100644 (file)
@@ -4,10 +4,12 @@
 /*                                                                         */
 /*    TrueType and OpenType embedded bitmap support (body).                */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType and OpenType embedded bitmap support (body).                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 2005-2009, 2013 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
+/*  Copyright 2013 by Google, Inc.                                         */
+/*  Google Author(s): Behdad Esfahbod.                                     */
+/*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*                                                                         */
 /***************************************************************************/
 
 /*                                                                         */
 /***************************************************************************/
 
-#include <ft2build.h>
-#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_STREAM_H
-#include FT_TRUETYPE_TAGS_H
-
-  /*
-   *  Alas, the memory-optimized sbit loader can't be used when implementing
-   *  the `old internals' hack
-   */
-#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
-
-#include "ttsbit0.c"
-
-#else /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
 #include <ft2build.h>
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_TRUETYPE_TAGS_H
 
 #include <ft2build.h>
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_TRUETYPE_TAGS_H
+#include FT_BITMAP_H
 #include "ttsbit.h"
 
 #include "sferrors.h"
 
 #include "ttsbit.h"
 
 #include "sferrors.h"
 
+#include "pngshim.h"
+
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
 #define FT_COMPONENT  trace_ttsbit
 
 
 #define FT_COMPONENT  trace_ttsbit
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    blit_sbit                                                          */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Blits a bitmap from an input stream into a given target.  Supports */
-  /*    x and y offsets as well as byte padded lines.                      */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    target      :: The target bitmap/pixmap.                           */
-  /*                                                                       */
-  /*    source      :: The input packed bitmap data.                       */
-  /*                                                                       */
-  /*    line_bits   :: The number of bits per line.                        */
-  /*                                                                       */
-  /*    byte_padded :: A flag which is true if lines are byte-padded.      */
-  /*                                                                       */
-  /*    x_offset    :: The horizontal offset.                              */
-  /*                                                                       */
-  /*    y_offset    :: The vertical offset.                                */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    IMPORTANT: The x and y offsets are relative to the top corner of   */
-  /*               the target bitmap (unlike the normal TrueType           */
-  /*               convention).  A positive y offset indicates a downwards */
-  /*               direction!                                              */
-  /*                                                                       */
-  static void
-  blit_sbit( FT_Bitmap*  target,
-             FT_Byte*    source,
-             FT_Int      line_bits,
-             FT_Bool     byte_padded,
-             FT_Int      x_offset,
-             FT_Int      y_offset,
-             FT_Int      source_height )
+  FT_LOCAL_DEF( FT_Error )
+  tt_face_load_eblc( TT_Face    face,
+                     FT_Stream  stream )
   {
   {
-    FT_Byte*   line_buff;
-    FT_Int     line_incr;
-    FT_Int     height;
+    FT_Error  error = FT_Err_Ok;
+    FT_Fixed  version;
+    FT_ULong  num_strikes, table_size;
+    FT_Byte*  p;
+    FT_Byte*  p_limit;
+    FT_UInt   count;
 
 
-    FT_UShort  acc;
-    FT_UInt    loaded;
 
 
+    face->sbit_num_strikes = 0;
+
+    /* this table is optional */
+    error = face->goto_table( face, TTAG_CBLC, stream, &table_size );
+    if ( error )
+      error = face->goto_table( face, TTAG_EBLC, stream, &table_size );
+    if ( error )
+      error = face->goto_table( face, TTAG_bloc, stream, &table_size );
+    if ( error )
+      goto Exit;
 
 
-    /* first of all, compute starting write position */
-    line_incr = target->pitch;
-    line_buff = target->buffer;
+    if ( table_size < 8 )
+    {
+      FT_ERROR(( "tt_face_load_sbit_strikes: table too short\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
+    }
 
 
-    if ( line_incr < 0 )
-      line_buff -= line_incr * ( target->rows - 1 );
+    if ( FT_FRAME_EXTRACT( table_size, face->sbit_table ) )
+      goto Exit;
 
 
-    line_buff += ( x_offset >> 3 ) + y_offset * line_incr;
+    face->sbit_table_size = table_size;
 
 
-    /***********************************************************************/
-    /*                                                                     */
-    /* We use the extra-classic `accumulator' trick to extract the bits    */
-    /* from the source byte stream.                                        */
-    /*                                                                     */
-    /* Namely, the variable `acc' is a 16-bit accumulator containing the   */
-    /* last `loaded' bits from the input stream.  The bits are shifted to  */
-    /* the upmost position in `acc'.                                       */
-    /*                                                                     */
-    /***********************************************************************/
+    p       = face->sbit_table;
+    p_limit = p + table_size;
 
 
-    acc    = 0;  /* clear accumulator   */
-    loaded = 0;  /* no bits were loaded */
+    version     = FT_NEXT_ULONG( p );
+    num_strikes = FT_NEXT_ULONG( p );
 
 
-    for ( height = source_height; height > 0; height-- )
+    if ( version != 0x00020000UL || num_strikes >= 0x10000UL )
     {
     {
-      FT_Byte*  cur   = line_buff;        /* current write cursor          */
-      FT_Int    count = line_bits;        /* # of bits to extract per line */
-      FT_Byte   shift = (FT_Byte)( x_offset & 7 ); /* current write shift  */
-      FT_Byte   space = (FT_Byte)( 8 - shift );
-
+      FT_ERROR(( "tt_face_load_sbit_strikes: invalid table version\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Fail;
+    }
 
 
-      /* first of all, read individual source bytes */
-      if ( count >= 8 )
-      {
-        count -= 8;
-        {
-          do
-          {
-            FT_Byte  val;
-
-
-            /* ensure that there are at least 8 bits in the accumulator */
-            if ( loaded < 8 )
-            {
-              acc    |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded ));
-              loaded += 8;
-            }
-
-            /* now write one byte */
-            val = (FT_Byte)( acc >> 8 );
-            if ( shift )
-            {
-              cur[0] |= (FT_Byte)( val >> shift );
-              cur[1] |= (FT_Byte)( val << space );
-            }
-            else
-              cur[0] |= val;
-
-            cur++;
-            acc   <<= 8;  /* remove bits from accumulator */
-            loaded -= 8;
-            count  -= 8;
-
-          } while ( count >= 0 );
-        }
+    /*
+     *  Count the number of strikes available in the table.  We are a bit
+     *  paranoid there and don't trust the data.
+     */
+    count = (FT_UInt)num_strikes;
+    if ( 8 + 48UL * count > table_size )
+      count = (FT_UInt)( ( p_limit - p ) / 48 );
 
 
-        /* restore `count' to correct value */
-        count += 8;
-      }
+    face->sbit_num_strikes = count;
 
 
-      /* now write remaining bits (count < 8) */
-      if ( count > 0 )
-      {
-        FT_Byte  val;
+    FT_TRACE3(( "sbit_num_strikes: %u\n", count ));
+  Exit:
+    return error;
 
 
+  Fail:
+    FT_FRAME_RELEASE( face->sbit_table );
+    face->sbit_table_size = 0;
+    goto Exit;
+  }
 
 
-        /* ensure that there are at least `count' bits in the accumulator */
-        if ( (FT_Int)loaded < count )
-        {
-          acc    |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded ));
-          loaded += 8;
-        }
 
 
-        /* now write remaining bits */
-        val     = (FT_Byte)( ( (FT_Byte)( acc >> 8 ) ) & ~( 0xFF >> count ) );
-        cur[0] |= (FT_Byte)( val >> shift );
+  FT_LOCAL_DEF( void )
+  tt_face_free_eblc( TT_Face  face )
+  {
+    FT_Stream  stream = face->root.stream;
 
 
-        if ( count > space )
-          cur[1] |= (FT_Byte)( val << space );
 
 
-        acc   <<= count;
-        loaded -= count;
-      }
+    FT_FRAME_RELEASE( face->sbit_table );
+    face->sbit_table_size  = 0;
+    face->sbit_num_strikes = 0;
+  }
 
 
-      /* now, skip to next line */
-      if ( byte_padded )
-      {
-        acc    = 0;
-        loaded = 0;   /* clear accumulator on byte-padded lines */
-      }
 
 
-      line_buff += line_incr;
-    }
+  FT_LOCAL_DEF( FT_Error )
+  tt_face_set_sbit_strike( TT_Face          face,
+                           FT_Size_Request  req,
+                           FT_ULong*        astrike_index )
+  {
+    return FT_Match_Size( (FT_Face)face, req, 0, astrike_index );
   }
 
 
   }
 
 
-  static const FT_Frame_Field  sbit_metrics_fields[] =
+  FT_LOCAL_DEF( FT_Error )
+  tt_face_load_strike_metrics( TT_Face           face,
+                               FT_ULong          strike_index,
+                               FT_Size_Metrics*  metrics )
   {
   {
-#undef  FT_STRUCTURE
-#define FT_STRUCTURE  TT_SBit_MetricsRec
+    FT_Byte*  strike;
 
 
-    FT_FRAME_START( 8 ),
-      FT_FRAME_BYTE( height ),
-      FT_FRAME_BYTE( width ),
 
 
-      FT_FRAME_CHAR( horiBearingX ),
-      FT_FRAME_CHAR( horiBearingY ),
-      FT_FRAME_BYTE( horiAdvance ),
+    if ( strike_index >= (FT_ULong)face->sbit_num_strikes )
+      return FT_THROW( Invalid_Argument );
 
 
-      FT_FRAME_CHAR( vertBearingX ),
-      FT_FRAME_CHAR( vertBearingY ),
-      FT_FRAME_BYTE( vertAdvance ),
-    FT_FRAME_END
-  };
+    strike = face->sbit_table + 8 + strike_index * 48;
 
 
+    metrics->x_ppem = (FT_UShort)strike[44];
+    metrics->y_ppem = (FT_UShort)strike[45];
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    Load_SBit_Const_Metrics                                            */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads the metrics for `EBLC' index tables format 2 and 5.          */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    range  :: The target range.                                        */
-  /*                                                                       */
-  /*    stream :: The input stream.                                        */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  static FT_Error
-  Load_SBit_Const_Metrics( TT_SBit_Range  range,
-                           FT_Stream      stream )
+    metrics->ascender  = (FT_Char)strike[16] << 6;  /* hori.ascender  */
+    metrics->descender = (FT_Char)strike[17] << 6;  /* hori.descender */
+    metrics->height    = metrics->ascender - metrics->descender;
+
+    /* XXX: Is this correct? */
+    metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB  */
+                                      strike[18] + /* max_width      */
+                             (FT_Char)strike[23]   /* min_advance_SB */
+                                                 ) << 6;
+
+    return FT_Err_Ok;
+  }
+
+
+  typedef struct  TT_SBitDecoderRec_
   {
   {
-    FT_Error  error;
+    TT_Face          face;
+    FT_Stream        stream;
+    FT_Bitmap*       bitmap;
+    TT_SBit_Metrics  metrics;
+    FT_Bool          metrics_loaded;
+    FT_Bool          bitmap_allocated;
+    FT_Byte          bit_depth;
 
 
+    FT_ULong         ebdt_start;
+    FT_ULong         ebdt_size;
 
 
-    if ( FT_READ_ULONG( range->image_size ) )
-      return error;
+    FT_ULong         strike_index_array;
+    FT_ULong         strike_index_count;
+    FT_Byte*         eblc_base;
+    FT_Byte*         eblc_limit;
 
 
-    return FT_STREAM_READ_FIELDS( sbit_metrics_fields, &range->metrics );
-  }
+  } TT_SBitDecoderRec, *TT_SBitDecoder;
 
 
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    Load_SBit_Range_Codes                                              */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads the range codes for `EBLC' index tables format 4 and 5.      */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    range        :: The target range.                                  */
-  /*                                                                       */
-  /*    stream       :: The input stream.                                  */
-  /*                                                                       */
-  /*    load_offsets :: A flag whether to load the glyph offset table.     */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
   static FT_Error
   static FT_Error
-  Load_SBit_Range_Codes( TT_SBit_Range  range,
-                         FT_Stream      stream,
-                         FT_Bool        load_offsets )
+  tt_sbit_decoder_init( TT_SBitDecoder       decoder,
+                        TT_Face              face,
+                        FT_ULong             strike_index,
+                        TT_SBit_MetricsRec*  metrics )
   {
     FT_Error   error;
   {
     FT_Error   error;
-    FT_ULong   count, n, size;
-    FT_Memory  memory = stream->memory;
+    FT_Stream  stream = face->root.stream;
+    FT_ULong   ebdt_size;
 
 
 
 
-    if ( FT_READ_ULONG( count ) )
+    error = face->goto_table( face, TTAG_CBDT, stream, &ebdt_size );
+    if ( error )
+      error = face->goto_table( face, TTAG_EBDT, stream, &ebdt_size );
+    if ( error )
+      error = face->goto_table( face, TTAG_bdat, stream, &ebdt_size );
+    if ( error )
       goto Exit;
 
       goto Exit;
 
-    range->num_glyphs = count;
+    decoder->face    = face;
+    decoder->stream  = stream;
+    decoder->bitmap  = &face->root.glyph->bitmap;
+    decoder->metrics = metrics;
 
 
-    /* Allocate glyph offsets table if needed */
-    if ( load_offsets )
-    {
-      if ( FT_NEW_ARRAY( range->glyph_offsets, count ) )
-        goto Exit;
+    decoder->metrics_loaded   = 0;
+    decoder->bitmap_allocated = 0;
 
 
-      size = count * 4L;
-    }
-    else
-      size = count * 2L;
+    decoder->ebdt_start = FT_STREAM_POS();
+    decoder->ebdt_size  = ebdt_size;
 
 
-    /* Allocate glyph codes table and access frame */
-    if ( FT_NEW_ARRAY ( range->glyph_codes, count ) ||
-         FT_FRAME_ENTER( size )                     )
-      goto Exit;
+    decoder->eblc_base  = face->sbit_table;
+    decoder->eblc_limit = face->sbit_table + face->sbit_table_size;
 
 
-    for ( n = 0; n < count; n++ )
+    /* now find the strike corresponding to the index */
     {
     {
-      range->glyph_codes[n] = FT_GET_USHORT();
+      FT_Byte*  p;
 
 
-      if ( load_offsets )
-        range->glyph_offsets[n] = (FT_ULong)range->image_offset +
-                                  FT_GET_USHORT();
-    }
 
 
-    FT_FRAME_EXIT();
+      if ( 8 + 48 * strike_index + 3 * 4 + 34 + 1 > face->sbit_table_size )
+      {
+        error = FT_THROW( Invalid_File_Format );
+        goto Exit;
+      }
+
+      p = decoder->eblc_base + 8 + 48 * strike_index;
+
+      decoder->strike_index_array = FT_NEXT_ULONG( p );
+      p                          += 4;
+      decoder->strike_index_count = FT_NEXT_ULONG( p );
+      p                          += 34;
+      decoder->bit_depth          = *p;
+
+      if ( decoder->strike_index_array > face->sbit_table_size             ||
+           decoder->strike_index_array + 8 * decoder->strike_index_count >
+             face->sbit_table_size                                         )
+        error = FT_THROW( Invalid_File_Format );
+    }
 
   Exit:
     return error;
   }
 
 
 
   Exit:
     return error;
   }
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    Load_SBit_Range                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads a given `EBLC' index/range table.                            */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    range  :: The target range.                                        */
-  /*                                                                       */
-  /*    stream :: The input stream.                                        */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  static FT_Error
-  Load_SBit_Range( TT_SBit_Range  range,
-                   FT_Stream      stream )
+  static void
+  tt_sbit_decoder_done( TT_SBitDecoder  decoder )
   {
   {
-    FT_Error   error;
-    FT_Memory  memory = stream->memory;
-
-
-    switch( range->index_format )
-    {
-    case 1:   /* variable metrics with 4-byte offsets */
-    case 3:   /* variable metrics with 2-byte offsets */
-      {
-        FT_ULong  num_glyphs, n;
-        FT_Int    size_elem;
-        FT_Bool   large = FT_BOOL( range->index_format == 1 );
+    FT_UNUSED( decoder );
+  }
 
 
 
 
+  static FT_Error
+  tt_sbit_decoder_alloc_bitmap( TT_SBitDecoder  decoder,
+                                FT_UInt         load_flags )
+  {
+    FT_Error    error = FT_Err_Ok;
+    FT_UInt     width, height;
+    FT_Bitmap*  map = decoder->bitmap;
+    FT_Long     size;
 
 
-        if ( range->last_glyph < range->first_glyph )
-        {
-          error = SFNT_Err_Invalid_File_Format;
-          goto Exit;
-        }
 
 
-        num_glyphs        = range->last_glyph - range->first_glyph + 1L;
-        range->num_glyphs = num_glyphs;
-        num_glyphs++;                       /* XXX: BEWARE - see spec */
+    if ( !decoder->metrics_loaded )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
 
 
-        size_elem = large ? 4 : 2;
+    width  = decoder->metrics->width;
+    height = decoder->metrics->height;
 
 
-        if ( FT_NEW_ARRAY( range->glyph_offsets, num_glyphs ) ||
-             FT_FRAME_ENTER( num_glyphs * size_elem )         )
-          goto Exit;
+    map->width = (int)width;
+    map->rows  = (int)height;
 
 
-        for ( n = 0; n < num_glyphs; n++ )
-          range->glyph_offsets[n] = (FT_ULong)( range->image_offset +
-                                                ( large ? FT_GET_ULONG()
-                                                        : FT_GET_USHORT() ) );
-        FT_FRAME_EXIT();
-      }
+    switch ( decoder->bit_depth )
+    {
+    case 1:
+      map->pixel_mode = FT_PIXEL_MODE_MONO;
+      map->pitch      = ( map->width + 7 ) >> 3;
+      map->num_grays  = 2;
       break;
 
       break;
 
-    case 2:   /* all glyphs have identical metrics */
-      error = Load_SBit_Const_Metrics( range, stream );
+    case 2:
+      map->pixel_mode = FT_PIXEL_MODE_GRAY2;
+      map->pitch      = ( map->width + 3 ) >> 2;
+      map->num_grays  = 4;
       break;
 
     case 4:
       break;
 
     case 4:
-      error = Load_SBit_Range_Codes( range, stream, 1 );
+      map->pixel_mode = FT_PIXEL_MODE_GRAY4;
+      map->pitch      = ( map->width + 1 ) >> 1;
+      map->num_grays  = 16;
+      break;
+
+    case 8:
+      map->pixel_mode = FT_PIXEL_MODE_GRAY;
+      map->pitch      = map->width;
+      map->num_grays  = 256;
       break;
 
       break;
 
-    case 5:
-      error = Load_SBit_Const_Metrics( range, stream );
-      if ( !error )
-        error = Load_SBit_Range_Codes( range, stream, 0 );
+    case 32:
+      if ( load_flags & FT_LOAD_COLOR )
+      {
+        map->pixel_mode = FT_PIXEL_MODE_BGRA;
+        map->pitch      = map->width * 4;
+        map->num_grays  = 256;
+      }
+      else
+      {
+        map->pixel_mode = FT_PIXEL_MODE_GRAY;
+        map->pitch      = map->width;
+        map->num_grays  = 256;
+      }
       break;
 
     default:
       break;
 
     default:
-      error = SFNT_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
     }
 
     }
 
+    size = map->rows * map->pitch;
+
+    /* check that there is no empty image */
+    if ( size == 0 )
+      goto Exit;     /* exit successfully! */
+
+    error = ft_glyphslot_alloc_bitmap( decoder->face->root.glyph, size );
+    if ( error )
+      goto Exit;
+
+    decoder->bitmap_allocated = 1;
+
   Exit:
     return error;
   }
 
 
   Exit:
     return error;
   }
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    tt_face_load_eblc                                                  */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads the table of embedded bitmap sizes for this face.            */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face   :: The target face object.                                  */
-  /*                                                                       */
-  /*    stream :: The input stream.                                        */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  FT_LOCAL_DEF( FT_Error )
-  tt_face_load_eblc( TT_Face    face,
-                     FT_Stream  stream )
+  static FT_Error
+  tt_sbit_decoder_load_metrics( TT_SBitDecoder  decoder,
+                                FT_Byte*       *pp,
+                                FT_Byte*        limit,
+                                FT_Bool         big )
   {
   {
-    FT_Error   error  = SFNT_Err_Ok;
-    FT_Memory  memory = stream->memory;
-    FT_Fixed   version;
-    FT_ULong   num_strikes;
-    FT_ULong   table_base;
+    FT_Byte*         p       = *pp;
+    TT_SBit_Metrics  metrics = decoder->metrics;
 
 
-    static const FT_Frame_Field  sbit_line_metrics_fields[] =
-    {
-#undef  FT_STRUCTURE
-#define FT_STRUCTURE  TT_SBit_LineMetricsRec
-
-      /* no FT_FRAME_START */
-        FT_FRAME_CHAR( ascender ),
-        FT_FRAME_CHAR( descender ),
-        FT_FRAME_BYTE( max_width ),
-
-        FT_FRAME_CHAR( caret_slope_numerator ),
-        FT_FRAME_CHAR( caret_slope_denominator ),
-        FT_FRAME_CHAR( caret_offset ),
-
-        FT_FRAME_CHAR( min_origin_SB ),
-        FT_FRAME_CHAR( min_advance_SB ),
-        FT_FRAME_CHAR( max_before_BL ),
-        FT_FRAME_CHAR( min_after_BL ),
-        FT_FRAME_CHAR( pads[0] ),
-        FT_FRAME_CHAR( pads[1] ),
-      FT_FRAME_END
-    };
-
-    static const FT_Frame_Field  strike_start_fields[] =
-    {
-#undef  FT_STRUCTURE
-#define FT_STRUCTURE  TT_SBit_StrikeRec
-
-      /* no FT_FRAME_START */
-        FT_FRAME_ULONG( ranges_offset ),
-        FT_FRAME_SKIP_LONG,
-        FT_FRAME_ULONG( num_ranges ),
-        FT_FRAME_ULONG( color_ref ),
-      FT_FRAME_END
-    };
-
-    static const FT_Frame_Field  strike_end_fields[] =
+
+    if ( p + 5 > limit )
+      goto Fail;
+
+    metrics->height       = p[0];
+    metrics->width        = p[1];
+    metrics->horiBearingX = (FT_Char)p[2];
+    metrics->horiBearingY = (FT_Char)p[3];
+    metrics->horiAdvance  = p[4];
+
+    p += 5;
+    if ( big )
     {
     {
-      /* no FT_FRAME_START */
-        FT_FRAME_USHORT( start_glyph ),
-        FT_FRAME_USHORT( end_glyph ),
-        FT_FRAME_BYTE  ( x_ppem ),
-        FT_FRAME_BYTE  ( y_ppem ),
-        FT_FRAME_BYTE  ( bit_depth ),
-        FT_FRAME_CHAR  ( flags ),
-      FT_FRAME_END
-    };
+      if ( p + 3 > limit )
+        goto Fail;
 
 
+      metrics->vertBearingX = (FT_Char)p[0];
+      metrics->vertBearingY = (FT_Char)p[1];
+      metrics->vertAdvance  = p[2];
 
 
-    face->num_sbit_strikes = 0;
+      p += 3;
+    }
 
 
-    /* this table is optional */
-    error = face->goto_table( face, TTAG_EBLC, stream, 0 );
-    if ( error )
-      error = face->goto_table( face, TTAG_bloc, stream, 0 );
-    if ( error )
-      goto Exit;
+    decoder->metrics_loaded = 1;
+    *pp = p;
+    return FT_Err_Ok;
 
 
-    table_base = FT_STREAM_POS();
-    if ( FT_FRAME_ENTER( 8L ) )
-      goto Exit;
+  Fail:
+    FT_TRACE1(( "tt_sbit_decoder_load_metrics: broken table" ));
+    return FT_THROW( Invalid_Argument );
+  }
 
 
-    version     = FT_GET_LONG();
-    num_strikes = FT_GET_ULONG();
 
 
-    FT_FRAME_EXIT();
+  /* forward declaration */
+  static FT_Error
+  tt_sbit_decoder_load_image( TT_SBitDecoder  decoder,
+                              FT_UInt         load_flags,
+                              FT_UInt         glyph_index,
+                              FT_Int          x_pos,
+                              FT_Int          y_pos );
 
 
-    /* check version number and strike count */
-    if ( version     != 0x00020000L ||
-         num_strikes >= 0x10000L    )
-    {
-      FT_ERROR(( "tt_face_load_sbit_strikes: invalid table version\n" ));
-      error = SFNT_Err_Invalid_File_Format;
+  typedef FT_Error  (*TT_SBitDecoder_LoadFunc)( TT_SBitDecoder  decoder,
+                                                FT_UInt         load_flags,
+                                                FT_Byte*        p,
+                                                FT_Byte*        plimit,
+                                                FT_Int          x_pos,
+                                                FT_Int          y_pos );
 
 
-      goto Exit;
-    }
 
 
-    /* allocate the strikes table */
-    if ( FT_NEW_ARRAY( face->sbit_strikes, num_strikes ) )
-      goto Exit;
+  static FT_Error
+  tt_sbit_decoder_load_byte_aligned( TT_SBitDecoder  decoder,
+                                     FT_UInt         load_flags,
+                                     FT_Byte*        p,
+                                     FT_Byte*        limit,
+                                     FT_Int          x_pos,
+                                     FT_Int          y_pos )
+  {
+    FT_Error    error = FT_Err_Ok;
+    FT_Byte*    line;
+    FT_Int      bit_height, bit_width, pitch, width, height, line_bits, h;
+    FT_Bitmap*  bitmap;
 
 
-    face->num_sbit_strikes = num_strikes;
+    FT_UNUSED( load_flags );
 
 
-    /* now read each strike table separately */
-    {
-      TT_SBit_Strike  strike = face->sbit_strikes;
-      FT_ULong        count  = num_strikes;
 
 
+    /* check that we can write the glyph into the bitmap */
+    bitmap     = decoder->bitmap;
+    bit_width  = bitmap->width;
+    bit_height = bitmap->rows;
+    pitch      = bitmap->pitch;
+    line       = bitmap->buffer;
 
 
-      if ( FT_FRAME_ENTER( 48L * num_strikes ) )
-        goto Exit;
+    width  = decoder->metrics->width;
+    height = decoder->metrics->height;
 
 
-      while ( count > 0 )
-      {
-        if ( FT_STREAM_READ_FIELDS( strike_start_fields, strike )             ||
-             FT_STREAM_READ_FIELDS( sbit_line_metrics_fields, &strike->hori ) ||
-             FT_STREAM_READ_FIELDS( sbit_line_metrics_fields, &strike->vert ) ||
-             FT_STREAM_READ_FIELDS( strike_end_fields, strike )               )
-          break;
-
-        count--;
-        strike++;
-      }
+    line_bits = width * decoder->bit_depth;
 
 
-      FT_FRAME_EXIT();
+    if ( x_pos < 0 || x_pos + width > bit_width   ||
+         y_pos < 0 || y_pos + height > bit_height )
+    {
+      FT_TRACE1(( "tt_sbit_decoder_load_byte_aligned:"
+                  " invalid bitmap dimensions\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
     }
 
     }
 
-    /* allocate the index ranges for each strike table */
+    if ( p + ( ( line_bits + 7 ) >> 3 ) * height > limit )
     {
     {
-      TT_SBit_Strike  strike = face->sbit_strikes;
-      FT_ULong        count  = num_strikes;
+      FT_TRACE1(( "tt_sbit_decoder_load_byte_aligned: broken bitmap\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
+    }
 
 
+    /* now do the blit */
+    line  += y_pos * pitch + ( x_pos >> 3 );
+    x_pos &= 7;
 
 
-      while ( count > 0 )
+    if ( x_pos == 0 )  /* the easy one */
+    {
+      for ( h = height; h > 0; h--, line += pitch )
       {
       {
-        TT_SBit_Range  range;
-        FT_ULong       count2 = strike->num_ranges;
-
+        FT_Byte*  pwrite = line;
+        FT_Int    w;
 
 
-        /* read each range */
-        if ( FT_STREAM_SEEK( table_base + strike->ranges_offset ) ||
-             FT_FRAME_ENTER( strike->num_ranges * 8L )            )
-          goto Exit;
 
 
-        if ( FT_NEW_ARRAY( strike->sbit_ranges, strike->num_ranges ) )
-          goto Exit;
-
-        range = strike->sbit_ranges;
-        while ( count2 > 0 )
+        for ( w = line_bits; w >= 8; w -= 8 )
         {
         {
-          range->first_glyph  = FT_GET_USHORT();
-          range->last_glyph   = FT_GET_USHORT();
-          range->table_offset = table_base + strike->ranges_offset +
-                                  FT_GET_ULONG();
-          count2--;
-          range++;
+          pwrite[0] = (FT_Byte)( pwrite[0] | *p++ );
+          pwrite   += 1;
         }
 
         }
 
-        FT_FRAME_EXIT();
+        if ( w > 0 )
+          pwrite[0] = (FT_Byte)( pwrite[0] | ( *p++ & ( 0xFF00U >> w ) ) );
+      }
+    }
+    else  /* x_pos > 0 */
+    {
+      for ( h = height; h > 0; h--, line += pitch )
+      {
+        FT_Byte*  pwrite = line;
+        FT_Int    w;
+        FT_UInt   wval = 0;
+
 
 
-        /* Now, read each index table */
-        count2 = strike->num_ranges;
-        range  = strike->sbit_ranges;
-        while ( count2 > 0 )
+        for ( w = line_bits; w >= 8; w -= 8 )
         {
         {
-          /* Read the header */
-          if ( FT_STREAM_SEEK( range->table_offset ) ||
-               FT_FRAME_ENTER( 8L )                  )
-            goto Exit;
+          wval       = (FT_UInt)( wval | *p++ );
+          pwrite[0]  = (FT_Byte)( pwrite[0] | ( wval >> x_pos ) );
+          pwrite    += 1;
+          wval     <<= 8;
+        }
 
 
-          range->index_format = FT_GET_USHORT();
-          range->image_format = FT_GET_USHORT();
-          range->image_offset = FT_GET_ULONG();
+        if ( w > 0 )
+          wval = (FT_UInt)( wval | ( *p++ & ( 0xFF00U >> w ) ) );
 
 
-          FT_FRAME_EXIT();
+        /* all bits read and there are `x_pos + w' bits to be written */
 
 
-          error = Load_SBit_Range( range, stream );
-          if ( error )
-            goto Exit;
+        pwrite[0] = (FT_Byte)( pwrite[0] | ( wval >> x_pos ) );
 
 
-          count2--;
-          range++;
+        if ( x_pos + w > 8 )
+        {
+          pwrite++;
+          wval     <<= 8;
+          pwrite[0]  = (FT_Byte)( pwrite[0] | ( wval >> x_pos ) );
         }
         }
-
-        count--;
-        strike++;
       }
     }
 
   Exit:
       }
     }
 
   Exit:
+    if ( !error )
+      FT_TRACE3(( "tt_sbit_decoder_load_byte_aligned: loaded\n" ));
     return error;
   }
 
 
     return error;
   }
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    tt_face_free_eblc                                                  */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Releases the embedded bitmap tables.                               */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face :: The target face object.                                    */
-  /*                                                                       */
-  FT_LOCAL_DEF( void )
-  tt_face_free_eblc( TT_Face  face )
+  /*
+   * Load a bit-aligned bitmap (with pointer `p') into a line-aligned bitmap
+   * (with pointer `pwrite').  In the example below, the width is 3 pixel,
+   * and `x_pos' is 1 pixel.
+   *
+   *       p                               p+1
+   *     |                               |                               |
+   *     | 7   6   5   4   3   2   1   0 | 7   6   5   4   3   2   1   0 |...
+   *     |                               |                               |
+   *       +-------+   +-------+   +-------+ ...
+   *           .           .           .
+   *           .           .           .
+   *           v           .           .
+   *       +-------+       .           .
+   * |                               | .
+   * | 7   6   5   4   3   2   1   0 | .
+   * |                               | .
+   *   pwrite              .           .
+   *                       .           .
+   *                       v           .
+   *                   +-------+       .
+   *             |                               |
+   *             | 7   6   5   4   3   2   1   0 |
+   *             |                               |
+   *               pwrite+1            .
+   *                                   .
+   *                                   v
+   *                               +-------+
+   *                         |                               |
+   *                         | 7   6   5   4   3   2   1   0 |
+   *                         |                               |
+   *                           pwrite+2
+   *
+   */
+
+  static FT_Error
+  tt_sbit_decoder_load_bit_aligned( TT_SBitDecoder  decoder,
+                                    FT_UInt         load_flags,
+                                    FT_Byte*        p,
+                                    FT_Byte*        limit,
+                                    FT_Int          x_pos,
+                                    FT_Int          y_pos )
   {
   {
-    FT_Memory       memory       = face->root.memory;
-    TT_SBit_Strike  strike       = face->sbit_strikes;
-    TT_SBit_Strike  strike_limit = strike + face->num_sbit_strikes;
+    FT_Error    error = FT_Err_Ok;
+    FT_Byte*    line;
+    FT_Int      bit_height, bit_width, pitch, width, height, line_bits, h, nbits;
+    FT_Bitmap*  bitmap;
+    FT_UShort   rval;
 
 
+    FT_UNUSED( load_flags );
 
 
-    if ( strike )
-    {
-      for ( ; strike < strike_limit; strike++ )
-      {
-        TT_SBit_Range  range       = strike->sbit_ranges;
-        TT_SBit_Range  range_limit = range + strike->num_ranges;
 
 
+    /* check that we can write the glyph into the bitmap */
+    bitmap     = decoder->bitmap;
+    bit_width  = bitmap->width;
+    bit_height = bitmap->rows;
+    pitch      = bitmap->pitch;
+    line       = bitmap->buffer;
 
 
-        if ( range )
-        {
-          for ( ; range < range_limit; range++ )
-          {
-            /* release the glyph offsets and codes tables */
-            /* where appropriate                          */
-            FT_FREE( range->glyph_offsets );
-            FT_FREE( range->glyph_codes );
-          }
-        }
-        FT_FREE( strike->sbit_ranges );
-        strike->num_ranges = 0;
-      }
-      FT_FREE( face->sbit_strikes );
+    width  = decoder->metrics->width;
+    height = decoder->metrics->height;
+
+    line_bits = width * decoder->bit_depth;
+
+    if ( x_pos < 0 || x_pos + width  > bit_width  ||
+         y_pos < 0 || y_pos + height > bit_height )
+    {
+      FT_TRACE1(( "tt_sbit_decoder_load_bit_aligned:"
+                  " invalid bitmap dimensions\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
     }
     }
-    face->num_sbit_strikes = 0;
-  }
 
 
+    if ( p + ( ( line_bits * height + 7 ) >> 3 ) > limit )
+    {
+      FT_TRACE1(( "tt_sbit_decoder_load_bit_aligned: broken bitmap\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
+    }
 
 
-  FT_LOCAL_DEF( FT_Error )
-  tt_face_set_sbit_strike( TT_Face          face,
-                           FT_Size_Request  req,
-                           FT_ULong*        astrike_index )
-  {
-    return FT_Match_Size( (FT_Face)face, req, 0, astrike_index );
-  }
+    /* now do the blit */
 
 
+    /* adjust `line' to point to the first byte of the bitmap */
+    line  += y_pos * pitch + ( x_pos >> 3 );
+    x_pos &= 7;
 
 
-  FT_LOCAL_DEF( FT_Error )
-  tt_face_load_strike_metrics( TT_Face           face,
-                               FT_ULong          strike_index,
-                               FT_Size_Metrics*  metrics )
-  {
-    TT_SBit_Strike  strike;
+    /* the higher byte of `rval' is used as a buffer */
+    rval  = 0;
+    nbits = 0;
 
 
+    for ( h = height; h > 0; h--, line += pitch )
+    {
+      FT_Byte*  pwrite = line;
+      FT_Int    w      = line_bits;
 
 
-    if ( strike_index >= face->num_sbit_strikes )
-      return SFNT_Err_Invalid_Argument;
 
 
-    strike = face->sbit_strikes + strike_index;
+      /* handle initial byte (in target bitmap) specially if necessary */
+      if ( x_pos )
+      {
+        w = ( line_bits < 8 - x_pos ) ? line_bits : 8 - x_pos;
 
 
-    metrics->x_ppem = strike->x_ppem;
-    metrics->y_ppem = strike->y_ppem;
+        if ( h == height )
+        {
+          rval  = *p++;
+          nbits = x_pos;
+        }
+        else if ( nbits < w )
+        {
+          if ( p < limit )
+            rval |= *p++;
+          nbits += 8 - w;
+        }
+        else
+        {
+          rval  >>= 8;
+          nbits  -= w;
+        }
 
 
-    metrics->ascender  = strike->hori.ascender << 6;
-    metrics->descender = strike->hori.descender << 6;
+        *pwrite++ |= ( ( rval >> nbits ) & 0xFF ) &
+                     ( ~( 0xFF << w ) << ( 8 - w - x_pos ) );
+        rval     <<= 8;
 
 
-    /* XXX: Is this correct? */
-    metrics->max_advance = ( strike->hori.min_origin_SB  +
-                             strike->hori.max_width      +
-                             strike->hori.min_advance_SB ) << 6;
+        w = line_bits - w;
+      }
 
 
-    metrics->height = metrics->ascender - metrics->descender;
+      /* handle medial bytes */
+      for ( ; w >= 8; w -= 8 )
+      {
+        rval      |= *p++;
+        *pwrite++ |= ( rval >> nbits ) & 0xFF;
 
 
-    return SFNT_Err_Ok;
-  }
+        rval <<= 8;
+      }
+
+      /* handle final byte if necessary */
+      if ( w > 0 )
+      {
+        if ( nbits < w )
+        {
+          if ( p < limit )
+            rval |= *p++;
+          *pwrite |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w );
+          nbits   += 8 - w;
+
+          rval <<= 8;
+        }
+        else
+        {
+          *pwrite |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w );
+          nbits   -= w;
+        }
+      }
+    }
+
+  Exit:
+    if ( !error )
+      FT_TRACE3(( "tt_sbit_decoder_load_bit_aligned: loaded\n" ));
+    return error;
+  }
 
 
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    find_sbit_range                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Scans a given strike's ranges and return, for a given glyph        */
-  /*    index, the corresponding sbit range, and `EBDT' offset.            */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    glyph_index   :: The glyph index.                                  */
-  /*                                                                       */
-  /*    strike        :: The source/current sbit strike.                   */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    arange        :: The sbit range containing the glyph index.        */
-  /*                                                                       */
-  /*    aglyph_offset :: The offset of the glyph data in `EBDT' table.     */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means the glyph index was found.           */
-  /*                                                                       */
   static FT_Error
   static FT_Error
-  find_sbit_range( FT_UInt          glyph_index,
-                   TT_SBit_Strike   strike,
-                   TT_SBit_Range   *arange,
-                   FT_ULong        *aglyph_offset )
+  tt_sbit_decoder_load_compound( TT_SBitDecoder  decoder,
+                                 FT_UInt         load_flags,
+                                 FT_Byte*        p,
+                                 FT_Byte*        limit,
+                                 FT_Int          x_pos,
+                                 FT_Int          y_pos )
   {
   {
-    TT_SBit_RangeRec  *range, *range_limit;
+    FT_Error  error = FT_Err_Ok;
+    FT_UInt   num_components, nn;
 
 
+    FT_Char  horiBearingX = decoder->metrics->horiBearingX;
+    FT_Char  horiBearingY = decoder->metrics->horiBearingY;
+    FT_Byte  horiAdvance  = decoder->metrics->horiAdvance;
+    FT_Char  vertBearingX = decoder->metrics->vertBearingX;
+    FT_Char  vertBearingY = decoder->metrics->vertBearingY;
+    FT_Byte  vertAdvance  = decoder->metrics->vertAdvance;
 
 
-    /* check whether the glyph index is within this strike's */
-    /* glyph range                                           */
-    if ( glyph_index < (FT_UInt)strike->start_glyph ||
-         glyph_index > (FT_UInt)strike->end_glyph   )
-      goto Fail;
 
 
-    /* scan all ranges in strike */
-    range       = strike->sbit_ranges;
-    range_limit = range + strike->num_ranges;
-    if ( !range )
+    if ( p + 2 > limit )
       goto Fail;
 
       goto Fail;
 
-    for ( ; range < range_limit; range++ )
+    num_components = FT_NEXT_USHORT( p );
+    if ( p + 4 * num_components > limit )
     {
     {
-      if ( glyph_index >= (FT_UInt)range->first_glyph &&
-           glyph_index <= (FT_UInt)range->last_glyph  )
-      {
-        FT_UShort  delta = (FT_UShort)( glyph_index - range->first_glyph );
+      FT_TRACE1(( "tt_sbit_decoder_load_compound: broken table\n" ));
+      goto Fail;
+    }
 
 
+    FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %d components\n",
+                num_components ));
 
 
-        switch ( range->index_format )
-        {
-        case 1:
-        case 3:
-          *aglyph_offset = range->glyph_offsets[delta];
-          break;
-
-        case 2:
-          *aglyph_offset = range->image_offset +
-                           range->image_size * delta;
-          break;
-
-        case 4:
-        case 5:
-          {
-            FT_ULong  n;
-
-
-            for ( n = 0; n < range->num_glyphs; n++ )
-            {
-              if ( (FT_UInt)range->glyph_codes[n] == glyph_index )
-              {
-                if ( range->index_format == 4 )
-                  *aglyph_offset = range->glyph_offsets[n];
-                else
-                  *aglyph_offset = range->image_offset +
-                                   n * range->image_size;
-                goto Found;
-              }
-            }
-          }
+    for ( nn = 0; nn < num_components; nn++ )
+    {
+      FT_UInt  gindex = FT_NEXT_USHORT( p );
+      FT_Byte  dx     = FT_NEXT_BYTE( p );
+      FT_Byte  dy     = FT_NEXT_BYTE( p );
 
 
-        /* fall-through */
-        default:
-          goto Fail;
-        }
 
 
-      Found:
-        /* return successfully! */
-        *arange  = range;
-        return SFNT_Err_Ok;
-      }
+      /* NB: a recursive call */
+      error = tt_sbit_decoder_load_image( decoder, load_flags, gindex,
+                                          x_pos + dx, y_pos + dy );
+      if ( error )
+        break;
     }
 
     }
 
-  Fail:
-    *arange        = 0;
-    *aglyph_offset = 0;
+    FT_TRACE3(( "tt_sbit_decoder_load_compound: done\n" ));
 
 
-    return SFNT_Err_Invalid_Argument;
-  }
+    decoder->metrics->horiBearingX = horiBearingX;
+    decoder->metrics->horiBearingY = horiBearingY;
+    decoder->metrics->horiAdvance  = horiAdvance;
+    decoder->metrics->vertBearingX = vertBearingX;
+    decoder->metrics->vertBearingY = vertBearingY;
+    decoder->metrics->vertAdvance  = vertAdvance;
+    decoder->metrics->width        = (FT_Byte)decoder->bitmap->width;
+    decoder->metrics->height       = (FT_Byte)decoder->bitmap->rows;
 
 
+  Exit:
+    return error;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    tt_find_sbit_image                                                 */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Checks whether an embedded bitmap (an `sbit') exists for a given   */
-  /*    glyph, at a given strike.                                          */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face          :: The target face object.                           */
-  /*                                                                       */
-  /*    glyph_index   :: The glyph index.                                  */
-  /*                                                                       */
-  /*    strike_index  :: The current strike index.                         */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    arange        :: The SBit range containing the glyph index.        */
-  /*                                                                       */
-  /*    astrike       :: The SBit strike containing the glyph index.       */
-  /*                                                                       */
-  /*    aglyph_offset :: The offset of the glyph data in `EBDT' table.     */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.  Returns                    */
-  /*    SFNT_Err_Invalid_Argument if no sbit exists for the requested      */
-  /*    glyph.                                                             */
-  /*                                                                       */
-  FT_LOCAL( FT_Error )
-  tt_find_sbit_image( TT_Face          face,
-                      FT_UInt          glyph_index,
-                      FT_ULong         strike_index,
-                      TT_SBit_Range   *arange,
-                      TT_SBit_Strike  *astrike,
-                      FT_ULong        *aglyph_offset )
-  {
-    FT_Error        error;
-    TT_SBit_Strike  strike;
+  Fail:
+    error = FT_THROW( Invalid_File_Format );
+    goto Exit;
+  }
 
 
 
 
-    if ( !face->sbit_strikes                        ||
-         ( face->num_sbit_strikes <= strike_index ) )
-      goto Fail;
+#ifdef FT_CONFIG_OPTION_USE_PNG
 
 
-    strike = &face->sbit_strikes[strike_index];
+  static FT_Error
+  tt_sbit_decoder_load_png( TT_SBitDecoder  decoder,
+                            FT_UInt         load_flags,
+                            FT_Byte*        p,
+                            FT_Byte*        limit,
+                            FT_Int          x_pos,
+                            FT_Int          y_pos )
+  {
+    FT_Error  error = FT_Err_Ok;
+    FT_ULong  png_len;
 
 
-    error = find_sbit_range( glyph_index, strike,
-                             arange, aglyph_offset );
-    if ( error )
-      goto Fail;
+    FT_UNUSED( load_flags );
 
 
-    *astrike = strike;
 
 
-    return SFNT_Err_Ok;
+    if ( limit - p < 4 )
+    {
+      FT_TRACE1(( "tt_sbit_decoder_load_png: broken bitmap\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
+    }
 
 
-  Fail:
-    /* no embedded bitmap for this glyph in face */
-    *arange        = 0;
-    *astrike       = 0;
-    *aglyph_offset = 0;
+    png_len = FT_NEXT_ULONG( p );
+    if ( (FT_ULong)( limit - p ) < png_len )
+    {
+      FT_TRACE1(( "tt_sbit_decoder_load_png: broken bitmap\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Exit;
+    }
+
+    error = Load_SBit_Png( decoder->bitmap,
+                           x_pos,
+                           y_pos,
+                           decoder->bit_depth,
+                           decoder->metrics,
+                           decoder->stream->memory,
+                           p,
+                           png_len );
 
 
-    return SFNT_Err_Invalid_Argument;
+  Exit:
+    if ( !error )
+      FT_TRACE3(( "tt_sbit_decoder_load_png: loaded\n" ));
+    return error;
   }
 
   }
 
+#endif /* FT_CONFIG_OPTION_USE_PNG */
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    tt_load_sbit_metrics                                               */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Gets the big metrics for a given SBit.                             */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    stream      :: The input stream.                                   */
-  /*                                                                       */
-  /*    range       :: The SBit range containing the glyph.                */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    big_metrics :: A big SBit metrics structure for the glyph.         */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    The stream cursor must be positioned at the glyph's offset within  */
-  /*    the `EBDT' table before the call.                                  */
-  /*                                                                       */
-  /*    If the image format uses variable metrics, the stream cursor is    */
-  /*    positioned just after the metrics header in the `EBDT' table on    */
-  /*    function exit.                                                     */
-  /*                                                                       */
-  FT_LOCAL( FT_Error )
-  tt_load_sbit_metrics( FT_Stream        stream,
-                        TT_SBit_Range    range,
-                        TT_SBit_Metrics  metrics )
+
+  static FT_Error
+  tt_sbit_decoder_load_bitmap( TT_SBitDecoder  decoder,
+                               FT_UInt         load_flags,
+                               FT_UInt         glyph_format,
+                               FT_ULong        glyph_start,
+                               FT_ULong        glyph_size,
+                               FT_Int          x_pos,
+                               FT_Int          y_pos )
   {
   {
-    FT_Error  error = SFNT_Err_Ok;
+    FT_Error   error;
+    FT_Stream  stream = decoder->stream;
+    FT_Byte*   p;
+    FT_Byte*   p_limit;
+    FT_Byte*   data;
 
 
 
 
-    switch ( range->image_format )
+    /* seek into the EBDT table now */
+    if ( glyph_start + glyph_size > decoder->ebdt_size )
+    {
+      error = FT_THROW( Invalid_Argument );
+      goto Exit;
+    }
+
+    if ( FT_STREAM_SEEK( decoder->ebdt_start + glyph_start ) ||
+         FT_FRAME_EXTRACT( glyph_size, data )                )
+      goto Exit;
+
+    p       = data;
+    p_limit = p + glyph_size;
+
+    /* read the data, depending on the glyph format */
+    switch ( glyph_format )
     {
     case 1:
     case 2:
     case 8:
     {
     case 1:
     case 2:
     case 8:
-      /* variable small metrics */
-      {
-        TT_SBit_SmallMetricsRec  smetrics;
-
-        static const FT_Frame_Field  sbit_small_metrics_fields[] =
-        {
-#undef  FT_STRUCTURE
-#define FT_STRUCTURE  TT_SBit_SmallMetricsRec
-
-          FT_FRAME_START( 5 ),
-            FT_FRAME_BYTE( height ),
-            FT_FRAME_BYTE( width ),
-            FT_FRAME_CHAR( bearingX ),
-            FT_FRAME_CHAR( bearingY ),
-            FT_FRAME_BYTE( advance ),
-          FT_FRAME_END
-        };
-
-
-        /* read small metrics */
-        if ( FT_STREAM_READ_FIELDS( sbit_small_metrics_fields, &smetrics ) )
-          goto Exit;
-
-        /* convert it to a big metrics */
-        metrics->height       = smetrics.height;
-        metrics->width        = smetrics.width;
-        metrics->horiBearingX = smetrics.bearingX;
-        metrics->horiBearingY = smetrics.bearingY;
-        metrics->horiAdvance  = smetrics.advance;
-
-        /* these metrics are made up at a higher level when */
-        /* needed.                                          */
-        metrics->vertBearingX = 0;
-        metrics->vertBearingY = 0;
-        metrics->vertAdvance  = 0;
-      }
+    case 17:
+      error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 0 );
       break;
 
     case 6:
     case 7:
     case 9:
       break;
 
     case 6:
     case 7:
     case 9:
-      /* variable big metrics */
-      if ( FT_STREAM_READ_FIELDS( sbit_metrics_fields, metrics ) )
-        goto Exit;
+    case 18:
+      error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 );
       break;
 
       break;
 
-    case 5:
-    default:  /* constant metrics */
-      if ( range->index_format == 2 || range->index_format == 5 )
-        *metrics = range->metrics;
-      else
-        return SFNT_Err_Invalid_File_Format;
-   }
-
-  Exit:
-    return error;
-  }
+    default:
+      error = FT_Err_Ok;
+    }
 
 
+    if ( error )
+      goto Fail;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    crop_bitmap                                                        */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Crops a bitmap to its tightest bounding box, and adjusts its       */
-  /*    metrics.                                                           */
-  /*                                                                       */
-  /* <InOut>                                                               */
-  /*    map     :: The bitmap.                                             */
-  /*                                                                       */
-  /*    metrics :: The corresponding metrics structure.                    */
-  /*                                                                       */
-  static void
-  crop_bitmap( FT_Bitmap*       map,
-               TT_SBit_Metrics  metrics )
-  {
-    /***********************************************************************/
-    /*                                                                     */
-    /* In this situation, some bounding boxes of embedded bitmaps are too  */
-    /* large.  We need to crop it to a reasonable size.                    */
-    /*                                                                     */
-    /*      ---------                                                      */
-    /*      |       |                -----                                 */
-    /*      |  ***  |                |***|                                 */
-    /*      |   *   |                | * |                                 */
-    /*      |   *   |    ------>     | * |                                 */
-    /*      |   *   |                | * |                                 */
-    /*      |   *   |                | * |                                 */
-    /*      |  ***  |                |***|                                 */
-    /*      ---------                -----                                 */
-    /*                                                                     */
-    /***********************************************************************/
-
-    FT_Int    rows, count;
-    FT_Long   line_len;
-    FT_Byte*  line;
-
-
-    /***********************************************************************/
-    /*                                                                     */
-    /* first of all, check the top-most lines of the bitmap, and remove    */
-    /* them if they're empty.                                              */
-    /*                                                                     */
     {
     {
-      line     = (FT_Byte*)map->buffer;
-      rows     = map->rows;
-      line_len = map->pitch;
+      TT_SBitDecoder_LoadFunc  loader;
 
 
 
 
-      for ( count = 0; count < rows; count++ )
+      switch ( glyph_format )
       {
       {
-        FT_Byte*  cur   = line;
-        FT_Byte*  limit = line + line_len;
-
-
-        for ( ; cur < limit; cur++ )
-          if ( cur[0] )
-            goto Found_Top;
+      case 1:
+      case 6:
+        loader = tt_sbit_decoder_load_byte_aligned;
+        break;
 
 
-        /* the current line was empty - skip to next one */
-        line  = limit;
-      }
+      case 2:
+      case 5:
+      case 7:
+        loader = tt_sbit_decoder_load_bit_aligned;
+        break;
 
 
-    Found_Top:
-      /* check that we have at least one filled line */
-      if ( count >= rows )
-        goto Empty_Bitmap;
+      case 8:
+        if ( p + 1 > p_limit )
+          goto Fail;
 
 
-      /* now, crop the empty upper lines */
-      if ( count > 0 )
-      {
-        line = (FT_Byte*)map->buffer;
+        p += 1;  /* skip padding */
+        /* fall-through */
 
 
-        FT_MEM_MOVE( line, line + count * line_len,
-                     ( rows - count ) * line_len );
+      case 9:
+        loader = tt_sbit_decoder_load_compound;
+        break;
 
 
-        metrics->height       = (FT_Byte)( metrics->height - count );
-        metrics->horiBearingY = (FT_Char)( metrics->horiBearingY - count );
-        metrics->vertBearingY = (FT_Char)( metrics->vertBearingY - count );
+#ifdef FT_CONFIG_OPTION_USE_PNG
+      case 17: /* small metrics, PNG image data   */
+      case 18: /* big metrics, PNG image data     */
+      case 19: /* metrics in EBLC, PNG image data */
+        loader = tt_sbit_decoder_load_png;
+        break;
+#endif /* FT_CONFIG_OPTION_USE_PNG */
 
 
-        map->rows -= count;
-        rows      -= count;
+      default:
+        error = FT_THROW( Invalid_Table );
+        goto Fail;
       }
       }
-    }
 
 
-    /***********************************************************************/
-    /*                                                                     */
-    /* second, crop the lower lines                                        */
-    /*                                                                     */
-    {
-      line = (FT_Byte*)map->buffer + ( rows - 1 ) * line_len;
-
-      for ( count = 0; count < rows; count++ )
+      if ( !decoder->bitmap_allocated )
       {
       {
-        FT_Byte*  cur   = line;
-        FT_Byte*  limit = line + line_len;
-
-
-        for ( ; cur < limit; cur++ )
-          if ( cur[0] )
-            goto Found_Bottom;
-
-        /* the current line was empty - skip to previous one */
-        line -= line_len;
+        error = tt_sbit_decoder_alloc_bitmap( decoder, load_flags );
+        if ( error )
+          goto Fail;
       }
 
       }
 
-    Found_Bottom:
-      if ( count > 0 )
+      if ( decoder->bit_depth == 32                          &&
+           decoder->bitmap->pixel_mode != FT_PIXEL_MODE_BGRA )
       {
       {
-        metrics->height  = (FT_Byte)( metrics->height - count );
-        rows            -= count;
-        map->rows       -= count;
-      }
-    }
-
-    /***********************************************************************/
-    /*                                                                     */
-    /* third, get rid of the space on the left side of the glyph           */
-    /*                                                                     */
-    do
-    {
-      FT_Byte*  limit;
+        /* Flatten color bitmaps if color was not requested. */
 
 
+        FT_Library library = decoder->face->root.glyph->library;
+        FT_Memory  memory  = decoder->stream->memory;
 
 
-      line  = (FT_Byte*)map->buffer;
-      limit = line + rows * line_len;
+        FT_Bitmap color, *orig;
 
 
-      for ( ; line < limit; line += line_len )
-        if ( line[0] & 0x80 )
-          goto Found_Left;
 
 
-      /* shift the whole glyph one pixel to the left */
-      line  = (FT_Byte*)map->buffer;
-      limit = line + rows * line_len;
-
-      for ( ; line < limit; line += line_len )
-      {
-        FT_Int    n, width = map->width;
-        FT_Byte   old;
-        FT_Byte*  cur = line;
-
-
-        old = (FT_Byte)(cur[0] << 1);
-        for ( n = 8; n < width; n += 8 )
+        if ( decoder->bitmap->pixel_mode != FT_PIXEL_MODE_GRAY ||
+             x_pos != 0 || y_pos != 0                          )
         {
         {
-          FT_Byte  val;
-
-
-          val    = cur[1];
-          cur[0] = (FT_Byte)( old | ( val >> 7 ) );
-          old    = (FT_Byte)( val << 1 );
-          cur++;
+          /* Shouldn't happen. */
+          error = FT_THROW( Invalid_Table );
+          goto Fail;
         }
         }
-        cur[0] = old;
-      }
 
 
-      map->width--;
-      metrics->horiBearingX++;
-      metrics->vertBearingX++;
-      metrics->width--;
+        FT_Bitmap_New( &color );
 
 
-    } while ( map->width > 0 );
+        color.rows       = decoder->bitmap->rows;
+        color.width      = decoder->bitmap->width;
+        color.pitch      = color.width * 4;
+        color.pixel_mode = FT_PIXEL_MODE_BGRA;
 
 
-  Found_Left:
+        if ( FT_ALLOC( color.buffer, color.rows * color.pitch ) )
+          goto Fail;
 
 
-    /***********************************************************************/
-    /*                                                                     */
-    /* finally, crop the bitmap width to get rid of the space on the right */
-    /* side of the glyph.                                                  */
-    /*                                                                     */
-    do
-    {
-      FT_Int    right = map->width - 1;
-      FT_Byte*  limit;
-      FT_Byte   mask;
+        orig            = decoder->bitmap;
+        decoder->bitmap = &color;
 
 
+        error = loader( decoder, load_flags, p, p_limit, x_pos, y_pos );
 
 
-      line  = (FT_Byte*)map->buffer + ( right >> 3 );
-      limit = line + rows * line_len;
-      mask  = (FT_Byte)( 0x80 >> ( right & 7 ) );
+        decoder->bitmap = orig;
 
 
-      for ( ; line < limit; line += line_len )
-        if ( line[0] & mask )
-          goto Found_Right;
+        /* explicitly test against FT_Err_Ok to avoid compiler warnings */
+        /* (we do an assignment within a conditional)                   */
+        if ( error                                           ||
+             ( error = FT_Bitmap_Convert( library,
+                                          &color,
+                                          decoder->bitmap,
+                                          1 ) ) != FT_Err_Ok )
+        {
+          FT_Bitmap_Done( library, &color );
+          goto Fail;
+        }
 
 
-      /* crop the whole glyph to the right */
-      map->width--;
-      metrics->width--;
+        FT_Bitmap_Done( library, &color );
+      }
 
 
-    } while ( map->width > 0 );
+      else
+        error = loader( decoder, load_flags, p, p_limit, x_pos, y_pos );
+    }
 
 
-  Found_Right:
-    /* all right, the bitmap was cropped */
-    return;
+  Fail:
+    FT_FRAME_RELEASE( data );
 
 
-  Empty_Bitmap:
-    map->width      = 0;
-    map->rows       = 0;
-    map->pitch      = 0;
-    map->pixel_mode = FT_PIXEL_MODE_MONO;
+  Exit:
+    return error;
   }
 
 
   static FT_Error
   }
 
 
   static FT_Error
-  Load_SBit_Single( FT_Bitmap*       map,
-                    FT_Int           x_offset,
-                    FT_Int           y_offset,
-                    FT_Int           pix_bits,
-                    FT_UShort        image_format,
-                    TT_SBit_Metrics  metrics,
-                    FT_Stream        stream )
+  tt_sbit_decoder_load_image( TT_SBitDecoder  decoder,
+                              FT_UInt         load_flags,
+                              FT_UInt         glyph_index,
+                              FT_Int          x_pos,
+                              FT_Int          y_pos )
   {
   {
-    FT_Error  error;
+    /*
+     *  First, we find the correct strike range that applies to this
+     *  glyph index.
+     */
+
+    FT_Byte*  p          = decoder->eblc_base + decoder->strike_index_array;
+    FT_Byte*  p_limit    = decoder->eblc_limit;
+    FT_ULong  num_ranges = decoder->strike_index_count;
+    FT_UInt   start, end, index_format, image_format;
+    FT_ULong  image_start = 0, image_end = 0, image_offset;
 
 
 
 
-    /* check that the source bitmap fits into the target pixmap */
-    if ( x_offset < 0 || x_offset + metrics->width  > map->width ||
-         y_offset < 0 || y_offset + metrics->height > map->rows  )
+    for ( ; num_ranges > 0; num_ranges-- )
     {
     {
-      error = SFNT_Err_Invalid_Argument;
+      start = FT_NEXT_USHORT( p );
+      end   = FT_NEXT_USHORT( p );
 
 
-      goto Exit;
+      if ( glyph_index >= start && glyph_index <= end )
+        goto FoundRange;
+
+      p += 4;  /* ignore index offset */
     }
     }
+    goto NoBitmap;
 
 
-    {
-      FT_Int   glyph_width  = metrics->width;
-      FT_Int   glyph_height = metrics->height;
-      FT_Int   glyph_size;
-      FT_Int   line_bits    = pix_bits * glyph_width;
-      FT_Bool  pad_bytes    = 0;
+  FoundRange:
+    image_offset = FT_NEXT_ULONG( p );
 
 
+    /* overflow check */
+    p = decoder->eblc_base + decoder->strike_index_array;
+    if ( image_offset > (FT_ULong)( p_limit - p ) )
+      goto Failure;
 
 
-      /* compute size of glyph image */
-      switch ( image_format )
-      {
-      case 1:  /* byte-padded formats */
-      case 6:
-        {
-          FT_Int  line_length;
+    p += image_offset;
+    if ( p + 8 > p_limit )
+      goto NoBitmap;
 
 
+    /* now find the glyph's location and extend within the ebdt table */
+    index_format = FT_NEXT_USHORT( p );
+    image_format = FT_NEXT_USHORT( p );
+    image_offset = FT_NEXT_ULONG ( p );
 
 
-          switch ( pix_bits )
-          {
-          case 1:
-            line_length = ( glyph_width + 7 ) >> 3;
-            break;
-          case 2:
-            line_length = ( glyph_width + 3 ) >> 2;
-            break;
-          case 4:
-            line_length = ( glyph_width + 1 ) >> 1;
-            break;
-          default:
-            line_length =   glyph_width;
-          }
-
-          glyph_size = glyph_height * line_length;
-          pad_bytes  = 1;
-        }
-        break;
+    switch ( index_format )
+    {
+    case 1: /* 4-byte offsets relative to `image_offset' */
+      {
+        p += 4 * ( glyph_index - start );
+        if ( p + 8 > p_limit )
+          goto NoBitmap;
 
 
-      case 2:
-      case 5:
-      case 7:
-        line_bits  =   glyph_width  * pix_bits;
-        glyph_size = ( glyph_height * line_bits + 7 ) >> 3;
-        break;
+        image_start = FT_NEXT_ULONG( p );
+        image_end   = FT_NEXT_ULONG( p );
 
 
-      default:  /* invalid format */
-        return SFNT_Err_Invalid_File_Format;
+        if ( image_start == image_end )  /* missing glyph */
+          goto NoBitmap;
       }
       }
+      break;
 
 
-      /* Now read data and draw glyph into target pixmap       */
-      if ( FT_FRAME_ENTER( glyph_size ) )
-        goto Exit;
+    case 2: /* big metrics, constant image size */
+      {
+        FT_ULong  image_size;
 
 
-      /* don't forget to multiply `x_offset' by `map->pix_bits' as */
-      /* the sbit blitter doesn't make a difference between pixmap */
-      /* depths.                                                   */
-      blit_sbit( map, (FT_Byte*)stream->cursor, line_bits, pad_bytes,
-                 x_offset * pix_bits, y_offset, metrics->height );
 
 
-      FT_FRAME_EXIT();
-    }
+        if ( p + 12 > p_limit )
+          goto NoBitmap;
 
 
-  Exit:
-    return error;
-  }
+        image_size = FT_NEXT_ULONG( p );
 
 
+        if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) )
+          goto NoBitmap;
 
 
-  static FT_Error
-  Load_SBit_Image( TT_SBit_Strike   strike,
-                   TT_SBit_Range    range,
-                   FT_ULong         ebdt_pos,
-                   FT_ULong         glyph_offset,
-                   FT_GlyphSlot     slot,
-                   FT_Int           x_offset,
-                   FT_Int           y_offset,
-                   FT_Stream        stream,
-                   TT_SBit_Metrics  metrics,
-                   FT_Int           depth )
-  {
-    FT_Memory   memory = stream->memory;
-    FT_Bitmap*  map    = &slot->bitmap;
-    FT_Error    error;
+        image_start = image_size * ( glyph_index - start );
+        image_end   = image_start + image_size;
+      }
+      break;
 
 
+    case 3: /* 2-byte offsets relative to 'image_offset' */
+      {
+        p += 2 * ( glyph_index - start );
+        if ( p + 4 > p_limit )
+          goto NoBitmap;
 
 
-    /* place stream at beginning of glyph data and read metrics */
-    if ( FT_STREAM_SEEK( ebdt_pos + glyph_offset ) )
-      goto Exit;
+        image_start = FT_NEXT_USHORT( p );
+        image_end   = FT_NEXT_USHORT( p );
 
 
-    error = tt_load_sbit_metrics( stream, range, metrics );
-    if ( error )
-      goto Exit;
+        if ( image_start == image_end )  /* missing glyph */
+          goto NoBitmap;
+      }
+      break;
 
 
-    /* This function is recursive.  At the top-level call, we  */
-    /* compute the dimensions of the higher-level glyph to     */
-    /* allocate the final pixmap buffer.                       */
-    if ( depth == 0 )
-    {
-      FT_Long  size;
+    case 4: /* sparse glyph array with (glyph,offset) pairs */
+      {
+        FT_ULong  mm, num_glyphs;
 
 
 
 
-      map->width = metrics->width;
-      map->rows  = metrics->height;
+        if ( p + 4 > p_limit )
+          goto NoBitmap;
 
 
-      switch ( strike->bit_depth )
-      {
-      case 1:
-        map->pixel_mode = FT_PIXEL_MODE_MONO;
-        map->pitch      = ( map->width + 7 ) >> 3;
-        break;
+        num_glyphs = FT_NEXT_ULONG( p );
 
 
-      case 2:
-        map->pixel_mode = FT_PIXEL_MODE_GRAY2;
-        map->pitch      = ( map->width + 3 ) >> 2;
-        break;
+        /* overflow check for p + ( num_glyphs + 1 ) * 4 */
+        if ( num_glyphs > (FT_ULong)( ( ( p_limit - p ) >> 2 ) - 1 ) )
+          goto NoBitmap;
 
 
-      case 4:
-        map->pixel_mode = FT_PIXEL_MODE_GRAY4;
-        map->pitch      = ( map->width + 1 ) >> 1;
-        break;
+        for ( mm = 0; mm < num_glyphs; mm++ )
+        {
+          FT_UInt  gindex = FT_NEXT_USHORT( p );
 
 
-      case 8:
-        map->pixel_mode = FT_PIXEL_MODE_GRAY;
-        map->pitch      = map->width;
-        break;
 
 
-      default:
-        return SFNT_Err_Invalid_File_Format;
-      }
+          if ( gindex == glyph_index )
+          {
+            image_start = FT_NEXT_USHORT( p );
+            p          += 2;
+            image_end   = FT_PEEK_USHORT( p );
+            break;
+          }
+          p += 2;
+        }
 
 
-      size = map->rows * map->pitch;
+        if ( mm >= num_glyphs )
+          goto NoBitmap;
+      }
+      break;
 
 
-      /* check that there is no empty image */
-      if ( size == 0 )
-        goto Exit;     /* exit successfully! */
+    case 5: /* constant metrics with sparse glyph codes */
+    case 19:
+      {
+        FT_ULong  image_size, mm, num_glyphs;
 
 
-      error = ft_glyphslot_alloc_bitmap( slot, size );
-      if (error)
-        goto Exit;
-    }
 
 
-    switch ( range->image_format )
-    {
-    case 1:  /* single sbit image - load it */
-    case 2:
-    case 5:
-    case 6:
-    case 7:
-      return Load_SBit_Single( map, x_offset, y_offset, strike->bit_depth,
-                               range->image_format, metrics, stream );
+        if ( p + 16 > p_limit )
+          goto NoBitmap;
 
 
-    case 8:  /* compound format */
-      if ( FT_STREAM_SKIP( 1L ) )
-      {
-        error = SFNT_Err_Invalid_Stream_Skip;
-        goto Exit;
-      }
-      /* fallthrough */
+        image_size = FT_NEXT_ULONG( p );
 
 
-    case 9:
-      break;
+        if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) )
+          goto NoBitmap;
 
 
-    default: /* invalid image format */
-      return SFNT_Err_Invalid_File_Format;
-    }
+        num_glyphs = FT_NEXT_ULONG( p );
 
 
-    /* All right, we have a compound format.  First of all, read */
-    /* the array of elements.                                    */
-    {
-      TT_SBit_Component  components;
-      TT_SBit_Component  comp;
-      FT_UShort          num_components, count;
+        /* overflow check for p + 2 * num_glyphs */
+        if ( num_glyphs > (FT_ULong)( ( p_limit - p ) >> 1 ) )
+          goto NoBitmap;
 
 
+        for ( mm = 0; mm < num_glyphs; mm++ )
+        {
+          FT_UInt  gindex = FT_NEXT_USHORT( p );
 
 
-      if ( FT_READ_USHORT( num_components )           ||
-           FT_NEW_ARRAY( components, num_components ) )
-        goto Exit;
 
 
-      count = num_components;
+          if ( gindex == glyph_index )
+            break;
+        }
 
 
-      if ( FT_FRAME_ENTER( 4L * num_components ) )
-        goto Fail_Memory;
+        if ( mm >= num_glyphs )
+          goto NoBitmap;
 
 
-      for ( comp = components; count > 0; count--, comp++ )
-      {
-        comp->glyph_code = FT_GET_USHORT();
-        comp->x_offset   = FT_GET_CHAR();
-        comp->y_offset   = FT_GET_CHAR();
+        image_start = image_size * mm;
+        image_end   = image_start + image_size;
       }
       }
+      break;
 
 
-      FT_FRAME_EXIT();
+    default:
+      goto NoBitmap;
+    }
 
 
-      /* Now recursively load each element glyph */
-      count = num_components;
-      comp  = components;
-      for ( ; count > 0; count--, comp++ )
-      {
-        TT_SBit_Range       elem_range;
-        TT_SBit_MetricsRec  elem_metrics;
-        FT_ULong            elem_offset;
+    if ( image_start > image_end )
+      goto NoBitmap;
 
 
+    image_end  -= image_start;
+    image_start = image_offset + image_start;
 
 
-        /* find the range for this element */
-        error = find_sbit_range( comp->glyph_code,
-                                 strike,
-                                 &elem_range,
-                                 &elem_offset );
-        if ( error )
-          goto Fail_Memory;
-
-        /* now load the element, recursively */
-        error = Load_SBit_Image( strike,
-                                 elem_range,
-                                 ebdt_pos,
-                                 elem_offset,
-                                 slot,
-                                 x_offset + comp->x_offset,
-                                 y_offset + comp->y_offset,
-                                 stream,
-                                 &elem_metrics,
-                                 depth + 1 );
-        if ( error )
-          goto Fail_Memory;
-      }
+    FT_TRACE3(( "tt_sbit_decoder_load_image:"
+                " found sbit (format %d) for glyph index %d\n",
+                image_format, glyph_index ));
 
 
-    Fail_Memory:
-      FT_FREE( components );
-    }
+    return tt_sbit_decoder_load_bitmap( decoder,
+                                        load_flags,
+                                        image_format,
+                                        image_start,
+                                        image_end,
+                                        x_pos,
+                                        y_pos );
 
 
-  Exit:
-    return error;
+  Failure:
+    return FT_THROW( Invalid_Table );
+
+  NoBitmap:
+    FT_TRACE4(( "tt_sbit_decoder_load_image:"
+                " no sbit found for glyph index %d\n", glyph_index ));
+
+    return FT_THROW( Invalid_Argument );
   }
 
 
   }
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    tt_face_load_sbit_image                                            */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads a given glyph sbit image from the font resource.  This also  */
-  /*    returns its metrics.                                               */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face         :: The target face object.                            */
-  /*                                                                       */
-  /*    strike_index :: The current strike index.                          */
-  /*                                                                       */
-  /*    glyph_index  :: The current glyph index.                           */
-  /*                                                                       */
-  /*    load_flags   :: The glyph load flags (the code checks for the flag */
-  /*                    FT_LOAD_CROP_BITMAP).                              */
-  /*                                                                       */
-  /*    stream       :: The input stream.                                  */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    map          :: The target pixmap.                                 */
-  /*                                                                       */
-  /*    metrics      :: A big sbit metrics structure for the glyph image.  */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.  Returns an error if no     */
-  /*    glyph sbit exists for the index.                                   */
-  /*                                                                       */
-  /*  <Note>                                                               */
-  /*    The `map.buffer' field is always freed before the glyph is loaded. */
-  /*                                                                       */
-  FT_LOCAL_DEF( FT_Error )
+  FT_LOCAL( FT_Error )
   tt_face_load_sbit_image( TT_Face              face,
                            FT_ULong             strike_index,
                            FT_UInt              glyph_index,
   tt_face_load_sbit_image( TT_Face              face,
                            FT_ULong             strike_index,
                            FT_UInt              glyph_index,
                            FT_Bitmap           *map,
                            TT_SBit_MetricsRec  *metrics )
   {
                            FT_Bitmap           *map,
                            TT_SBit_MetricsRec  *metrics )
   {
-    FT_Error        error;
-    FT_ULong        ebdt_pos, glyph_offset;
+    TT_SBitDecoderRec  decoder[1];
+    FT_Error           error;
 
 
-    TT_SBit_Strike  strike;
-    TT_SBit_Range   range;
+    FT_UNUSED( load_flags );
+    FT_UNUSED( stream );
+    FT_UNUSED( map );
 
 
 
 
-    /* Check whether there is a glyph sbit for the current index */
-    error = tt_find_sbit_image( face, glyph_index, strike_index,
-                                &range, &strike, &glyph_offset );
-    if ( error )
-      goto Exit;
-
-    /* now, find the location of the `EBDT' table in */
-    /* the font file                                 */
-    error = face->goto_table( face, TTAG_EBDT, stream, 0 );
-    if ( error )
-      error = face->goto_table( face, TTAG_bdat, stream, 0 );
-    if ( error )
-      goto Exit;
-
-    ebdt_pos = FT_STREAM_POS();
-
-    error = Load_SBit_Image( strike, range, ebdt_pos, glyph_offset,
-                             face->root.glyph, 0, 0, stream, metrics, 0 );
-    if ( error )
-      goto Exit;
-
-    /* setup vertical metrics if needed */
-    if ( strike->flags & 1 )
+    error = tt_sbit_decoder_init( decoder, face, strike_index, metrics );
+    if ( !error )
     {
     {
-      /* in case of a horizontal strike only */
-      FT_Int  advance;
-
-
-      advance = strike->hori.ascender - strike->hori.descender;
-
-      /* some heuristic values */
-
-      metrics->vertBearingX = (FT_Char)(-metrics->width / 2 );
-      metrics->vertBearingY = (FT_Char)( ( advance - metrics->height ) / 2 );
-      metrics->vertAdvance  = (FT_Char)( advance * 12 / 10 );
+      error = tt_sbit_decoder_load_image( decoder,
+                                          load_flags,
+                                          glyph_index,
+                                          0,
+                                          0 );
+      tt_sbit_decoder_done( decoder );
     }
 
     }
 
-    /* Crop the bitmap now, unless specified otherwise */
-    if ( load_flags & FT_LOAD_CROP_BITMAP )
-      crop_bitmap( map, metrics );
-
-  Exit:
     return error;
   }
 
     return error;
   }
 
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
 
 
-/* END */
+/* EOF */
index 7ea2af1..ea0b5f8 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType and OpenType embedded bitmap support (specification).       */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType and OpenType embedded bitmap support (specification).       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by       */
+/*  Copyright 1996-2008, 2013 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -45,22 +45,6 @@ FT_BEGIN_HEADER
                                FT_ULong          strike_index,
                                FT_Size_Metrics*  metrics );
 
                                FT_ULong          strike_index,
                                FT_Size_Metrics*  metrics );
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-  FT_LOCAL( FT_Error )
-  tt_find_sbit_image( TT_Face          face,
-                      FT_UInt          glyph_index,
-                      FT_ULong         strike_index,
-                      TT_SBit_Range   *arange,
-                      TT_SBit_Strike  *astrike,
-                      FT_ULong        *aglyph_offset );
-
-  FT_LOCAL( FT_Error )
-  tt_load_sbit_metrics( FT_Stream        stream,
-                        TT_SBit_Range    range,
-                        TT_SBit_Metrics  metrics );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
   FT_LOCAL( FT_Error )
   tt_face_load_sbit_image( TT_Face              face,
                            FT_ULong             strike_index,
   FT_LOCAL( FT_Error )
   tt_face_load_sbit_image( TT_Face              face,
                            FT_ULong             strike_index,
diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit0.c b/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit0.c
deleted file mode 100644 (file)
index 38bcf21..0000000
+++ /dev/null
@@ -1,1011 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ttsbit0.c                                                              */
-/*                                                                         */
-/*    TrueType and OpenType embedded bitmap support (body).                */
-/*    This is a heap-optimized version.                                    */
-/*                                                                         */
-/*  Copyright 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,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-/* This file is included by ttsbit.c */
-
-
-#include <ft2build.h>
-#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_STREAM_H
-#include FT_TRUETYPE_TAGS_H
-#include "ttsbit.h"
-
-#include "sferrors.h"
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
-  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
-  /* messages during execution.                                            */
-  /*                                                                       */
-#undef  FT_COMPONENT
-#define FT_COMPONENT  trace_ttsbit
-
-
-  FT_LOCAL_DEF( FT_Error )
-  tt_face_load_eblc( TT_Face    face,
-                     FT_Stream  stream )
-  {
-    FT_Error  error = SFNT_Err_Ok;
-    FT_Fixed  version;
-    FT_ULong  num_strikes, table_size;
-    FT_Byte*  p;
-    FT_Byte*  p_limit;
-    FT_UInt   count;
-
-
-    face->sbit_num_strikes = 0;
-
-    /* this table is optional */
-    error = face->goto_table( face, TTAG_EBLC, stream, &table_size );
-    if ( error )
-      error = face->goto_table( face, TTAG_bloc, stream, &table_size );
-    if ( error )
-      goto Exit;
-
-    if ( table_size < 8 )
-    {
-      FT_ERROR(( "tt_face_load_sbit_strikes: table too short\n" ));
-      error = SFNT_Err_Invalid_File_Format;
-      goto Exit;
-    }
-
-    if ( FT_FRAME_EXTRACT( table_size, face->sbit_table ) )
-      goto Exit;
-
-    face->sbit_table_size = table_size;
-
-    p       = face->sbit_table;
-    p_limit = p + table_size;
-
-    version     = FT_NEXT_ULONG( p );
-    num_strikes = FT_NEXT_ULONG( p );
-
-    if ( version != 0x00020000UL || num_strikes >= 0x10000UL )
-    {
-      FT_ERROR(( "tt_face_load_sbit_strikes: invalid table version\n" ));
-      error = SFNT_Err_Invalid_File_Format;
-      goto Fail;
-    }
-
-    /*
-     *  Count the number of strikes available in the table.  We are a bit
-     *  paranoid there and don't trust the data.
-     */
-    count = (FT_UInt)num_strikes;
-    if ( 8 + 48UL * count > table_size )
-      count = (FT_UInt)( ( p_limit - p ) / 48 );
-
-    face->sbit_num_strikes = count;
-
-    FT_TRACE3(( "sbit_num_strikes: %u\n", count ));
-  Exit:
-    return error;
-
-  Fail:
-    FT_FRAME_RELEASE( face->sbit_table );
-    face->sbit_table_size = 0;
-    goto Exit;
-  }
-
-
-  FT_LOCAL_DEF( void )
-  tt_face_free_eblc( TT_Face  face )
-  {
-    FT_Stream  stream = face->root.stream;
-
-
-    FT_FRAME_RELEASE( face->sbit_table );
-    face->sbit_table_size  = 0;
-    face->sbit_num_strikes = 0;
-  }
-
-
-  FT_LOCAL_DEF( FT_Error )
-  tt_face_set_sbit_strike( TT_Face          face,
-                           FT_Size_Request  req,
-                           FT_ULong*        astrike_index )
-  {
-    return FT_Match_Size( (FT_Face)face, req, 0, astrike_index );
-  }
-
-
-  FT_LOCAL_DEF( FT_Error )
-  tt_face_load_strike_metrics( TT_Face           face,
-                               FT_ULong          strike_index,
-                               FT_Size_Metrics*  metrics )
-  {
-    FT_Byte*  strike;
-
-
-    if ( strike_index >= (FT_ULong)face->sbit_num_strikes )
-      return SFNT_Err_Invalid_Argument;
-
-    strike = face->sbit_table + 8 + strike_index * 48;
-
-    metrics->x_ppem = (FT_UShort)strike[44];
-    metrics->y_ppem = (FT_UShort)strike[45];
-
-    metrics->ascender  = (FT_Char)strike[16] << 6;  /* hori.ascender  */
-    metrics->descender = (FT_Char)strike[17] << 6;  /* hori.descender */
-    metrics->height    = metrics->ascender - metrics->descender;
-
-    /* XXX: Is this correct? */
-    metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB  */
-                                      strike[18] + /* max_width      */
-                             (FT_Char)strike[23]   /* min_advance_SB */
-                                                 ) << 6;
-
-    return SFNT_Err_Ok;
-  }
-
-
-  typedef struct  TT_SBitDecoderRec_
-  {
-    TT_Face          face;
-    FT_Stream        stream;
-    FT_Bitmap*       bitmap;
-    TT_SBit_Metrics  metrics;
-    FT_Bool          metrics_loaded;
-    FT_Bool          bitmap_allocated;
-    FT_Byte          bit_depth;
-
-    FT_ULong         ebdt_start;
-    FT_ULong         ebdt_size;
-
-    FT_ULong         strike_index_array;
-    FT_ULong         strike_index_count;
-    FT_Byte*         eblc_base;
-    FT_Byte*         eblc_limit;
-
-  } TT_SBitDecoderRec, *TT_SBitDecoder;
-
-
-  static FT_Error
-  tt_sbit_decoder_init( TT_SBitDecoder       decoder,
-                        TT_Face              face,
-                        FT_ULong             strike_index,
-                        TT_SBit_MetricsRec*  metrics )
-  {
-    FT_Error   error;
-    FT_Stream  stream = face->root.stream;
-    FT_ULong   ebdt_size;
-
-
-    error = face->goto_table( face, TTAG_EBDT, stream, &ebdt_size );
-    if ( error )
-      error = face->goto_table( face, TTAG_bdat, stream, &ebdt_size );
-    if ( error )
-      goto Exit;
-
-    decoder->face    = face;
-    decoder->stream  = stream;
-    decoder->bitmap  = &face->root.glyph->bitmap;
-    decoder->metrics = metrics;
-
-    decoder->metrics_loaded   = 0;
-    decoder->bitmap_allocated = 0;
-
-    decoder->ebdt_start = FT_STREAM_POS();
-    decoder->ebdt_size  = ebdt_size;
-
-    decoder->eblc_base  = face->sbit_table;
-    decoder->eblc_limit = face->sbit_table + face->sbit_table_size;
-
-    /* now find the strike corresponding to the index */
-    {
-      FT_Byte*  p;
-
-
-      if ( 8 + 48 * strike_index + 3 * 4 + 34 + 1 > face->sbit_table_size )
-      {
-        error = SFNT_Err_Invalid_File_Format;
-        goto Exit;
-      }
-
-      p = decoder->eblc_base + 8 + 48 * strike_index;
-
-      decoder->strike_index_array = FT_NEXT_ULONG( p );
-      p                          += 4;
-      decoder->strike_index_count = FT_NEXT_ULONG( p );
-      p                          += 34;
-      decoder->bit_depth          = *p;
-
-      if ( decoder->strike_index_array > face->sbit_table_size             ||
-           decoder->strike_index_array + 8 * decoder->strike_index_count >
-             face->sbit_table_size                                         )
-        error = SFNT_Err_Invalid_File_Format;
-    }
-
-  Exit:
-    return error;
-  }
-
-
-  static void
-  tt_sbit_decoder_done( TT_SBitDecoder  decoder )
-  {
-    FT_UNUSED( decoder );
-  }
-
-
-  static FT_Error
-  tt_sbit_decoder_alloc_bitmap( TT_SBitDecoder  decoder )
-  {
-    FT_Error    error = SFNT_Err_Ok;
-    FT_UInt     width, height;
-    FT_Bitmap*  map = decoder->bitmap;
-    FT_Long     size;
-
-
-    if ( !decoder->metrics_loaded )
-    {
-      error = SFNT_Err_Invalid_Argument;
-      goto Exit;
-    }
-
-    width  = decoder->metrics->width;
-    height = decoder->metrics->height;
-
-    map->width = (int)width;
-    map->rows  = (int)height;
-
-    switch ( decoder->bit_depth )
-    {
-    case 1:
-      map->pixel_mode = FT_PIXEL_MODE_MONO;
-      map->pitch      = ( map->width + 7 ) >> 3;
-      break;
-
-    case 2:
-      map->pixel_mode = FT_PIXEL_MODE_GRAY2;
-      map->pitch      = ( map->width + 3 ) >> 2;
-      break;
-
-    case 4:
-      map->pixel_mode = FT_PIXEL_MODE_GRAY4;
-      map->pitch      = ( map->width + 1 ) >> 1;
-      break;
-
-    case 8:
-      map->pixel_mode = FT_PIXEL_MODE_GRAY;
-      map->pitch      = map->width;
-      break;
-
-    default:
-      error = SFNT_Err_Invalid_File_Format;
-      goto Exit;
-    }
-
-    size = map->rows * map->pitch;
-
-    /* check that there is no empty image */
-    if ( size == 0 )
-      goto Exit;     /* exit successfully! */
-
-    error = ft_glyphslot_alloc_bitmap( decoder->face->root.glyph, size );
-    if ( error )
-      goto Exit;
-
-    decoder->bitmap_allocated = 1;
-
-  Exit:
-    return error;
-  }
-
-
-  static FT_Error
-  tt_sbit_decoder_load_metrics( TT_SBitDecoder  decoder,
-                                FT_Byte*       *pp,
-                                FT_Byte*        limit,
-                                FT_Bool         big )
-  {
-    FT_Byte*         p       = *pp;
-    TT_SBit_Metrics  metrics = decoder->metrics;
-
-
-    if ( p + 5 > limit )
-      goto Fail;
-
-    metrics->height       = p[0];
-    metrics->width        = p[1];
-    metrics->horiBearingX = (FT_Char)p[2];
-    metrics->horiBearingY = (FT_Char)p[3];
-    metrics->horiAdvance  = p[4];
-
-    p += 5;
-    if ( big )
-    {
-      if ( p + 3 > limit )
-        goto Fail;
-
-      metrics->vertBearingX = (FT_Char)p[0];
-      metrics->vertBearingY = (FT_Char)p[1];
-      metrics->vertAdvance  = p[2];
-
-      p += 3;
-    }
-
-    decoder->metrics_loaded = 1;
-    *pp = p;
-    return SFNT_Err_Ok;
-
-  Fail:
-    return SFNT_Err_Invalid_Argument;
-  }
-
-
-  /* forward declaration */
-  static FT_Error
-  tt_sbit_decoder_load_image( TT_SBitDecoder  decoder,
-                              FT_UInt         glyph_index,
-                              FT_Int          x_pos,
-                              FT_Int          y_pos );
-
-  typedef FT_Error  (*TT_SBitDecoder_LoadFunc)( TT_SBitDecoder  decoder,
-                                                FT_Byte*        p,
-                                                FT_Byte*        plimit,
-                                                FT_Int          x_pos,
-                                                FT_Int          y_pos );
-
-
-  static FT_Error
-  tt_sbit_decoder_load_byte_aligned( TT_SBitDecoder  decoder,
-                                     FT_Byte*        p,
-                                     FT_Byte*        limit,
-                                     FT_Int          x_pos,
-                                     FT_Int          y_pos )
-  {
-    FT_Error    error = SFNT_Err_Ok;
-    FT_Byte*    line;
-    FT_Int      bit_height, bit_width, pitch, width, height, h;
-    FT_Bitmap*  bitmap;
-
-
-    if ( !decoder->bitmap_allocated )
-    {
-      error = tt_sbit_decoder_alloc_bitmap( decoder );
-      if ( error )
-        goto Exit;
-    }
-
-    /* check that we can write the glyph into the bitmap */
-    bitmap     = decoder->bitmap;
-    bit_width  = bitmap->width;
-    bit_height = bitmap->rows;
-    pitch      = bitmap->pitch;
-    line       = bitmap->buffer;
-
-    width  = decoder->metrics->width;
-    height = decoder->metrics->height;
-
-    if ( x_pos < 0 || x_pos + width > bit_width   ||
-         y_pos < 0 || y_pos + height > bit_height )
-    {
-      error = SFNT_Err_Invalid_File_Format;
-      goto Exit;
-    }
-
-    if ( p + ( ( width + 7 ) >> 3 ) * height > limit )
-    {
-      error = SFNT_Err_Invalid_File_Format;
-      goto Exit;
-    }
-
-    /* now do the blit */
-    line  += y_pos * pitch + ( x_pos >> 3 );
-    x_pos &= 7;
-
-    if ( x_pos == 0 )  /* the easy one */
-    {
-      for ( h = height; h > 0; h--, line += pitch )
-      {
-        FT_Byte*  write = line;
-        FT_Int    w;
-
-
-        for ( w = width; w >= 8; w -= 8 )
-        {
-          write[0] = (FT_Byte)( write[0] | *p++ );
-          write   += 1;
-        }
-
-        if ( w > 0 )
-          write[0] = (FT_Byte)( write[0] | ( *p++ & ( 0xFF00U >> w ) ) );
-      }
-    }
-    else  /* x_pos > 0 */
-    {
-      for ( h = height; h > 0; h--, line += pitch )
-      {
-        FT_Byte*  write = line;
-        FT_Int    w;
-        FT_UInt   wval = 0;
-
-
-        for ( w = width; w >= 8; w -= 8 )
-        {
-          wval      = (FT_UInt)( wval | *p++ );
-          write[0]  = (FT_Byte)( write[0] | ( wval >> x_pos ) );
-          write    += 1;
-          wval    <<= 8;
-        }
-
-        if ( w > 0 )
-          wval = (FT_UInt)( wval | ( *p++ & ( 0xFF00U >> w ) ) );
-
-        /* all bits read and there are `x_pos + w' bits to be written */
-
-        write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) );
-
-        if ( x_pos + w > 8 )
-        {
-          write++;
-          wval   <<= 8;
-          write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) );
-        }
-      }
-    }
-
-  Exit:
-    return error;
-  }
-
-
-  /*
-   * Load a bit-aligned bitmap (with pointer `p') into a line-aligned bitmap
-   * (with pointer `write').  In the example below, the width is 3 pixel,
-   * and `x_pos' is 1 pixel.
-   *
-   *       p                               p+1
-   *     |                               |                               |
-   *     | 7   6   5   4   3   2   1   0 | 7   6   5   4   3   2   1   0 |...
-   *     |                               |                               |
-   *       +-------+   +-------+   +-------+ ...
-   *           .           .           .
-   *           .           .           .
-   *           v           .           .
-   *       +-------+       .           .
-   * |                               | .
-   * | 7   6   5   4   3   2   1   0 | .
-   * |                               | .
-   *   write               .           .
-   *                       .           .
-   *                       v           .
-   *                   +-------+       .
-   *             |                               |
-   *             | 7   6   5   4   3   2   1   0 |
-   *             |                               |
-   *               write+1             .
-   *                                   .
-   *                                   v
-   *                               +-------+
-   *                         |                               |
-   *                         | 7   6   5   4   3   2   1   0 |
-   *                         |                               |
-   *                           write+2
-   *
-   */
-
-  static FT_Error
-  tt_sbit_decoder_load_bit_aligned( TT_SBitDecoder  decoder,
-                                    FT_Byte*        p,
-                                    FT_Byte*        limit,
-                                    FT_Int          x_pos,
-                                    FT_Int          y_pos )
-  {
-    FT_Error    error = SFNT_Err_Ok;
-    FT_Byte*    line;
-    FT_Int      bit_height, bit_width, pitch, width, height, h, nbits;
-    FT_Bitmap*  bitmap;
-    FT_UShort   rval;
-
-
-    if ( !decoder->bitmap_allocated )
-    {
-      error = tt_sbit_decoder_alloc_bitmap( decoder );
-      if ( error )
-        goto Exit;
-    }
-
-    /* check that we can write the glyph into the bitmap */
-    bitmap     = decoder->bitmap;
-    bit_width  = bitmap->width;
-    bit_height = bitmap->rows;
-    pitch      = bitmap->pitch;
-    line       = bitmap->buffer;
-
-    width  = decoder->metrics->width;
-    height = decoder->metrics->height;
-
-    if ( x_pos < 0 || x_pos + width  > bit_width  ||
-         y_pos < 0 || y_pos + height > bit_height )
-    {
-      error = SFNT_Err_Invalid_File_Format;
-      goto Exit;
-    }
-
-    if ( p + ( ( width * height + 7 ) >> 3 ) > limit )
-    {
-      error = SFNT_Err_Invalid_File_Format;
-      goto Exit;
-    }
-
-    /* now do the blit */
-
-    /* adjust `line' to point to the first byte of the bitmap */
-    line  += y_pos * pitch + ( x_pos >> 3 );
-    x_pos &= 7;
-
-    /* the higher byte of `rval' is used as a buffer */
-    rval  = 0;
-    nbits = 0;
-
-    for ( h = height; h > 0; h--, line += pitch )
-    {
-      FT_Byte*  write = line;
-      FT_Int    w     = width;
-
-
-      /* handle initial byte (in target bitmap) specially if necessary */
-      if ( x_pos )
-      {
-        w = ( width < 8 - x_pos ) ? width : 8 - x_pos;
-
-        if ( h == height )
-        {
-          rval  = *p++;
-          nbits = x_pos;
-        }
-        else if ( nbits < w )
-        {
-          if ( p < limit )
-            rval |= *p++;
-          nbits += 8 - w;
-        }
-        else
-        {
-          rval  >>= 8;
-          nbits  -= w;
-        }
-
-        *write++ |= ( ( rval >> nbits ) & 0xFF ) &
-                    ( ~( 0xFF << w ) << ( 8 - w - x_pos ) );
-        rval    <<= 8;
-
-        w = width - w;
-      }
-
-      /* handle medial bytes */
-      for ( ; w >= 8; w -= 8 )
-      {
-        rval     |= *p++;
-        *write++ |= ( rval >> nbits ) & 0xFF;
-
-        rval <<= 8;
-      }
-
-      /* handle final byte if necessary */
-      if ( w > 0 )
-      {
-        if ( nbits < w )
-        {
-          if ( p < limit )
-            rval |= *p++;
-          *write |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w );
-          nbits  += 8 - w;
-
-          rval <<= 8;
-        }
-        else
-        {
-          *write |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w );
-          nbits  -= w;
-        }
-      }
-    }
-
-  Exit:
-    return error;
-  }
-
-
-  static FT_Error
-  tt_sbit_decoder_load_compound( TT_SBitDecoder  decoder,
-                                 FT_Byte*        p,
-                                 FT_Byte*        limit,
-                                 FT_Int          x_pos,
-                                 FT_Int          y_pos )
-  {
-    FT_Error  error = SFNT_Err_Ok;
-    FT_UInt   num_components, nn;
-
-    FT_Char  horiBearingX = decoder->metrics->horiBearingX;
-    FT_Char  horiBearingY = decoder->metrics->horiBearingY;
-    FT_Byte  horiAdvance  = decoder->metrics->horiAdvance;
-    FT_Char  vertBearingX = decoder->metrics->vertBearingX;
-    FT_Char  vertBearingY = decoder->metrics->vertBearingY;
-    FT_Byte  vertAdvance  = decoder->metrics->vertAdvance;
-
-
-    if ( p + 2 > limit )
-      goto Fail;
-
-    num_components = FT_NEXT_USHORT( p );
-    if ( p + 4 * num_components > limit )
-      goto Fail;
-
-    if ( !decoder->bitmap_allocated )
-    {
-      error = tt_sbit_decoder_alloc_bitmap( decoder );
-      if ( error )
-        goto Exit;
-    }
-
-    for ( nn = 0; nn < num_components; nn++ )
-    {
-      FT_UInt  gindex = FT_NEXT_USHORT( p );
-      FT_Byte  dx     = FT_NEXT_BYTE( p );
-      FT_Byte  dy     = FT_NEXT_BYTE( p );
-
-
-      /* NB: a recursive call */
-      error = tt_sbit_decoder_load_image( decoder, gindex,
-                                          x_pos + dx, y_pos + dy );
-      if ( error )
-        break;
-    }
-
-    decoder->metrics->horiBearingX = horiBearingX;
-    decoder->metrics->horiBearingY = horiBearingY;
-    decoder->metrics->horiAdvance  = horiAdvance;
-    decoder->metrics->vertBearingX = vertBearingX;
-    decoder->metrics->vertBearingY = vertBearingY;
-    decoder->metrics->vertAdvance  = vertAdvance;
-    decoder->metrics->width        = (FT_UInt)decoder->bitmap->width;
-    decoder->metrics->height       = (FT_UInt)decoder->bitmap->rows;
-
-  Exit:
-    return error;
-
-  Fail:
-    error = SFNT_Err_Invalid_File_Format;
-    goto Exit;
-  }
-
-
-  static FT_Error
-  tt_sbit_decoder_load_bitmap( TT_SBitDecoder  decoder,
-                               FT_UInt         glyph_format,
-                               FT_ULong        glyph_start,
-                               FT_ULong        glyph_size,
-                               FT_Int          x_pos,
-                               FT_Int          y_pos )
-  {
-    FT_Error   error;
-    FT_Stream  stream = decoder->stream;
-    FT_Byte*   p;
-    FT_Byte*   p_limit;
-    FT_Byte*   data;
-
-
-    /* seek into the EBDT table now */
-    if ( glyph_start + glyph_size > decoder->ebdt_size )
-    {
-      error = SFNT_Err_Invalid_Argument;
-      goto Exit;
-    }
-
-    if ( FT_STREAM_SEEK( decoder->ebdt_start + glyph_start ) ||
-         FT_FRAME_EXTRACT( glyph_size, data )                )
-      goto Exit;
-
-    p       = data;
-    p_limit = p + glyph_size;
-
-    /* read the data, depending on the glyph format */
-    switch ( glyph_format )
-    {
-    case 1:
-    case 2:
-    case 8:
-      error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 0 );
-      break;
-
-    case 6:
-    case 7:
-    case 9:
-      error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 );
-      break;
-
-    default:
-      error = SFNT_Err_Ok;
-    }
-
-    if ( error )
-      goto Fail;
-
-    {
-      TT_SBitDecoder_LoadFunc  loader;
-
-
-      switch ( glyph_format )
-      {
-      case 1:
-      case 6:
-        loader = tt_sbit_decoder_load_byte_aligned;
-        break;
-
-      case 2:
-      case 5:
-      case 7:
-        loader = tt_sbit_decoder_load_bit_aligned;
-        break;
-
-      case 8:
-        if ( p + 1 > p_limit )
-          goto Fail;
-
-        p += 1;  /* skip padding */
-        /* fall-through */
-
-      case 9:
-        loader = tt_sbit_decoder_load_compound;
-        break;
-
-      default:
-        goto Fail;
-      }
-
-      error = loader( decoder, p, p_limit, x_pos, y_pos );
-    }
-
-  Fail:
-    FT_FRAME_RELEASE( data );
-
-  Exit:
-    return error;
-  }
-
-
-  static FT_Error
-  tt_sbit_decoder_load_image( TT_SBitDecoder  decoder,
-                              FT_UInt         glyph_index,
-                              FT_Int          x_pos,
-                              FT_Int          y_pos )
-  {
-    /*
-     *  First, we find the correct strike range that applies to this
-     *  glyph index.
-     */
-
-    FT_Byte*  p          = decoder->eblc_base + decoder->strike_index_array;
-    FT_Byte*  p_limit    = decoder->eblc_limit;
-    FT_ULong  num_ranges = decoder->strike_index_count;
-    FT_UInt   start, end, index_format, image_format;
-    FT_ULong  image_start = 0, image_end = 0, image_offset;
-
-
-    for ( ; num_ranges > 0; num_ranges-- )
-    {
-      start = FT_NEXT_USHORT( p );
-      end   = FT_NEXT_USHORT( p );
-
-      if ( glyph_index >= start && glyph_index <= end )
-        goto FoundRange;
-
-      p += 4;  /* ignore index offset */
-    }
-    goto NoBitmap;
-
-  FoundRange:
-    image_offset = FT_NEXT_ULONG( p );
-
-    /* overflow check */
-    if ( decoder->eblc_base + decoder->strike_index_array + image_offset <
-           decoder->eblc_base )
-      goto Failure;
-
-    p = decoder->eblc_base + decoder->strike_index_array + image_offset;
-    if ( p + 8 > p_limit )
-      goto NoBitmap;
-
-    /* now find the glyph's location and extend within the ebdt table */
-    index_format = FT_NEXT_USHORT( p );
-    image_format = FT_NEXT_USHORT( p );
-    image_offset = FT_NEXT_ULONG ( p );
-
-    switch ( index_format )
-    {
-    case 1: /* 4-byte offsets relative to `image_offset' */
-      {
-        p += 4 * ( glyph_index - start );
-        if ( p + 8 > p_limit )
-          goto NoBitmap;
-
-        image_start = FT_NEXT_ULONG( p );
-        image_end   = FT_NEXT_ULONG( p );
-
-        if ( image_start == image_end )  /* missing glyph */
-          goto NoBitmap;
-      }
-      break;
-
-    case 2: /* big metrics, constant image size */
-      {
-        FT_ULong  image_size;
-
-
-        if ( p + 12 > p_limit )
-          goto NoBitmap;
-
-        image_size = FT_NEXT_ULONG( p );
-
-        if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) )
-          goto NoBitmap;
-
-        image_start = image_size * ( glyph_index - start );
-        image_end   = image_start + image_size;
-      }
-      break;
-
-    case 3: /* 2-byte offsets relative to 'image_offset' */
-      {
-        p += 2 * ( glyph_index - start );
-        if ( p + 4 > p_limit )
-          goto NoBitmap;
-
-        image_start = FT_NEXT_USHORT( p );
-        image_end   = FT_NEXT_USHORT( p );
-
-        if ( image_start == image_end )  /* missing glyph */
-          goto NoBitmap;
-      }
-      break;
-
-    case 4: /* sparse glyph array with (glyph,offset) pairs */
-      {
-        FT_ULong  mm, num_glyphs;
-
-
-        if ( p + 4 > p_limit )
-          goto NoBitmap;
-
-        num_glyphs = FT_NEXT_ULONG( p );
-
-        /* overflow check */
-        if ( p + ( num_glyphs + 1 ) * 4 < p )
-          goto Failure;
-
-        if ( p + ( num_glyphs + 1 ) * 4 > p_limit )
-          goto NoBitmap;
-
-        for ( mm = 0; mm < num_glyphs; mm++ )
-        {
-          FT_UInt  gindex = FT_NEXT_USHORT( p );
-
-
-          if ( gindex == glyph_index )
-          {
-            image_start = FT_NEXT_USHORT( p );
-            p          += 2;
-            image_end   = FT_PEEK_USHORT( p );
-            break;
-          }
-          p += 2;
-        }
-
-        if ( mm >= num_glyphs )
-          goto NoBitmap;
-      }
-      break;
-
-    case 5: /* constant metrics with sparse glyph codes */
-      {
-        FT_ULong  image_size, mm, num_glyphs;
-
-
-        if ( p + 16 > p_limit )
-          goto NoBitmap;
-
-        image_size = FT_NEXT_ULONG( p );
-
-        if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) )
-          goto NoBitmap;
-
-        num_glyphs = FT_NEXT_ULONG( p );
-
-        /* overflow check */
-        if ( p + 2 * num_glyphs < p )
-          goto Failure;
-
-        if ( p + 2 * num_glyphs > p_limit )
-          goto NoBitmap;
-
-        for ( mm = 0; mm < num_glyphs; mm++ )
-        {
-          FT_UInt  gindex = FT_NEXT_USHORT( p );
-
-
-          if ( gindex == glyph_index )
-            break;
-        }
-
-        if ( mm >= num_glyphs )
-          goto NoBitmap;
-
-        image_start = image_size * mm;
-        image_end   = image_start + image_size;
-      }
-      break;
-
-    default:
-      goto NoBitmap;
-    }
-
-    if ( image_start > image_end )
-      goto NoBitmap;
-
-    image_end  -= image_start;
-    image_start = image_offset + image_start;
-
-    return tt_sbit_decoder_load_bitmap( decoder,
-                                        image_format,
-                                        image_start,
-                                        image_end,
-                                        x_pos,
-                                        y_pos );
-
-  Failure:
-    return SFNT_Err_Invalid_Table;
-
-  NoBitmap:
-    return SFNT_Err_Invalid_Argument;
-  }
-
-
-  FT_LOCAL( FT_Error )
-  tt_face_load_sbit_image( TT_Face              face,
-                           FT_ULong             strike_index,
-                           FT_UInt              glyph_index,
-                           FT_UInt              load_flags,
-                           FT_Stream            stream,
-                           FT_Bitmap           *map,
-                           TT_SBit_MetricsRec  *metrics )
-  {
-    TT_SBitDecoderRec  decoder[1];
-    FT_Error           error;
-
-    FT_UNUSED( load_flags );
-    FT_UNUSED( stream );
-    FT_UNUSED( map );
-
-
-    error = tt_sbit_decoder_init( decoder, face, strike_index, metrics );
-    if ( !error )
-    {
-      error = tt_sbit_decoder_load_image( decoder, glyph_index, 0, 0 );
-      tt_sbit_decoder_done( decoder );
-    }
-
-    return error;
-  }
-
-/* EOF */
diff --git a/reactos/lib/3rdparty/freetype/src/smooth/Jamfile b/reactos/lib/3rdparty/freetype/src/smooth/Jamfile
deleted file mode 100644 (file)
index a8496aa..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/smooth Jamfile
-#
-# Copyright 2001 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) smooth ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = ftgrays ftsmooth ftspic ;
-  }
-  else
-  {
-    _sources = smooth ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/smooth Jamfile
index a85e160..7532a35 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    A new `perfect' anti-aliasing renderer (body).                       */
 /*                                                                         */
 /*                                                                         */
 /*    A new `perfect' anti-aliasing renderer (body).                       */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010 by */
+/*  Copyright 2000-2003, 2005-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #ifdef _STANDALONE_
 
 
 #ifdef _STANDALONE_
 
 
+  /* Auxiliary macros for token concatenation. */
+#define FT_ERR_XCAT( x, y )  x ## y
+#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )
+
+
   /* define this to dump debugging information */
 /* #define FT_DEBUG_LEVEL_TRACE */
 
   /* define this to dump debugging information */
 /* #define FT_DEBUG_LEVEL_TRACE */
 
@@ -154,6 +159,21 @@ typedef ptrdiff_t  FT_PtrDist;
     va_end( ap );
   }
 
     va_end( ap );
   }
 
+
+  /* empty function useful for setting a breakpoint to catch errors */
+  int
+  FT_Throw( int          error,
+            int          line,
+            const char*  file )
+  {
+    FT_UNUSED( error );
+    FT_UNUSED( line );
+    FT_UNUSED( file );
+
+    return 0;
+  }
+
+
   /* we don't handle tracing levels in stand-alone mode; */
 #ifndef FT_TRACE5
 #define FT_TRACE5( varformat )  FT_Message varformat
   /* we don't handle tracing levels in stand-alone mode; */
 #ifndef FT_TRACE5
 #define FT_TRACE5( varformat )  FT_Message varformat
@@ -165,11 +185,19 @@ typedef ptrdiff_t  FT_PtrDist;
 #define FT_ERROR( varformat )   FT_Message varformat
 #endif
 
 #define FT_ERROR( varformat )   FT_Message varformat
 #endif
 
+#define FT_THROW( e )                               \
+          ( FT_Throw( FT_ERR_CAT( ErrRaster, e ),   \
+                      __LINE__,                     \
+                      __FILE__ )                  | \
+            FT_ERR_CAT( ErrRaster, e )            )
+
 #else /* !FT_DEBUG_LEVEL_TRACE */
 
 #define FT_TRACE5( x )  do { } while ( 0 )     /* nothing */
 #define FT_TRACE7( x )  do { } while ( 0 )     /* nothing */
 #define FT_ERROR( x )   do { } while ( 0 )     /* nothing */
 #else /* !FT_DEBUG_LEVEL_TRACE */
 
 #define FT_TRACE5( x )  do { } while ( 0 )     /* nothing */
 #define FT_TRACE7( x )  do { } while ( 0 )     /* nothing */
 #define FT_ERROR( x )   do { } while ( 0 )     /* nothing */
+#define FT_THROW( e )   FT_ERR_CAT( ErrRaster_, e )
+
 
 #endif /* !FT_DEBUG_LEVEL_TRACE */
 
 
 #endif /* !FT_DEBUG_LEVEL_TRACE */
 
@@ -202,6 +230,7 @@ typedef ptrdiff_t  FT_PtrDist;
             raster_done_                                          \
          };
 
             raster_done_                                          \
          };
 
+
 #else /* !_STANDALONE_ */
 
 
 #else /* !_STANDALONE_ */
 
 
@@ -215,13 +244,14 @@ typedef ptrdiff_t  FT_PtrDist;
 
 #include "ftspic.h"
 
 
 #include "ftspic.h"
 
-#define ErrRaster_Invalid_Mode      Smooth_Err_Cannot_Render_Glyph
-#define ErrRaster_Invalid_Outline   Smooth_Err_Invalid_Outline
+#define Smooth_Err_Invalid_Mode     Smooth_Err_Cannot_Render_Glyph
+#define Smooth_Err_Memory_Overflow  Smooth_Err_Out_Of_Memory
 #define ErrRaster_Memory_Overflow   Smooth_Err_Out_Of_Memory
 #define ErrRaster_Memory_Overflow   Smooth_Err_Out_Of_Memory
-#define ErrRaster_Invalid_Argument  Smooth_Err_Invalid_Argument
+
 
 #endif /* !_STANDALONE_ */
 
 
 #endif /* !_STANDALONE_ */
 
+
 #ifndef FT_MEM_SET
 #define FT_MEM_SET( d, s, c )  ft_memset( d, s, c )
 #endif
 #ifndef FT_MEM_SET
 #define FT_MEM_SET( d, s, c )  ft_memset( d, s, c )
 #endif
@@ -232,10 +262,15 @@ typedef ptrdiff_t  FT_PtrDist;
 
   /* as usual, for the speed hungry :-) */
 
 
   /* as usual, for the speed hungry :-) */
 
+#undef RAS_ARG
+#undef RAS_ARG_
+#undef RAS_VAR
+#undef RAS_VAR_
+
 #ifndef FT_STATIC_RASTER
 
 #ifndef FT_STATIC_RASTER
 
-#define RAS_ARG   PWorker  worker
-#define RAS_ARG_  PWorker  worker,
+#define RAS_ARG   gray_PWorker  worker
+#define RAS_ARG_  gray_PWorker  worker,
 
 #define RAS_VAR   worker
 #define RAS_VAR_  worker,
 
 #define RAS_VAR   worker
 #define RAS_VAR_  worker,
@@ -253,6 +288,11 @@ typedef ptrdiff_t  FT_PtrDist;
   /* must be at least 6 bits! */
 #define PIXEL_BITS  8
 
   /* must be at least 6 bits! */
 #define PIXEL_BITS  8
 
+#undef FLOOR
+#undef CEILING
+#undef TRUNC
+#undef SCALED
+
 #define ONE_PIXEL       ( 1L << PIXEL_BITS )
 #define PIXEL_MASK      ( -1L << PIXEL_BITS )
 #define TRUNC( x )      ( (TCoord)( (x) >> PIXEL_BITS ) )
 #define ONE_PIXEL       ( 1L << PIXEL_BITS )
 #define PIXEL_MASK      ( -1L << PIXEL_BITS )
 #define TRUNC( x )      ( (TCoord)( (x) >> PIXEL_BITS ) )
@@ -302,7 +342,7 @@ typedef ptrdiff_t  FT_PtrDist;
 #endif /* PIXEL_BITS >= 8 */
 
 
 #endif /* PIXEL_BITS >= 8 */
 
 
-  /* maximal number of gray spans in a call to the span callback */
+  /* maximum number of gray spans in a call to the span callback */
 #define FT_MAX_GRAY_SPANS  32
 
 
 #define FT_MAX_GRAY_SPANS  32
 
 
@@ -310,15 +350,23 @@ typedef ptrdiff_t  FT_PtrDist;
 
   typedef struct  TCell_
   {
 
   typedef struct  TCell_
   {
-    TPos   x;     /* same with TWorker.ex */
-    TCoord cover; /* same with TWorker.cover */
-    TArea  area;
-    PCell  next;
+    TPos    x;     /* same with gray_TWorker.ex    */
+    TCoord  cover; /* same with gray_TWorker.cover */
+    TArea   area;
+    PCell   next;
 
   } TCell;
 
 
 
   } TCell;
 
 
-  typedef struct  TWorker_
+#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */
+  /* We disable the warning `structure was padded due to   */
+  /* __declspec(align())' in order to compile cleanly with */
+  /* the maximum level of warnings.                        */
+#pragma warning( push )
+#pragma warning( disable : 4324 )
+#endif /* _MSC_VER */
+
+  typedef struct  gray_TWorker_
   {
     TCoord  ex, ey;
     TPos    min_ex, max_ex;
   {
     TCoord  ex, ey;
     TPos    min_ex, max_ex;
@@ -329,7 +377,7 @@ typedef ptrdiff_t  FT_PtrDist;
     TCoord  cover;
     int     invalid;
 
     TCoord  cover;
     int     invalid;
 
-    PCell   cells;
+    PCell       cells;
     FT_PtrDist  max_cells;
     FT_PtrDist  num_cells;
 
     FT_PtrDist  max_cells;
     FT_PtrDist  num_cells;
 
@@ -363,25 +411,29 @@ typedef ptrdiff_t  FT_PtrDist;
     PCell*     ycells;
     TPos       ycount;
 
     PCell*     ycells;
     TPos       ycount;
 
-  } TWorker, *PWorker;
+  } gray_TWorker, *gray_PWorker;
+
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
 
 
 #ifndef FT_STATIC_RASTER
 #define ras  (*worker)
 #else
 
 
 #ifndef FT_STATIC_RASTER
 #define ras  (*worker)
 #else
-  static TWorker  ras;
+  static gray_TWorker  ras;
 #endif
 
 
 #endif
 
 
-  typedef struct TRaster_
+  typedef struct gray_TRaster_
   {
   {
-    void*    buffer;
-    long     buffer_size;
-    int      band_size;
-    void*    memory;
-    PWorker  worker;
+    void*         buffer;
+    long          buffer_size;
+    int           band_size;
+    void*         memory;
+    gray_PWorker  worker;
 
 
-  } TRaster, *PRaster;
+  } gray_TRaster, *gray_PRaster;
 
 
 
 
 
 
@@ -590,7 +642,7 @@ typedef ptrdiff_t  FT_PtrDist;
                                  TPos    x2,
                                  TCoord  y2 )
   {
                                  TPos    x2,
                                  TCoord  y2 )
   {
-    TCoord  ex1, ex2, fx1, fx2, delta, mod, lift, rem;
+    TCoord  ex1, ex2, fx1, fx2, delta, mod;
     long    p, first, dx;
     int     incr;
 
     long    p, first, dx;
     int     incr;
 
@@ -651,6 +703,9 @@ typedef ptrdiff_t  FT_PtrDist;
 
     if ( ex1 != ex2 )
     {
 
     if ( ex1 != ex2 )
     {
+      TCoord  lift, rem;
+
+
       p    = ONE_PIXEL * ( y2 - y1 + delta );
       lift = (TCoord)( p / dx );
       rem  = (TCoord)( p % dx );
       p    = ONE_PIXEL * ( y2 - y1 + delta );
       lift = (TCoord)( p / dx );
       rem  = (TCoord)( p % dx );
@@ -872,11 +927,14 @@ typedef ptrdiff_t  FT_PtrDist;
                               const FT_Vector*  to )
   {
     TPos        dx, dy;
                               const FT_Vector*  to )
   {
     TPos        dx, dy;
+    TPos        min, max, y;
     int         top, level;
     int*        levels;
     FT_Vector*  arc;
 
 
     int         top, level;
     int*        levels;
     FT_Vector*  arc;
 
 
+    levels = ras.lev_stack;
+
     arc      = ras.bez_stack;
     arc[0].x = UPSCALE( to->x );
     arc[0].y = UPSCALE( to->y );
     arc      = ras.bez_stack;
     arc[0].x = UPSCALE( to->x );
     arc[0].y = UPSCALE( to->y );
@@ -884,51 +942,44 @@ typedef ptrdiff_t  FT_PtrDist;
     arc[1].y = UPSCALE( control->y );
     arc[2].x = ras.x;
     arc[2].y = ras.y;
     arc[1].y = UPSCALE( control->y );
     arc[2].x = ras.x;
     arc[2].y = ras.y;
+    top      = 0;
 
     dx = FT_ABS( arc[2].x + arc[0].x - 2 * arc[1].x );
     dy = FT_ABS( arc[2].y + arc[0].y - 2 * arc[1].y );
     if ( dx < dy )
       dx = dy;
 
 
     dx = FT_ABS( arc[2].x + arc[0].x - 2 * arc[1].x );
     dy = FT_ABS( arc[2].y + arc[0].y - 2 * arc[1].y );
     if ( dx < dy )
       dx = dy;
 
-    if ( dx <= ONE_PIXEL / 4 )
-    {
-      gray_render_line( RAS_VAR_ arc[0].x, arc[0].y );
-      return;
-    }
+    if ( dx < ONE_PIXEL / 4 )
+      goto Draw;
+
+    /* short-cut the arc that crosses the current band */
+    min = max = arc[0].y;
+
+    y = arc[1].y;
+    if ( y < min ) min = y;
+    if ( y > max ) max = y;
+
+    y = arc[2].y;
+    if ( y < min ) min = y;
+    if ( y > max ) max = y;
+
+    if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey )
+      goto Draw;
 
     level = 0;
 
     level = 0;
-    while ( dx > ONE_PIXEL / 4 )
+    do
     {
       dx >>= 2;
       level++;
     {
       dx >>= 2;
       level++;
-    }
+    } while ( dx > ONE_PIXEL / 4 );
 
 
-    levels    = ras.lev_stack;
     levels[0] = level;
     levels[0] = level;
-    top       = 0;
 
 
-    while ( top >= 0 )
+    do
     {
       level = levels[top];
     {
       level = levels[top];
-      if ( level > 1 )
+      if ( level > 0 )
       {
       {
-        /* check that the arc crosses the current band */
-        TPos  min, max, y;
-
-
-        min = max = arc[0].y;
-
-        y = arc[1].y;
-        if ( y < min ) min = y;
-        if ( y > max ) max = y;
-
-        y = arc[2].y;
-        if ( y < min ) min = y;
-        if ( y > max ) max = y;
-
-        if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey )
-          goto Draw;
-
         gray_split_conic( arc );
         arc += 2;
         top++;
         gray_split_conic( arc );
         arc += 2;
         top++;
@@ -940,9 +991,8 @@ typedef ptrdiff_t  FT_PtrDist;
       gray_render_line( RAS_VAR_ arc[0].x, arc[0].y );
       top--;
       arc -= 2;
       gray_render_line( RAS_VAR_ arc[0].x, arc[0].y );
       top--;
       arc -= 2;
-    }
 
 
-    return;
+    } while ( top >= 0 );
   }
 
 
   }
 
 
@@ -980,6 +1030,7 @@ typedef ptrdiff_t  FT_PtrDist;
                               const FT_Vector*  to )
   {
     FT_Vector*  arc;
                               const FT_Vector*  to )
   {
     FT_Vector*  arc;
+    TPos        min, max, y;
 
 
     arc      = ras.bez_stack;
 
 
     arc      = ras.bez_stack;
@@ -992,35 +1043,32 @@ typedef ptrdiff_t  FT_PtrDist;
     arc[3].x = ras.x;
     arc[3].y = ras.y;
 
     arc[3].x = ras.x;
     arc[3].y = ras.y;
 
-    for (;;)
-    {
-      /* Check that the arc crosses the current band. */
-      TPos  min, max, y;
+    /* Short-cut the arc that crosses the current band. */
+    min = max = arc[0].y;
 
 
+    y = arc[1].y;
+    if ( y < min )
+      min = y;
+    if ( y > max )
+      max = y;
 
 
-      min = max = arc[0].y;
+    y = arc[2].y;
+    if ( y < min )
+      min = y;
+    if ( y > max )
+      max = y;
 
 
-      y = arc[1].y;
-      if ( y < min )
-        min = y;
-      if ( y > max )
-        max = y;
+    y = arc[3].y;
+    if ( y < min )
+      min = y;
+    if ( y > max )
+      max = y;
 
 
-      y = arc[2].y;
-      if ( y < min )
-        min = y;
-      if ( y > max )
-        max = y;
-
-      y = arc[3].y;
-      if ( y < min )
-        min = y;
-      if ( y > max )
-        max = y;
-
-      if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey )
-        goto Draw;
+    if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey )
+      goto Draw;
 
 
+    for (;;)
+    {
       /* Decide whether to split or draw. See `Rapid Termination          */
       /* Evaluation for Recursive Subdivision of Bezier Curves' by Thomas */
       /* F. Hain, at                                                      */
       /* Decide whether to split or draw. See `Rapid Termination          */
       /* Evaluation for Recursive Subdivision of Bezier Curves' by Thomas */
       /* F. Hain, at                                                      */
@@ -1088,11 +1136,11 @@ typedef ptrdiff_t  FT_PtrDist;
         if ( s > s_limit )
           goto Split;
 
         if ( s > s_limit )
           goto Split;
 
-        /* If P1 or P2 is outside P0-P3, split the curve. */
-        if ( dy * dy1 + dx * dx1 < 0                                     ||
-             dy * dy2 + dx * dx2 < 0                                     ||
-             dy * (arc[3].y - arc[1].y) + dx * (arc[3].x - arc[1].x) < 0 ||
-             dy * (arc[3].y - arc[2].y) + dx * (arc[3].x - arc[2].x) < 0 )
+        /* Split super curvy segments where the off points are so far
+           from the chord that the angles P0-P1-P3 or P0-P2-P3 become
+           acute as detected by appropriate dot products. */
+        if ( dx1 * ( dx1 - dx ) + dy1 * ( dy1 - dy ) > 0 ||
+             dx2 * ( dx2 - dx ) + dy2 * ( dy2 - dy ) > 0 )
           goto Split;
 
         /* No reason to split. */
           goto Split;
 
         /* No reason to split. */
@@ -1117,7 +1165,7 @@ typedef ptrdiff_t  FT_PtrDist;
 
   static int
   gray_move_to( const FT_Vector*  to,
 
   static int
   gray_move_to( const FT_Vector*  to,
-                PWorker           worker )
+                gray_PWorker      worker )
   {
     TPos  x, y;
 
   {
     TPos  x, y;
 
@@ -1139,7 +1187,7 @@ typedef ptrdiff_t  FT_PtrDist;
 
   static int
   gray_line_to( const FT_Vector*  to,
 
   static int
   gray_line_to( const FT_Vector*  to,
-                PWorker           worker )
+                gray_PWorker      worker )
   {
     gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) );
     return 0;
   {
     gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) );
     return 0;
@@ -1149,7 +1197,7 @@ typedef ptrdiff_t  FT_PtrDist;
   static int
   gray_conic_to( const FT_Vector*  control,
                  const FT_Vector*  to,
   static int
   gray_conic_to( const FT_Vector*  control,
                  const FT_Vector*  to,
-                 PWorker           worker )
+                 gray_PWorker      worker )
   {
     gray_render_conic( RAS_VAR_ control, to );
     return 0;
   {
     gray_render_conic( RAS_VAR_ control, to );
     return 0;
@@ -1160,7 +1208,7 @@ typedef ptrdiff_t  FT_PtrDist;
   gray_cubic_to( const FT_Vector*  control1,
                  const FT_Vector*  control2,
                  const FT_Vector*  to,
   gray_cubic_to( const FT_Vector*  control1,
                  const FT_Vector*  control2,
                  const FT_Vector*  to,
-                 PWorker           worker )
+                 gray_PWorker      worker )
   {
     gray_render_cubic( RAS_VAR_ control1, control2, to );
     return 0;
   {
     gray_render_cubic( RAS_VAR_ control1, control2, to );
     return 0;
@@ -1171,7 +1219,7 @@ typedef ptrdiff_t  FT_PtrDist;
   gray_render_span( int             y,
                     int             count,
                     const FT_Span*  spans,
   gray_render_span( int             y,
                     int             count,
                     const FT_Span*  spans,
-                    PWorker         worker )
+                    gray_PWorker    worker )
   {
     unsigned char*  p;
     FT_Bitmap*      map = &worker->target;
   {
     unsigned char*  p;
     FT_Bitmap*      map = &worker->target;
@@ -1224,9 +1272,7 @@ typedef ptrdiff_t  FT_PtrDist;
                        TPos    area,
                        TCoord  acount )
   {
                        TPos    area,
                        TCoord  acount )
   {
-    FT_Span*  span;
-    int       count;
-    int       coverage;
+    int  coverage;
 
 
     /* compute the coverage line's coverage, depending on the    */
 
 
     /* compute the coverage line's coverage, depending on the    */
@@ -1268,6 +1314,10 @@ typedef ptrdiff_t  FT_PtrDist;
 
     if ( coverage )
     {
 
     if ( coverage )
     {
+      FT_Span*  span;
+      int       count;
+
+
       /* see whether we can add this span to the current list */
       count = ras.num_gray_spans;
       span  = ras.gray_spans + count - 1;
       /* see whether we can add this span to the current list */
       count = ras.num_gray_spans;
       span  = ras.gray_spans + count - 1;
@@ -1397,7 +1447,26 @@ typedef ptrdiff_t  FT_PtrDist;
       ras.render_span( ras.span_y, ras.num_gray_spans,
                        ras.gray_spans, ras.render_span_data );
 
       ras.render_span( ras.span_y, ras.num_gray_spans,
                        ras.gray_spans, ras.render_span_data );
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+    if ( ras.num_gray_spans > 0 )
+    {
+      FT_Span*  span;
+      int       n;
+
+
+      FT_TRACE7(( "y = %3d ", ras.span_y ));
+      span = ras.gray_spans;
+      for ( n = 0; n < ras.num_gray_spans; n++, span++ )
+        FT_TRACE7(( "[%d..%d]:%02x ",
+                    span->x, span->x + span->len - 1, span->coverage ));
+      FT_TRACE7(( "\n" ));
+    }
+
     FT_TRACE7(( "gray_sweep: end\n" ));
     FT_TRACE7(( "gray_sweep: end\n" ));
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
   }
 
 
   }
 
 
@@ -1464,7 +1533,7 @@ typedef ptrdiff_t  FT_PtrDist;
 
 
     if ( !outline || !func_interface )
 
 
     if ( !outline || !func_interface )
-      return ErrRaster_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     shift = func_interface->shift;
     delta = func_interface->delta;
 
     shift = func_interface->shift;
     delta = func_interface->delta;
@@ -1677,17 +1746,17 @@ typedef ptrdiff_t  FT_PtrDist;
     return error;
 
   Invalid_Outline:
     return error;
 
   Invalid_Outline:
-    return ErrRaster_Invalid_Outline;
+    return FT_THROW( Invalid_Outline );
   }
 
 #endif /* _STANDALONE_ */
 
 
   }
 
 #endif /* _STANDALONE_ */
 
 
-  typedef struct  TBand_
+  typedef struct  gray_TBand_
   {
     TPos  min, max;
 
   {
     TPos  min, max;
 
-  } TBand;
+  } gray_TBand;
 
     FT_DEFINE_OUTLINE_FUNCS(func_interface,
       (FT_Outline_MoveTo_Func) gray_move_to,
 
     FT_DEFINE_OUTLINE_FUNCS(func_interface,
       (FT_Outline_MoveTo_Func) gray_move_to,
@@ -1715,7 +1784,7 @@ typedef ptrdiff_t  FT_PtrDist;
       gray_record_cell( RAS_VAR );
     }
     else
       gray_record_cell( RAS_VAR );
     }
     else
-      error = ErrRaster_Memory_Overflow;
+      error = FT_THROW( Memory_Overflow );
 
     return error;
   }
 
     return error;
   }
@@ -1724,11 +1793,11 @@ typedef ptrdiff_t  FT_PtrDist;
   static int
   gray_convert_glyph( RAS_ARG )
   {
   static int
   gray_convert_glyph( RAS_ARG )
   {
-    TBand            bands[40];
-    TBand* volatile  band;
-    int volatile     n, num_bands;
-    TPos volatile    min, max, max_y;
-    FT_BBox*         clip;
+    gray_TBand            bands[40];
+    gray_TBand* volatile  band;
+    int volatile          n, num_bands;
+    TPos volatile         min, max, max_y;
+    FT_BBox*              clip;
 
 
     /* Set up state in the raster object */
 
 
     /* Set up state in the raster object */
@@ -1792,7 +1861,7 @@ typedef ptrdiff_t  FT_PtrDist;
             cell_start += sizeof ( TCell ) - cell_mod;
 
           cell_end  = ras.buffer_size;
             cell_start += sizeof ( TCell ) - cell_mod;
 
           cell_end  = ras.buffer_size;
-          cell_end -= cell_end % sizeof( TCell );
+          cell_end -= cell_end % sizeof ( TCell );
 
           cells_max = (PCell)( (char*)ras.buffer + cell_end );
           ras.cells = (PCell)( (char*)ras.buffer + cell_start );
 
           cells_max = (PCell)( (char*)ras.buffer + cell_end );
           ras.cells = (PCell)( (char*)ras.buffer + cell_start );
@@ -1859,30 +1928,30 @@ typedef ptrdiff_t  FT_PtrDist;
 
 
   static int
 
 
   static int
-  gray_raster_render( PRaster                  raster,
+  gray_raster_render( gray_PRaster             raster,
                       const FT_Raster_Params*  params )
   {
     const FT_Outline*  outline    = (const FT_Outline*)params->source;
     const FT_Bitmap*   target_map = params->target;
                       const FT_Raster_Params*  params )
   {
     const FT_Outline*  outline    = (const FT_Outline*)params->source;
     const FT_Bitmap*   target_map = params->target;
-    PWorker            worker;
+    gray_PWorker       worker;
 
 
     if ( !raster || !raster->buffer || !raster->buffer_size )
 
 
     if ( !raster || !raster->buffer || !raster->buffer_size )
-      return ErrRaster_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( !outline )
 
     if ( !outline )
-      return ErrRaster_Invalid_Outline;
+      return FT_THROW( Invalid_Outline );
 
     /* return immediately if the outline is empty */
     if ( outline->n_points == 0 || outline->n_contours <= 0 )
       return 0;
 
     if ( !outline->contours || !outline->points )
 
     /* return immediately if the outline is empty */
     if ( outline->n_points == 0 || outline->n_contours <= 0 )
       return 0;
 
     if ( !outline->contours || !outline->points )
-      return ErrRaster_Invalid_Outline;
+      return FT_THROW( Invalid_Outline );
 
     if ( outline->n_points !=
            outline->contours[outline->n_contours - 1] + 1 )
 
     if ( outline->n_points !=
            outline->contours[outline->n_contours - 1] + 1 )
-      return ErrRaster_Invalid_Outline;
+      return FT_THROW( Invalid_Outline );
 
     worker = raster->worker;
 
 
     worker = raster->worker;
 
@@ -1890,19 +1959,19 @@ typedef ptrdiff_t  FT_PtrDist;
     if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )
     {
       if ( !target_map )
     if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )
     {
       if ( !target_map )
-        return ErrRaster_Invalid_Argument;
+        return FT_THROW( Invalid_Argument );
 
       /* nothing to do */
       if ( !target_map->width || !target_map->rows )
         return 0;
 
       if ( !target_map->buffer )
 
       /* nothing to do */
       if ( !target_map->width || !target_map->rows )
         return 0;
 
       if ( !target_map->buffer )
-        return ErrRaster_Invalid_Argument;
+        return FT_THROW( Invalid_Argument );
     }
 
     /* this version does not support monochrome rendering */
     if ( !( params->flags & FT_RASTER_FLAG_AA ) )
     }
 
     /* this version does not support monochrome rendering */
     if ( !( params->flags & FT_RASTER_FLAG_AA ) )
-      return ErrRaster_Invalid_Mode;
+      return FT_THROW( Invalid_Mode );
 
     /* compute clipping box */
     if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )
 
     /* compute clipping box */
     if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )
@@ -1956,7 +2025,7 @@ typedef ptrdiff_t  FT_PtrDist;
   gray_raster_new( void*       memory,
                    FT_Raster*  araster )
   {
   gray_raster_new( void*       memory,
                    FT_Raster*  araster )
   {
-    static TRaster  the_raster;
+    static gray_TRaster  the_raster;
 
     FT_UNUSED( memory );
 
 
     FT_UNUSED( memory );
 
@@ -1981,15 +2050,15 @@ typedef ptrdiff_t  FT_PtrDist;
   gray_raster_new( FT_Memory   memory,
                    FT_Raster*  araster )
   {
   gray_raster_new( FT_Memory   memory,
                    FT_Raster*  araster )
   {
-    FT_Error  error;
-    PRaster   raster = NULL;
+    FT_Error      error;
+    gray_PRaster  raster = NULL;
 
 
     *araster = 0;
 
 
     *araster = 0;
-    if ( !FT_ALLOC( raster, sizeof ( TRaster ) ) )
+    if ( !FT_ALLOC( raster, sizeof ( gray_TRaster ) ) )
     {
       raster->memory = memory;
     {
       raster->memory = memory;
-      *araster = (FT_Raster)raster;
+      *araster       = (FT_Raster)raster;
     }
 
     return error;
     }
 
     return error;
@@ -1999,7 +2068,7 @@ typedef ptrdiff_t  FT_PtrDist;
   static void
   gray_raster_done( FT_Raster  raster )
   {
   static void
   gray_raster_done( FT_Raster  raster )
   {
-    FT_Memory  memory = (FT_Memory)((PRaster)raster)->memory;
+    FT_Memory  memory = (FT_Memory)((gray_PRaster)raster)->memory;
 
 
     FT_FREE( raster );
 
 
     FT_FREE( raster );
@@ -2013,19 +2082,20 @@ typedef ptrdiff_t  FT_PtrDist;
                      char*      pool_base,
                      long       pool_size )
   {
                      char*      pool_base,
                      long       pool_size )
   {
-    PRaster  rast = (PRaster)raster;
+    gray_PRaster  rast = (gray_PRaster)raster;
 
 
     if ( raster )
     {
 
 
     if ( raster )
     {
-      if ( pool_base && pool_size >= (long)sizeof ( TWorker ) + 2048 )
+      if ( pool_base && pool_size >= (long)sizeof ( gray_TWorker ) + 2048 )
       {
       {
-        PWorker  worker = (PWorker)pool_base;
+        gray_PWorker  worker = (gray_PWorker)pool_base;
 
 
         rast->worker      = worker;
         rast->buffer      = pool_base +
 
 
         rast->worker      = worker;
         rast->buffer      = pool_base +
-                              ( ( sizeof ( TWorker ) + sizeof ( TCell ) - 1 ) &
+                              ( ( sizeof ( gray_TWorker ) +
+                                  sizeof ( TCell ) - 1 )  &
                                 ~( sizeof ( TCell ) - 1 ) );
         rast->buffer_size = (long)( ( pool_base + pool_size ) -
                                     (char*)rast->buffer ) &
                                 ~( sizeof ( TCell ) - 1 ) );
         rast->buffer_size = (long)( ( pool_base + pool_size ) -
                                     (char*)rast->buffer ) &
index 0c2a2ec..413d2f1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    smooth renderer error codes (specification only).                    */
 /*                                                                         */
 /*                                                                         */
 /*    smooth renderer error codes (specification only).                    */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,6 +30,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  Smooth_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Smooth
 
 #define FT_ERR_PREFIX  Smooth_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Smooth
 
index eb12f18..89088cd 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Anti-aliasing renderer interface (body).                             */
 /*                                                                         */
 /*                                                                         */
 /*    Anti-aliasing renderer interface (body).                             */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by       */
+/*  Copyright 2000-2006, 2009-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
                        const FT_Matrix*  matrix,
                        const FT_Vector*  delta )
   {
                        const FT_Matrix*  matrix,
                        const FT_Vector*  delta )
   {
-    FT_Error  error = Smooth_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( slot->format != render->glyph_format )
     {
 
 
     if ( slot->format != render->glyph_format )
     {
-      error = Smooth_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
     FT_Error     error;
     FT_Outline*  outline = NULL;
     FT_BBox      cbox;
     FT_Error     error;
     FT_Outline*  outline = NULL;
     FT_BBox      cbox;
-    FT_UInt      width, height, height_org, width_org, pitch;
-    FT_Bitmap*   bitmap;
-    FT_Memory    memory;
-    FT_Int       hmul = mode == FT_RENDER_MODE_LCD;
-    FT_Int       vmul = mode == FT_RENDER_MODE_LCD_V;
-    FT_Pos       x_shift, y_shift, x_left, y_top;
+    FT_Pos       width, height, pitch;
+#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+    FT_Pos       height_org, width_org;
+#endif
+    FT_Bitmap*   bitmap  = &slot->bitmap;
+    FT_Memory    memory  = render->root.memory;
+    FT_Int       hmul    = mode == FT_RENDER_MODE_LCD;
+    FT_Int       vmul    = mode == FT_RENDER_MODE_LCD_V;
+    FT_Pos       x_shift = 0;
+    FT_Pos       y_shift = 0;
+    FT_Pos       x_left, y_top;
 
     FT_Raster_Params  params;
 
 
     FT_Raster_Params  params;
 
+    FT_Bool  have_translated_origin = FALSE;
+    FT_Bool  have_outline_shifted   = FALSE;
+    FT_Bool  have_buffer            = FALSE;
+
 
     /* check glyph image format */
     if ( slot->format != render->glyph_format )
     {
 
     /* check glyph image format */
     if ( slot->format != render->glyph_format )
     {
-      error = Smooth_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     /* check mode */
     if ( mode != required_mode )
       goto Exit;
     }
 
     /* check mode */
     if ( mode != required_mode )
-      return Smooth_Err_Cannot_Render_Glyph;
+    {
+      error = FT_THROW( Cannot_Render_Glyph );
+      goto Exit;
+    }
 
     outline = &slot->outline;
 
     /* translate the outline to the new origin if needed */
     if ( origin )
 
     outline = &slot->outline;
 
     /* translate the outline to the new origin if needed */
     if ( origin )
+    {
       FT_Outline_Translate( outline, origin->x, origin->y );
       FT_Outline_Translate( outline, origin->x, origin->y );
+      have_translated_origin = TRUE;
+    }
 
     /* compute the control box, and grid fit it */
     FT_Outline_Get_CBox( outline, &cbox );
 
     /* compute the control box, and grid fit it */
     FT_Outline_Get_CBox( outline, &cbox );
       FT_ERROR(( "ft_smooth_render_generic: glyph too large:"
                  " xMin = %d, xMax = %d\n",
                  cbox.xMin >> 6, cbox.xMax >> 6 ));
       FT_ERROR(( "ft_smooth_render_generic: glyph too large:"
                  " xMin = %d, xMax = %d\n",
                  cbox.xMin >> 6, cbox.xMax >> 6 ));
-      return Smooth_Err_Raster_Overflow;
+      error = FT_THROW( Raster_Overflow );
+      goto Exit;
     }
     else
     }
     else
-      width  = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
+      width = ( cbox.xMax - cbox.xMin ) >> 6;
 
     if ( cbox.yMin < 0 && cbox.yMax > FT_INT_MAX + cbox.yMin )
     {
       FT_ERROR(( "ft_smooth_render_generic: glyph too large:"
                  " yMin = %d, yMax = %d\n",
                  cbox.yMin >> 6, cbox.yMax >> 6 ));
 
     if ( cbox.yMin < 0 && cbox.yMax > FT_INT_MAX + cbox.yMin )
     {
       FT_ERROR(( "ft_smooth_render_generic: glyph too large:"
                  " yMin = %d, yMax = %d\n",
                  cbox.yMin >> 6, cbox.yMax >> 6 ));
-      return Smooth_Err_Raster_Overflow;
+      error = FT_THROW( Raster_Overflow );
+      goto Exit;
     }
     else
     }
     else
-      height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
-
-    bitmap = &slot->bitmap;
-    memory = render->root.memory;
+      height = ( cbox.yMax - cbox.yMin ) >> 6;
 
 
+#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
     width_org  = width;
     height_org = height;
     width_org  = width;
     height_org = height;
+#endif
 
     /* release old bitmap buffer */
     if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
 
     /* release old bitmap buffer */
     if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
 
 #if FT_UINT_MAX > 0xFFFFU
 
 
 #if FT_UINT_MAX > 0xFFFFU
 
-    /* Required check is ( pitch * height < FT_ULONG_MAX ),     */
-    /* but we care realistic cases only. Always pitch <= width. */
-    if ( width > 0x7FFFU || height > 0x7FFFU )
+    /* Required check is (pitch * height < FT_ULONG_MAX),        */
+    /* but we care realistic cases only.  Always pitch <= width. */
+    if ( width > 0x7FFF || height > 0x7FFF )
     {
       FT_ERROR(( "ft_smooth_render_generic: glyph too large: %u x %u\n",
                  width, height ));
     {
       FT_ERROR(( "ft_smooth_render_generic: glyph too large: %u x %u\n",
                  width, height ));
-      return Smooth_Err_Raster_Overflow;
+      error = FT_THROW( Raster_Overflow );
+      goto Exit;
     }
 
 #endif
     }
 
 #endif
 
     /* translate outline to render it into the bitmap */
     FT_Outline_Translate( outline, -x_shift, -y_shift );
 
     /* translate outline to render it into the bitmap */
     FT_Outline_Translate( outline, -x_shift, -y_shift );
+    have_outline_shifted = TRUE;
 
     if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
       goto Exit;
 
     if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
       goto Exit;
+    else
+      have_buffer = TRUE;
 
     slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
 
 
     slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
 
           vec->y /= 3;
     }
 
           vec->y /= 3;
     }
 
+    if ( error )
+      goto Exit;
+
     if ( slot->library->lcd_filter_func )
       slot->library->lcd_filter_func( bitmap, mode, slot->library );
 
     if ( slot->library->lcd_filter_func )
       slot->library->lcd_filter_func( bitmap, mode, slot->library );
 
 
     /* render outline into bitmap */
     error = render->raster_render( render->raster, &params );
 
     /* render outline into bitmap */
     error = render->raster_render( render->raster, &params );
+    if ( error )
+      goto Exit;
 
     /* expand it horizontally */
     if ( hmul )
 
     /* expand it horizontally */
     if ( hmul )
 
 #endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
 
 
 #endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
 
-    FT_Outline_Translate( outline, x_shift, y_shift );
-
     /*
      * XXX: on 16bit system, we return an error for huge bitmap
      * to prevent an overflow.
      */
     if ( x_left > FT_INT_MAX || y_top > FT_INT_MAX )
     /*
      * XXX: on 16bit system, we return an error for huge bitmap
      * to prevent an overflow.
      */
     if ( x_left > FT_INT_MAX || y_top > FT_INT_MAX )
-      return Smooth_Err_Invalid_Pixel_Size;
-
-    if ( error )
+    {
+      error = FT_THROW( Invalid_Pixel_Size );
       goto Exit;
       goto Exit;
+    }
 
     slot->format      = FT_GLYPH_FORMAT_BITMAP;
     slot->bitmap_left = (FT_Int)x_left;
     slot->bitmap_top  = (FT_Int)y_top;
 
 
     slot->format      = FT_GLYPH_FORMAT_BITMAP;
     slot->bitmap_left = (FT_Int)x_left;
     slot->bitmap_top  = (FT_Int)y_top;
 
+    /* everything is fine; don't deallocate buffer */
+    have_buffer = FALSE;
+
+    error = FT_Err_Ok;
+
   Exit:
   Exit:
-    if ( outline && origin )
+    if ( have_outline_shifted )
+      FT_Outline_Translate( outline, x_shift, y_shift );
+    if ( have_translated_origin )
       FT_Outline_Translate( outline, -origin->x, -origin->y );
       FT_Outline_Translate( outline, -origin->x, -origin->y );
+    if ( have_buffer )
+    {
+      FT_FREE( bitmap->buffer );
+      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
+    }
 
     return error;
   }
 
     return error;
   }
   }
 
 
   }
 
 
-  FT_DEFINE_RENDERER(ft_smooth_renderer_class,
+  FT_DEFINE_RENDERER( ft_smooth_renderer_class,
 
       FT_MODULE_RENDERER,
 
       FT_MODULE_RENDERER,
-      sizeof( FT_RendererRec ),
+      sizeof ( FT_RendererRec ),
 
       "smooth",
       0x10000L,
 
       "smooth",
       0x10000L,
   )
 
 
   )
 
 
-  FT_DEFINE_RENDERER(ft_smooth_lcd_renderer_class,
-  
+  FT_DEFINE_RENDERER( ft_smooth_lcd_renderer_class,
+
       FT_MODULE_RENDERER,
       FT_MODULE_RENDERER,
-      sizeof( FT_RendererRec ),
+      sizeof ( FT_RendererRec ),
 
       "smooth-lcd",
       0x10000L,
 
       "smooth-lcd",
       0x10000L,
     (FT_Raster_Funcs*)    &FT_GRAYS_RASTER_GET
   )
 
     (FT_Raster_Funcs*)    &FT_GRAYS_RASTER_GET
   )
 
-  FT_DEFINE_RENDERER(ft_smooth_lcdv_renderer_class,
+  FT_DEFINE_RENDERER( ft_smooth_lcdv_renderer_class,
 
       FT_MODULE_RENDERER,
 
       FT_MODULE_RENDERER,
-      sizeof( FT_RendererRec ),
+      sizeof ( FT_RendererRec ),
 
       "smooth-lcdv",
       0x10000L,
 
       "smooth-lcdv",
       0x10000L,
index 7adaab1..67a2b83 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for smooth module.   */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for smooth module.   */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009, 2010, 2012, 2013 by                                    */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "ftspic.h"
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "ftspic.h"
+#include "ftsmerrs.h"
+
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ftgrays.c */
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ftgrays.c */
-  void FT_Init_Class_ft_grays_raster(FT_Raster_Funcs*);
+  void
+  FT_Init_Class_ft_grays_raster( FT_Raster_Funcs*  funcs );
+
 
   void
 
   void
-  ft_smooth_renderer_class_pic_free(  FT_Library library )
+  ft_smooth_renderer_class_pic_free( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Memory memory = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Memory          memory        = library->memory;
+
+
     if ( pic_container->smooth )
     {
     if ( pic_container->smooth )
     {
-      SmoothPIC* container = (SmoothPIC*)pic_container->smooth;
-      if(--container->ref_count)
+      SmoothPIC*  container = (SmoothPIC*)pic_container->smooth;
+
+
+      if ( --container->ref_count )
         return;
         return;
+
       FT_FREE( container );
       pic_container->smooth = NULL;
     }
       FT_FREE( container );
       pic_container->smooth = NULL;
     }
   ft_smooth_renderer_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
   ft_smooth_renderer_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Error           error         = Smooth_Err_Ok;
-    SmoothPIC*         container;
+    FT_Error           error         = FT_Err_Ok;
+    SmoothPIC*         container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
     FT_Memory          memory        = library->memory;
 
 
-    /* since this function also serve smooth_lcd and smooth_lcdv renderers, 
+    /* since this function also serve smooth_lcd and smooth_lcdv renderers,
        it implements reference counting */
        it implements reference counting */
-    if(pic_container->smooth)
+    if ( pic_container->smooth )
     {
       ((SmoothPIC*)pic_container->smooth)->ref_count++;
       return error;
     }
 
     /* allocate pointer, clear and set global container pointer */
     {
       ((SmoothPIC*)pic_container->smooth)->ref_count++;
       return error;
     }
 
     /* allocate pointer, clear and set global container pointer */
-    if ( FT_ALLOC ( container, sizeof ( *container ) ) )
+    if ( FT_ALLOC( container, sizeof ( *container ) ) )
       return error;
       return error;
-    FT_MEM_SET( container, 0, sizeof(*container) );
+    FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->smooth = container;
     pic_container->smooth = container;
+
     container->ref_count = 1;
 
     container->ref_count = 1;
 
-    /* initialize pointer table - this is how the module usually expects this data */
-    FT_Init_Class_ft_grays_raster(&container->ft_grays_raster);
-/*Exit:*/
-    if(error)
-      ft_smooth_renderer_class_pic_free(library);
+    /* initialize pointer table -                       */
+    /* this is how the module usually expects this data */
+    FT_Init_Class_ft_grays_raster( &container->ft_grays_raster );
+
     return error;
   }
 
     return error;
   }
 
+
   /* re-route these init and free functions to the above functions */
   /* re-route these init and free functions to the above functions */
-  FT_Error ft_smooth_lcd_renderer_class_pic_init(FT_Library library)
+  FT_Error
+  ft_smooth_lcd_renderer_class_pic_init( FT_Library  library )
   {
   {
-    return ft_smooth_renderer_class_pic_init(library);
+    return ft_smooth_renderer_class_pic_init( library );
   }
   }
-  void ft_smooth_lcd_renderer_class_pic_free(FT_Library library)
+
+
+  void
+  ft_smooth_lcd_renderer_class_pic_free( FT_Library  library )
   {
   {
-    ft_smooth_renderer_class_pic_free(library);
+    ft_smooth_renderer_class_pic_free( library );
   }
   }
-  FT_Error ft_smooth_lcdv_renderer_class_pic_init(FT_Library library)
+
+
+  FT_Error
+  ft_smooth_lcdv_renderer_class_pic_init( FT_Library  library )
   {
   {
-    return ft_smooth_renderer_class_pic_init(library);
+    return ft_smooth_renderer_class_pic_init( library );
   }
   }
-  void ft_smooth_lcdv_renderer_class_pic_free(FT_Library library)
+
+
+  void
+  ft_smooth_lcdv_renderer_class_pic_free( FT_Library  library )
   {
   {
-    ft_smooth_renderer_class_pic_free(library);
+    ft_smooth_renderer_class_pic_free( library );
   }
 
 #endif /* FT_CONFIG_OPTION_PIC */
   }
 
 #endif /* FT_CONFIG_OPTION_PIC */
index c7e0ce9..334b51c 100644 (file)
 #ifndef __FTSPIC_H__
 #define __FTSPIC_H__
 
 #ifndef __FTSPIC_H__
 #define __FTSPIC_H__
 
-  
+
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 #ifndef FT_CONFIG_OPTION_PIC
 FT_BEGIN_HEADER
 
 #include FT_INTERNAL_PIC_H
 
 #ifndef FT_CONFIG_OPTION_PIC
-#define FT_GRAYS_RASTER_GET        ft_grays_raster
+
+#define FT_GRAYS_RASTER_GET  ft_grays_raster
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 
 #else /* FT_CONFIG_OPTION_PIC */
 
-  typedef struct SmoothPIC_
+  typedef struct  SmoothPIC_
   {
   {
-    int ref_count;
-    FT_Raster_Funcs ft_grays_raster;
+    int              ref_count;
+    FT_Raster_Funcs  ft_grays_raster;
+
   } SmoothPIC;
 
   } SmoothPIC;
 
-#define GET_PIC(lib)               ((SmoothPIC*)((lib)->pic_container.smooth))
-#define FT_GRAYS_RASTER_GET        (GET_PIC(library)->ft_grays_raster)
+
+#define GET_PIC( lib ) \
+          ( (SmoothPIC*)( (lib)->pic_container.smooth ) )
+#define FT_GRAYS_RASTER_GET  ( GET_PIC( library )->ft_grays_raster )
+
+
+  /* see ftspic.c for the implementation */
+  void
+  ft_smooth_renderer_class_pic_free( FT_Library  library );
+
+  void
+  ft_smooth_lcd_renderer_class_pic_free( FT_Library  library );
+
+  void
+  ft_smooth_lcdv_renderer_class_pic_free( FT_Library  library );
+
+  FT_Error
+  ft_smooth_renderer_class_pic_init( FT_Library  library );
+
+  FT_Error
+  ft_smooth_lcd_renderer_class_pic_init( FT_Library  library );
+
+  FT_Error
+  ft_smooth_lcdv_renderer_class_pic_init( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
index 4f27f01..88d0aa5 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
 #
 
 
-# Copyright 1996-2000, 2001, 2003 by
+# Copyright 1996-2000, 2001, 2003, 2011 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -25,7 +25,8 @@ SMOOTH_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SMOOTH_DIR))
 # smooth driver sources (i.e., C files)
 #
 SMOOTH_DRV_SRC := $(SMOOTH_DIR)/ftgrays.c  \
 # smooth driver sources (i.e., C files)
 #
 SMOOTH_DRV_SRC := $(SMOOTH_DIR)/ftgrays.c  \
-                  $(SMOOTH_DIR)/ftsmooth.c
+                  $(SMOOTH_DIR)/ftsmooth.c \
+                  $(SMOOTH_DIR)/ftspic.c
 
 
 # smooth driver headers
 
 
 # smooth driver headers
diff --git a/reactos/lib/3rdparty/freetype/src/tools/Jamfile b/reactos/lib/3rdparty/freetype/src/tools/Jamfile
deleted file mode 100644 (file)
index 475161e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# Jamfile for src/tools
-#
-SubDir FT2_TOP src tools ;
-
-Main  apinames : apinames.c ;
index 99e3028..c85df72 100644 (file)
@@ -10,7 +10,7 @@
  * accepted if you are using GCC for compilation (and probably by
  * other compilers too).
  *
  * accepted if you are using GCC for compilation (and probably by
  * other compilers too).
  *
- * Author: David Turner, 2005, 2006, 2008, 2009, 2010
+ * Author: David Turner, 2005, 2006, 2008-2013
  *
  * This code is explicitly placed into the public domain.
  *
  *
  * This code is explicitly placed into the public domain.
  *
@@ -22,7 +22,7 @@
 #include <ctype.h>
 
 #define  PROGRAM_NAME     "apinames"
 #include <ctype.h>
 
 #define  PROGRAM_NAME     "apinames"
-#define  PROGRAM_VERSION  "0.1"
+#define  PROGRAM_VERSION  "0.2"
 
 #define  LINEBUFF_SIZE  1024
 
 
 #define  LINEBUFF_SIZE  1024
 
@@ -31,7 +31,8 @@ typedef enum  OutputFormat_
   OUTPUT_LIST = 0,      /* output the list of names, one per line             */
   OUTPUT_WINDOWS_DEF,   /* output a Windows .DEF file for Visual C++ or Mingw */
   OUTPUT_BORLAND_DEF,   /* output a Windows .DEF file for Borland C++         */
   OUTPUT_LIST = 0,      /* output the list of names, one per line             */
   OUTPUT_WINDOWS_DEF,   /* output a Windows .DEF file for Visual C++ or Mingw */
   OUTPUT_BORLAND_DEF,   /* output a Windows .DEF file for Borland C++         */
-  OUTPUT_WATCOM_LBC     /* output a Watcom Linker Command File                */
+  OUTPUT_WATCOM_LBC,    /* output a Watcom Linker Command File                */
+  OUTPUT_NETWARE_IMP    /* output a NetWare ImportFile                        */
 
 } OutputFormat;
 
 
 } OutputFormat;
 
@@ -59,8 +60,9 @@ static void
 names_add( const char*  name,
            const char*  end )
 {
 names_add( const char*  name,
            const char*  end )
 {
-  int   nn, len, h;
-  Name  nm;
+  unsigned int  h;
+  int           nn, len;
+  Name          nm;
 
   if ( end <= name )
     return;
 
   if ( end <= name )
     return;
@@ -86,7 +88,8 @@ names_add( const char*  name,
   if ( num_names >= max_names )
   {
     max_names += (max_names >> 1) + 4;
   if ( num_names >= max_names )
   {
     max_names += (max_names >> 1) + 4;
-    the_names  = (NameRec*)realloc( the_names, sizeof(the_names[0])*max_names );
+    the_names  = (NameRec*)realloc( the_names,
+                                    sizeof ( the_names[0] ) * max_names );
     if ( the_names == NULL )
       panic( "not enough memory" );
   }
     if ( the_names == NULL )
       panic( "not enough memory" );
   }
@@ -115,7 +118,8 @@ name_compare( const void*  name1,
 static void
 names_sort( void )
 {
 static void
 names_sort( void )
 {
-  qsort( the_names, (size_t)num_names, sizeof(the_names[0]), name_compare );
+  qsort( the_names, (size_t)num_names,
+         sizeof ( the_names[0] ), name_compare );
 }
 
 
 }
 
 
@@ -151,8 +155,6 @@ names_dump( FILE*         out,
 
     case OUTPUT_WATCOM_LBC:
       {
 
     case OUTPUT_WATCOM_LBC:
       {
-        /* we must omit the .dll suffix from the library name */
-        char         temp[512];
         const char*  dot;
 
 
         const char*  dot;
 
 
@@ -163,13 +165,15 @@ names_dump( FILE*         out,
           exit( 4 );
         }
 
           exit( 4 );
         }
 
+        /* we must omit the .dll suffix from the library name */
         dot = strchr( dll_name, '.' );
         if ( dot != NULL )
         {
         dot = strchr( dll_name, '.' );
         if ( dot != NULL )
         {
-          int  len = dot - dll_name;
+          char  temp[512];
+          int   len = dot - dll_name;
 
 
 
 
-          if ( len > (int)( sizeof( temp ) - 1 ) )
+          if ( len > (int)( sizeof ( temp ) - 1 ) )
             len = sizeof ( temp ) - 1;
 
           memcpy( temp, dll_name, len );
             len = sizeof ( temp ) - 1;
 
           memcpy( temp, dll_name, len );
@@ -184,6 +188,16 @@ names_dump( FILE*         out,
       }
       break;
 
       }
       break;
 
+    case OUTPUT_NETWARE_IMP:
+      {
+        if ( dll_name != NULL )
+          fprintf( out, "  (%s)\n", dll_name );
+        for ( nn = 0; nn < num_names - 1; nn++ )
+          fprintf( out, "  %s,\n", the_names[nn].name );
+        fprintf( out, "  %s\n", the_names[num_names - 1].name );
+      }
+      break;
+
     default:  /* LIST */
       for ( nn = 0; nn < num_names; nn++ )
         fprintf( out, "%s\n", the_names[nn].name );
     default:  /* LIST */
       for ( nn = 0; nn < num_names; nn++ )
         fprintf( out, "%s\n", the_names[nn].name );
@@ -205,7 +219,7 @@ typedef enum  State_
 static int
 read_header_file( FILE*  file, int  verbose )
 {
 static int
 read_header_file( FILE*  file, int  verbose )
 {
-  static char  buff[ LINEBUFF_SIZE+1 ];
+  static char  buff[LINEBUFF_SIZE + 1];
   State        state = STATE_START;
 
   while ( !feof( file ) )
   State        state = STATE_START;
 
   while ( !feof( file ) )
@@ -308,6 +322,7 @@ usage( void )
    "           -w     : output .DEF file for Visual C++ and Mingw\n"
    "           -wB    : output .DEF file for Borland C++\n"
    "           -wW    : output Watcom Linker Response File\n"
    "           -w     : output .DEF file for Visual C++ and Mingw\n"
    "           -wB    : output .DEF file for Borland C++\n"
    "           -wW    : output Watcom Linker Response File\n"
+   "           -wN    : output NetWare Import File\n"
    "\n";
 
   fprintf( stderr,
    "\n";
 
   fprintf( stderr,
@@ -391,6 +406,10 @@ int  main( int argc, const char* const*  argv )
             format = OUTPUT_WATCOM_LBC;
             break;
 
             format = OUTPUT_WATCOM_LBC;
             break;
 
+          case 'N':
+            format = OUTPUT_NETWARE_IMP;
+            break;
+
           case 0:
             break;
 
           case 0:
             break;
 
index 3f80c5f..6742c90 100644 (file)
@@ -2,65 +2,20 @@
 import sys, math
 
 #units  = 64*65536.0   # don't change !!
 import sys, math
 
 #units  = 64*65536.0   # don't change !!
-units  = 256
+units  = 180 * 2**16
 scale  = units/math.pi
 shrink = 1.0
 comma  = ""
 
 scale  = units/math.pi
 shrink = 1.0
 comma  = ""
 
-def calc_val( x ):
-    global units, shrink
-    angle  = math.atan(x)
-    shrink = shrink * math.cos(angle)
-    return angle/math.pi * units
-
-def  print_val( n, x ):
-    global comma
-
-    lo  = int(x)
-    hi  = lo + 1
-    alo = math.atan(lo)
-    ahi = math.atan(hi)
-    ax  = math.atan(2.0**n)
-
-    errlo = abs( alo - ax )
-    errhi = abs( ahi - ax )
-
-    if ( errlo < errhi ):
-      hi = lo
-
-    sys.stdout.write( comma + repr( int(hi) ) )
-    comma = ", "
-
-
 print ""
 print "table of arctan( 1/2^n ) for PI = " + repr(units/65536.0) + " units"
 
 print ""
 print "table of arctan( 1/2^n ) for PI = " + repr(units/65536.0) + " units"
 
-# compute range of "i"
-r = [-1]
-r = r + range(32)
-
-for n in r:
-
-    if n >= 0:
-        x = 1.0/(2.0**n)    # tangent value
-    else:
-        x = 2.0**(-n)
+for n in range(1,32):
 
 
-    angle  = math.atan(x)    # arctangent
-    angle2 = angle*scale     # arctangent in FT_Angle units
+    x = 0.5**n                      # tangent value
 
 
-    # determine which integer value for angle gives the best tangent
-    lo  = int(angle2)
-    hi  = lo + 1
-    tlo = math.tan(lo/scale)
-    thi = math.tan(hi/scale)
-
-    errlo = abs( tlo - x )
-    errhi = abs( thi - x )
-
-    angle2 = hi
-    if errlo < errhi:
-        angle2 = lo
+    angle  = math.atan(x)           # arctangent
+    angle2 = round(angle*scale)     # arctangent in FT_Angle units
 
     if angle2 <= 0:
         break
 
     if angle2 <= 0:
         break
@@ -68,12 +23,11 @@ for n in r:
     sys.stdout.write( comma + repr( int(angle2) ) )
     comma = ", "
 
     sys.stdout.write( comma + repr( int(angle2) ) )
     comma = ", "
 
-    shrink = shrink * math.cos( angle2/scale)
-
+    shrink /= math.sqrt( 1 + x*x )
 
 print
 print "shrink factor    = " + repr( shrink )
 
 print
 print "shrink factor    = " + repr( shrink )
-print "shrink factor 2  = " + repr( shrink * (2.0**32) )
-print "expansion factor = " + repr(1/shrink)
+print "shrink factor 2  = " + repr( int( shrink * (2**32) ) )
+print "expansion factor = " + repr( 1/shrink )
 print ""
 
 print ""
 
index b398955..26087f7 100644 (file)
@@ -1,4 +1,4 @@
-#  Content (c) 2002, 2004, 2006, 2007, 2008, 2009
+#  Content (c) 2002, 2004, 2006-2009, 2012
 #    David Turner <david@freetype.org>
 #
 #  This file contains routines used to parse the content of documentation
 #    David Turner <david@freetype.org>
 #
 #  This file contains routines used to parse the content of documentation
@@ -32,7 +32,7 @@ re_code_end   = re.compile( r"(\s*)}\s*$" )
 # this regular expression is used to isolate identifiers from
 # other text
 #
 # this regular expression is used to isolate identifiers from
 # other text
 #
-re_identifier = re.compile( r'(\w*)' )
+re_identifier = re.compile( r'((?:\w|-)*)' )
 
 
 # we collect macros ending in `_H'; while outputting the object data, we use
 
 
 # we collect macros ending in `_H'; while outputting the object data, we use
index 7b68c07..490ba25 100644 (file)
@@ -1,4 +1,4 @@
-#  Sources (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009
+#  Sources (c) 2002-2004, 2006-2009, 2012
 #    David Turner <david@freetype.org>
 #
 #
 #    David Turner <david@freetype.org>
 #
 #
@@ -120,8 +120,8 @@ re_source_block_formats = [re_source_block_format1, re_source_block_format2]
 #
 # notice how each markup tag _must_ begin a new line
 #
 #
 # notice how each markup tag _must_ begin a new line
 #
-re_markup_tag1 = re.compile( r'''\s*<(\w*)>''' )  # <xxxx> format
-re_markup_tag2 = re.compile( r'''\s*@(\w*):''' )  # @xxxx: format
+re_markup_tag1 = re.compile( r'''\s*<((?:\w|-)*)>''' )  # <xxxx> format
+re_markup_tag2 = re.compile( r'''\s*@((?:\w|-)*):''' )  # @xxxx: format
 
 #
 # the list of supported markup tags, we could add new ones relatively
 
 #
 # the list of supported markup tags, we could add new ones relatively
@@ -132,7 +132,7 @@ re_markup_tags = [re_markup_tag1, re_markup_tag2]
 #
 # used to detect a cross-reference, after markup tags have been stripped
 #
 #
 # used to detect a cross-reference, after markup tags have been stripped
 #
-re_crossref = re.compile( r'@(\w*)(.*)' )
+re_crossref = re.compile( r'@((?:\w|-)*)(.*)' )
 
 #
 # used to detect italic and bold styles in paragraph text
 
 #
 # used to detect italic and bold styles in paragraph text
index fffa120..1cbda75 100644 (file)
@@ -549,7 +549,7 @@ class  HtmlFormatter( Formatter ):
                 if block.source.filename.find( f ) >= 0:
                     header = self.headers[f] + ' (' + f + ')'
                     break;
                 if block.source.filename.find( f ) >= 0:
                     header = self.headers[f] + ' (' + f + ')'
                     break;
-                
+
 #           if not header:
 #               sys.stderr.write( \
 #                 'WARNING: No header macro for ' + block.source.filename + '.\n' )
 #           if not header:
 #               sys.stderr.write( \
 #                 'WARNING: No header macro for ' + block.source.filename + '.\n' )
index c093f15..71bf053 100644 (file)
@@ -43,6 +43,6 @@ Arguments are:
   --rasterize              Call FT_Render_Glyph as well as loading it.
   --result <dir>           This is the directory in which test files are
                            placed.
   --rasterize              Call FT_Render_Glyph as well as loading it.
   --result <dir>           This is the directory in which test files are
                            placed.
-  --test <file>            Run a single test on a pre-generated testcase. 
+  --test <file>            Run a single test on a pre-generated testcase.
                            Done in the current process so it can be debugged
                            more easily.
                            Done in the current process so it can be debugged
                            more easily.
index 4daac0d..7c97957 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2007, 2008 by George Williams */
+/* Copyright (C) 2005, 2007, 2008, 2013 by George Williams */
 /*
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
 /*
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
   {
     FT_Library  context;
     FT_Face     face;
   {
     FT_Library  context;
     FT_Face     face;
-    int         i, num;
 
 
     if ( FT_Init_FreeType( &context ) )
 
 
     if ( FT_Init_FreeType( &context ) )
       TestFace( face );
     else
     {
       TestFace( face );
     else
     {
+      int  i, num;
+
+
       num = face->num_faces;
       FT_Done_Face( face );
 
       num = face->num_faces;
       FT_Done_Face( face );
 
   FindFonts( char**  fontdirs,
              char**  extensions )
   {
   FindFonts( char**  fontdirs,
              char**  extensions )
   {
-    DIR*            examples;
-    struct dirent*  ent;
-
-    int             i, max;
-    char            buffer[1025];
-    struct stat     statb;
+    int          i, max;
+    char         buffer[1025];
+    struct stat  statb;
 
 
     max  = 0;
 
 
     max  = 0;
 
     for ( i = 0; fontdirs[i] != NULL; ++i )
     {
 
     for ( i = 0; fontdirs[i] != NULL; ++i )
     {
+      DIR*            examples;
+      struct dirent*  ent;
+
+
       examples = opendir( fontdirs[i] );
       if ( examples == NULL )
       {
       examples = opendir( fontdirs[i] );
       if ( examples == NULL )
       {
         char**  argv )
   {
     char    **dirs, **exts;
         char**  argv )
   {
     char    **dirs, **exts;
-    char    *pt, *end;
     int     dcnt = 0, ecnt = 0, rset = false, allexts = false;
     int     i;
     time_t  now;
     int     dcnt = 0, ecnt = 0, rset = false, allexts = false;
     int     i;
     time_t  now;
 
     for ( i = 1; i < argc; ++i )
     {
 
     for ( i = 1; i < argc; ++i )
     {
-      pt = argv[i];
+      char*  pt = argv[i];
+      char*  end;
+
+
       if ( pt[0] == '-' && pt[1] == '-' )
         ++pt;
 
       if ( pt[0] == '-' && pt[1] == '-' )
         ++pt;
 
     }
 
     if ( allexts )
     }
 
     if ( allexts )
+    {
+      free( exts );
       exts = NULL;
       exts = NULL;
+    }
     else if ( ecnt == 0 )
     else if ( ecnt == 0 )
+    {
+      free( exts );
       exts = default_ext_list;
       exts = default_ext_list;
+    }
 
     if ( dcnt == 0 )
 
     if ( dcnt == 0 )
+    {
+      free( dirs );
       dirs = default_dir_list;
       dirs = default_dir_list;
+    }
 
     if ( testfile != NULL )
       ExecuteTest( testfile );         /* This should never return */
 
     if ( testfile != NULL )
       ExecuteTest( testfile );         /* This should never return */
index 55573b2..8810bf5 100644 (file)
@@ -6,7 +6,7 @@
 #
 
 
 #
 
 
-# Copyright 1996-2000, 2003, 2005, 2007, 2008 by
+# Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -151,7 +151,7 @@ mac_standard_names = \
 # The list of standard `SID' glyph names.  For the official list,
 # see Annex A of document at
 #
 # The list of standard `SID' glyph names.  For the official list,
 # see Annex A of document at
 #
-#   http://partners.adobe.com/asn/developer/pdfs/tn/5176.CFF.pdf.
+#   http://partners.adobe.com/public/developer/en/font/5176.CFF.pdf  .
 #
 sid_standard_names = \
 [
 #
 sid_standard_names = \
 [
@@ -412,11 +412,10 @@ t1_expert_encoding = \
 ]
 
 
 ]
 
 
-# This data has been taken literally from the file `glyphlist.txt',
-# version 2.0, 22 Sept 2002.  It is available from
+# This data has been taken literally from the files `glyphlist.txt'
+# and `zapfdingbats.txt' version 2.0, Sept 2002.  It is available from
 #
 #
-#   http://partners.adobe.com/asn/developer/typeforum/unicodegn.html
-#   http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
+#   http://sourceforge.net/adobe/aglfn/
 #
 adobe_glyph_list = """\
 A;0041
 #
 adobe_glyph_list = """\
 A;0041
@@ -4700,6 +4699,207 @@ zretroflexhook;0290
 zstroke;01B6
 zuhiragana;305A
 zukatakana;30BA
 zstroke;01B6
 zuhiragana;305A
 zukatakana;30BA
+a100;275E
+a101;2761
+a102;2762
+a103;2763
+a104;2764
+a105;2710
+a106;2765
+a107;2766
+a108;2767
+a109;2660
+a10;2721
+a110;2665
+a111;2666
+a112;2663
+a117;2709
+a118;2708
+a119;2707
+a11;261B
+a120;2460
+a121;2461
+a122;2462
+a123;2463
+a124;2464
+a125;2465
+a126;2466
+a127;2467
+a128;2468
+a129;2469
+a12;261E
+a130;2776
+a131;2777
+a132;2778
+a133;2779
+a134;277A
+a135;277B
+a136;277C
+a137;277D
+a138;277E
+a139;277F
+a13;270C
+a140;2780
+a141;2781
+a142;2782
+a143;2783
+a144;2784
+a145;2785
+a146;2786
+a147;2787
+a148;2788
+a149;2789
+a14;270D
+a150;278A
+a151;278B
+a152;278C
+a153;278D
+a154;278E
+a155;278F
+a156;2790
+a157;2791
+a158;2792
+a159;2793
+a15;270E
+a160;2794
+a161;2192
+a162;27A3
+a163;2194
+a164;2195
+a165;2799
+a166;279B
+a167;279C
+a168;279D
+a169;279E
+a16;270F
+a170;279F
+a171;27A0
+a172;27A1
+a173;27A2
+a174;27A4
+a175;27A5
+a176;27A6
+a177;27A7
+a178;27A8
+a179;27A9
+a17;2711
+a180;27AB
+a181;27AD
+a182;27AF
+a183;27B2
+a184;27B3
+a185;27B5
+a186;27B8
+a187;27BA
+a188;27BB
+a189;27BC
+a18;2712
+a190;27BD
+a191;27BE
+a192;279A
+a193;27AA
+a194;27B6
+a195;27B9
+a196;2798
+a197;27B4
+a198;27B7
+a199;27AC
+a19;2713
+a1;2701
+a200;27AE
+a201;27B1
+a202;2703
+a203;2750
+a204;2752
+a205;276E
+a206;2770
+a20;2714
+a21;2715
+a22;2716
+a23;2717
+a24;2718
+a25;2719
+a26;271A
+a27;271B
+a28;271C
+a29;2722
+a2;2702
+a30;2723
+a31;2724
+a32;2725
+a33;2726
+a34;2727
+a35;2605
+a36;2729
+a37;272A
+a38;272B
+a39;272C
+a3;2704
+a40;272D
+a41;272E
+a42;272F
+a43;2730
+a44;2731
+a45;2732
+a46;2733
+a47;2734
+a48;2735
+a49;2736
+a4;260E
+a50;2737
+a51;2738
+a52;2739
+a53;273A
+a54;273B
+a55;273C
+a56;273D
+a57;273E
+a58;273F
+a59;2740
+a5;2706
+a60;2741
+a61;2742
+a62;2743
+a63;2744
+a64;2745
+a65;2746
+a66;2747
+a67;2748
+a68;2749
+a69;274A
+a6;271D
+a70;274B
+a71;25CF
+a72;274D
+a73;25A0
+a74;274F
+a75;2751
+a76;25B2
+a77;25BC
+a78;25C6
+a79;2756
+a7;271E
+a81;25D7
+a82;2758
+a83;2759
+a84;275A
+a85;276F
+a86;2771
+a87;2772
+a88;2773
+a89;2768
+a8;271F
+a90;2769
+a91;276C
+a92;276D
+a93;276A
+a94;276B
+a95;2774
+a96;2775
+a97;275B
+a98;275C
+a99;275D
+a9;2720
 """
 
 
 """
 
 
@@ -5067,7 +5267,7 @@ def main():
   write( "/*                                                                         */\n" )
   write( "/*    PostScript glyph names.                                              */\n" )
   write( "/*                                                                         */\n" )
   write( "/*                                                                         */\n" )
   write( "/*    PostScript glyph names.                                              */\n" )
   write( "/*                                                                         */\n" )
-  write( "/*  Copyright 2005, 2008 by                                                */\n" )
+  write( "/*  Copyright 2005, 2008, 2011 by                                          */\n" )
   write( "/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n" )
   write( "/*                                                                         */\n" )
   write( "/*  This file is part of the FreeType project, and may only be used,       */\n" )
   write( "/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n" )
   write( "/*                                                                         */\n" )
   write( "/*  This file is part of the FreeType project, and may only be used,       */\n" )
index f5f9936..24cd0c4 100644 (file)
 
 
     if ( argc < 2 )
 
 
     if ( argc < 2 )
-      return FT_Err_Invalid_Argument;
+      return FT_ERR( Invalid_Argument );
 
     error = FT_Init_FreeType( &library );
     if ( error )
 
     error = FT_Init_FreeType( &library );
     if ( error )
index e085c5b..64b82c3 100644 (file)
   };
 
 
   };
 
 
+  /* dummy outline #3 with bbox of [0 100 128 128] precisely */
+  static FT_Vector  dummy_vec_3[4] =
+  {
+    XVEC( 100.0, 127.0 ),
+    XVEC( 200.0, 127.0 ),
+    XVEC(   0.0, 136.0 ),
+    XVEC(   0.0, 100.0 )
+  };
+
+  static FT_Outline  dummy_outline_3 =
+  {
+    1,
+    4,
+    dummy_vec_3,
+    dummy_tag_1,
+    dummy_contour_1,
+    0
+  };
+
+
   static void
   dump_outline( FT_Outline*  outline )
   {
   static void
   dump_outline( FT_Outline*  outline )
   {
       FT_Outline_Get_CBox( outline, &bbox );
 
     time0 = get_time() - time0;
       FT_Outline_Get_CBox( outline, &bbox );
 
     time0 = get_time() - time0;
-    printf( "time = %5.2f cbox = [%.2f %.2f %.2f %.2f]\n",
+    printf( "time = %6.3f cbox = [%8.4f %8.4f %8.4f %8.4f]\n",
              ((double)time0/10000.0),
              XVAL( bbox.xMin ),
              XVAL( bbox.yMin ),
              XVAL( bbox.xMax ),
              XVAL( bbox.yMax ) );
              ((double)time0/10000.0),
              XVAL( bbox.xMin ),
              XVAL( bbox.yMin ),
              XVAL( bbox.xMax ),
              XVAL( bbox.yMax ) );
+    printf( "cbox_hex = [%08X %08X %08X %08X]\n",
+             bbox.xMin, bbox.yMin, bbox.xMax, bbox.yMax );
 
 
     time0 = get_time();
 
 
     time0 = get_time();
       FT_Outline_Get_BBox( outline, &bbox );
 
     time0 = get_time() - time0;
       FT_Outline_Get_BBox( outline, &bbox );
 
     time0 = get_time() - time0;
-    printf( "time = %5.2f bbox = [%.2f %.2f %.2f %.2f]\n",
+    printf( "time = %6.3f bbox = [%8.4f %8.4f %8.4f %8.4f]\n",
              ((double)time0/10000.0),
              XVAL( bbox.xMin ),
              XVAL( bbox.yMin ),
              XVAL( bbox.xMax ),
              XVAL( bbox.yMax ) );
              ((double)time0/10000.0),
              XVAL( bbox.xMin ),
              XVAL( bbox.yMin ),
              XVAL( bbox.xMax ),
              XVAL( bbox.yMax ) );
+    printf( "bbox_hex = [%08X %08X %08X %08X]\n",
+             bbox.xMin, bbox.yMin, bbox.xMax, bbox.yMax );
   }
 
   }
 
-#define REPEAT  100000L
+#define REPEAT  1000000L
 
   int  main( int  argc, char**  argv )
   {
 
   int  main( int  argc, char**  argv )
   {
 
     printf( "outline #2\n" );
     profile_outline( &dummy_outline_2, REPEAT );
 
     printf( "outline #2\n" );
     profile_outline( &dummy_outline_2, REPEAT );
+
+    printf( "outline #3\n" );
+    profile_outline( &dummy_outline_3, REPEAT );
+
     return 0;
   }
 
     return 0;
   }
 
index 8c8a544..49d927e 100644 (file)
@@ -8,9 +8,8 @@
 #define  PI   3.14159265358979323846
 #define  SPI  (PI/FT_ANGLE_PI)
 
 #define  PI   3.14159265358979323846
 #define  SPI  (PI/FT_ANGLE_PI)
 
-/* the precision in 16.16 fixed float points of the checks. Expect */
-/* between 2 and 5 noise LSB bits during operations, due to        */
-/* rounding errors..                                               */
+/* the precision in 16.16 fixed-point checks. Expect between 2 and 5 */
+/* noise LSB bits during operations, due to rounding errors..        */
 #define  THRESHOLD  64
 
   static  error = 0;
 #define  THRESHOLD  64
 
   static  error = 0;
   static void
   test_cos( void )
   {
   static void
   test_cos( void )
   {
-    FT_Fixed  f1, f2;
-    double    d1, d2;
-    int       i;
+    int  i;
+
 
     for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
     {
 
     for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
     {
+      FT_Fixed  f1, f2;
+      double    d2;
+
+
       f1 = FT_Cos(i);
       f1 = FT_Cos(i);
-      d1 = f1/65536.0;
       d2 = cos( i*SPI );
       f2 = (FT_Fixed)(d2*65536.0);
 
       d2 = cos( i*SPI );
       f2 = (FT_Fixed)(d2*65536.0);
 
   }
 
 
   }
 
 
-
   static void
   test_sin( void )
   {
   static void
   test_sin( void )
   {
-    FT_Fixed  f1, f2;
-    double    d1, d2;
-    int       i;
+    int  i;
+
 
     for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
     {
 
     for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
     {
+      FT_Fixed  f1, f2;
+      double    d2;
+
+
       f1 = FT_Sin(i);
       f1 = FT_Sin(i);
-      d1 = f1/65536.0;
       d2 = sin( i*SPI );
       f2 = (FT_Fixed)(d2*65536.0);
 
       d2 = sin( i*SPI );
       f2 = (FT_Fixed)(d2*65536.0);
 
   static void
   test_tan( void )
   {
   static void
   test_tan( void )
   {
-    FT_Fixed  f1, f2;
-    double    d1, d2;
-    int       i;
+    int  i;
+
 
     for ( i = 0; i < FT_ANGLE_PI2-0x2000000; i += 0x10000 )
     {
 
     for ( i = 0; i < FT_ANGLE_PI2-0x2000000; i += 0x10000 )
     {
+      FT_Fixed  f1, f2;
+      double    d2;
+
+
       f1 = FT_Tan(i);
       f1 = FT_Tan(i);
-      d1 = f1/65536.0;
       d2 = tan( i*SPI );
       f2 = (FT_Fixed)(d2*65536.0);
 
       d2 = tan( i*SPI );
       f2 = (FT_Fixed)(d2*65536.0);
 
   static void
   test_atan2( void )
   {
   static void
   test_atan2( void )
   {
-    FT_Fixed  c2, s2;
-    double    l, a, c1, s1;
-    int       i, j;
+    int  i;
+
 
     for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
     {
 
     for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
     {
+      FT_Fixed  c2, s2;
+      double    l, a, c1, s1;
+      int       j;
+
+
       l  = 5.0;
       a  = i*SPI;
 
       l  = 5.0;
       a  = i*SPI;
 
     }
   }
 
     }
   }
 
+
   static void
   test_unit( void )
   {
   static void
   test_unit( void )
   {
-    FT_Vector  v;
-    double     a, c1, s1;
-    FT_Fixed   c2, s2;
-    int        i;
+    int  i;
+
 
     for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
     {
 
     for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
     {
+      FT_Vector  v;
+      double     a, c1, s1;
+      FT_Fixed   c2, s2;
+
+
       FT_Vector_Unit( &v, i );
       a  = ( i*SPI );
       c1 = cos(a);
       FT_Vector_Unit( &v, i );
       a  = ( i*SPI );
       c1 = cos(a);
   static void
   test_length( void )
   {
   static void
   test_length( void )
   {
-    FT_Vector  v;
-    FT_Fixed   l, l2;
-    int        i;
+    int  i;
+
 
     for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
     {
 
     for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
     {
+      FT_Vector  v;
+      FT_Fixed   l, l2;
+
+
       l   = (FT_Fixed)(500.0*65536.0);
       v.x = (FT_Fixed)( l * cos( i*SPI ) );
       v.y = (FT_Fixed)( l * sin( i*SPI ) );
       l   = (FT_Fixed)(500.0*65536.0);
       v.x = (FT_Fixed)( l * cos( i*SPI ) );
       v.y = (FT_Fixed)( l * sin( i*SPI ) );
   static void
   test_rotate( void )
   {
   static void
   test_rotate( void )
   {
-    FT_Fixed  c2, s2, c4, s4;
-    FT_Vector v;
-    double    l, ra, a, c1, s1, cra, sra, c3, s3;
-    int       i, j, rotate;
+    int  rotate;
+
 
     for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000 )
     {
 
     for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000 )
     {
+      double  ra, cra, sra;
+      int     i;
+
+
       ra  = rotate*SPI;
       cra = cos( ra );
       sra = sin( ra );
 
       for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
       {
       ra  = rotate*SPI;
       cra = cos( ra );
       sra = sin( ra );
 
       for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
       {
+        FT_Fixed   c2, s2, c4, s4;
+        FT_Vector  v;
+        double     l, a, c1, s1, c3, s3;
+
+
         l  = 500.0;
         a  = i*SPI;
 
         l  = 500.0;
         a  = i*SPI;
 
diff --git a/reactos/lib/3rdparty/freetype/src/truetype/Jamfile b/reactos/lib/3rdparty/freetype/src/truetype/Jamfile
deleted file mode 100644 (file)
index a8cccfe..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/truetype Jamfile
-#
-# Copyright 2001, 2004 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) truetype ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = ttdriver ttobjs ttpload ttgload ttinterp ttgxvar ttpic ;
-  }
-  else
-  {
-    _sources = truetype ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/truetype Jamfile
index 7468426..d4b69f5 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
 #
 
 
-# Copyright 1996-2000, 2001, 2003, 2004 by
+# Copyright 1996-2001, 2003-2004, 2011-2012 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -25,12 +25,14 @@ TT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(TT_DIR))
 
 # TrueType driver sources (i.e., C files)
 #
 
 # TrueType driver sources (i.e., C files)
 #
-TT_DRV_SRC := $(TT_DIR)/ttobjs.c   \
-              $(TT_DIR)/ttpload.c  \
+TT_DRV_SRC := $(TT_DIR)/ttdriver.c \
               $(TT_DIR)/ttgload.c  \
               $(TT_DIR)/ttgload.c  \
+              $(TT_DIR)/ttgxvar.c  \
               $(TT_DIR)/ttinterp.c \
               $(TT_DIR)/ttinterp.c \
-              $(TT_DIR)/ttgxvar.c \
-              $(TT_DIR)/ttdriver.c
+              $(TT_DIR)/ttobjs.c   \
+              $(TT_DIR)/ttpic.c    \
+              $(TT_DIR)/ttpload.c  \
+              $(TT_DIR)/ttsubpix.c
 
 # TrueType driver headers
 #
 
 # TrueType driver headers
 #
index 4bd1209..576912b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType TrueType driver component (body only).                      */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType TrueType driver component (body only).                      */
 /*                                                                         */
-/*  Copyright 1996-2001, 2004, 2006 by                                     */
+/*  Copyright 1996-2001, 2004, 2006, 2012 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -27,6 +27,7 @@
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
 #include "ttinterp.c"
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
 #include "ttinterp.c"
+#include "ttsubpix.c"
 #endif
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
 #endif
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
index d723b57..fb25706 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    TrueType font driver implementation (body).                          */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType font driver implementation (body).                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009    */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,6 +29,8 @@
 
 #include FT_SERVICE_TRUETYPE_ENGINE_H
 #include FT_SERVICE_TRUETYPE_GLYF_H
 
 #include FT_SERVICE_TRUETYPE_ENGINE_H
 #include FT_SERVICE_TRUETYPE_GLYF_H
+#include FT_SERVICE_PROPERTIES_H
+#include FT_TRUETYPE_DRIVER_H
 
 #include "ttdriver.h"
 #include "ttgload.h"
 
 #include "ttdriver.h"
 #include "ttgload.h"
 #define FT_COMPONENT  trace_ttdriver
 
 
 #define FT_COMPONENT  trace_ttdriver
 
 
+  /*
+   *  PROPERTY SERVICE
+   *
+   */
+  static FT_Error
+  tt_property_set( FT_Module    module,         /* TT_Driver */
+                   const char*  property_name,
+                   const void*  value )
+  {
+    FT_Error   error  = FT_Err_Ok;
+    TT_Driver  driver = (TT_Driver)module;
+
+
+    if ( !ft_strcmp( property_name, "interpreter-version" ) )
+    {
+      FT_UInt*  interpreter_version = (FT_UInt*)value;
+
+
+#ifndef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      if ( *interpreter_version != TT_INTERPRETER_VERSION_35 )
+        error = FT_ERR( Unimplemented_Feature );
+      else
+#endif
+        driver->interpreter_version = *interpreter_version;
+
+      return error;
+    }
+
+    FT_TRACE0(( "tt_property_set: missing property `%s'\n",
+                property_name ));
+    return FT_THROW( Missing_Property );
+  }
+
+
+  static FT_Error
+  tt_property_get( FT_Module    module,         /* TT_Driver */
+                   const char*  property_name,
+                   const void*  value )
+  {
+    FT_Error   error  = FT_Err_Ok;
+    TT_Driver  driver = (TT_Driver)module;
+
+    FT_UInt  interpreter_version = driver->interpreter_version;
+
+
+    if ( !ft_strcmp( property_name, "interpreter-version" ) )
+    {
+      FT_UInt*  val = (FT_UInt*)value;
+
+
+      *val = interpreter_version;
+
+      return error;
+    }
+
+    FT_TRACE0(( "tt_property_get: missing property `%s'\n",
+                property_name ));
+    return FT_THROW( Missing_Property );
+  }
+
+
+  FT_DEFINE_SERVICE_PROPERTIESREC(
+    tt_service_properties,
+    (FT_Properties_SetFunc)tt_property_set,
+    (FT_Properties_GetFunc)tt_property_get )
+
+
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
   {
     FT_UInt  nn;
     TT_Face  face  = (TT_Face) ttface;
   {
     FT_UInt  nn;
     TT_Face  face  = (TT_Face) ttface;
-    FT_Bool  check = FT_BOOL(
-                       !( flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) );
 
 
     /* XXX: TODO: check for sbits */
 
 
     /* XXX: TODO: check for sbits */
         FT_UShort  ah;
 
 
         FT_UShort  ah;
 
 
-        TT_Get_VMetrics( face, start + nn, check, &tsb, &ah );
+        TT_Get_VMetrics( face, start + nn, &tsb, &ah );
         advances[nn] = ah;
       }
     }
         advances[nn] = ah;
       }
     }
         FT_UShort  aw;
 
 
         FT_UShort  aw;
 
 
-        TT_Get_HMetrics( face, start + nn, check, &lsb, &aw );
+        TT_Get_HMetrics( face, start + nn, &lsb, &aw );
         advances[nn] = aw;
       }
     }
 
         advances[nn] = aw;
       }
     }
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
   /*************************************************************************/
   }
 
   /*************************************************************************/
   {
     TT_Face   ttface = (TT_Face)size->face;
     TT_Size   ttsize = (TT_Size)size;
   {
     TT_Face   ttface = (TT_Face)size->face;
     TT_Size   ttsize = (TT_Size)size;
-    FT_Error  error  = TT_Err_Ok;
+    FT_Error  error  = FT_Err_Ok;
 
 
     ttsize->strike_index = strike_index;
 
 
     ttsize->strike_index = strike_index;
                    FT_Size_Request  req )
   {
     TT_Size   ttsize = (TT_Size)size;
                    FT_Size_Request  req )
   {
     TT_Size   ttsize = (TT_Size)size;
-    FT_Error  error  = TT_Err_Ok;
+    FT_Error  error  = FT_Err_Ok;
 
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
 
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
     FT_Request_Metrics( size->face, req );
 
     if ( FT_IS_SCALABLE( size->face ) )
     FT_Request_Metrics( size->face, req );
 
     if ( FT_IS_SCALABLE( size->face ) )
+    {
       error = tt_size_reset( ttsize );
       error = tt_size_reset( ttsize );
+      ttsize->root.metrics = ttsize->metrics;
+    }
 
     return error;
   }
 
     return error;
   }
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    Load_Glyph                                                         */
+  /*    tt_glyph_load                                                      */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A driver method used to load a glyph within a given glyph slot.    */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A driver method used to load a glyph within a given glyph slot.    */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   static FT_Error
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   static FT_Error
-  Load_Glyph( FT_GlyphSlot  ttslot,         /* TT_GlyphSlot */
-              FT_Size       ttsize,         /* TT_Size      */
-              FT_UInt       glyph_index,
-              FT_Int32      load_flags )
+  tt_glyph_load( FT_GlyphSlot  ttslot,      /* TT_GlyphSlot */
+                 FT_Size       ttsize,      /* TT_Size      */
+                 FT_UInt       glyph_index,
+                 FT_Int32      load_flags )
   {
     TT_GlyphSlot  slot = (TT_GlyphSlot)ttslot;
     TT_Size       size = (TT_Size)ttsize;
   {
     TT_GlyphSlot  slot = (TT_GlyphSlot)ttslot;
     TT_Size       size = (TT_Size)ttsize;
 
 
     if ( !slot )
 
 
     if ( !slot )
-      return TT_Err_Invalid_Slot_Handle;
+      return FT_THROW( Invalid_Slot_Handle );
 
     if ( !size )
 
     if ( !size )
-      return TT_Err_Invalid_Size_Handle;
+      return FT_THROW( Invalid_Size_Handle );
 
     if ( !face )
 
     if ( !face )
-      return TT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     if ( glyph_index >= (FT_UInt)face->num_glyphs &&
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     if ( glyph_index >= (FT_UInt)face->num_glyphs &&
 #else
     if ( glyph_index >= (FT_UInt)face->num_glyphs )
 #endif
 #else
     if ( glyph_index >= (FT_UInt)face->num_glyphs )
 #endif
-      return TT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     if ( load_flags & FT_LOAD_NO_HINTING )
     {
       /* both FT_LOAD_NO_HINTING and FT_LOAD_NO_AUTOHINT   */
 
     if ( load_flags & FT_LOAD_NO_HINTING )
     {
       /* both FT_LOAD_NO_HINTING and FT_LOAD_NO_AUTOHINT   */
-      /* are necessary to disable hinting for tricky fonts */          
+      /* are necessary to disable hinting for tricky fonts */
 
       if ( FT_IS_TRICKY( face ) )
         load_flags &= ~FT_LOAD_NO_HINTING;
 
       if ( FT_IS_TRICKY( face ) )
         load_flags &= ~FT_LOAD_NO_HINTING;
   /*************************************************************************/
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
   /*************************************************************************/
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-  FT_DEFINE_SERVICE_MULTIMASTERSREC(tt_service_gx_multi_masters,
+  FT_DEFINE_SERVICE_MULTIMASTERSREC(
+    tt_service_gx_multi_masters,
     (FT_Get_MM_Func)        NULL,
     (FT_Set_MM_Design_Func) NULL,
     (FT_Set_MM_Blend_Func)  TT_Set_MM_Blend,
     (FT_Get_MM_Var_Func)    TT_Get_MM_Var,
     (FT_Get_MM_Func)        NULL,
     (FT_Set_MM_Design_Func) NULL,
     (FT_Set_MM_Blend_Func)  TT_Set_MM_Blend,
     (FT_Get_MM_Var_Func)    TT_Get_MM_Var,
-    (FT_Set_Var_Design_Func)TT_Set_Var_Design
-  )
+    (FT_Set_Var_Design_Func)TT_Set_Var_Design )
 #endif
 
   static const FT_Service_TrueTypeEngineRec  tt_service_truetype_engine =
 #endif
 
   static const FT_Service_TrueTypeEngineRec  tt_service_truetype_engine =
 #endif /* TT_USE_BYTECODE_INTERPRETER */
   };
 
 #endif /* TT_USE_BYTECODE_INTERPRETER */
   };
 
-  FT_DEFINE_SERVICE_TTGLYFREC(tt_service_truetype_glyf,
-    (TT_Glyf_GetLocationFunc)tt_face_get_location
-  )
+  FT_DEFINE_SERVICE_TTGLYFREC(
+    tt_service_truetype_glyf,
+    (TT_Glyf_GetLocationFunc)tt_face_get_location )
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-  FT_DEFINE_SERVICEDESCREC4(tt_services,
+  FT_DEFINE_SERVICEDESCREC5(
+    tt_services,
     FT_SERVICE_ID_XF86_NAME,       FT_XF86_FORMAT_TRUETYPE,
     FT_SERVICE_ID_XF86_NAME,       FT_XF86_FORMAT_TRUETYPE,
-    FT_SERVICE_ID_MULTI_MASTERS,   &FT_TT_SERVICE_GX_MULTI_MASTERS_GET,
+    FT_SERVICE_ID_MULTI_MASTERS,   &TT_SERVICE_GX_MULTI_MASTERS_GET,
     FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
     FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
-    FT_SERVICE_ID_TT_GLYF,         &FT_TT_SERVICE_TRUETYPE_GLYF_GET
-  )
+    FT_SERVICE_ID_TT_GLYF,         &TT_SERVICE_TRUETYPE_GLYF_GET,
+    FT_SERVICE_ID_PROPERTIES,      &TT_SERVICE_PROPERTIES_GET )
 #else
 #else
-  FT_DEFINE_SERVICEDESCREC3(tt_services,
+  FT_DEFINE_SERVICEDESCREC4(
+    tt_services,
     FT_SERVICE_ID_XF86_NAME,       FT_XF86_FORMAT_TRUETYPE,
     FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
     FT_SERVICE_ID_XF86_NAME,       FT_XF86_FORMAT_TRUETYPE,
     FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
-    FT_SERVICE_ID_TT_GLYF,         &FT_TT_SERVICE_TRUETYPE_GLYF_GET
-  )
+    FT_SERVICE_ID_TT_GLYF,         &TT_SERVICE_TRUETYPE_GLYF_GET,
+    FT_SERVICE_ID_PROPERTIES,      &TT_SERVICE_PROPERTIES_GET )
 #endif
 
 #endif
 
+
   FT_CALLBACK_DEF( FT_Module_Interface )
   tt_get_interface( FT_Module    driver,    /* TT_Driver */
                     const char*  tt_interface )
   {
   FT_CALLBACK_DEF( FT_Module_Interface )
   tt_get_interface( FT_Module    driver,    /* TT_Driver */
                     const char*  tt_interface )
   {
+    FT_Library           library;
     FT_Module_Interface  result;
     FT_Module            sfntd;
     SFNT_Service         sfnt;
 
     FT_Module_Interface  result;
     FT_Module            sfntd;
     SFNT_Service         sfnt;
 
-    result = ft_service_list_lookup( FT_TT_SERVICES_GET, tt_interface );
+
+    /* TT_SERVICES_GET derefers `library' in PIC mode */
+#ifdef FT_CONFIG_OPTION_PIC
+    if ( !driver )
+      return NULL;
+    library = driver->library;
+    if ( !library )
+      return NULL;
+#endif
+
+    result = ft_service_list_lookup( TT_SERVICES_GET, tt_interface );
     if ( result != NULL )
       return result;
 
     if ( result != NULL )
       return result;
 
+#ifndef FT_CONFIG_OPTION_PIC
     if ( !driver )
       return NULL;
     if ( !driver )
       return NULL;
+    library = driver->library;
+    if ( !library )
+      return NULL;
+#endif
 
     /* only return the default interface from the SFNT module */
 
     /* only return the default interface from the SFNT module */
-    sfntd = FT_Get_Module( driver->library, "sfnt" );
+    sfntd = FT_Get_Module( library, "sfnt" );
     if ( sfntd )
     {
       sfnt = (SFNT_Service)( sfntd->clazz->module_interface );
     if ( sfntd )
     {
       sfnt = (SFNT_Service)( sfntd->clazz->module_interface );
   /* The FT_DriverInterface structure is defined in ftdriver.h. */
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
   /* The FT_DriverInterface structure is defined in ftdriver.h. */
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
-#define TT_HINTER_FLAG   FT_MODULE_DRIVER_HAS_HINTER
+#define TT_HINTER_FLAG  FT_MODULE_DRIVER_HAS_HINTER
 #else
 #else
-#define TT_HINTER_FLAG   0
+#define TT_HINTER_FLAG  0
 #endif
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
 #endif
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-#define TT_SIZE_SELECT    tt_size_select
+#define TT_SIZE_SELECT  tt_size_select
 #else
 #else
-#define TT_SIZE_SELECT    0
+#define TT_SIZE_SELECT  0
 #endif
 
 #endif
 
-  FT_DEFINE_DRIVER(tt_driver_class,
-  
-    
-      FT_MODULE_FONT_DRIVER        |
-      FT_MODULE_DRIVER_SCALABLE    |
+  FT_DEFINE_DRIVER(
+    tt_driver_class,
+
+      FT_MODULE_FONT_DRIVER     |
+      FT_MODULE_DRIVER_SCALABLE |
       TT_HINTER_FLAG,
 
       sizeof ( TT_DriverRec ),
       TT_HINTER_FLAG,
 
       sizeof ( TT_DriverRec ),
     tt_size_init,
     tt_size_done,
     tt_slot_init,
     tt_size_init,
     tt_size_done,
     tt_slot_init,
-    0,                      /* FT_Slot_DoneFunc */
-
-    ft_stub_set_char_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-    ft_stub_set_pixel_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */
+    0,                       /* FT_Slot_DoneFunc */
 
 
-    Load_Glyph,
+    tt_glyph_load,
 
     tt_get_kerning,
 
     tt_get_kerning,
-    0,                      /* FT_Face_AttachFunc      */
+    0,                       /* FT_Face_AttachFunc */
     tt_get_advances,
 
     tt_size_request,
     tt_get_advances,
 
     tt_size_request,
index d317c70..78d138f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType error codes (specification only).                           */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType error codes (specification only).                           */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,6 +30,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  TT_Err_
 #define FT_ERR_BASE    FT_Mod_Err_TrueType
 
 #define FT_ERR_PREFIX  TT_Err_
 #define FT_ERR_BASE    FT_Mod_Err_TrueType
 
index 3a69b7b..f640a6c 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    TrueType Glyph Loader (body).                                        */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType Glyph Loader (body).                                        */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013                                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -24,6 +23,7 @@
 #include FT_INTERNAL_SFNT_H
 #include FT_TRUETYPE_TAGS_H
 #include FT_OUTLINE_H
 #include FT_INTERNAL_SFNT_H
 #include FT_TRUETYPE_TAGS_H
 #include FT_OUTLINE_H
+#include FT_TRUETYPE_DRIVER_H
 
 #include "ttgload.h"
 #include "ttpload.h"
 
 #include "ttgload.h"
 #include "ttpload.h"
@@ -33,6 +33,7 @@
 #endif
 
 #include "tterrors.h"
 #endif
 
 #include "tterrors.h"
+#include "ttsubpix.h"
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
@@ -47,7 +48,7 @@
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
-  /* Composite font flags.                                                 */
+  /* Composite glyph flags.                                                */
   /*                                                                       */
 #define ARGS_ARE_WORDS             0x0001
 #define ARGS_ARE_XY_VALUES         0x0002
   /*                                                                       */
 #define ARGS_ARE_WORDS             0x0001
 #define ARGS_ARE_XY_VALUES         0x0002
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
-  /* Returns the horizontal metrics in font units for a given glyph.  If   */
-  /* `check' is true, take care of monospaced fonts by returning the       */
-  /* advance width maximum.                                                */
+  /* Return the horizontal metrics in font units for a given glyph.        */
   /*                                                                       */
   FT_LOCAL_DEF( void )
   TT_Get_HMetrics( TT_Face     face,
                    FT_UInt     idx,
   /*                                                                       */
   FT_LOCAL_DEF( void )
   TT_Get_HMetrics( TT_Face     face,
                    FT_UInt     idx,
-                   FT_Bool     check,
                    FT_Short*   lsb,
                    FT_UShort*  aw )
   {
     ( (SFNT_Service)face->sfnt )->get_metrics( face, 0, idx, lsb, aw );
 
                    FT_Short*   lsb,
                    FT_UShort*  aw )
   {
     ( (SFNT_Service)face->sfnt )->get_metrics( face, 0, idx, lsb, aw );
 
-    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 ));
   }
     FT_TRACE5(( "  advance width (font units): %d\n", *aw ));
     FT_TRACE5(( "  left side bearing (font units): %d\n", *lsb ));
   }
@@ -89,7 +84,7 @@
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
-  /* Returns the vertical metrics in font units for a given glyph.         */
+  /* Return the vertical metrics in font units for a given glyph.          */
   /* Greg Hitchcock from Microsoft told us that if there were no `vmtx'    */
   /* table, typoAscender/Descender from the `OS/2' table would be used     */
   /* instead, and if there were no `OS/2' table, use ascender/descender    */
   /* Greg Hitchcock from Microsoft told us that if there were no `vmtx'    */
   /* table, typoAscender/Descender from the `OS/2' table would be used     */
   /* instead, and if there were no `OS/2' table, use ascender/descender    */
   /* apparently does: It uses the ppem value as the advance height, and    */
   /* sets the top side bearing to be zero.                                 */
   /*                                                                       */
   /* apparently does: It uses the ppem value as the advance height, and    */
   /* sets the top side bearing to be zero.                                 */
   /*                                                                       */
-  /* The monospace `check' is probably not meaningful here, but we leave   */
-  /* it in for a consistent interface.                                     */
-  /*                                                                       */
   FT_LOCAL_DEF( void )
   TT_Get_VMetrics( TT_Face     face,
                    FT_UInt     idx,
   FT_LOCAL_DEF( void )
   TT_Get_VMetrics( TT_Face     face,
                    FT_UInt     idx,
-                   FT_Bool     check,
                    FT_Short*   tsb,
                    FT_UShort*  ah )
   {
                    FT_Short*   tsb,
                    FT_UShort*  ah )
   {
-    FT_UNUSED( check );
-
     if ( face->vertical_info )
       ( (SFNT_Service)face->sfnt )->get_metrics( face, 1, idx, tsb, ah );
 
     if ( face->vertical_info )
       ( (SFNT_Service)face->sfnt )->get_metrics( face, 1, idx, tsb, ah );
 
   tt_get_metrics( TT_Loader  loader,
                   FT_UInt    glyph_index )
   {
   tt_get_metrics( TT_Loader  loader,
                   FT_UInt    glyph_index )
   {
-    TT_Face  face = (TT_Face)loader->face;
+    TT_Face    face   = (TT_Face)loader->face;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );
+#endif
 
     FT_Short   left_bearing = 0, top_bearing = 0;
     FT_UShort  advance_width = 0, advance_height = 0;
 
 
     TT_Get_HMetrics( face, glyph_index,
 
     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,
                      &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 );
 
                      &top_bearing,
                      &advance_height );
 
     loader->top_bearing  = top_bearing;
     loader->vadvance     = advance_height;
 
     loader->top_bearing  = top_bearing;
     loader->vadvance     = advance_height;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
+    {
+      if ( loader->exec )
+        loader->exec->sph_tweak_flags = 0;
+
+      /* this may not be the right place for this, but it works */
+      if ( loader->exec && loader->exec->ignore_x_mode )
+        sph_set_tweaks( loader, glyph_index );
+    }
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     if ( !loader->linear_def )
     {
       loader->linear_def = 1;
     if ( !loader->linear_def )
     {
       loader->linear_def = 1;
   }
 
 
   }
 
 
-#undef  IS_HINTED
-#define IS_HINTED( flags )  ( ( flags & FT_LOAD_NO_HINTING ) == 0 )
-
-
   /*************************************************************************/
   /*                                                                       */
   /* The following functions are used by default with TrueType fonts.      */
   /*************************************************************************/
   /*                                                                       */
   /* The following functions are used by default with TrueType fonts.      */
     loader->cursor = stream->cursor;
     loader->limit  = stream->limit;
 
     loader->cursor = stream->cursor;
     loader->limit  = stream->limit;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
 
 
     if ( p + 10 > limit )
 
 
     if ( p + 10 > limit )
-      return TT_Err_Invalid_Outline;
+      return FT_THROW( Invalid_Outline );
 
     loader->n_contours = FT_NEXT_SHORT( p );
 
 
     loader->n_contours = FT_NEXT_SHORT( p );
 
                                             loader->bbox.yMax ));
     loader->cursor = p;
 
                                             loader->bbox.yMax ));
     loader->cursor = p;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     if ( n_contours >= 0xFFF || p + ( n_contours + 1 ) * 2 > limit )
       goto Invalid_Outline;
 
     if ( n_contours >= 0xFFF || p + ( n_contours + 1 ) * 2 > limit )
       goto Invalid_Outline;
 
-    prev_cont = FT_NEXT_USHORT( p );
+    prev_cont = FT_NEXT_SHORT( p );
 
     if ( n_contours > 0 )
       cont[0] = prev_cont;
 
 
     if ( n_contours > 0 )
       cont[0] = prev_cont;
 
+    if ( prev_cont < 0 )
+      goto Invalid_Outline;
+
     for ( cont++; cont < cont_limit; cont++ )
     {
     for ( cont++; cont < cont_limit; cont++ )
     {
-      cont[0] = FT_NEXT_USHORT( p );
+      cont[0] = FT_NEXT_SHORT( p );
       if ( cont[0] <= prev_cont )
       {
         /* unordered contours: this is invalid */
       if ( cont[0] <= prev_cont )
       {
         /* unordered contours: this is invalid */
-        error = TT_Err_Invalid_Table;
-        goto Fail;
+        goto Invalid_Outline;
       }
       prev_cont = cont[0];
     }
       }
       prev_cont = cont[0];
     }
     if ( error )
       goto Fail;
 
     if ( error )
       goto Fail;
 
-    /* we'd better check the contours table right now */
-    outline = &gloader->current.outline;
-
-    for ( cont = outline->contours + 1; cont < cont_limit; cont++ )
-      if ( cont[-1] >= cont[0] )
-        goto Invalid_Outline;
-
     /* reading the bytecode instructions */
     load->glyph->control_len  = 0;
     load->glyph->control_data = 0;
     /* reading the bytecode instructions */
     load->glyph->control_len  = 0;
     load->glyph->control_data = 0;
     {
       FT_TRACE0(( "TT_Load_Simple_Glyph: too many instructions (%d)\n",
                   n_ins ));
     {
       FT_TRACE0(( "TT_Load_Simple_Glyph: too many instructions (%d)\n",
                   n_ins ));
-      error = TT_Err_Too_Many_Hints;
+      error = FT_THROW( Too_Many_Hints );
       goto Fail;
     }
 
     if ( ( limit - p ) < n_ins )
     {
       FT_TRACE0(( "TT_Load_Simple_Glyph: instruction count mismatch\n" ));
       goto Fail;
     }
 
     if ( ( limit - p ) < n_ins )
     {
       FT_TRACE0(( "TT_Load_Simple_Glyph: instruction count mismatch\n" ));
-      error = TT_Err_Too_Many_Hints;
+      error = FT_THROW( Too_Many_Hints );
       goto Fail;
     }
 
       goto Fail;
     }
 
 
     p += n_ins;
 
 
     p += n_ins;
 
+    outline = &gloader->current.outline;
+
     /* reading the point tags */
     flag       = (FT_Byte*)outline->tags;
     flag_limit = flag + n_points;
     /* reading the point tags */
     flag       = (FT_Byte*)outline->tags;
     flag_limit = flag + n_points;
     return error;
 
   Invalid_Outline:
     return error;
 
   Invalid_Outline:
-    error = TT_Err_Invalid_Outline;
+    error = FT_THROW( Invalid_Outline );
     goto Fail;
   }
 
     goto Fail;
   }
 
     return error;
 
   Invalid_Composite:
     return error;
 
   Invalid_Composite:
-    error = TT_Err_Invalid_Composite;
+    error = FT_THROW( Invalid_Composite );
     goto Fail;
   }
 
     goto Fail;
   }
 
   TT_Hint_Glyph( TT_Loader  loader,
                  FT_Bool    is_composite )
   {
   TT_Hint_Glyph( TT_Loader  loader,
                  FT_Bool    is_composite )
   {
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    TT_Face    face   = (TT_Face)loader->face;
+    TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );
+#endif
+
     TT_GlyphZone  zone = &loader->zone;
     FT_Pos        origin;
 
     TT_GlyphZone  zone = &loader->zone;
     FT_Pos        origin;
 
       loader->pp4 = zone->cur[zone->n_points - 1];
     }
 
       loader->pp4 = zone->cur[zone->n_points - 1];
     }
 
-    return TT_Err_Ok;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
+    {
+      if ( loader->exec->sph_tweak_flags & SPH_TWEAK_DEEMBOLDEN )
+        FT_Outline_EmboldenXY( &loader->gloader->current.outline, -24, 0 );
+
+      else if ( loader->exec->sph_tweak_flags & SPH_TWEAK_EMBOLDEN )
+        FT_Outline_EmboldenXY( &loader->gloader->current.outline, 24, 0 );
+    }
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   TT_Process_Simple_Glyph( TT_Loader  loader )
   {
     FT_GlyphLoader  gloader = loader->gloader;
   TT_Process_Simple_Glyph( TT_Loader  loader )
   {
     FT_GlyphLoader  gloader = loader->gloader;
-    FT_Error        error   = TT_Err_Ok;
+    FT_Error        error   = FT_Err_Ok;
     FT_Outline*     outline;
     FT_Int          n_points;
 
     FT_Outline*     outline;
     FT_Int          n_points;
 
                      loader->zone.n_points + 4 );
     }
 
                      loader->zone.n_points + 4 );
     }
 
-    /* scale the glyph */
-    if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
     {
     {
-      FT_Vector*  vec     = outline->points;
-      FT_Vector*  limit   = outline->points + n_points;
-      FT_Fixed    x_scale = ((TT_Size)loader->size)->metrics.x_scale;
-      FT_Fixed    y_scale = ((TT_Size)loader->size)->metrics.y_scale;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      TT_Face    face   = (TT_Face)loader->face;
+      TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );
+
+      FT_String*  family         = face->root.family_name;
+      FT_Int      ppem           = loader->size->metrics.x_ppem;
+      FT_String*  style          = face->root.style_name;
+      FT_Int      x_scale_factor = 1000;
+#endif
+
+      FT_Vector*  vec   = outline->points;
+      FT_Vector*  limit = outline->points + n_points;
 
 
+      FT_Fixed  x_scale = 0; /* pacify compiler */
+      FT_Fixed  y_scale = 0;
 
 
-      for ( ; vec < limit; vec++ )
+      FT_Bool  do_scale = FALSE;
+
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
       {
       {
-        vec->x = FT_MulFix( vec->x, x_scale );
-        vec->y = FT_MulFix( vec->y, y_scale );
+        /* scale, but only if enabled and only if TT hinting is being used */
+        if ( IS_HINTED( loader->load_flags ) )
+          x_scale_factor = sph_test_tweak_x_scaling( face,
+                                                     family,
+                                                     ppem,
+                                                     style,
+                                                     loader->glyph_index );
+        /* scale the glyph */
+        if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ||
+             x_scale_factor != 1000                         )
+        {
+          x_scale = FT_MulDiv( ((TT_Size)loader->size)->metrics.x_scale,
+                               x_scale_factor, 1000 );
+          y_scale = ((TT_Size)loader->size)->metrics.y_scale;
+
+          /* compensate for any scaling by de/emboldening; */
+          /* the amount was determined via experimentation */
+          if ( x_scale_factor != 1000 && ppem > 11 )
+            FT_Outline_EmboldenXY( outline,
+                                   FT_MulFix( 1280 * ppem,
+                                              1000 - x_scale_factor ),
+                                   0 );
+          do_scale = TRUE;
+        }
       }
       }
+      else
 
 
-      loader->pp1 = outline->points[n_points - 4];
-      loader->pp2 = outline->points[n_points - 3];
-      loader->pp3 = outline->points[n_points - 2];
-      loader->pp4 = outline->points[n_points - 1];
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+      {
+        /* scale the glyph */
+        if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
+        {
+          x_scale = ((TT_Size)loader->size)->metrics.x_scale;
+          y_scale = ((TT_Size)loader->size)->metrics.y_scale;
+
+          do_scale = TRUE;
+        }
+      }
+
+      if ( do_scale )
+      {
+        for ( ; vec < limit; vec++ )
+        {
+          vec->x = FT_MulFix( vec->x, x_scale );
+          vec->y = FT_MulFix( vec->y, y_scale );
+        }
+
+        loader->pp1 = outline->points[n_points - 4];
+        loader->pp2 = outline->points[n_points - 3];
+        loader->pp3 = outline->points[n_points - 2];
+        loader->pp4 = outline->points[n_points - 1];
+      }
     }
 
     if ( IS_HINTED( loader->load_flags ) )
     }
 
     if ( IS_HINTED( loader->load_flags ) )
       l += num_base_points;
       if ( k >= num_base_points ||
            l >= num_points      )
       l += num_base_points;
       if ( k >= num_base_points ||
            l >= num_points      )
-        return TT_Err_Invalid_Composite;
+        return FT_THROW( Invalid_Composite );
 
       p1 = gloader->base.outline.points + k;
       p2 = gloader->base.outline.points + l;
 
       p1 = gloader->base.outline.points + k;
       p2 = gloader->base.outline.points + l;
       y = subglyph->arg2;
 
       if ( !x && !y )
       y = subglyph->arg2;
 
       if ( !x && !y )
-        return TT_Err_Ok;
+        return FT_Err_Ok;
 
   /* Use a default value dependent on                                     */
   /* TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED.  This is useful for old TT */
 
   /* Use a default value dependent on                                     */
   /* TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED.  This is useful for old TT */
   /*                                                                       */
   /* This algorithm is a guess and works much better than the above.       */
   /*                                                                       */
   /*                                                                       */
   /* This algorithm is a guess and works much better than the above.       */
   /*                                                                       */
-        FT_Fixed  mac_xscale = FT_SqrtFixed(
-                                 (FT_Int32)FT_MulFix( subglyph->transform.xx,
-                                                      subglyph->transform.xx ) +
-                                 (FT_Int32)FT_MulFix( subglyph->transform.xy,
-                                                      subglyph->transform.xy ) );
-        FT_Fixed  mac_yscale = FT_SqrtFixed(
-                                 (FT_Int32)FT_MulFix( subglyph->transform.yy,
-                                                      subglyph->transform.yy ) +
-                                 (FT_Int32)FT_MulFix( subglyph->transform.yx,
-                                                      subglyph->transform.yx ) );
+        FT_Fixed  mac_xscale = FT_Hypot( subglyph->transform.xx,
+                                         subglyph->transform.xy );
+        FT_Fixed  mac_yscale = FT_Hypot( subglyph->transform.yy,
+                                         subglyph->transform.yx );
 
 
         x = FT_MulFix( x, mac_xscale );
 
 
         x = FT_MulFix( x, mac_xscale );
                        base_vec + num_base_points,
                        x, y );
 
                        base_vec + num_base_points,
                        x, y );
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
           FT_TRACE1(( "TT_Process_Composite_Glyph: "
                       "too many instructions (%d) for glyph with length %d\n",
                       n_ins, loader->byte_len ));
           FT_TRACE1(( "TT_Process_Composite_Glyph: "
                       "too many instructions (%d) for glyph with length %d\n",
                       n_ins, loader->byte_len ));
-          return TT_Err_Too_Many_Hints;
+          return FT_THROW( Too_Many_Hints );
         }
 
         tmp = loader->exec->glyphSize;
         }
 
         tmp = loader->exec->glyphSize;
           return error;
       }
       else if ( n_ins == 0 )
           return error;
       }
       else if ( n_ins == 0 )
-        return TT_Err_Ok;
+        return FT_Err_Ok;
 
       if ( FT_STREAM_READ( loader->exec->glyphIns, n_ins ) )
         return error;
 
       if ( FT_STREAM_READ( loader->exec->glyphIns, n_ins ) )
         return error;
                        FT_UInt    recurse_count,
                        FT_Bool    header_only )
   {
                        FT_UInt    recurse_count,
                        FT_Bool    header_only )
   {
-    FT_Error        error        = TT_Err_Ok;
+    FT_Error        error        = FT_Err_Ok;
     FT_Fixed        x_scale, y_scale;
     FT_ULong        offset;
     TT_Face         face         = (TT_Face)loader->face;
     FT_Fixed        x_scale, y_scale;
     FT_ULong        offset;
     TT_Face         face         = (TT_Face)loader->face;
     if ( recurse_count > 1                                   &&
          recurse_count > face->max_profile.maxComponentDepth )
     {
     if ( recurse_count > 1                                   &&
          recurse_count > face->max_profile.maxComponentDepth )
     {
-      error = TT_Err_Invalid_Composite;
+      error = FT_THROW( Invalid_Composite );
       goto Exit;
     }
 
     /* check glyph index */
     if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
     {
       goto Exit;
     }
 
     /* check glyph index */
     if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
     {
-      error = TT_Err_Invalid_Glyph_Index;
+      error = FT_THROW( Invalid_Glyph_Index );
       goto Exit;
     }
 
       goto Exit;
     }
 
 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
       {
         FT_TRACE2(( "no `glyf' table but non-zero `loca' entry\n" ));
 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
       {
         FT_TRACE2(( "no `glyf' table but non-zero `loca' entry\n" ));
-        error = TT_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         goto Exit;
       }
 
         goto Exit;
       }
 
         loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
       }
 
         loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
       }
 
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
       goto Exit;
     }
 
     else
     {
       /* invalid composite count (negative but not -1) */
     else
     {
       /* invalid composite count (negative but not -1) */
-      error = TT_Err_Invalid_Outline;
+      error = FT_THROW( Invalid_Outline );
       goto Exit;
     }
 
       goto Exit;
     }
 
   compute_glyph_metrics( TT_Loader  loader,
                          FT_UInt    glyph_index )
   {
   compute_glyph_metrics( TT_Loader  loader,
                          FT_UInt    glyph_index )
   {
+    TT_Face    face   = (TT_Face)loader->face;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );
+#endif
+
     FT_BBox       bbox;
     FT_BBox       bbox;
-    TT_Face       face = (TT_Face)loader->face;
     FT_Fixed      y_scale;
     TT_GlyphSlot  glyph = loader->glyph;
     FT_Fixed      y_scale;
     TT_GlyphSlot  glyph = loader->glyph;
-    TT_Size       size = (TT_Size)loader->size;
+    TT_Size       size  = (TT_Size)loader->size;
 
 
     y_scale = 0x10000L;
 
 
     y_scale = 0x10000L;
 
     /* get the device-independent horizontal advance; it is scaled later */
     /* by the base layer.                                                */
 
     /* get the device-independent horizontal advance; it is scaled later */
     /* by the base layer.                                                */
-    {
-      FT_Pos  advance = loader->linear;
-
-
-      /* the flag FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH was introduced to */
-      /* correctly support DynaLab fonts, which have an incorrect       */
-      /* `advance_Width_Max' field!  It is used, to my knowledge,       */
-      /* exclusively in the X-TrueType font server.                     */
-      /*                                                                */
-      if ( face->postscript.isFixedPitch                                     &&
-           ( loader->load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) == 0 )
-        advance = face->horizontal.advance_Width_Max;
-
-      /* we need to return the advance in font units in linearHoriAdvance, */
-      /* it will be scaled later by the base layer.                        */
-      glyph->linearHoriAdvance = advance;
-    }
+    glyph->linearHoriAdvance = loader->linear;
 
     glyph->metrics.horiBearingX = bbox.xMin;
     glyph->metrics.horiBearingY = bbox.yMax;
 
     glyph->metrics.horiBearingX = bbox.xMin;
     glyph->metrics.horiBearingY = bbox.yMax;
                                            size->root.metrics.x_ppem,
                                            glyph_index );
 
                                            size->root.metrics.x_ppem,
                                            glyph_index );
 
-      if ( widthp )
-        glyph->metrics.horiAdvance = *widthp << 6;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
+      {
+        FT_Bool  ignore_x_mode;
+
+
+        ignore_x_mode = FT_BOOL( FT_LOAD_TARGET_MODE( loader->load_flags ) !=
+                                 FT_RENDER_MODE_MONO );
+
+        if ( widthp                                                   &&
+             ( ( ignore_x_mode && loader->exec->compatible_widths ) ||
+                !ignore_x_mode                                      ||
+                SPH_OPTION_BITMAP_WIDTHS                            ) )
+          glyph->metrics.horiAdvance = *widthp << 6;
+      }
+      else
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+      {
+        if ( widthp )
+          glyph->metrics.horiAdvance = *widthp << 6;
+      }
     }
 
     /* set glyph dimensions */
     }
 
     /* set glyph dimensions */
   {
     TT_Face    face;
     FT_Stream  stream;
   {
     TT_Face    face;
     FT_Stream  stream;
+#ifdef TT_USE_BYTECODE_INTERPRETER
+    FT_Bool    pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
+#endif
 
 
     face   = (TT_Face)glyph->face;
 
 
     face   = (TT_Face)glyph->face;
       TT_ExecContext  exec;
       FT_Bool         grayscale;
 
       TT_ExecContext  exec;
       FT_Bool         grayscale;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );
+
+      FT_Bool  subpixel_hinting  = FALSE;
+      FT_Bool  grayscale_hinting = TRUE;
+
+#if 0
+      /* not used yet */
+      FT_Bool  compatible_widths;
+      FT_Bool  symmetrical_smoothing;
+      FT_Bool  bgr;
+      FT_Bool  subpixel_positioned;
+#endif
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+      FT_Bool  reexecute = FALSE;
+
 
       if ( !size->cvt_ready )
       {
 
       if ( !size->cvt_ready )
       {
-        FT_Error  error = tt_size_ready_bytecode( size );
+        FT_Error  error = tt_size_ready_bytecode( size, pedantic );
+
+
         if ( error )
           return error;
       }
         if ( error )
           return error;
       }
       exec = size->debug ? size->context
                          : ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;
       if ( !exec )
       exec = size->debug ? size->context
                          : ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;
       if ( !exec )
-        return TT_Err_Could_Not_Find_Context;
+        return FT_THROW( Could_Not_Find_Context );
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
+      {
+        subpixel_hinting = FT_BOOL( ( FT_LOAD_TARGET_MODE( load_flags )
+                                      != FT_RENDER_MODE_MONO )          &&
+                                    SPH_OPTION_SET_SUBPIXEL             );
+
+        if ( subpixel_hinting )
+          grayscale = grayscale_hinting = FALSE;
+        else if ( SPH_OPTION_SET_GRAYSCALE )
+        {
+          grayscale = grayscale_hinting = TRUE;
+          subpixel_hinting              = FALSE;
+        }
+        else
+          grayscale = grayscale_hinting = FALSE;
+
+        if ( FT_IS_TRICKY( glyph->face ) )
+          subpixel_hinting = grayscale_hinting = FALSE;
+
+        exec->ignore_x_mode      = subpixel_hinting || grayscale_hinting;
+        exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
+        if ( exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 )
+          exec->rasterizer_version = TT_INTERPRETER_VERSION_35;
+
+#if 1
+        exec->compatible_widths     = SPH_OPTION_SET_COMPATIBLE_WIDTHS;
+        exec->symmetrical_smoothing = FALSE;
+        exec->bgr                   = FALSE;
+        exec->subpixel_positioned   = TRUE;
+#else /* 0 */
+        exec->compatible_widths =
+          FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
+                   TT_LOAD_COMPATIBLE_WIDTHS );
+        exec->symmetrical_smoothing =
+          FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
+                   TT_LOAD_SYMMETRICAL_SMOOTHING );
+        exec->bgr =
+          FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
+                   TT_LOAD_BGR );
+        exec->subpixel_positioned =
+          FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
+                   TT_LOAD_SUBPIXEL_POSITIONED );
+#endif /* 0 */
 
 
-      grayscale =
-        FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != FT_RENDER_MODE_MONO );
+      }
+      else
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+      {
+        grayscale = FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
+                             FT_RENDER_MODE_MONO );
+      }
 
       TT_Load_Context( exec, face, size );
 
 
       TT_Load_Context( exec, face, size );
 
-      /* a change from mono to grayscale rendering (and vice versa) */
-      /* requires a re-execution of the CVT program                 */
-      if ( grayscale != exec->grayscale )
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
       {
       {
-        FT_UInt  i;
+        /* a change from mono to subpixel rendering (and vice versa) */
+        /* requires a re-execution of the CVT program                */
+        if ( subpixel_hinting != exec->subpixel_hinting )
+        {
+          FT_TRACE4(( "tt_loader_init: subpixel hinting change,"
+                      " re-executing `prep' table\n" ));
+
+          exec->subpixel_hinting = subpixel_hinting;
+          reexecute              = TRUE;
+        }
 
 
+        /* a change from mono to grayscale rendering (and vice versa) */
+        /* requires a re-execution of the CVT program                 */
+        if ( grayscale != exec->grayscale_hinting )
+        {
+          FT_TRACE4(( "tt_loader_init: grayscale hinting change,"
+                      " re-executing `prep' table\n" ));
 
 
-        FT_TRACE4(( "tt_loader_init: grayscale change,"
-                    " re-executing `prep' table\n" ));
+          exec->grayscale_hinting = grayscale_hinting;
+          reexecute               = TRUE;
+        }
+      }
+      else
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+      {
+        /* a change from mono to grayscale rendering (and vice versa) */
+        /* requires a re-execution of the CVT program                 */
+        if ( grayscale != exec->grayscale )
+        {
+          FT_TRACE4(( "tt_loader_init: grayscale change,"
+                      " re-executing `prep' table\n" ));
+
+          exec->grayscale = grayscale;
+          reexecute       = TRUE;
+        }
+      }
+
+      if ( reexecute )
+      {
+        FT_UInt  i;
 
 
-        exec->grayscale = grayscale;
 
         for ( i = 0; i < size->cvt_size; i++ )
           size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );
 
         for ( i = 0; i < size->cvt_size; i++ )
           size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );
-        tt_size_run_prep( size );
+        tt_size_run_prep( size, pedantic );
       }
 
       /* see whether the cvt program has disabled hinting */
       }
 
       /* see whether the cvt program has disabled hinting */
       FT_Error  error = face->goto_table( face, TTAG_glyf, stream, 0 );
 
 
       FT_Error  error = face->goto_table( face, TTAG_glyf, stream, 0 );
 
 
-      if ( error == TT_Err_Table_Missing )
+      if ( FT_ERR_EQ( error, Table_Missing ) )
         loader->glyf_offset = 0;
       else if ( error )
       {
         loader->glyf_offset = 0;
       else if ( error )
       {
     loader->glyph  = (FT_GlyphSlot)glyph;
     loader->stream = stream;
 
     loader->glyph  = (FT_GlyphSlot)glyph;
     loader->stream = stream;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
                  FT_UInt       glyph_index,
                  FT_Int32      load_flags )
   {
                  FT_UInt       glyph_index,
                  FT_Int32      load_flags )
   {
-    TT_Face       face;
     FT_Error      error;
     TT_LoaderRec  loader;
 
 
     FT_Error      error;
     TT_LoaderRec  loader;
 
 
-    face   = (TT_Face)glyph->face;
-    error  = TT_Err_Ok;
+    error = FT_Err_Ok;
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
 
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
 
       error = load_sbit_image( size, glyph, glyph_index, load_flags );
       if ( !error )
       {
       error = load_sbit_image( size, glyph, glyph_index, load_flags );
       if ( !error )
       {
-        FT_Face  root = &face->root;
-
-
-        if ( FT_IS_SCALABLE( root ) )
+        if ( FT_IS_SCALABLE( glyph->face ) )
         {
           /* for the bbox we need the header only */
           (void)tt_loader_init( &loader, size, glyph, load_flags, TRUE );
         {
           /* for the bbox we need the header only */
           (void)tt_loader_init( &loader, size, glyph, load_flags, TRUE );
           glyph->linearHoriAdvance = loader.linear;
           glyph->linearVertAdvance = loader.top_bearing + loader.bbox.yMax -
                                        loader.vadvance;
           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;
+
+          /* sanity check: if `horiAdvance' in the sbit metric */
+          /* structure isn't set, use `linearHoriAdvance'      */
+          if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )
+            glyph->metrics.horiAdvance =
+              FT_MulFix( glyph->linearHoriAdvance,
+                         size->root.metrics.x_scale );
         }
 
         }
 
-        return TT_Err_Ok;
+        return FT_Err_Ok;
       }
     }
 
       }
     }
 
 
     /* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */
     if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid )
 
     /* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */
     if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid )
-      return TT_Err_Invalid_Size_Handle;
+      return FT_THROW( Invalid_Size_Handle );
 
     if ( load_flags & FT_LOAD_SBITS_ONLY )
 
     if ( load_flags & FT_LOAD_SBITS_ONLY )
-      return TT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     error = tt_loader_init( &loader, size, glyph, load_flags, FALSE );
     if ( error )
 
     error = tt_loader_init( &loader, size, glyph, load_flags, FALSE );
     if ( error )
diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttgload.c.old b/reactos/lib/3rdparty/freetype/src/truetype/ttgload.c.old
deleted file mode 100644 (file)
index e9af0f5..0000000
+++ /dev/null
@@ -1,1927 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ttgload.c                                                              */
-/*                                                                         */
-/*    TrueType Glyph Loader (body).                                        */
-/*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#include <ft2build.h>
-#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_CALC_H
-#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_SFNT_H
-#include FT_TRUETYPE_TAGS_H
-#include FT_OUTLINE_H
-
-#include "ttgload.h"
-#include "ttpload.h"
-
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-#include "ttgxvar.h"
-#endif
-
-#include "tterrors.h"
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
-  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
-  /* messages during execution.                                            */
-  /*                                                                       */
-#undef  FT_COMPONENT
-#define FT_COMPONENT  trace_ttgload
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Composite font flags.                                                 */
-  /*                                                                       */
-#define ARGS_ARE_WORDS             0x0001
-#define ARGS_ARE_XY_VALUES         0x0002
-#define ROUND_XY_TO_GRID           0x0004
-#define WE_HAVE_A_SCALE            0x0008
-/* reserved                        0x0010 */
-#define MORE_COMPONENTS            0x0020
-#define WE_HAVE_AN_XY_SCALE        0x0040
-#define WE_HAVE_A_2X2              0x0080
-#define WE_HAVE_INSTR              0x0100
-#define USE_MY_METRICS             0x0200
-#define OVERLAP_COMPOUND           0x0400
-#define SCALED_COMPONENT_OFFSET    0x0800
-#define UNSCALED_COMPONENT_OFFSET  0x1000
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Returns the horizontal metrics in font units for a given glyph.  If   */
-  /* `check' is true, take care of monospaced fonts by returning the       */
-  /* advance width maximum.                                                */
-  /*                                                                       */
-  static void
-  Get_HMetrics( TT_Face     face,
-                FT_UInt     idx,
-                FT_Bool     check,
-                FT_Short*   lsb,
-                FT_UShort*  aw )
-  {
-    ( (SFNT_Service)face->sfnt )->get_metrics( face, 0, idx, lsb, aw );
-
-    if ( check && face->postscript.isFixedPitch )
-      *aw = face->horizontal.advance_Width_Max;
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Returns the vertical metrics in font units for a given glyph.         */
-  /* Greg Hitchcock from Microsoft told us that if there were no `vmtx'    */
-  /* table, typoAscender/Descender from the `OS/2' table would be used     */
-  /* instead, and if there were no `OS/2' table, use ascender/descender    */
-  /* from the `hhea' table.  But that is not what Microsoft's rasterizer   */
-  /* apparently does: It uses the ppem value as the advance height, and    */
-  /* sets the top side bearing to be zero.                                 */
-  /*                                                                       */
-  /* The monospace `check' is probably not meaningful here, but we leave   */
-  /* it in for a consistent interface.                                     */
-  /*                                                                       */
-  static void
-  Get_VMetrics( TT_Face     face,
-                FT_UInt     idx,
-                FT_Bool     check,
-                FT_Short*   tsb,
-                FT_UShort*  ah )
-  {
-    FT_UNUSED( check );
-
-    if ( face->vertical_info )
-      ( (SFNT_Service)face->sfnt )->get_metrics( face, 1, idx, tsb, ah );
-
-#if 1             /* Empirically determined, at variance with what MS said */
-
-    else
-    {
-      *tsb = 0;
-      *ah  = face->root.units_per_EM;
-    }
-
-#else      /* This is what MS said to do.  It isn't what they do, however. */
-
-    else if ( face->os2.version != 0xFFFFU )
-    {
-      *tsb = face->os2.sTypoAscender;
-      *ah  = face->os2.sTypoAscender - face->os2.sTypoDescender;
-    }
-    else
-    {
-      *tsb = face->horizontal.Ascender;
-      *ah  = face->horizontal.Ascender - face->horizontal.Descender;
-    }
-
-#endif
-
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Translates an array of coordinates.                                   */
-  /*                                                                       */
-  static void
-  translate_array( FT_UInt     n,
-                   FT_Vector*  coords,
-                   FT_Pos      delta_x,
-                   FT_Pos      delta_y )
-  {
-    FT_UInt  k;
-
-
-    if ( delta_x )
-      for ( k = 0; k < n; k++ )
-        coords[k].x += delta_x;
-
-    if ( delta_y )
-      for ( k = 0; k < n; k++ )
-        coords[k].y += delta_y;
-  }
-
-
-#undef  IS_HINTED
-#define IS_HINTED( flags )  ( ( flags & FT_LOAD_NO_HINTING ) == 0 )
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* The following functions are used by default with TrueType fonts.      */
-  /* However, they can be replaced by alternatives if we need to support   */
-  /* TrueType-compressed formats (like MicroType) in the future.           */
-  /*                                                                       */
-  /*************************************************************************/
-
-  FT_CALLBACK_DEF( FT_Error )
-  TT_Access_Glyph_Frame( TT_Loader  loader,
-                         FT_UInt    glyph_index,
-                         FT_ULong   offset,
-                         FT_UInt    byte_count )
-  {
-    FT_Error   error;
-    FT_Stream  stream = loader->stream;
-
-    /* for non-debug mode */
-    FT_UNUSED( glyph_index );
-
-
-    FT_TRACE5(( "Glyph %ld\n", glyph_index ));
-
-    /* the following line sets the `error' variable through macros! */
-    if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( byte_count ) )
-      return error;
-
-    loader->cursor = stream->cursor;
-    loader->limit  = stream->limit;
-
-    return TT_Err_Ok;
-  }
-
-
-  FT_CALLBACK_DEF( void )
-  TT_Forget_Glyph_Frame( TT_Loader  loader )
-  {
-    FT_Stream  stream = loader->stream;
-
-
-    FT_FRAME_EXIT();
-  }
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  TT_Load_Glyph_Header( TT_Loader  loader )
-  {
-    FT_Byte*  p     = loader->cursor;
-    FT_Byte*  limit = loader->limit;
-
-
-    if ( p + 10 > limit )
-      return TT_Err_Invalid_Outline;
-
-    loader->n_contours = FT_NEXT_SHORT( p );
-
-    loader->bbox.xMin = FT_NEXT_SHORT( p );
-    loader->bbox.yMin = FT_NEXT_SHORT( p );
-    loader->bbox.xMax = FT_NEXT_SHORT( p );
-    loader->bbox.yMax = FT_NEXT_SHORT( p );
-
-    FT_TRACE5(( "  # of contours: %d\n", loader->n_contours ));
-    FT_TRACE5(( "  xMin: %4d  xMax: %4d\n", loader->bbox.xMin,
-                                            loader->bbox.xMax ));
-    FT_TRACE5(( "  yMin: %4d  yMax: %4d\n", loader->bbox.yMin,
-                                            loader->bbox.yMax ));
-    loader->cursor = p;
-
-    return TT_Err_Ok;
-  }
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  TT_Load_Simple_Glyph( TT_Loader  load )
-  {
-    FT_Error        error;
-    FT_Byte*        p          = load->cursor;
-    FT_Byte*        limit      = load->limit;
-    FT_GlyphLoader  gloader    = load->gloader;
-    FT_Int          n_contours = load->n_contours;
-    FT_Outline*     outline;
-    TT_Face         face       = (TT_Face)load->face;
-    FT_UShort       n_ins;
-    FT_Int          n, n_points;
-
-    FT_Byte         *flag, *flag_limit;
-    FT_Byte         c, count;
-    FT_Vector       *vec, *vec_limit;
-    FT_Pos          x;
-    FT_Short        *cont, *cont_limit;
-
-
-    /* check that we can add the contours to the glyph */
-    error = FT_GLYPHLOADER_CHECK_POINTS( gloader, 0, n_contours );
-    if ( error )
-      goto Fail;
-
-    /* reading the contours' endpoints & number of points */
-    cont       = gloader->current.outline.contours;
-    cont_limit = cont + n_contours;
-
-    /* check space for contours array + instructions count */
-    if ( n_contours >= 0xFFF || p + (n_contours + 1) * 2 > limit )
-      goto Invalid_Outline;
-
-    for ( ; cont < cont_limit; cont++ )
-      cont[0] = FT_NEXT_USHORT( p );
-
-    n_points = 0;
-    if ( n_contours > 0 )
-      n_points = cont[-1] + 1;
-
-    /* note that we will add four phantom points later */
-    error = FT_GLYPHLOADER_CHECK_POINTS( gloader, n_points + 4, 0 );
-    if ( error )
-      goto Fail;
-
-    /* we'd better check the contours table right now */
-    outline = &gloader->current.outline;
-
-    for ( cont = outline->contours + 1; cont < cont_limit; cont++ )
-      if ( cont[-1] >= cont[0] )
-        goto Invalid_Outline;
-
-    /* reading the bytecode instructions */
-    load->glyph->control_len  = 0;
-    load->glyph->control_data = 0;
-
-    if ( p + 2 > limit )
-      goto Invalid_Outline;
-
-    n_ins = FT_NEXT_USHORT( p );
-
-    FT_TRACE5(( "  Instructions size: %u\n", n_ins ));
-
-    if ( n_ins > face->max_profile.maxSizeOfInstructions )
-    {
-      FT_TRACE0(( "TT_Load_Simple_Glyph: Too many instructions!\n" ));
-      error = TT_Err_Too_Many_Hints;
-      goto Fail;
-    }
-
-    if ( ( limit - p ) < n_ins )
-    {
-      FT_TRACE0(( "TT_Load_Simple_Glyph: Instruction count mismatch!\n" ));
-      error = TT_Err_Too_Many_Hints;
-      goto Fail;
-    }
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
-    if ( IS_HINTED( load->load_flags ) )
-    {
-      load->glyph->control_len  = n_ins;
-      load->glyph->control_data = load->exec->glyphIns;
-
-      FT_MEM_COPY( load->exec->glyphIns, p, (FT_Long)n_ins );
-    }
-
-#endif /* TT_USE_BYTECODE_INTERPRETER */
-
-    p += n_ins;
-
-    /* reading the point tags */
-    flag       = (FT_Byte*)outline->tags;
-    flag_limit = flag + n_points;
-
-    FT_ASSERT( flag != NULL );
-
-    while ( flag < flag_limit )
-    {
-      if ( p + 1 > limit )
-        goto Invalid_Outline;
-
-      *flag++ = c = FT_NEXT_BYTE( p );
-      if ( c & 8 )
-      {
-        if ( p + 1 > limit )
-          goto Invalid_Outline;
-
-        count = FT_NEXT_BYTE( p );
-        if ( flag + (FT_Int)count > flag_limit )
-          goto Invalid_Outline;
-
-        for ( ; count > 0; count-- )
-          *flag++ = c;
-      }
-    }
-
-    /* reading the X coordinates */
-
-    vec       = outline->points;
-    vec_limit = vec + n_points;
-    flag      = (FT_Byte*)outline->tags;
-    x         = 0;
-
-    for ( ; vec < vec_limit; vec++, flag++ )
-    {
-      FT_Pos  y = 0;
-
-
-      if ( *flag & 2 )
-      {
-        if ( p + 1 > limit )
-          goto Invalid_Outline;
-
-        y = (FT_Pos)FT_NEXT_BYTE( p );
-        if ( ( *flag & 16 ) == 0 )
-          y = -y;
-      }
-      else if ( ( *flag & 16 ) == 0 )
-      {
-        if ( p + 2 > limit )
-          goto Invalid_Outline;
-
-        y = (FT_Pos)FT_NEXT_SHORT( p );
-      }
-
-      x     += y;
-      vec->x = x;
-    }
-
-    /* reading the Y coordinates */
-
-    vec       = gloader->current.outline.points;
-    vec_limit = vec + n_points;
-    flag      = (FT_Byte*)outline->tags;
-    x         = 0;
-
-    for ( ; vec < vec_limit; vec++, flag++ )
-    {
-      FT_Pos  y = 0;
-
-
-      if ( *flag & 4 )
-      {
-        if ( p  +1 > limit )
-          goto Invalid_Outline;
-
-        y = (FT_Pos)FT_NEXT_BYTE( p );
-        if ( ( *flag & 32 ) == 0 )
-          y = -y;
-      }
-      else if ( ( *flag & 32 ) == 0 )
-      {
-        if ( p + 2 > limit )
-          goto Invalid_Outline;
-
-        y = (FT_Pos)FT_NEXT_SHORT( p );
-      }
-
-      x     += y;
-      vec->y = x;
-    }
-
-    /* clear the touch tags */
-    for ( n = 0; n < n_points; n++ )
-      outline->tags[n] &= FT_CURVE_TAG_ON;
-
-    outline->n_points   = (FT_UShort)n_points;
-    outline->n_contours = (FT_Short) n_contours;
-
-    load->cursor = p;
-
-  Fail:
-    return error;
-
-  Invalid_Outline:
-    error = TT_Err_Invalid_Outline;
-    goto Fail;
-  }
-
-
-  FT_CALLBACK_DEF( FT_Error )
-  TT_Load_Composite_Glyph( TT_Loader  loader )
-  {
-    FT_Error        error;
-    FT_Byte*        p       = loader->cursor;
-    FT_Byte*        limit   = loader->limit;
-    FT_GlyphLoader  gloader = loader->gloader;
-    FT_SubGlyph     subglyph;
-    FT_UInt         num_subglyphs;
-
-
-    num_subglyphs = 0;
-
-    do
-    {
-      FT_Fixed  xx, xy, yy, yx;
-      FT_UInt   count;
-
-
-      /* check that we can load a new subglyph */
-      error = FT_GlyphLoader_CheckSubGlyphs( gloader, num_subglyphs + 1 );
-      if ( error )
-        goto Fail;
-
-      /* check space */
-      if ( p + 4 > limit )
-        goto Invalid_Composite;
-
-      subglyph = gloader->current.subglyphs + num_subglyphs;
-
-      subglyph->arg1 = subglyph->arg2 = 0;
-
-      subglyph->flags = FT_NEXT_USHORT( p );
-      subglyph->index = FT_NEXT_USHORT( p );
-
-      /* check space */
-      count = 2;
-      if ( subglyph->flags & ARGS_ARE_WORDS )
-        count += 2;
-      if ( subglyph->flags & WE_HAVE_A_SCALE )
-        count += 2;
-      else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE )
-        count += 4;
-      else if ( subglyph->flags & WE_HAVE_A_2X2 )
-        count += 8;
-
-      if ( p + count > limit )
-        goto Invalid_Composite;
-
-      /* read arguments */
-      if ( subglyph->flags & ARGS_ARE_WORDS )
-      {
-        subglyph->arg1 = FT_NEXT_SHORT( p );
-        subglyph->arg2 = FT_NEXT_SHORT( p );
-      }
-      else
-      {
-        subglyph->arg1 = FT_NEXT_CHAR( p );
-        subglyph->arg2 = FT_NEXT_CHAR( p );
-      }
-
-      /* read transform */
-      xx = yy = 0x10000L;
-      xy = yx = 0;
-
-      if ( subglyph->flags & WE_HAVE_A_SCALE )
-      {
-        xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
-        yy = xx;
-      }
-      else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE )
-      {
-        xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
-        yy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
-      }
-      else if ( subglyph->flags & WE_HAVE_A_2X2 )
-      {
-        xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
-        yx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
-        xy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
-        yy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
-      }
-
-      subglyph->transform.xx = xx;
-      subglyph->transform.xy = xy;
-      subglyph->transform.yx = yx;
-      subglyph->transform.yy = yy;
-
-      num_subglyphs++;
-
-    } while ( subglyph->flags & MORE_COMPONENTS );
-
-    gloader->current.num_subglyphs = num_subglyphs;
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
-    {
-      FT_Stream  stream = loader->stream;
-
-
-      /* we must undo the FT_FRAME_ENTER in order to point to the */
-      /* composite instructions, if we find some.               */
-      /* we will process them later...                          */
-      /*                                                        */
-      loader->ins_pos = (FT_ULong)( FT_STREAM_POS() +
-                                    p - limit );
-    }
-
-#endif
-
-    loader->cursor = p;
-
-  Fail:
-    return error;
-
-  Invalid_Composite:
-    error = TT_Err_Invalid_Composite;
-    goto Fail;
-  }
-
-
-  FT_LOCAL_DEF( void )
-  TT_Init_Glyph_Loading( TT_Face  face )
-  {
-    face->access_glyph_frame   = TT_Access_Glyph_Frame;
-    face->read_glyph_header    = TT_Load_Glyph_Header;
-    face->read_simple_glyph    = TT_Load_Simple_Glyph;
-    face->read_composite_glyph = TT_Load_Composite_Glyph;
-    face->forget_glyph_frame   = TT_Forget_Glyph_Frame;
-  }
-
-
-  static void
-  tt_prepare_zone( TT_GlyphZone  zone,
-                   FT_GlyphLoad  load,
-                   FT_UInt       start_point,
-                   FT_UInt       start_contour )
-  {
-    zone->n_points   = (FT_UShort)( load->outline.n_points - start_point );
-    zone->n_contours = (FT_Short) ( load->outline.n_contours - start_contour );
-    zone->org        = load->extra_points + start_point;
-    zone->cur        = load->outline.points + start_point;
-    zone->orus       = load->extra_points2 + start_point;
-    zone->tags       = (FT_Byte*)load->outline.tags + start_point;
-    zone->contours   = (FT_UShort*)load->outline.contours + start_contour;
-    zone->first_point = (FT_UShort)start_point;
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Hint_Glyph                                                      */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Hint the glyph using the zone prepared by the caller.  Note that   */
-  /*    the zone is supposed to include four phantom points.               */
-  /*                                                                       */
-  static FT_Error
-  TT_Hint_Glyph( TT_Loader  loader,
-                 FT_Bool    is_composite )
-  {
-    TT_GlyphZone  zone = &loader->zone;
-    FT_Pos        origin;
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
-    FT_UInt       n_ins;
-#else
-    FT_UNUSED( is_composite );
-#endif
-
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
-    n_ins = loader->glyph->control_len;
-#endif
-
-    origin = zone->cur[zone->n_points - 4].x;
-    origin = FT_PIX_ROUND( origin ) - origin;
-    if ( origin )
-      translate_array( zone->n_points, zone->cur, origin, 0 );
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
-    /* save original point position in org */
-    if ( n_ins > 0 )
-      FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points );
-#endif
-
-    /* round pp2 and pp4 */
-    zone->cur[zone->n_points - 3].x =
-      FT_PIX_ROUND( zone->cur[zone->n_points - 3].x );
-    zone->cur[zone->n_points - 1].y =
-      FT_PIX_ROUND( zone->cur[zone->n_points - 1].y );
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
-    if ( n_ins > 0 )
-    {
-      FT_Bool   debug;
-      FT_Error  error;
-
-
-      error = TT_Set_CodeRange( loader->exec, tt_coderange_glyph,
-                                loader->exec->glyphIns, n_ins );
-      if ( error )
-        return error;
-
-      loader->exec->is_composite = is_composite;
-      loader->exec->pts          = *zone;
-
-      debug = FT_BOOL( !( loader->load_flags & FT_LOAD_NO_SCALE ) &&
-                       ((TT_Size)loader->size)->debug             );
-
-      error = TT_Run_Context( loader->exec, debug );
-      if ( error && loader->exec->pedantic_hinting )
-        return error;
-    }
-
-#endif
-
-    /* save glyph phantom points */
-    if ( !loader->preserve_pps )
-    {
-      loader->pp1 = zone->cur[zone->n_points - 4];
-      loader->pp2 = zone->cur[zone->n_points - 3];
-      loader->pp3 = zone->cur[zone->n_points - 2];
-      loader->pp4 = zone->cur[zone->n_points - 1];
-    }
-
-    return TT_Err_Ok;
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Process_Simple_Glyph                                            */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Once a simple glyph has been loaded, it needs to be processed.     */
-  /*    Usually, this means scaling and hinting through bytecode           */
-  /*    interpretation.                                                    */
-  /*                                                                       */
-  static FT_Error
-  TT_Process_Simple_Glyph( TT_Loader  loader )
-  {
-    FT_GlyphLoader  gloader = loader->gloader;
-    FT_Error        error   = TT_Err_Ok;
-    FT_Outline*     outline;
-    FT_UInt         n_points;
-
-
-    outline  = &gloader->current.outline;
-    n_points = outline->n_points;
-
-    /* set phantom points */
-
-    outline->points[n_points    ] = loader->pp1;
-    outline->points[n_points + 1] = loader->pp2;
-    outline->points[n_points + 2] = loader->pp3;
-    outline->points[n_points + 3] = loader->pp4;
-
-    outline->tags[n_points    ] = 0;
-    outline->tags[n_points + 1] = 0;
-    outline->tags[n_points + 2] = 0;
-    outline->tags[n_points + 3] = 0;
-
-    n_points += 4;
-
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-
-    if ( ((TT_Face)loader->face)->doblend )
-    {
-      /* Deltas apply to the unscaled data. */
-      FT_Vector*  deltas;
-      FT_Memory   memory = loader->face->memory;
-      FT_UInt     i;
-
-
-      error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),
-                                        loader->glyph_index,
-                                        &deltas,
-                                        n_points );
-      if ( error )
-        return error;
-
-      for ( i = 0; i < n_points; ++i )
-      {
-        outline->points[i].x += deltas[i].x;
-        outline->points[i].y += deltas[i].y;
-      }
-
-      FT_FREE( deltas );
-    }
-
-#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
-
-    if ( IS_HINTED( loader->load_flags ) )
-    {
-      tt_prepare_zone( &loader->zone, &gloader->current, 0, 0 );
-
-      FT_ARRAY_COPY( loader->zone.orus, loader->zone.cur,
-                     loader->zone.n_points + 4 );
-    }
-
-    /* scale the glyph */
-    if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
-    {
-      FT_Vector*  vec     = outline->points;
-      FT_Vector*  limit   = outline->points + n_points;
-      FT_Fixed    x_scale = ((TT_Size)loader->size)->metrics.x_scale;
-      FT_Fixed    y_scale = ((TT_Size)loader->size)->metrics.y_scale;
-
-
-      for ( ; vec < limit; vec++ )
-      {
-        vec->x = FT_MulFix( vec->x, x_scale );
-        vec->y = FT_MulFix( vec->y, y_scale );
-      }
-
-      loader->pp1 = outline->points[n_points - 4];
-      loader->pp2 = outline->points[n_points - 3];
-      loader->pp3 = outline->points[n_points - 2];
-      loader->pp4 = outline->points[n_points - 1];
-    }
-
-    if ( IS_HINTED( loader->load_flags ) )
-    {
-      loader->zone.n_points += 4;
-
-      error = TT_Hint_Glyph( loader, 0 );
-    }
-
-    return error;
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Process_Composite_Component                                     */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Once a composite component has been loaded, it needs to be         */
-  /*    processed.  Usually, this means transforming and translating.      */
-  /*                                                                       */
-  static FT_Error
-  TT_Process_Composite_Component( TT_Loader    loader,
-                                  FT_SubGlyph  subglyph,
-                                  FT_UInt      start_point,
-                                  FT_UInt      num_base_points )
-  {
-    FT_GlyphLoader  gloader    = loader->gloader;
-    FT_Vector*      base_vec   = gloader->base.outline.points;
-    FT_UInt         num_points = gloader->base.outline.n_points;
-    FT_Bool         have_scale;
-    FT_Pos          x, y;
-
-
-    have_scale = FT_BOOL( subglyph->flags & ( WE_HAVE_A_SCALE     |
-                                              WE_HAVE_AN_XY_SCALE |
-                                              WE_HAVE_A_2X2       ) );
-
-    /* perform the transform required for this subglyph */
-    if ( have_scale )
-    {
-      FT_UInt  i;
-
-
-      for ( i = num_base_points; i < num_points; i++ )
-        FT_Vector_Transform( base_vec + i, &subglyph->transform );
-    }
-
-    /* get offset */
-    if ( !( subglyph->flags & ARGS_ARE_XY_VALUES ) )
-    {
-      FT_UInt     k = subglyph->arg1;
-      FT_UInt     l = subglyph->arg2;
-      FT_Vector*  p1;
-      FT_Vector*  p2;
-
-
-      /* match l-th point of the newly loaded component to the k-th point */
-      /* of the previously loaded components.                             */
-
-      /* change to the point numbers used by our outline */
-      k += start_point;
-      l += num_base_points;
-      if ( k >= num_base_points ||
-           l >= num_points      )
-        return TT_Err_Invalid_Composite;
-
-      p1 = gloader->base.outline.points + k;
-      p2 = gloader->base.outline.points + l;
-
-      x = p1->x - p2->x;
-      y = p1->y - p2->y;
-    }
-    else
-    {
-      x = subglyph->arg1;
-      y = subglyph->arg2;
-
-      if ( !x && !y )
-        return TT_Err_Ok;
-
-  /* Use a default value dependent on                                     */
-  /* TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED.  This is useful for old TT */
-  /* fonts which don't set the xxx_COMPONENT_OFFSET bit.                  */
-
-      if ( have_scale &&
-#ifdef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
-           !( subglyph->flags & UNSCALED_COMPONENT_OFFSET ) )
-#else
-            ( subglyph->flags & SCALED_COMPONENT_OFFSET ) )
-#endif
-      {
-
-#if 0
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* This algorithm is what Apple documents.  But it doesn't work.         */
-  /*                                                                       */
-        int  a = subglyph->transform.xx > 0 ?  subglyph->transform.xx
-                                            : -subglyph->transform.xx;
-        int  b = subglyph->transform.yx > 0 ?  subglyph->transform.yx
-                                            : -subglyph->transform.yx;
-        int  c = subglyph->transform.xy > 0 ?  subglyph->transform.xy
-                                            : -subglyph->transform.xy;
-        int  d = subglyph->transform.yy > 0 ? subglyph->transform.yy
-                                            : -subglyph->transform.yy;
-        int  m = a > b ? a : b;
-        int  n = c > d ? c : d;
-
-
-        if ( a - b <= 33 && a - b >= -33 )
-          m *= 2;
-        if ( c - d <= 33 && c - d >= -33 )
-          n *= 2;
-        x = FT_MulFix( x, m );
-        y = FT_MulFix( y, n );
-
-#else /* 0 */
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* This algorithm is a guess and works much better than the above.       */
-  /*                                                                       */
-        FT_Fixed  mac_xscale = FT_SqrtFixed(
-                                 FT_MulFix( subglyph->transform.xx,
-                                            subglyph->transform.xx ) +
-                                 FT_MulFix( subglyph->transform.xy,
-                                            subglyph->transform.xy ) );
-        FT_Fixed  mac_yscale = FT_SqrtFixed(
-                                 FT_MulFix( subglyph->transform.yy,
-                                            subglyph->transform.yy ) +
-                                 FT_MulFix( subglyph->transform.yx,
-                                            subglyph->transform.yx ) );
-
-
-        x = FT_MulFix( x, mac_xscale );
-        y = FT_MulFix( y, mac_yscale );
-
-#endif /* 0 */
-
-      }
-
-      if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) )
-      {
-        FT_Fixed  x_scale = ((TT_Size)loader->size)->metrics.x_scale;
-        FT_Fixed  y_scale = ((TT_Size)loader->size)->metrics.y_scale;
-
-
-        x = FT_MulFix( x, x_scale );
-        y = FT_MulFix( y, y_scale );
-
-        if ( subglyph->flags & ROUND_XY_TO_GRID )
-        {
-          x = FT_PIX_ROUND( x );
-          y = FT_PIX_ROUND( y );
-        }
-      }
-    }
-
-    if ( x || y )
-      translate_array( num_points - num_base_points,
-                       base_vec + num_base_points,
-                       x, y );
-
-    return TT_Err_Ok;
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Process_Composite_Glyph                                         */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    This is slightly different from TT_Process_Simple_Glyph, in that   */
-  /*    its sole purpose is to hint the glyph.  Thus this function is      */
-  /*    only available when bytecode interpreter is enabled.               */
-  /*                                                                       */
-  static FT_Error
-  TT_Process_Composite_Glyph( TT_Loader  loader,
-                              FT_UInt    start_point,
-                              FT_UInt    start_contour )
-  {
-    FT_Error     error;
-    FT_Outline*  outline;
-    FT_UInt      i;
-
-
-    outline = &loader->gloader->base.outline;
-
-    /* make room for phantom points */
-    error = FT_GLYPHLOADER_CHECK_POINTS( loader->gloader,
-                                         outline->n_points + 4,
-                                         0 );
-    if ( error )
-      return error;
-
-    outline->points[outline->n_points    ] = loader->pp1;
-    outline->points[outline->n_points + 1] = loader->pp2;
-    outline->points[outline->n_points + 2] = loader->pp3;
-    outline->points[outline->n_points + 3] = loader->pp4;
-
-    outline->tags[outline->n_points    ] = 0;
-    outline->tags[outline->n_points + 1] = 0;
-    outline->tags[outline->n_points + 2] = 0;
-    outline->tags[outline->n_points + 3] = 0;
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
-    {
-      FT_Stream  stream = loader->stream;
-      FT_UShort  n_ins;
-
-
-      /* TT_Load_Composite_Glyph only gives us the offset of instructions */
-      /* so we read them here                                             */
-      if ( FT_STREAM_SEEK( loader->ins_pos ) ||
-           FT_READ_USHORT( n_ins )           )
-        return error;
-
-      FT_TRACE5(( "  Instructions size = %d\n", n_ins ));
-
-      /* check it */
-      if ( n_ins > ((TT_Face)loader->face)->max_profile.maxSizeOfInstructions )
-      {
-        FT_TRACE0(( "Too many instructions (%d)\n", n_ins ));
-
-        return TT_Err_Too_Many_Hints;
-      }
-      else if ( n_ins == 0 )
-        return TT_Err_Ok;
-
-      if ( FT_STREAM_READ( loader->exec->glyphIns, n_ins ) )
-        return error;
-
-      loader->glyph->control_data = loader->exec->glyphIns;
-      loader->glyph->control_len  = n_ins;
-    }
-
-#endif
-
-    tt_prepare_zone( &loader->zone, &loader->gloader->base,
-                     start_point, start_contour );
-
-    /* Some points are likely touched during execution of  */
-    /* instructions on components.  So let's untouch them. */
-    for ( i = start_point; i < loader->zone.n_points; i++ )
-      loader->zone.tags[i] &= ~( FT_CURVE_TAG_TOUCH_X |
-                                 FT_CURVE_TAG_TOUCH_Y );
-
-    loader->zone.n_points += 4;
-
-    return TT_Hint_Glyph( loader, 1 );
-  }
-
-
-  /* Calculate the four phantom points.                     */
-  /* The first two stand for horizontal origin and advance. */
-  /* The last two stand for vertical origin and advance.    */
-#define TT_LOADER_SET_PP( loader )                                          \
-          do {                                                              \
-            (loader)->pp1.x = (loader)->bbox.xMin - (loader)->left_bearing; \
-            (loader)->pp1.y = 0;                                            \
-            (loader)->pp2.x = (loader)->pp1.x + (loader)->advance;          \
-            (loader)->pp2.y = 0;                                            \
-            (loader)->pp3.x = 0;                                            \
-            (loader)->pp3.y = (loader)->top_bearing + (loader)->bbox.yMax;  \
-            (loader)->pp4.x = 0;                                            \
-            (loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance;         \
-          } while ( 0 )
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    load_truetype_glyph                                                */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads a given truetype glyph.  Handles composites and uses a       */
-  /*    TT_Loader object.                                                  */
-  /*                                                                       */
-  static FT_Error
-  load_truetype_glyph( TT_Loader  loader,
-                       FT_UInt    glyph_index,
-                       FT_UInt    recurse_count )
-  {
-    FT_Error        error;
-    FT_Fixed        x_scale, y_scale;
-    FT_ULong        offset;
-    TT_Face         face         = (TT_Face)loader->face;
-    FT_GlyphLoader  gloader      = loader->gloader;
-    FT_Bool         opened_frame = 0;
-
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-    FT_Vector*      deltas       = NULL;
-#endif
-
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
-    FT_StreamRec    inc_stream;
-    FT_Data         glyph_data;
-    FT_Bool         glyph_data_loaded = 0;
-#endif
-
-
-    if ( recurse_count > face->max_profile.maxComponentDepth )
-    {
-      error = TT_Err_Invalid_Composite;
-      goto Exit;
-    }
-
-    /* check glyph index */
-    if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
-    {
-      error = TT_Err_Invalid_Glyph_Index;
-      goto Exit;
-    }
-
-    loader->glyph_index = glyph_index;
-
-    if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
-    {
-      x_scale = ((TT_Size)loader->size)->metrics.x_scale;
-      y_scale = ((TT_Size)loader->size)->metrics.y_scale;
-    }
-    else
-    {
-      x_scale = 0x10000L;
-      y_scale = 0x10000L;
-    }
-
-    /* get metrics, horizontal and vertical */
-    {
-      FT_Short   left_bearing = 0, top_bearing = 0;
-      FT_UShort  advance_width = 0, advance_height = 0;
-
-
-      Get_HMetrics( face, glyph_index,
-                    (FT_Bool)!( loader->load_flags &
-                                FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ),
-                    &left_bearing,
-                    &advance_width );
-      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;
-      }
-    }
-
-    /* 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  */
-    /* bytes.                                                          */
-
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
-
-    /* If we are loading glyph data via the incremental interface, set */
-    /* the loader stream to a memory stream reading the data returned  */
-    /* by the interface.                                               */
-    if ( face->root.internal->incremental_interface )
-    {
-      error = face->root.internal->incremental_interface->funcs->get_glyph_data(
-                face->root.internal->incremental_interface->object,
-                glyph_index, &glyph_data );
-      if ( error )
-        goto Exit;
-
-      glyph_data_loaded = 1;
-      offset            = 0;
-      loader->byte_len  = glyph_data.length;
-
-      FT_MEM_ZERO( &inc_stream, sizeof ( inc_stream ) );
-      FT_Stream_OpenMemory( &inc_stream,
-                            glyph_data.pointer, glyph_data.length );
-
-      loader->stream = &inc_stream;
-    }
-    else
-
-#endif /* FT_CONFIG_OPTION_INCREMENTAL */
-
-      offset = tt_face_get_location( face, glyph_index,
-                                     (FT_UInt*)&loader->byte_len );
-
-    if ( loader->byte_len == 0 )
-    {
-      /* as described by Frederic Loyer, these are spaces or */
-      /* the unknown glyph.                                  */
-      loader->bbox.xMin = 0;
-      loader->bbox.xMax = 0;
-      loader->bbox.yMin = 0;
-      loader->bbox.yMax = 0;
-
-      TT_LOADER_SET_PP( loader );
-
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-
-      if ( ((TT_Face)(loader->face))->doblend )
-      {
-        /* this must be done before scaling */
-        FT_Memory  memory = loader->face->memory;
-
-
-        error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),
-                                          glyph_index, &deltas, 4 );
-        if ( error )
-          goto Exit;
-
-        loader->pp1.x += deltas[0].x; loader->pp1.y += deltas[0].y;
-        loader->pp2.x += deltas[1].x; loader->pp2.y += deltas[1].y;
-        loader->pp3.x += deltas[2].x; loader->pp3.y += deltas[2].y;
-        loader->pp4.x += deltas[3].x; loader->pp4.y += deltas[3].y;
-
-        FT_FREE( deltas );
-      }
-
-#endif
-
-      if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
-      {
-        loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale );
-        loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
-        loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );
-        loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
-      }
-
-      error = TT_Err_Ok;
-      goto Exit;
-    }
-
-    error = face->access_glyph_frame( loader, glyph_index,
-                                      loader->glyf_offset + offset,
-                                      loader->byte_len );
-    if ( error )
-      goto Exit;
-
-    opened_frame = 1;
-
-    /* read first glyph header */
-    error = face->read_glyph_header( loader );
-    if ( error )
-      goto Exit;
-
-    TT_LOADER_SET_PP( loader );
-
-    /***********************************************************************/
-    /***********************************************************************/
-    /***********************************************************************/
-
-    /* if it is a simple glyph, load it */
-
-    if ( loader->n_contours >= 0 )
-    {
-      error = face->read_simple_glyph( loader );
-      if ( error )
-        goto Exit;
-
-      /* all data have been read */
-      face->forget_glyph_frame( loader );
-      opened_frame = 0;
-
-      error = TT_Process_Simple_Glyph( loader );
-      if ( error )
-        goto Exit;
-
-      FT_GlyphLoader_Add( gloader );
-    }
-
-    /***********************************************************************/
-    /***********************************************************************/
-    /***********************************************************************/
-
-    /* otherwise, load a composite! */
-    else if ( loader->n_contours == -1 )
-    {
-      FT_UInt       start_point;
-      FT_UInt       start_contour;
-      FT_ULong      ins_pos;  /* position of composite instructions, if any */
-
-
-      start_point   = gloader->base.outline.n_points;
-      start_contour = gloader->base.outline.n_contours;
-
-      /* for each subglyph, read composite header */
-      error = face->read_composite_glyph( loader );
-      if ( error )
-        goto Exit;
-
-      /* store the offset of instructions */
-      ins_pos = loader->ins_pos;
-
-      /* all data we need are read */
-      face->forget_glyph_frame( loader );
-      opened_frame = 0;
-
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-
-      if ( face->doblend )
-      {
-        FT_Int       i, limit;
-        FT_SubGlyph  subglyph;
-        FT_Memory    memory = face->root.memory;
-
-
-        /* this provides additional offsets */
-        /* for each component's translation */
-
-        if ( (error = TT_Vary_Get_Glyph_Deltas(
-                        face,
-                        glyph_index,
-                        &deltas,
-                        gloader->current.num_subglyphs + 4 )) != 0 )
-          goto Exit;
-
-        subglyph = gloader->current.subglyphs + gloader->base.num_subglyphs;
-        limit    = gloader->current.num_subglyphs;
-
-        for ( i = 0; i < limit; ++i, ++subglyph )
-        {
-          if ( subglyph->flags & ARGS_ARE_XY_VALUES )
-          {
-            subglyph->arg1 += deltas[i].x;
-            subglyph->arg2 += deltas[i].y;
-          }
-        }
-
-        loader->pp1.x += deltas[i + 0].x; loader->pp1.y += deltas[i + 0].y;
-        loader->pp2.x += deltas[i + 1].x; loader->pp2.y += deltas[i + 1].y;
-        loader->pp3.x += deltas[i + 2].x; loader->pp3.y += deltas[i + 2].y;
-        loader->pp4.x += deltas[i + 3].x; loader->pp4.y += deltas[i + 3].y;
-
-        FT_FREE( deltas );
-      }
-
-#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
-
-      if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
-      {
-        loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale );
-        loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
-        loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );
-        loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
-      }
-
-      /* if the flag FT_LOAD_NO_RECURSE is set, we return the subglyph */
-      /* `as is' in the glyph slot (the client application will be     */
-      /* responsible for interpreting these data)...                   */
-      /*                                                               */
-      if ( loader->load_flags & FT_LOAD_NO_RECURSE )
-      {
-        FT_GlyphLoader_Add( gloader );
-        loader->glyph->format = FT_GLYPH_FORMAT_COMPOSITE;
-
-        goto Exit;
-      }
-
-      /*********************************************************************/
-      /*********************************************************************/
-      /*********************************************************************/
-
-      {
-        FT_UInt      n, num_base_points;
-        FT_SubGlyph  subglyph       = 0;
-
-        FT_UInt      num_points     = start_point;
-        FT_UInt      num_subglyphs  = gloader->current.num_subglyphs;
-        FT_UInt      num_base_subgs = gloader->base.num_subglyphs;
-
-
-        FT_GlyphLoader_Add( gloader );
-
-        /* read each subglyph independently */
-        for ( n = 0; n < num_subglyphs; n++ )
-        {
-          FT_Vector  pp[4];
-
-
-          /* Each time we call load_truetype_glyph in this loop, the   */
-          /* value of `gloader.base.subglyphs' can change due to table */
-          /* reallocations.  We thus need to recompute the subglyph    */
-          /* pointer on each iteration.                                */
-          subglyph = gloader->base.subglyphs + num_base_subgs + n;
-
-          pp[0] = loader->pp1;
-          pp[1] = loader->pp2;
-          pp[2] = loader->pp3;
-          pp[3] = loader->pp4;
-
-          num_base_points = gloader->base.outline.n_points;
-
-          error = load_truetype_glyph( loader, subglyph->index,
-                                       recurse_count + 1 );
-          if ( error )
-            goto Exit;
-
-          /* restore subglyph pointer */
-          subglyph = gloader->base.subglyphs + num_base_subgs + n;
-
-          if ( !( subglyph->flags & USE_MY_METRICS ) )
-          {
-            loader->pp1 = pp[0];
-            loader->pp2 = pp[1];
-            loader->pp3 = pp[2];
-            loader->pp4 = pp[3];
-          }
-
-          num_points = gloader->base.outline.n_points;
-
-          if ( num_points == num_base_points )
-            continue;
-
-          /* gloader->base.outline consists of three part:                  */
-          /* 0 -(1)-> start_point -(2)-> num_base_points -(3)-> n_points.   */
-          /*                                                                */
-          /* (1): exist from the beginning                                  */
-          /* (2): components that have been loaded so far                   */
-          /* (3): the newly loaded component                                */
-          TT_Process_Composite_Component( loader, subglyph, start_point,
-                                          num_base_points );
-        }
-
-
-        /* process the glyph */
-        loader->ins_pos = ins_pos;
-        if ( IS_HINTED( loader->load_flags ) &&
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
-             subglyph->flags & WE_HAVE_INSTR &&
-
-#endif
-
-             num_points > start_point )
-          TT_Process_Composite_Glyph( loader, start_point, start_contour );
-
-      }
-    }
-    else
-    {
-      /* invalid composite count ( negative but not -1 ) */
-      error = TT_Err_Invalid_Outline;
-      goto Exit;
-    }
-
-    /***********************************************************************/
-    /***********************************************************************/
-    /***********************************************************************/
-
-  Exit:
-
-    if ( opened_frame )
-      face->forget_glyph_frame( loader );
-
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
-
-    if ( glyph_data_loaded )
-      face->root.internal->incremental_interface->funcs->free_glyph_data(
-        face->root.internal->incremental_interface->object,
-        &glyph_data );
-
-#endif
-
-    return error;
-  }
-
-
-  static FT_Error
-  compute_glyph_metrics( TT_Loader   loader,
-                         FT_UInt     glyph_index )
-  {
-    FT_BBox       bbox;
-    TT_Face       face = (TT_Face)loader->face;
-    FT_Fixed      y_scale;
-    TT_GlyphSlot  glyph = loader->glyph;
-    TT_Size       size = (TT_Size)loader->size;
-
-
-    y_scale = 0x10000L;
-    if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
-      y_scale = size->root.metrics.y_scale;
-
-    if ( glyph->format != FT_GLYPH_FORMAT_COMPOSITE )
-      FT_Outline_Get_CBox( &glyph->outline, &bbox );
-    else
-      bbox = loader->bbox;
-
-    /* get the device-independent horizontal advance.  It is scaled later */
-    /* by the base layer.                                                 */
-    {
-      FT_Pos  advance = loader->linear;
-
-
-      /* the flag FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH was introduced to */
-      /* correctly support DynaLab fonts, which have an incorrect       */
-      /* `advance_Width_Max' field!  It is used, to my knowledge,       */
-      /* exclusively in the X-TrueType font server.                     */
-      /*                                                                */
-      if ( face->postscript.isFixedPitch                                     &&
-           ( loader->load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) == 0 )
-        advance = face->horizontal.advance_Width_Max;
-
-      /* we need to return the advance in font units in linearHoriAdvance, */
-      /* it will be scaled later by the base layer.                        */
-      glyph->linearHoriAdvance = advance;
-    }
-
-    glyph->metrics.horiBearingX = bbox.xMin;
-    glyph->metrics.horiBearingY = bbox.yMax;
-    glyph->metrics.horiAdvance  = loader->pp2.x - loader->pp1.x;
-
-    /* Now take care of vertical metrics.  In the case where there is    */
-    /* no vertical information within the font (relatively common), make */
-    /* up some metrics by `hand'...                                      */
-
-    {
-      FT_Pos  top;      /* scaled vertical top side bearing  */
-      FT_Pos  advance;  /* scaled vertical advance height    */
-
-
-      /* Get the unscaled top bearing and advance height. */
-      if ( face->vertical_info &&
-           face->vertical.number_Of_VMetrics > 0 )
-      {
-        top = (FT_Short)FT_DivFix( loader->pp3.y - bbox.yMax,
-                                   y_scale );
-
-        if ( loader->pp3.y <= loader->pp4.y )
-          advance = 0;
-        else
-          advance = (FT_UShort)FT_DivFix( loader->pp3.y - loader->pp4.y,
-                                          y_scale );
-      }
-      else
-      {
-        FT_Pos  height;
-
-
-        /* XXX Compute top side bearing and advance height in  */
-        /*     Get_VMetrics instead of here.                   */
-
-        /* NOTE: The OS/2 values are the only `portable' ones, */
-        /*       which is why we use them, if there is an OS/2 */
-        /*       table in the font.  Otherwise, we use the     */
-        /*       values defined in the horizontal header.      */
-
-        height = (FT_Short)FT_DivFix( bbox.yMax - bbox.yMin,
-                                      y_scale );
-        if ( face->os2.version != 0xFFFFU )
-          advance = (FT_Pos)( face->os2.sTypoAscender -
-                              face->os2.sTypoDescender );
-        else
-          advance = (FT_Pos)( face->horizontal.Ascender -
-                              face->horizontal.Descender );
-
-        top = ( advance - height ) / 2;
-      }
-
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
-      {
-        FT_Incremental_InterfaceRec*  incr;
-        FT_Incremental_MetricsRec     metrics;
-        FT_Error                      error;
-
-
-        incr = face->root.internal->incremental_interface;
-
-        /* If this is an incrementally loaded font see if there are */
-        /* overriding metrics for this glyph.                       */
-        if ( incr && incr->funcs->get_glyph_metrics )
-        {
-          metrics.bearing_x = 0;
-          metrics.bearing_y = top;
-          metrics.advance   = advance;
-
-          error = incr->funcs->get_glyph_metrics( incr->object,
-                                                  glyph_index,
-                                                  TRUE,
-                                                  &metrics );
-          if ( error )
-            return error;
-
-          top     = metrics.bearing_y;
-          advance = metrics.advance;
-        }
-      }
-
-      /* GWW: Do vertical metrics get loaded incrementally too? */
-
-#endif /* FT_CONFIG_OPTION_INCREMENTAL */
-
-      glyph->linearVertAdvance = advance;
-
-      /* scale the metrics */
-      if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) )
-      {
-        top     = FT_MulFix( top, y_scale );
-        advance = FT_MulFix( advance, y_scale );
-      }
-
-      /* XXX: for now, we have no better algorithm for the lsb, but it */
-      /*      should work fine.                                        */
-      /*                                                               */
-      glyph->metrics.vertBearingX = ( bbox.xMin - bbox.xMax ) / 2;
-      glyph->metrics.vertBearingY = top;
-      glyph->metrics.vertAdvance  = advance;
-    }
-
-    /* adjust advance width to the value contained in the hdmx table */
-    if ( !face->postscript.isFixedPitch &&
-         IS_HINTED( loader->load_flags )        )
-    {
-      FT_Byte*  widthp;
-
-
-      widthp = tt_face_get_device_metrics( face,
-                                           size->root.metrics.x_ppem,
-                                           glyph_index );
-
-      if ( widthp )
-        glyph->metrics.horiAdvance = *widthp << 6;
-    }
-
-    /* set glyph dimensions */
-    glyph->metrics.width  = bbox.xMax - bbox.xMin;
-    glyph->metrics.height = bbox.yMax - bbox.yMin;
-
-    return 0;
-  }
-
-
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
-  static FT_Error
-  load_sbit_image( TT_Size       size,
-                   TT_GlyphSlot  glyph,
-                   FT_UInt       glyph_index,
-                   FT_Int32      load_flags )
-  {
-    TT_Face             face;
-    SFNT_Service        sfnt;
-    FT_Stream           stream;
-    FT_Error            error;
-    TT_SBit_MetricsRec  metrics;
-
-
-    face   = (TT_Face)glyph->face;
-    sfnt   = (SFNT_Service)face->sfnt;
-    stream = face->root.stream;
-
-    error = sfnt->load_sbit_image( face,
-                                   size->strike_index,
-                                   glyph_index,
-                                   (FT_Int)load_flags,
-                                   stream,
-                                   &glyph->bitmap,
-                                   &metrics );
-    if ( !error )
-    {
-      glyph->outline.n_points   = 0;
-      glyph->outline.n_contours = 0;
-
-      glyph->metrics.width  = (FT_Pos)metrics.width  << 6;
-      glyph->metrics.height = (FT_Pos)metrics.height << 6;
-
-      glyph->metrics.horiBearingX = (FT_Pos)metrics.horiBearingX << 6;
-      glyph->metrics.horiBearingY = (FT_Pos)metrics.horiBearingY << 6;
-      glyph->metrics.horiAdvance  = (FT_Pos)metrics.horiAdvance  << 6;
-
-      glyph->metrics.vertBearingX = (FT_Pos)metrics.vertBearingX << 6;
-      glyph->metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6;
-      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;
-        glyph->bitmap_top  = metrics.vertBearingY;
-      }
-      else
-      {
-        glyph->bitmap_left = metrics.horiBearingX;
-        glyph->bitmap_top  = metrics.horiBearingY;
-      }
-    }
-
-    return error;
-  }
-
-#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
-
-
-  static FT_Error
-  tt_loader_init( TT_Loader     loader,
-                  TT_Size       size,
-                  TT_GlyphSlot  glyph,
-                  FT_Int32      load_flags )
-  {
-    TT_Face    face;
-    FT_Stream  stream;
-
-
-    face   = (TT_Face)glyph->face;
-    stream = face->root.stream;
-
-    FT_MEM_ZERO( loader, sizeof ( TT_LoaderRec ) );
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
-    /* load execution context */
-    if ( IS_HINTED( load_flags ) )
-    {
-      TT_ExecContext  exec;
-      FT_Bool         grayscale;
-
-
-      if ( !size->cvt_ready )
-      {
-        FT_Error  error = tt_size_ready_bytecode( size );
-        if ( error )
-          return error;
-      }
-
-      /* query new execution context */
-      exec = size->debug ? size->context
-                         : ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;
-      if ( !exec )
-        return TT_Err_Could_Not_Find_Context;
-
-      grayscale =
-        FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != FT_RENDER_MODE_MONO );
-
-      TT_Load_Context( exec, face, size );
-
-      /* a change from mono to grayscale rendering (and vice versa) */
-      /* requires a re-execution of the CVT program                 */
-      if ( grayscale != exec->grayscale )
-      {
-        FT_UInt  i;
-
-
-        exec->grayscale = grayscale;
-
-        for ( i = 0; i < size->cvt_size; i++ )
-          size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );
-        tt_size_run_prep( size );
-      }
-
-      /* see if the cvt program has disabled hinting */
-      if ( exec->GS.instruct_control & 1 )
-        load_flags |= FT_LOAD_NO_HINTING;
-
-      /* load default graphics state - if needed */
-      if ( exec->GS.instruct_control & 2 )
-        exec->GS = tt_default_graphics_state;
-
-      exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
-      loader->exec = exec;
-      loader->instructions = exec->glyphIns;
-    }
-
-#endif /* TT_USE_BYTECODE_INTERPRETER */
-
-    /* seek to the beginning of the glyph table.  For Type 42 fonts      */
-    /* the table might be accessed from a Postscript stream or something */
-    /* else...                                                           */
-
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
-
-    if ( face->root.internal->incremental_interface )
-      loader->glyf_offset = 0;
-    else
-
-#endif
-
-    {
-      FT_Error  error = face->goto_table( face, TTAG_glyf, stream, 0 );
-
-
-      if ( error )
-      {
-        FT_ERROR(( "TT_Load_Glyph: could not access glyph table\n" ));
-        return error;
-      }
-      loader->glyf_offset = FT_STREAM_POS();
-    }
-
-    /* get face's glyph loader */
-    {
-      FT_GlyphLoader  gloader = glyph->internal->loader;
-
-
-      FT_GlyphLoader_Rewind( gloader );
-      loader->gloader = gloader;
-    }
-
-    loader->load_flags    = load_flags;
-
-    loader->face   = (FT_Face)face;
-    loader->size   = (FT_Size)size;
-    loader->glyph  = (FT_GlyphSlot)glyph;
-    loader->stream = stream;
-
-    return TT_Err_Ok;
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Load_Glyph                                                      */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A function used to load a single glyph within a given glyph slot,  */
-  /*    for a given size.                                                  */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    glyph       :: A handle to a target slot object where the glyph    */
-  /*                   will be loaded.                                     */
-  /*                                                                       */
-  /*    size        :: A handle to the source face size at which the glyph */
-  /*                   must be scaled/loaded.                              */
-  /*                                                                       */
-  /*    glyph_index :: The index of the glyph in the font file.            */
-  /*                                                                       */
-  /*    load_flags  :: A flag indicating what to load for this glyph.  The */
-  /*                   FT_LOAD_XXX constants can be used to control the    */
-  /*                   glyph loading process (e.g., whether the outline    */
-  /*                   should be scaled, whether to load bitmaps or not,   */
-  /*                   whether to hint the outline, etc).                  */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  FT_LOCAL_DEF( FT_Error )
-  TT_Load_Glyph( TT_Size       size,
-                 TT_GlyphSlot  glyph,
-                 FT_UInt       glyph_index,
-                 FT_Int32      load_flags )
-  {
-    TT_Face       face;
-    FT_Stream     stream;
-    FT_Error      error;
-    TT_LoaderRec  loader;
-
-
-    face   = (TT_Face)glyph->face;
-    stream = face->root.stream;
-    error  = TT_Err_Ok;
-
-#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
-    /* try to load embedded bitmap if any              */
-    /*                                                 */
-    /* XXX: The convention should be emphasized in     */
-    /*      the documents because it can be confusing. */
-    if ( size->strike_index != 0xFFFFFFFFUL      &&
-         ( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
-    {
-      error = load_sbit_image( size, glyph, glyph_index, load_flags );
-      if ( !error )
-        return TT_Err_Ok;
-    }
-
-#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
-
-    /* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */
-    if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid )
-      return TT_Err_Invalid_Size_Handle;
-
-    if ( load_flags & FT_LOAD_SBITS_ONLY )
-      return TT_Err_Invalid_Argument;
-
-    error = tt_loader_init( &loader, size, glyph, load_flags );
-    if ( error )
-      return error;
-
-    glyph->format        = FT_GLYPH_FORMAT_OUTLINE;
-    glyph->num_subglyphs = 0;
-    glyph->outline.flags = 0;
-
-    /* Main loading loop */
-    error = load_truetype_glyph( &loader, glyph_index, 0 );
-    if ( !error )
-    {
-      if ( glyph->format == FT_GLYPH_FORMAT_COMPOSITE )
-      {
-        glyph->num_subglyphs = loader.gloader->base.num_subglyphs;
-        glyph->subglyphs     = loader.gloader->base.subglyphs;
-      }
-      else
-      {
-        glyph->outline        = loader.gloader->base.outline;
-        glyph->outline.flags &= ~FT_OUTLINE_SINGLE_PASS;
-
-        /* In case bit 1 of the `flags' field in the `head' table isn't */
-        /* set, translate array so that (0,0) is the glyph's origin.    */
-        if ( ( face->header.Flags & 2 ) == 0 && loader.pp1.x )
-          FT_Outline_Translate( &glyph->outline, -loader.pp1.x, 0 );
-      }
-
-      compute_glyph_metrics( &loader, glyph_index );
-    }
-
-    /* Set the `high precision' bit flag.                           */
-    /* This is _critical_ to get correct output for monochrome      */
-    /* TrueType glyphs at all sizes using the bytecode interpreter. */
-    /*                                                              */
-    if ( !( load_flags & FT_LOAD_NO_SCALE ) &&
-         size->root.metrics.y_ppem < 24     )
-      glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
-
-    return error;
-  }
-
-
-/* END */
index 958d67d..05f7588 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType Glyph Loader (specification).                               */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType Glyph Loader (specification).                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by             */
+/*  Copyright 1996-2006, 2008, 2011 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -37,14 +37,12 @@ FT_BEGIN_HEADER
   FT_LOCAL( void )
   TT_Get_HMetrics( TT_Face     face,
                    FT_UInt     idx,
   FT_LOCAL( void )
   TT_Get_HMetrics( TT_Face     face,
                    FT_UInt     idx,
-                   FT_Bool     check,
                    FT_Short*   lsb,
                    FT_UShort*  aw );
 
   FT_LOCAL( void )
   TT_Get_VMetrics( TT_Face     face,
                    FT_UInt     idx,
                    FT_Short*   lsb,
                    FT_UShort*  aw );
 
   FT_LOCAL( void )
   TT_Get_VMetrics( TT_Face     face,
                    FT_UInt     idx,
-                   FT_Bool     check,
                    FT_Short*   tsb,
                    FT_UShort*  ah );
 
                    FT_Short*   tsb,
                    FT_UShort*  ah );
 
index 47bb9fc..7899d36 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType GX Font Variation loader                                    */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType GX Font Variation loader                                    */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010 by                  */
+/*  Copyright 2004-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.     */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.     */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -61,9 +61,9 @@
 
 
 #define FT_Stream_FTell( stream )  \
 
 
 #define FT_Stream_FTell( stream )  \
-          ( (stream)->cursor - (stream)->base )
+          (FT_ULong)( (stream)->cursor - (stream)->base )
 #define FT_Stream_SeekSet( stream, off ) \
 #define FT_Stream_SeekSet( stream, off ) \
-              ( (stream)->cursor = (stream)->base+(off) )
+          ( (stream)->cursor = (stream)->base + (off) )
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
@@ -91,7 +91,9 @@
   /* indicates that there is a delta for every point without needing to    */
   /* enumerate all of them.                                                */
   /*                                                                       */
   /* indicates that there is a delta for every point without needing to    */
   /* enumerate all of them.                                                */
   /*                                                                       */
-#define ALL_POINTS  (FT_UShort*)( -1 )
+
+  /* ensure that value `0' has the same width as a pointer */
+#define ALL_POINTS  (FT_UShort*)~(FT_PtrDist)0
 
 
 #define GX_PT_POINTS_ARE_WORDS      0x80
 
 
 #define GX_PT_POINTS_ARE_WORDS      0x80
   ft_var_readpackedpoints( FT_Stream  stream,
                            FT_UInt   *point_cnt )
   {
   ft_var_readpackedpoints( FT_Stream  stream,
                            FT_UInt   *point_cnt )
   {
-    FT_UShort *points;
+    FT_UShort *points = NULL;
     FT_Int     n;
     FT_Int     runcnt;
     FT_Int     i;
     FT_Int     j;
     FT_Int     first;
     FT_Memory  memory = stream->memory;
     FT_Int     n;
     FT_Int     runcnt;
     FT_Int     i;
     FT_Int     j;
     FT_Int     first;
     FT_Memory  memory = stream->memory;
-    FT_Error   error  = TT_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
 
     FT_UNUSED( error );
 
 
     FT_UNUSED( error );
 
     FT_Offset  i;
     FT_UInt    j;
     FT_Memory  memory = stream->memory;
     FT_Offset  i;
     FT_UInt    j;
     FT_Memory  memory = stream->memory;
-    FT_Error   error  = TT_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
 
     FT_UNUSED( error );
 
 
     FT_UNUSED( error );
 
     FT_Memory       memory = stream->memory;
     GX_Blend        blend  = face->blend;
     GX_AVarSegment  segment;
     FT_Memory       memory = stream->memory;
     GX_Blend        blend  = face->blend;
     GX_AVarSegment  segment;
-    FT_Error        error = TT_Err_Ok;
+    FT_Error        error = FT_Err_Ok;
     FT_ULong        version;
     FT_Long         axisCount;
     FT_Int          i, j;
     FT_ULong        version;
     FT_Long         axisCount;
     FT_Int          i, j;
     if ( gvar_head.version   != (FT_Long)0x00010000L              ||
          gvar_head.axisCount != (FT_UShort)blend->mmvar->num_axis )
     {
     if ( gvar_head.version   != (FT_Long)0x00010000L              ||
          gvar_head.axisCount != (FT_UShort)blend->mmvar->num_axis )
     {
-      error = TT_Err_Invalid_Table;
+      error = FT_THROW( Invalid_Table );
       goto Exit;
     }
 
       goto Exit;
     }
 
                       FT_Fixed*  im_end_coords )
   {
     FT_UInt   i;
                       FT_Fixed*  im_end_coords )
   {
     FT_UInt   i;
-    FT_Fixed  apply;
-    FT_Fixed  temp;
+    FT_Fixed  apply = 0x10000L;
 
 
 
 
-    apply = 0x10000L;
     for ( i = 0; i < blend->num_axis; ++i )
     {
       if ( tuple_coords[i] == 0 )
     for ( i = 0; i < blend->num_axis; ++i )
     {
       if ( tuple_coords[i] == 0 )
 
       else if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
         /* not an intermediate tuple */
 
       else if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
         /* not an intermediate tuple */
-        apply = FT_MulDiv( apply,
+        apply = FT_MulFix( apply,
                            blend->normalizedcoords[i] > 0
                              ? blend->normalizedcoords[i]
                            blend->normalizedcoords[i] > 0
                              ? blend->normalizedcoords[i]
-                             : -blend->normalizedcoords[i],
-                           0x10000L );
+                             : -blend->normalizedcoords[i] );
 
       else if ( blend->normalizedcoords[i] <= im_start_coords[i] ||
                 blend->normalizedcoords[i] >= im_end_coords[i]   )
 
       else if ( blend->normalizedcoords[i] <= im_start_coords[i] ||
                 blend->normalizedcoords[i] >= im_end_coords[i]   )
       }
 
       else if ( blend->normalizedcoords[i] < tuple_coords[i] )
       }
 
       else if ( blend->normalizedcoords[i] < tuple_coords[i] )
-      {
-        temp = FT_MulDiv( blend->normalizedcoords[i] - im_start_coords[i],
-                          0x10000L,
-                          tuple_coords[i] - im_start_coords[i]);
-        apply = FT_MulDiv( apply, temp, 0x10000L );
-      }
+        apply = FT_MulDiv( apply,
+                           blend->normalizedcoords[i] - im_start_coords[i],
+                           tuple_coords[i] - im_start_coords[i] );
 
       else
 
       else
-      {
-        temp = FT_MulDiv( im_end_coords[i] - blend->normalizedcoords[i],
-                          0x10000L,
-                          im_end_coords[i] - tuple_coords[i] );
-        apply = FT_MulDiv( apply, temp, 0x10000L );
-      }
+        apply = FT_MulDiv( apply,
+                           im_end_coords[i] - blend->normalizedcoords[i],
+                           im_end_coords[i] - tuple_coords[i] );
     }
 
     return apply;
     }
 
     return apply;
     FT_Stream            stream = face->root.stream;
     FT_Memory            memory = face->root.memory;
     FT_ULong             table_len;
     FT_Stream            stream = face->root.stream;
     FT_Memory            memory = face->root.memory;
     FT_ULong             table_len;
-    FT_Error             error  = TT_Err_Ok;
+    FT_Error             error  = FT_Err_Ok;
     FT_ULong             fvar_start;
     FT_Int               i, j;
     FT_ULong             fvar_start;
     FT_Int               i, j;
-    FT_MM_Var*           mmvar;
+    FT_MM_Var*           mmvar = NULL;
     FT_Fixed*            next_coords;
     FT_String*           next_name;
     FT_Var_Axis*         a;
     FT_Fixed*            next_coords;
     FT_String*           next_name;
     FT_Var_Axis*         a;
            fvar_head.offsetToData + fvar_head.axisCount * 20U +
              fvar_head.instanceCount * fvar_head.instanceSize > table_len )
       {
            fvar_head.offsetToData + fvar_head.axisCount * 20U +
              fvar_head.instanceCount * fvar_head.instanceSize > table_len )
       {
-        error = TT_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         goto Exit;
       }
 
         goto Exit;
       }
 
       mmvar->num_axis =
         fvar_head.axisCount;
       mmvar->num_designs =
       mmvar->num_axis =
         fvar_head.axisCount;
       mmvar->num_designs =
-        (FT_UInt)-1;           /* meaningless in this context; each glyph */
+        ~0U;                   /* meaningless in this context; each glyph */
                                /* may have a different number of designs  */
                                /* (or tuples, as called by Apple)         */
       mmvar->num_namedstyles =
                                /* may have a different number of designs  */
                                /* (or tuples, as called by Apple)         */
       mmvar->num_namedstyles =
                    FT_UInt    num_coords,
                    FT_Fixed*  coords )
   {
                    FT_UInt    num_coords,
                    FT_Fixed*  coords )
   {
-    FT_Error    error = TT_Err_Ok;
+    FT_Error    error = FT_Err_Ok;
     GX_Blend    blend;
     FT_MM_Var*  mmvar;
     FT_UInt     i;
     GX_Blend    blend;
     FT_MM_Var*  mmvar;
     FT_UInt     i;
 
     if ( num_coords != mmvar->num_axis )
     {
 
     if ( num_coords != mmvar->num_axis )
     {
-      error = TT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
     for ( i = 0; i < num_coords; ++i )
       if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L )
       {
       goto Exit;
     }
 
     for ( i = 0; i < num_coords; ++i )
       if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L )
       {
-        error = TT_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Exit;
       }
 
         goto Exit;
       }
 
                      FT_UInt    num_coords,
                      FT_Fixed*  coords )
   {
                      FT_UInt    num_coords,
                      FT_Fixed*  coords )
   {
-    FT_Error        error      = TT_Err_Ok;
+    FT_Error        error      = FT_Err_Ok;
     FT_Fixed*       normalized = NULL;
     GX_Blend        blend;
     FT_MM_Var*      mmvar;
     FT_Fixed*       normalized = NULL;
     GX_Blend        blend;
     FT_MM_Var*      mmvar;
 
     if ( num_coords != mmvar->num_axis )
     {
 
     if ( num_coords != mmvar->num_axis )
     {
-      error = TT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
     {
       if ( coords[i] > a->maximum || coords[i] < a->minimum )
       {
     {
       if ( coords[i] > a->maximum || coords[i] < a->minimum )
       {
-        error = TT_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Exit;
       }
 
       if ( coords[i] < a->def )
         goto Exit;
       }
 
       if ( coords[i] < a->def )
-      {
-        normalized[i] = -FT_MulDiv( coords[i] - a->def,
-                                    0x10000L,
-                                    a->minimum - a->def );
-      }
+        normalized[i] = -FT_DivFix( coords[i] - a->def, a->minimum - a->def );
       else if ( a->maximum == a->def )
         normalized[i] = 0;
       else
       else if ( a->maximum == a->def )
         normalized[i] = 0;
       else
-      {
-        normalized[i] = FT_MulDiv( coords[i] - a->def,
-                                   0x10000L,
-                                   a->maximum - a->def );
-      }
+        normalized[i] = FT_DivFix( coords[i] - a->def, a->maximum - a->def );
     }
 
     if ( !blend->avar_checked )
     }
 
     if ( !blend->avar_checked )
           if ( normalized[i] < av->correspondence[j].fromCoord )
           {
             normalized[i] =
           if ( normalized[i] < av->correspondence[j].fromCoord )
           {
             normalized[i] =
-              FT_MulDiv(
-                FT_MulDiv(
-                  normalized[i] - av->correspondence[j - 1].fromCoord,
-                  0x10000L,
-                  av->correspondence[j].fromCoord -
-                    av->correspondence[j - 1].fromCoord ),
-                av->correspondence[j].toCoord -
-                  av->correspondence[j - 1].toCoord,
-                0x10000L ) +
+              FT_MulDiv( normalized[i] - av->correspondence[j - 1].fromCoord,
+                         av->correspondence[j].toCoord -
+                           av->correspondence[j - 1].toCoord,
+                         av->correspondence[j].fromCoord -
+                           av->correspondence[j - 1].fromCoord ) +
               av->correspondence[j - 1].toCoord;
             break;
           }
               av->correspondence[j - 1].toCoord;
             break;
           }
     {
       FT_TRACE2(( "tt_face_vary_cvt: no blend specified\n" ));
 
     {
       FT_TRACE2(( "tt_face_vary_cvt: no blend specified\n" ));
 
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
       goto Exit;
     }
 
     {
       FT_TRACE2(( "tt_face_vary_cvt: no `cvt ' table\n" ));
 
     {
       FT_TRACE2(( "tt_face_vary_cvt: no `cvt ' table\n" ));
 
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
       goto Exit;
     }
 
     {
       FT_TRACE2(( "is missing\n" ));
 
     {
       FT_TRACE2(( "is missing\n" ));
 
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
     if ( FT_FRAME_ENTER( table_len ) )
     {
       goto Exit;
     }
 
     if ( FT_FRAME_ENTER( table_len ) )
     {
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto Exit;
     }
 
       goto Exit;
     }
 
     {
       FT_TRACE2(( "bad table version\n" ));
 
     {
       FT_TRACE2(( "bad table version\n" ));
 
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
       goto FExit;
     }
 
       goto FExit;
     }
 
     FT_Stream   stream = face->root.stream;
     FT_Memory   memory = stream->memory;
     GX_Blend    blend  = face->blend;
     FT_Stream   stream = face->root.stream;
     FT_Memory   memory = stream->memory;
     GX_Blend    blend  = face->blend;
-    FT_Vector*  delta_xy;
+    FT_Vector*  delta_xy = NULL;
 
     FT_Error    error;
     FT_ULong    glyph_start;
 
     FT_Error    error;
     FT_ULong    glyph_start;
 
 
     if ( !face->doblend || blend == NULL )
 
 
     if ( !face->doblend || blend == NULL )
-      return TT_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     /* to be freed by the caller */
     if ( FT_NEW_ARRAY( delta_xy, n_points ) )
 
     /* to be freed by the caller */
     if ( FT_NEW_ARRAY( delta_xy, n_points ) )
     if ( glyph_index >= blend->gv_glyphcnt      ||
          blend->glyphoffsets[glyph_index] ==
            blend->glyphoffsets[glyph_index + 1] )
     if ( glyph_index >= blend->gv_glyphcnt      ||
          blend->glyphoffsets[glyph_index] ==
            blend->glyphoffsets[glyph_index + 1] )
-      return TT_Err_Ok;               /* no variation data for this glyph */
+      return FT_Err_Ok;               /* no variation data for this glyph */
 
     if ( FT_STREAM_SEEK( blend->glyphoffsets[glyph_index] )   ||
          FT_FRAME_ENTER( blend->glyphoffsets[glyph_index + 1] -
 
     if ( FT_STREAM_SEEK( blend->glyphoffsets[glyph_index] )   ||
          FT_FRAME_ENTER( blend->glyphoffsets[glyph_index + 1] -
       }
       else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount )
       {
       }
       else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount )
       {
-        error = TT_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         goto Fail3;
       }
       else
         goto Fail3;
       }
       else
       {
         for ( j = 0; j < point_count; ++j )
         {
       {
         for ( j = 0; j < point_count; ++j )
         {
+          if ( localpoints[j] >= n_points )
+            continue;
+
           delta_xy[localpoints[j]].x += FT_MulFix( deltas_x[j], apply );
           delta_xy[localpoints[j]].y += FT_MulFix( deltas_y[j], apply );
         }
           delta_xy[localpoints[j]].x += FT_MulFix( deltas_x[j], apply );
           delta_xy[localpoints[j]].y += FT_MulFix( deltas_y[j], apply );
         }
index f55b8ee..e7ffb98 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    TrueType bytecode interpreter (body).                                */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType bytecode interpreter (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010                                                         */
+/*  Copyright 1996-2013                                                    */
 /*  by David Turner, Robert Wilhelm, and Werner Lemberg.                   */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  by David Turner, Robert Wilhelm, and Werner Lemberg.                   */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /***************************************************************************/
 
 
 /***************************************************************************/
 
 
+/* Greg Hitchcock from Microsoft has helped a lot in resolving unclear */
+/* issues; many thanks!                                                */
+
+
 #include <ft2build.h>
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_CALC_H
 #include FT_TRIGONOMETRY_H
 #include FT_SYSTEM_H
 #include <ft2build.h>
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_CALC_H
 #include FT_TRIGONOMETRY_H
 #include FT_SYSTEM_H
+#include FT_TRUETYPE_DRIVER_H
 
 #include "ttinterp.h"
 
 #include "ttinterp.h"
-
 #include "tterrors.h"
 #include "tterrors.h"
+#include "ttsubpix.h"
 
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
 
 
 
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
 
 
-#define TT_MULFIX           FT_MulFix
-#define TT_MULDIV           FT_MulDiv
-#define TT_MULDIV_NO_ROUND  FT_MulDiv_No_Round
-
-
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
@@ -49,7 +48,7 @@
   /*                                                                       */
   /* In order to detect infinite loops in the code, we set up a counter    */
   /* within the run loop.  A single stroke of interpretation is now        */
   /*                                                                       */
   /* In order to detect infinite loops in the code, we set up a counter    */
   /* within the run loop.  A single stroke of interpretation is now        */
-  /* limited to a maximal number of opcodes defined below.                 */
+  /* limited to a maximum number of opcodes defined below.                 */
   /*                                                                       */
 #define MAX_RUNNABLE_OPCODES  1000000L
 
   /*                                                                       */
 #define MAX_RUNNABLE_OPCODES  1000000L
 
 #define FT_UNUSED_ARG  FT_UNUSED_EXEC; FT_UNUSED( args )
 
 
 #define FT_UNUSED_ARG  FT_UNUSED_EXEC; FT_UNUSED( args )
 
 
+#define SUBPIXEL_HINTING                                                    \
+          ( ((TT_Driver)FT_FACE_DRIVER( CUR.face ))->interpreter_version == \
+            TT_INTERPRETER_VERSION_38 )
+
+
   /*************************************************************************/
   /*                                                                       */
   /* The following macros hide the use of EXEC_ARG and EXEC_ARG_ to        */
   /*************************************************************************/
   /*                                                                       */
   /* The following macros hide the use of EXEC_ARG and EXEC_ARG_ to        */
 #define BOUNDS( x, n )   ( (FT_UInt)(x)  >= (FT_UInt)(n)  )
 #define BOUNDSL( x, n )  ( (FT_ULong)(x) >= (FT_ULong)(n) )
 
 #define BOUNDS( x, n )   ( (FT_UInt)(x)  >= (FT_UInt)(n)  )
 #define BOUNDSL( x, n )  ( (FT_ULong)(x) >= (FT_ULong)(n) )
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* This macro computes (a*2^14)/b and complements TT_MulFix14.           */
+  /*                                                                       */
+#define TT_DivFix14( a, b ) \
+          FT_DivFix( a, (b) << 2 )
+
+
 #undef  SUCCESS
 #define SUCCESS  0
 
 #undef  SUCCESS
 #define SUCCESS  0
 
     exec->IP       = IP;
     exec->curRange = range;
 
     exec->IP       = IP;
     exec->curRange = range;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     exec->codeRangeTable[range - 1].base = (FT_Byte*)base;
     exec->codeRangeTable[range - 1].size = length;
 
     exec->codeRangeTable[range - 1].base = (FT_Byte*)base;
     exec->codeRangeTable[range - 1].size = length;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     exec->codeRangeTable[range - 1].base = NULL;
     exec->codeRangeTable[range - 1].size = 0;
 
     exec->codeRangeTable[range - 1].base = NULL;
     exec->codeRangeTable[range - 1].size = 0;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
 
     FT_FREE( exec );
 
 
     FT_FREE( exec );
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     exec->face = NULL;
     exec->size = NULL;
 
     exec->face = NULL;
     exec->size = NULL;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
 
   Fail_Memory:
     FT_ERROR(( "Init_Context: not enough memory for %p\n", exec ));
 
   Fail_Memory:
     FT_ERROR(( "Init_Context: not enough memory for %p\n", exec ));
       *size = new_max;
     }
 
       *size = new_max;
     }
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
 
     exec->instruction_trap = FALSE;
 
 
     exec->instruction_trap = FALSE;
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     FT_Int  i;
 
 
     FT_Int  i;
 
 
-    /* XXXX: Will probably disappear soon with all the code range */
-    /*       management, which is now rather obsolete.            */
-    /*                                                            */
+    /* XXX: Will probably disappear soon with all the code range */
+    /*      management, which is now rather obsolete.            */
+    /*                                                           */
     size->num_function_defs    = exec->numFDefs;
     size->num_instruction_defs = exec->numIDefs;
 
     size->num_function_defs    = exec->numFDefs;
     size->num_instruction_defs = exec->numIDefs;
 
     for ( i = 0; i < TT_MAX_CODE_RANGES; i++ )
       size->codeRangeTable[i] = exec->codeRangeTable[i];
 
     for ( i = 0; i < TT_MAX_CODE_RANGES; i++ )
       size->codeRangeTable[i] = exec->codeRangeTable[i];
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     FT_Error  error;
 
 
     FT_Error  error;
 
 
-    if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0  ) )
-           != TT_Err_Ok )
+    if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ) )
+           != FT_Err_Ok )
       return error;
 
     exec->zp0 = exec->pts;
       return error;
 
     exec->zp0 = exec->pts;
     if ( !debug )
       return TT_RunIns( exec );
     else
     if ( !debug )
       return TT_RunIns( exec );
     else
-      return TT_Err_Ok;
+      return FT_Err_Ok;
 #endif
   }
 
 #endif
   }
 
     /*  INS_$83   */  PACK( 0, 0 ),
     /*  INS_$84   */  PACK( 0, 0 ),
     /*  ScanCTRL  */  PACK( 1, 0 ),
     /*  INS_$83   */  PACK( 0, 0 ),
     /*  INS_$84   */  PACK( 0, 0 ),
     /*  ScanCTRL  */  PACK( 1, 0 ),
-    /*  SDVPTL[0] */  PACK( 2, 0 ),
-    /*  SDVPTL[1] */  PACK( 2, 0 ),
+    /*  SDPVTL[0] */  PACK( 2, 0 ),
+    /*  SDPVTL[1] */  PACK( 2, 0 ),
     /*  GetINFO   */  PACK( 1, 1 ),
     /*  IDEF      */  PACK( 1, 0 ),
     /*  ROLL      */  PACK( 3, 3 ),
     /*  GetINFO   */  PACK( 1, 1 ),
     /*  IDEF      */  PACK( 1, 0 ),
     /*  ROLL      */  PACK( 3, 3 ),
 
 #else
 
 
 #else
 
-  /* compute (a*b)/2^14 with maximal accuracy and rounding */
+  /* compute (a*b)/2^14 with maximum accuracy and rounding */
   static FT_Int32
   TT_MulFix14( FT_Int32  a,
                FT_Int    b )
   static FT_Int32
   TT_MulFix14( FT_Int32  a,
                FT_Int    b )
     l  = (FT_UInt32)( ( a & 0xFFFFU ) * b );
     m  = ( a >> 16 ) * b;
 
     l  = (FT_UInt32)( ( a & 0xFFFFU ) * b );
     m  = ( a >> 16 ) * b;
 
-    lo = l + (FT_UInt32)( m << 16 );
+    lo = l + ( (FT_UInt32)m << 16 );
     hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l );
 
     /* divide the result by 2^14 with rounding */
     hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l );
 
     /* divide the result by 2^14 with rounding */
     l   = lo + 0x2000U;
     hi += l < lo;
 
     l   = lo + 0x2000U;
     hi += l < lo;
 
-    return ( hi << 18 ) | ( l >> 14 );
+    return (FT_Int32)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) );
   }
 #endif
 
 
   }
 #endif
 
 
-  /* compute (ax*bx+ay*by)/2^14 with maximal accuracy and rounding */
+  /* compute (ax*bx+ay*by)/2^14 with maximum accuracy and rounding */
   static FT_Int32
   TT_DotFix14( FT_Int32  ax,
                FT_Int32  ay,
   static FT_Int32
   TT_DotFix14( FT_Int32  ax,
                FT_Int32  ay,
     l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx );
     m = ( ax >> 16 ) * bx;
 
     l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx );
     m = ( ax >> 16 ) * bx;
 
-    lo1 = l + (FT_UInt32)( m << 16 );
+    lo1 = l + ( (FT_UInt32)m << 16 );
     hi1 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo1 < l );
 
     /* compute ay*by as 64-bit value */
     l = (FT_UInt32)( ( ay & 0xFFFFU ) * by );
     m = ( ay >> 16 ) * by;
 
     hi1 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo1 < l );
 
     /* compute ay*by as 64-bit value */
     l = (FT_UInt32)( ( ay & 0xFFFFU ) * by );
     m = ( ay >> 16 ) * by;
 
-    lo2 = l + (FT_UInt32)( m << 16 );
+    lo2 = l + ( (FT_UInt32)m << 16 );
     hi2 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo2 < l );
 
     /* add them */
     hi2 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo2 < l );
 
     /* add them */
     l   = lo + 0x2000U;
     hi += ( l < lo );
 
     l   = lo + 0x2000U;
     hi += ( l < lo );
 
-    return ( hi << 18 ) | ( l >> 14 );
-  }
-
-
-  /* return length of given vector */
-
-#if 0
-
-  static FT_Int32
-  TT_VecLen( FT_Int32  x,
-             FT_Int32  y )
-  {
-    FT_Int32   m, hi1, hi2, hi;
-    FT_UInt32  l, lo1, lo2, lo;
-
-
-    /* compute x*x as 64-bit value */
-    lo = (FT_UInt32)( x & 0xFFFFU );
-    hi = x >> 16;
-
-    l  = lo * lo;
-    m  = hi * lo;
-    hi = hi * hi;
-
-    lo1 = l + (FT_UInt32)( m << 17 );
-    hi1 = hi + ( m >> 15 ) + ( lo1 < l );
-
-    /* compute y*y as 64-bit value */
-    lo = (FT_UInt32)( y & 0xFFFFU );
-    hi = y >> 16;
-
-    l  = lo * lo;
-    m  = hi * lo;
-    hi = hi * hi;
-
-    lo2 = l + (FT_UInt32)( m << 17 );
-    hi2 = hi + ( m >> 15 ) + ( lo2 < l );
-
-    /* add them to get 'x*x+y*y' as 64-bit value */
-    lo = lo1 + lo2;
-    hi = hi1 + hi2 + ( lo < lo1 );
-
-    /* compute the square root of this value */
-    {
-      FT_UInt32  root, rem, test_div;
-      FT_Int     count;
-
-
-      root = 0;
-
-      {
-        rem   = 0;
-        count = 32;
-        do
-        {
-          rem      = ( rem << 2 ) | ( (FT_UInt32)hi >> 30 );
-          hi       = (  hi << 2 ) | (            lo >> 30 );
-          lo     <<= 2;
-          root   <<= 1;
-          test_div = ( root << 1 ) + 1;
-
-          if ( rem >= test_div )
-          {
-            rem  -= test_div;
-            root += 1;
-          }
-        } while ( --count );
-      }
-
-      return (FT_Int32)root;
-    }
-  }
-
-#else
-
-  /* this version uses FT_Vector_Length which computes the same value */
-  /* much, much faster..                                              */
-  /*                                                                  */
-  static FT_F26Dot6
-  TT_VecLen( FT_F26Dot6  X,
-             FT_F26Dot6  Y )
-  {
-    FT_Vector  v;
-
-
-    v.x = X;
-    v.y = Y;
-
-    return FT_Vector_Length( &v );
+    return (FT_Int32)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) );
   }
 
   }
 
-#endif
-
 
   /*************************************************************************/
   /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
 
         else
         {
 
         else
         {
-          FT_Long  x, y;
+          FT_F26Dot6  x, y;
 
 
 
 
-          x = TT_MULDIV( CUR.GS.projVector.x,
-                         CUR.tt_metrics.x_ratio, 0x4000 );
-          y = TT_MULDIV( CUR.GS.projVector.y,
-                         CUR.tt_metrics.y_ratio, 0x4000 );
-          CUR.tt_metrics.ratio = TT_VecLen( x, y );
+          x = TT_MulFix14( CUR.tt_metrics.x_ratio,
+                           CUR.GS.projVector.x );
+          y = TT_MulFix14( CUR.tt_metrics.y_ratio,
+                           CUR.GS.projVector.y );
+          CUR.tt_metrics.ratio = FT_Hypot( x, y );
         }
       }
     }
         }
       }
     }
   static FT_Long
   Current_Ppem( EXEC_OP )
   {
   static FT_Long
   Current_Ppem( EXEC_OP )
   {
-    return TT_MULFIX( CUR.tt_metrics.ppem, CURRENT_Ratio() );
+    return FT_MulFix( CUR.tt_metrics.ppem, CURRENT_Ratio() );
   }
 
 
   }
 
 
   FT_CALLBACK_DEF( FT_F26Dot6 )
   Read_CVT_Stretched( EXEC_OP_ FT_ULong  idx )
   {
   FT_CALLBACK_DEF( FT_F26Dot6 )
   Read_CVT_Stretched( EXEC_OP_ FT_ULong  idx )
   {
-    return TT_MULFIX( CUR.cvt[idx], CURRENT_Ratio() );
+    return FT_MulFix( CUR.cvt[idx], CURRENT_Ratio() );
   }
 
 
   }
 
 
 
     if ( aRange < 1 || aRange > 3 )
     {
 
     if ( aRange < 1 || aRange > 3 )
     {
-      CUR.error = TT_Err_Bad_Argument;
+      CUR.error = FT_THROW( Bad_Argument );
       return FAILURE;
     }
 
       return FAILURE;
     }
 
 
     if ( range->base == NULL )     /* invalid coderange */
     {
 
     if ( range->base == NULL )     /* invalid coderange */
     {
-      CUR.error = TT_Err_Invalid_CodeRange;
+      CUR.error = FT_THROW( Invalid_CodeRange );
       return FAILURE;
     }
 
     /* NOTE: Because the last instruction of a program may be a CALL */
     /*       which will return to the first byte *after* the code    */
       return FAILURE;
     }
 
     /* NOTE: Because the last instruction of a program may be a CALL */
     /*       which will return to the first byte *after* the code    */
-    /*       range, we test for AIP <= Size, instead of AIP < Size.  */
+    /*       range, we test for aIP <= Size, instead of aIP < Size.  */
 
     if ( aIP > range->size )
     {
 
     if ( aIP > range->size )
     {
-      CUR.error = TT_Err_Code_Overflow;
+      CUR.error = FT_THROW( Code_Overflow );
       return FAILURE;
     }
 
       return FAILURE;
     }
 
 
     if ( v != 0 )
     {
 
     if ( v != 0 )
     {
-      zone->cur[point].x += TT_MULDIV( distance,
-                                       v * 0x10000L,
-                                       CUR.F_dot_P );
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      if ( !SUBPIXEL_HINTING                                     ||
+           ( !CUR.ignore_x_mode                                ||
+             ( CUR.sph_tweak_flags & SPH_TWEAK_ALLOW_X_DMOVE ) ) )
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+        zone->cur[point].x += FT_MulDiv( distance, v, CUR.F_dot_P );
 
       zone->tags[point] |= FT_CURVE_TAG_TOUCH_X;
     }
 
       zone->tags[point] |= FT_CURVE_TAG_TOUCH_X;
     }
 
     if ( v != 0 )
     {
 
     if ( v != 0 )
     {
-      zone->cur[point].y += TT_MULDIV( distance,
-                                       v * 0x10000L,
-                                       CUR.F_dot_P );
+      zone->cur[point].y += FT_MulDiv( distance, v, CUR.F_dot_P );
 
       zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y;
     }
 
       zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y;
     }
     v = CUR.GS.freeVector.x;
 
     if ( v != 0 )
     v = CUR.GS.freeVector.x;
 
     if ( v != 0 )
-      zone->org[point].x += TT_MULDIV( distance,
-                                       v * 0x10000L,
-                                       CUR.F_dot_P );
+      zone->org[point].x += FT_MulDiv( distance, v, CUR.F_dot_P );
 
     v = CUR.GS.freeVector.y;
 
     if ( v != 0 )
 
     v = CUR.GS.freeVector.y;
 
     if ( v != 0 )
-      zone->org[point].y += TT_MULDIV( distance,
-                                       v * 0x10000L,
-                                       CUR.F_dot_P );
+      zone->org[point].y += FT_MulDiv( distance, v, CUR.F_dot_P );
   }
 
 
   }
 
 
   {
     FT_UNUSED_EXEC;
 
   {
     FT_UNUSED_EXEC;
 
-    zone->cur[point].x += distance;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( !SUBPIXEL_HINTING  ||
+         !CUR.ignore_x_mode )
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+      zone->cur[point].x += distance;
+
     zone->tags[point]  |= FT_CURVE_TAG_TOUCH_X;
   }
 
     zone->tags[point]  |= FT_CURVE_TAG_TOUCH_X;
   }
 
     }
     else
     {
     }
     else
     {
-      val = - FT_PIX_CEIL( compensation - distance );
+      val = -FT_PIX_CEIL( compensation - distance );
       if ( val > 0 )
         val = 0;
     }
       if ( val > 0 )
         val = 0;
     }
   /*    Sets Super Round parameters.                                       */
   /*                                                                       */
   /* <Input>                                                               */
   /*    Sets Super Round parameters.                                       */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    GridPeriod :: Grid period                                          */
-  /*    selector   :: SROUND opcode                                        */
+  /*    GridPeriod :: The grid period.                                     */
+  /*                                                                       */
+  /*    selector   :: The SROUND opcode.                                   */
   /*                                                                       */
   static void
   SetSuperRound( EXEC_OP_ FT_F26Dot6  GridPeriod,
   /*                                                                       */
   static void
   SetSuperRound( EXEC_OP_ FT_F26Dot6  GridPeriod,
 
       if ( CUR.GS.dualVector.x == 0x4000 )
         CUR.func_dualproj = Project_x;
 
       if ( CUR.GS.dualVector.x == 0x4000 )
         CUR.func_dualproj = Project_x;
+      else if ( CUR.GS.dualVector.y == 0x4000 )
+        CUR.func_dualproj = Project_y;
       else
       else
-      {
-        if ( CUR.GS.dualVector.y == 0x4000 )
-          CUR.func_dualproj = Project_y;
-        else
-          CUR.func_dualproj = Dual_Project;
-      }
+        CUR.func_dualproj = Dual_Project;
 
       /* Force recalculation of cached aspect ratio */
       CUR.tt_metrics.ratio = 0;
 
       /* Force recalculation of cached aspect ratio */
       CUR.tt_metrics.ratio = 0;
 #endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */
 
     if ( CUR.GS.freeVector.x == 0x4000 )
 #endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */
 
     if ( CUR.GS.freeVector.x == 0x4000 )
-      CUR.F_dot_P       = CUR.GS.projVector.x * 0x10000L;
+      CUR.F_dot_P = CUR.GS.projVector.x;
+    else if ( CUR.GS.freeVector.y == 0x4000 )
+      CUR.F_dot_P = CUR.GS.projVector.y;
     else
     else
-    {
-      if ( CUR.GS.freeVector.y == 0x4000 )
-        CUR.F_dot_P       = CUR.GS.projVector.y * 0x10000L;
-      else
-        CUR.F_dot_P = (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x * 4 +
-                      (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y * 4;
-    }
+      CUR.F_dot_P = ( (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x +
+                      (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y ) >>
+                    14;
 
     if ( CUR.GS.projVector.x == 0x4000 )
       CUR.func_project = (TT_Project_Func)Project_x;
 
     if ( CUR.GS.projVector.x == 0x4000 )
       CUR.func_project = (TT_Project_Func)Project_x;
+    else if ( CUR.GS.projVector.y == 0x4000 )
+      CUR.func_project = (TT_Project_Func)Project_y;
     else
     else
-    {
-      if ( CUR.GS.projVector.y == 0x4000 )
-        CUR.func_project = (TT_Project_Func)Project_y;
-      else
-        CUR.func_project = (TT_Project_Func)Project;
-    }
+      CUR.func_project = (TT_Project_Func)Project;
 
     if ( CUR.GS.dualVector.x == 0x4000 )
       CUR.func_dualproj = (TT_Project_Func)Project_x;
 
     if ( CUR.GS.dualVector.x == 0x4000 )
       CUR.func_dualproj = (TT_Project_Func)Project_x;
+    else if ( CUR.GS.dualVector.y == 0x4000 )
+      CUR.func_dualproj = (TT_Project_Func)Project_y;
     else
     else
-    {
-      if ( CUR.GS.dualVector.y == 0x4000 )
-        CUR.func_dualproj = (TT_Project_Func)Project_y;
-      else
-        CUR.func_dualproj = (TT_Project_Func)Dual_Project;
-    }
+      CUR.func_dualproj = (TT_Project_Func)Dual_Project;
 
     CUR.func_move      = (TT_Move_Func)Direct_Move;
     CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig;
 
 
     CUR.func_move      = (TT_Move_Func)Direct_Move;
     CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig;
 
-    if ( CUR.F_dot_P == 0x40000000L )
+    if ( CUR.F_dot_P == 0x4000L )
     {
       if ( CUR.GS.freeVector.x == 0x4000 )
       {
         CUR.func_move      = (TT_Move_Func)Direct_Move_X;
         CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;
       }
     {
       if ( CUR.GS.freeVector.x == 0x4000 )
       {
         CUR.func_move      = (TT_Move_Func)Direct_Move_X;
         CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;
       }
-      else
+      else if ( CUR.GS.freeVector.y == 0x4000 )
       {
       {
-        if ( CUR.GS.freeVector.y == 0x4000 )
-        {
-          CUR.func_move      = (TT_Move_Func)Direct_Move_Y;
-          CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;
-        }
+        CUR.func_move      = (TT_Move_Func)Direct_Move_Y;
+        CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;
       }
     }
 
     /* at small sizes, F_dot_P can become too small, resulting   */
     /* in overflows and `spikes' in a number of glyphs like `w'. */
 
       }
     }
 
     /* at small sizes, F_dot_P can become too small, resulting   */
     /* in overflows and `spikes' in a number of glyphs like `w'. */
 
-    if ( FT_ABS( CUR.F_dot_P ) < 0x4000000L )
-      CUR.F_dot_P = 0x40000000L;
+    if ( FT_ABS( CUR.F_dot_P ) < 0x400L )
+      CUR.F_dot_P = 0x4000L;
 
     /* Disable cached aspect ratio */
     CUR.tt_metrics.ratio = 0;
 
     /* Disable cached aspect ratio */
     CUR.tt_metrics.ratio = 0;
   /*    In case Vx and Vy are both zero, Normalize() returns SUCCESS, and  */
   /*    R is undefined.                                                    */
   /*                                                                       */
   /*    In case Vx and Vy are both zero, Normalize() returns SUCCESS, and  */
   /*    R is undefined.                                                    */
   /*                                                                       */
-
-
   static FT_Bool
   Normalize( EXEC_OP_ FT_F26Dot6      Vx,
                       FT_F26Dot6      Vy,
                       FT_UnitVector*  R )
   {
     FT_F26Dot6  W;
   static FT_Bool
   Normalize( EXEC_OP_ FT_F26Dot6      Vx,
                       FT_F26Dot6      Vy,
                       FT_UnitVector*  R )
   {
     FT_F26Dot6  W;
-    FT_Bool     S1, S2;
 
     FT_UNUSED_EXEC;
 
 
 
     FT_UNUSED_EXEC;
 
 
-    if ( FT_ABS( Vx ) < 0x10000L && FT_ABS( Vy ) < 0x10000L )
+    if ( FT_ABS( Vx ) < 0x4000L && FT_ABS( Vy ) < 0x4000L )
     {
     {
-      Vx *= 0x100;
-      Vy *= 0x100;
-
-      W = TT_VecLen( Vx, Vy );
-
-      if ( W == 0 )
+      if ( Vx == 0 && Vy == 0 )
       {
         /* XXX: UNDOCUMENTED! It seems that it is possible to try   */
         /*      to normalize the vector (0,0).  Return immediately. */
         return SUCCESS;
       }
 
       {
         /* XXX: UNDOCUMENTED! It seems that it is possible to try   */
         /*      to normalize the vector (0,0).  Return immediately. */
         return SUCCESS;
       }
 
-      R->x = (FT_F2Dot14)FT_MulDiv( Vx, 0x4000L, W );
-      R->y = (FT_F2Dot14)FT_MulDiv( Vy, 0x4000L, W );
-
-      return SUCCESS;
-    }
-
-    W = TT_VecLen( Vx, Vy );
-
-    Vx = FT_MulDiv( Vx, 0x4000L, W );
-    Vy = FT_MulDiv( Vy, 0x4000L, W );
-
-    W = Vx * Vx + Vy * Vy;
-
-    /* Now, we want that Sqrt( W ) = 0x4000 */
-    /* Or 0x10000000 <= W < 0x10004000        */
-
-    if ( Vx < 0 )
-    {
-      Vx = -Vx;
-      S1 = TRUE;
-    }
-    else
-      S1 = FALSE;
-
-    if ( Vy < 0 )
-    {
-      Vy = -Vy;
-      S2 = TRUE;
+      Vx *= 0x4000;
+      Vy *= 0x4000;
     }
     }
-    else
-      S2 = FALSE;
 
 
-    while ( W < 0x10000000L )
-    {
-      /* We need to increase W by a minimal amount */
-      if ( Vx < Vy )
-        Vx++;
-      else
-        Vy++;
+    W = FT_Hypot( Vx, Vy );
 
 
-      W = Vx * Vx + Vy * Vy;
-    }
-
-    while ( W >= 0x10004000L )
-    {
-      /* We need to decrease W by a minimal amount */
-      if ( Vx < Vy )
-        Vx--;
-      else
-        Vy--;
-
-      W = Vx * Vx + Vy * Vy;
-    }
-
-    /* Note that in various cases, we can only  */
-    /* compute a Sqrt(W) of 0x3FFF, eg. Vx = Vy */
-
-    if ( S1 )
-      Vx = -Vx;
-
-    if ( S2 )
-      Vy = -Vy;
-
-    R->x = (FT_F2Dot14)Vx;   /* Type conversion */
-    R->y = (FT_F2Dot14)Vy;   /* Type conversion */
+    R->x = (FT_F2Dot14)TT_DivFix14( Vx, W );
+    R->y = (FT_F2Dot14)TT_DivFix14( Vy, W );
 
     return SUCCESS;
   }
 
     return SUCCESS;
   }
          BOUNDS( aIdx2, CUR.zp1.n_points ) )
     {
       if ( CUR.pedantic_hinting )
          BOUNDS( aIdx2, CUR.zp1.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return FAILURE;
     }
 
       return FAILURE;
     }
 
     A = p1->x - p2->x;
     B = p1->y - p2->y;
 
     A = p1->x - p2->x;
     B = p1->y - p2->y;
 
+    /* If p1 == p2, SPVTL and SFVTL behave the same as */
+    /* SPVTCA[X] and SFVTCA[X], respectively.          */
+    /*                                                 */
+    /* Confirmed by Greg Hitchcock.                    */
+
+    if ( A == 0 && B == 0 )
+    {
+      A    = 0x4000;
+      aOpc = 0;
+    }
+
     if ( ( aOpc & 1 ) != 0 )
     {
       C =  B;   /* counter clockwise rotation */
     if ( ( aOpc & 1 ) != 0 )
     {
       C =  B;   /* counter clockwise rotation */
     CUR.func_round = (TT_Round_Func)Round_Super_45;
 
 
     CUR.func_round = (TT_Round_Func)Round_Super_45;
 
 
-#define DO_SLOOP                       \
-    if ( args[0] < 0 )                 \
-      CUR.error = TT_Err_Bad_Argument; \
-    else                               \
+#define DO_SLOOP                            \
+    if ( args[0] < 0 )                      \
+      CUR.error = FT_THROW( Bad_Argument ); \
+    else                                    \
       CUR.GS.loop = args[0];
 
 
       CUR.GS.loop = args[0];
 
 
     CUR.GS.single_width_cutin = (FT_F26Dot6)args[0];
 
 
     CUR.GS.single_width_cutin = (FT_F26Dot6)args[0];
 
 
-    /* XXX: UNDOCUMENTED! or bug in the Windows engine?   */
-    /*                                                    */
-    /*      It seems that the value that is read here is  */
-    /*      expressed in 16.16 format rather than in font */
-    /*      units.                                        */
-    /*                                                    */
-#define DO_SSW                                                 \
-    CUR.GS.single_width_value = (FT_F26Dot6)( args[0] >> 10 );
+#define DO_SSW                                                     \
+    CUR.GS.single_width_value = FT_MulFix( args[0],                \
+                                           CUR.tt_metrics.scale );
 
 
 #define DO_FLIPON            \
 
 
 #define DO_FLIPON            \
     args[0] = CUR.top;
 
 
     args[0] = CUR.top;
 
 
-#define DO_CINDEX                           \
-  {                                         \
-    FT_Long  L;                             \
-                                            \
-                                            \
-    L = args[0];                            \
-                                            \
-    if ( L <= 0 || L > CUR.args )           \
-      CUR.error = TT_Err_Invalid_Reference; \
-    else                                    \
-      args[0] = CUR.stack[CUR.args - L];    \
-  }
-
-
-#define DO_JROT                          \
-    if ( args[1] != 0 )                  \
-    {                                    \
-      CUR.IP      += args[0];            \
-      if ( CUR.IP < 0 )                  \
-        CUR.error = TT_Err_Bad_Argument; \
-      CUR.step_ins = FALSE;              \
-    }
-
-
-#define DO_JMPR                        \
-    CUR.IP      += args[0];            \
-    if ( CUR.IP < 0 )                  \
-      CUR.error = TT_Err_Bad_Argument; \
+#define DO_CINDEX                                  \
+  {                                                \
+    FT_Long  L;                                    \
+                                                   \
+                                                   \
+    L = args[0];                                   \
+                                                   \
+    if ( L <= 0 || L > CUR.args )                  \
+    {                                              \
+      if ( CUR.pedantic_hinting )                  \
+        CUR.error = FT_THROW( Invalid_Reference ); \
+      args[0] = 0;                                 \
+    }                                              \
+    else                                           \
+      args[0] = CUR.stack[CUR.args - L];           \
+  }
+
+
+#define DO_JROT                                                   \
+    if ( args[1] != 0 )                                           \
+    {                                                             \
+      if ( args[0] == 0 && CUR.args == 0 )                        \
+        CUR.error = FT_THROW( Bad_Argument );                     \
+      CUR.IP += args[0];                                          \
+      if ( CUR.IP < 0                                          || \
+           ( CUR.callTop > 0                                 &&   \
+             CUR.IP > CUR.callStack[CUR.callTop - 1].Cur_End ) )  \
+        CUR.error = FT_THROW( Bad_Argument );                     \
+      CUR.step_ins = FALSE;                                       \
+    }
+
+
+#define DO_JMPR                                                 \
+    if ( args[0] == 0 && CUR.args == 0 )                        \
+      CUR.error = FT_THROW( Bad_Argument );                     \
+    CUR.IP += args[0];                                          \
+    if ( CUR.IP < 0                                          || \
+         ( CUR.callTop > 0                                 &&   \
+           CUR.IP > CUR.callStack[CUR.callTop - 1].Cur_End ) )  \
+      CUR.error = FT_THROW( Bad_Argument );                     \
     CUR.step_ins = FALSE;
 
 
     CUR.step_ins = FALSE;
 
 
-#define DO_JROF                          \
-    if ( args[1] == 0 )                  \
-    {                                    \
-      CUR.IP      += args[0];            \
-      if ( CUR.IP < 0 )                  \
-        CUR.error = TT_Err_Bad_Argument; \
-      CUR.step_ins = FALSE;              \
+#define DO_JROF                                                   \
+    if ( args[1] == 0 )                                           \
+    {                                                             \
+      if ( args[0] == 0 && CUR.args == 0 )                        \
+        CUR.error = FT_THROW( Bad_Argument );                     \
+      CUR.IP += args[0];                                          \
+      if ( CUR.IP < 0                                          || \
+           ( CUR.callTop > 0                                 &&   \
+             CUR.IP > CUR.callStack[CUR.callTop - 1].Cur_End ) )  \
+        CUR.error = FT_THROW( Bad_Argument );                     \
+      CUR.step_ins = FALSE;                                       \
     }
 
 
     }
 
 
 
 #define DO_DIV                                               \
     if ( args[1] == 0 )                                      \
 
 #define DO_DIV                                               \
     if ( args[1] == 0 )                                      \
-      CUR.error = TT_Err_Divide_By_Zero;                     \
+      CUR.error = FT_THROW( Divide_By_Zero );                \
     else                                                     \
     else                                                     \
-      args[0] = TT_MULDIV_NO_ROUND( args[0], 64L, args[1] );
+      args[0] = FT_MulDiv_No_Round( args[0], 64L, args[1] );
 
 
 #define DO_MUL                                    \
 
 
 #define DO_MUL                                    \
-    args[0] = TT_MULDIV( args[0], args[1], 64L );
+    args[0] = FT_MulDiv( args[0], args[1], 64L );
 
 
 #define DO_ABS                   \
 
 
 #define DO_ABS                   \
 #define DO_CEILING                    \
     args[0] = FT_PIX_CEIL( args[0] );
 
 #define DO_CEILING                    \
     args[0] = FT_PIX_CEIL( args[0] );
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+#define DO_RS                                             \
+   {                                                      \
+     FT_ULong  I = (FT_ULong)args[0];                     \
+                                                          \
+                                                          \
+     if ( BOUNDSL( I, CUR.storeSize ) )                   \
+     {                                                    \
+       if ( CUR.pedantic_hinting )                        \
+         ARRAY_BOUND_ERROR;                               \
+       else                                               \
+         args[0] = 0;                                     \
+     }                                                    \
+     else                                                 \
+     {                                                    \
+       /* subpixel hinting - avoid Typeman Dstroke and */ \
+       /* IStroke and Vacuform rounds                  */ \
+                                                          \
+       if ( SUBPIXEL_HINTING                           && \
+            CUR.ignore_x_mode                          && \
+            ( ( I == 24                            &&     \
+                ( CUR.face->sph_found_func_flags &        \
+                  ( SPH_FDEF_SPACING_1 |                  \
+                    SPH_FDEF_SPACING_2 )         ) ) ||   \
+              ( I == 22                      &&           \
+                ( CUR.sph_in_func_flags    &              \
+                  SPH_FDEF_TYPEMAN_STROKES ) )       ||   \
+              ( I == 8                             &&     \
+                ( CUR.face->sph_found_func_flags &        \
+                  SPH_FDEF_VACUFORM_ROUND_1      ) &&     \
+                  CUR.iup_called                   ) ) )  \
+         args[0] = 0;                                     \
+       else                                               \
+         args[0] = CUR.storage[I];                        \
+     }                                                    \
+   }
+
+#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
 
 #define DO_RS                           \
    {                                    \
 
 #define DO_RS                           \
    {                                    \
        args[0] = CUR.storage[I];        \
    }
 
        args[0] = CUR.storage[I];        \
    }
 
+#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
 
 #define DO_WS                           \
    {                                    \
 
 #define DO_WS                           \
    {                                    \
        }                                                        \
      }                                                          \
      else                                                       \
        }                                                        \
      }                                                          \
      else                                                       \
-       CUR.cvt[I] = TT_MULFIX( args[1], CUR.tt_metrics.scale ); \
+       CUR.cvt[I] = FT_MulFix( args[1], CUR.tt_metrics.scale ); \
    }
 
 
    }
 
 
-#define DO_DEBUG                     \
-    CUR.error = TT_Err_Debug_OpCode;
+#define DO_DEBUG                          \
+    CUR.error = FT_THROW( Debug_OpCode );
 
 
 #define DO_ROUND                                                   \
 
 
 #define DO_ROUND                                                   \
 
 
 #undef  ARRAY_BOUND_ERROR
 
 
 #undef  ARRAY_BOUND_ERROR
-#define ARRAY_BOUND_ERROR                   \
-    {                                       \
-      CUR.error = TT_Err_Invalid_Reference; \
-      return;                               \
+#define ARRAY_BOUND_ERROR                        \
+    {                                            \
+      CUR.error = FT_THROW( Invalid_Reference ); \
+      return;                                    \
     }
 
 
     }
 
 
 
     if ( L <= 0 || L > CUR.args )
     {
 
     if ( L <= 0 || L > CUR.args )
     {
-      CUR.error = TT_Err_Invalid_Reference;
-      return;
+      if ( CUR.pedantic_hinting )
+        CUR.error = FT_THROW( Invalid_Reference );
     }
     }
+    else
+    {
+      K = CUR.stack[CUR.args - L];
 
 
-    K = CUR.stack[CUR.args - L];
-
-    FT_ARRAY_MOVE( &CUR.stack[CUR.args - L    ],
-                   &CUR.stack[CUR.args - L + 1],
-                   ( L - 1 ) );
+      FT_ARRAY_MOVE( &CUR.stack[CUR.args - L    ],
+                     &CUR.stack[CUR.args - L + 1],
+                     ( L - 1 ) );
 
 
-    CUR.stack[CUR.args - 1] = K;
+      CUR.stack[CUR.args - 1] = K;
+    }
   }
 
 
   }
 
 
       CUR.length = opcode_length[CUR.opcode];
       if ( CUR.length < 0 )
       {
       CUR.length = opcode_length[CUR.opcode];
       if ( CUR.length < 0 )
       {
-        if ( CUR.IP + 1 > CUR.codeSize )
+        if ( CUR.IP + 1 >= CUR.codeSize )
           goto Fail_Overflow;
         CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
       }
           goto Fail_Overflow;
         CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
       }
     }
 
   Fail_Overflow:
     }
 
   Fail_Overflow:
-    CUR.error = TT_Err_Code_Overflow;
+    CUR.error = FT_THROW( Code_Overflow );
     return FAILURE;
   }
 
     return FAILURE;
   }
 
     TT_DefRecord*  rec;
     TT_DefRecord*  limit;
 
     TT_DefRecord*  rec;
     TT_DefRecord*  limit;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    /* arguments to opcodes are skipped by `SKIP_Code' */
+    FT_Byte    opcode_pattern[9][12] = {
+                 /* #0 inline delta function 1 */
+                 {
+                   0x4B, /* PPEM    */
+                   0x53, /* GTEQ    */
+                   0x23, /* SWAP    */
+                   0x4B, /* PPEM    */
+                   0x51, /* LTEQ    */
+                   0x5A, /* AND     */
+                   0x58, /* IF      */
+                   0x38, /*   SHPIX */
+                   0x1B, /* ELSE    */
+                   0x21, /*   POP   */
+                   0x21, /*   POP   */
+                   0x59  /* EIF     */
+                 },
+                 /* #1 inline delta function 2 */
+                 {
+                   0x4B, /* PPEM    */
+                   0x54, /* EQ      */
+                   0x58, /* IF      */
+                   0x38, /*   SHPIX */
+                   0x1B, /* ELSE    */
+                   0x21, /*   POP   */
+                   0x21, /*   POP   */
+                   0x59  /* EIF     */
+                 },
+                 /* #2 diagonal stroke function */
+                 {
+                   0x20, /* DUP     */
+                   0x20, /* DUP     */
+                   0xB0, /* PUSHB_1 */
+                         /*   1     */
+                   0x60, /* ADD     */
+                   0x46, /* GC_cur  */
+                   0xB0, /* PUSHB_1 */
+                         /*   64    */
+                   0x23, /* SWAP    */
+                   0x42  /* WS      */
+                 },
+                 /* #3 VacuFormRound function */
+                 {
+                   0x45, /* RCVT    */
+                   0x23, /* SWAP    */
+                   0x46, /* GC_cur  */
+                   0x60, /* ADD     */
+                   0x20, /* DUP     */
+                   0xB0  /* PUSHB_1 */
+                         /*   38    */
+                 },
+                 /* #4 TTFautohint bytecode (old) */
+                 {
+                   0x20, /* DUP     */
+                   0x64, /* ABS     */
+                   0xB0, /* PUSHB_1 */
+                         /*   32    */
+                   0x60, /* ADD     */
+                   0x66, /* FLOOR   */
+                   0x23, /* SWAP    */
+                   0xB0  /* PUSHB_1 */
+                 },
+                 /* #5 spacing function 1 */
+                 {
+                   0x01, /* SVTCA_x */
+                   0xB0, /* PUSHB_1 */
+                         /*   24    */
+                   0x43, /* RS      */
+                   0x58  /* IF      */
+                 },
+                 /* #6 spacing function 2 */
+                 {
+                   0x01, /* SVTCA_x */
+                   0x18, /* RTG     */
+                   0xB0, /* PUSHB_1 */
+                         /*   24    */
+                   0x43, /* RS      */
+                   0x58  /* IF      */
+                 },
+                 /* #7 TypeMan Talk DiagEndCtrl function */
+                 {
+                   0x01, /* SVTCA_x */
+                   0x20, /* DUP     */
+                   0xB0, /* PUSHB_1 */
+                         /*   3     */
+                   0x25, /* CINDEX  */
+                 },
+                 /* #8 TypeMan Talk Align */
+                 {
+                   0x06, /* SPVTL   */
+                   0x7D, /* RDTG    */
+                 },
+               };
+    FT_UShort  opcode_patterns   = 9;
+    FT_UShort  opcode_pointer[9] = {  0, 0, 0, 0, 0, 0, 0, 0, 0 };
+    FT_UShort  opcode_size[9]    = { 12, 8, 8, 6, 7, 4, 5, 4, 2 };
+    FT_UShort  i;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
 
     /* some font programs are broken enough to redefine functions! */
     /* We will then parse the current table.                       */
 
     /* some font programs are broken enough to redefine functions! */
     /* We will then parse the current table.                       */
       /* check that there is enough room for new functions */
       if ( CUR.numFDefs >= CUR.maxFDefs )
       {
       /* check that there is enough room for new functions */
       if ( CUR.numFDefs >= CUR.maxFDefs )
       {
-        CUR.error = TT_Err_Too_Many_Function_Defs;
+        CUR.error = FT_THROW( Too_Many_Function_Defs );
         return;
       }
       CUR.numFDefs++;
         return;
       }
       CUR.numFDefs++;
     /* func # must be within unsigned 16-bit integer */
     if ( n > 0xFFFFU )
     {
     /* func # must be within unsigned 16-bit integer */
     if ( n > 0xFFFFU )
     {
-      CUR.error = TT_Err_Too_Many_Function_Defs;
+      CUR.error = FT_THROW( Too_Many_Function_Defs );
       return;
     }
 
       return;
     }
 
-    rec->range  = CUR.curRange;
-    rec->opc    = (FT_UInt16)n;
-    rec->start  = CUR.IP + 1;
-    rec->active = TRUE;
+    rec->range          = CUR.curRange;
+    rec->opc            = (FT_UInt16)n;
+    rec->start          = CUR.IP + 1;
+    rec->active         = TRUE;
+    rec->inline_delta   = FALSE;
+    rec->sph_fdef_flags = 0x0000;
 
     if ( n > CUR.maxFunc )
       CUR.maxFunc = (FT_UInt16)n;
 
 
     if ( n > CUR.maxFunc )
       CUR.maxFunc = (FT_UInt16)n;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    /* We don't know for sure these are typeman functions, */
+    /* however they are only active when RS 22 is called   */
+    if ( n >= 64 && n <= 66 )
+      rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_STROKES;
+#endif
+
     /* Now skip the whole function definition. */
     /* We don't allow nested IDEFS & FDEFs.    */
 
     while ( SKIP_Code() == SUCCESS )
     {
     /* Now skip the whole function definition. */
     /* We don't allow nested IDEFS & FDEFs.    */
 
     while ( SKIP_Code() == SUCCESS )
     {
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+      if ( SUBPIXEL_HINTING )
+      {
+        for ( i = 0; i < opcode_patterns; i++ )
+        {
+          if ( opcode_pointer[i] < opcode_size[i]                 &&
+               CUR.opcode == opcode_pattern[i][opcode_pointer[i]] )
+          {
+            opcode_pointer[i] += 1;
+
+            if ( opcode_pointer[i] == opcode_size[i] )
+            {
+              FT_TRACE7(( "sph: Function %d, opcode ptrn: %d, %s %s\n",
+                          i, n,
+                          CUR.face->root.family_name,
+                          CUR.face->root.style_name ));
+
+              switch ( i )
+              {
+              case 0:
+                rec->sph_fdef_flags            |= SPH_FDEF_INLINE_DELTA_1;
+                CUR.face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_1;
+                break;
+
+              case 1:
+                rec->sph_fdef_flags            |= SPH_FDEF_INLINE_DELTA_2;
+                CUR.face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_2;
+                break;
+
+              case 2:
+                switch ( n )
+                {
+                  /* needs to be implemented still */
+                case 58:
+                  rec->sph_fdef_flags            |= SPH_FDEF_DIAGONAL_STROKE;
+                  CUR.face->sph_found_func_flags |= SPH_FDEF_DIAGONAL_STROKE;
+                }
+                break;
+
+              case 3:
+                switch ( n )
+                {
+                case 0:
+                  rec->sph_fdef_flags            |= SPH_FDEF_VACUFORM_ROUND_1;
+                  CUR.face->sph_found_func_flags |= SPH_FDEF_VACUFORM_ROUND_1;
+                }
+                break;
+
+              case 4:
+                /* probably not necessary to detect anymore */
+                rec->sph_fdef_flags            |= SPH_FDEF_TTFAUTOHINT_1;
+                CUR.face->sph_found_func_flags |= SPH_FDEF_TTFAUTOHINT_1;
+                break;
+
+              case 5:
+                switch ( n )
+                {
+                case 0:
+                case 1:
+                case 2:
+                case 4:
+                case 7:
+                case 8:
+                  rec->sph_fdef_flags            |= SPH_FDEF_SPACING_1;
+                  CUR.face->sph_found_func_flags |= SPH_FDEF_SPACING_1;
+                }
+                break;
+
+              case 6:
+                switch ( n )
+                {
+                case 0:
+                case 1:
+                case 2:
+                case 4:
+                case 7:
+                case 8:
+                  rec->sph_fdef_flags            |= SPH_FDEF_SPACING_2;
+                  CUR.face->sph_found_func_flags |= SPH_FDEF_SPACING_2;
+                }
+                break;
+
+               case 7:
+                 rec->sph_fdef_flags            |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
+                 CUR.face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
+                 break;
+
+               case 8:
+#if 0
+                 rec->sph_fdef_flags            |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
+                 CUR.face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
+#endif
+                 break;
+              }
+              opcode_pointer[i] = 0;
+            }
+          }
+
+          else
+            opcode_pointer[i] = 0;
+        }
+
+        /* Set sph_compatibility_mode only when deltas are detected */
+        CUR.face->sph_compatibility_mode =
+          ( ( CUR.face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_1 ) |
+            ( CUR.face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_2 ) );
+      }
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
       switch ( CUR.opcode )
       {
       case 0x89:    /* IDEF */
       case 0x2C:    /* FDEF */
       switch ( CUR.opcode )
       {
       case 0x89:    /* IDEF */
       case 0x2C:    /* FDEF */
-        CUR.error = TT_Err_Nested_DEFS;
+        CUR.error = FT_THROW( Nested_DEFS );
         return;
 
       case 0x2D:   /* ENDF */
         return;
 
       case 0x2D:   /* ENDF */
+        rec->end = CUR.IP;
         return;
       }
     }
         return;
       }
     }
     FT_UNUSED_ARG;
 
 
     FT_UNUSED_ARG;
 
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    CUR.sph_in_func_flags = 0x0000;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     if ( CUR.callTop <= 0 )     /* We encountered an ENDF without a call */
     {
     if ( CUR.callTop <= 0 )     /* We encountered an ENDF without a call */
     {
-      CUR.error = TT_Err_ENDF_In_Exec_Stream;
+      CUR.error = FT_THROW( ENDF_In_Exec_Stream );
       return;
     }
 
       return;
     }
 
     if ( !def->active )
       goto Fail;
 
     if ( !def->active )
       goto Fail;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING                                              &&
+         CUR.ignore_x_mode                                             &&
+         ( ( CUR.iup_called                                        &&
+             ( CUR.sph_tweak_flags & SPH_TWEAK_NO_CALL_AFTER_IUP ) ) ||
+           ( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 )       ) )
+      goto Fail;
+    else
+      CUR.sph_in_func_flags = def->sph_fdef_flags;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     /* check the call stack */
     if ( CUR.callTop >= CUR.callSize )
     {
     /* check the call stack */
     if ( CUR.callTop >= CUR.callSize )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
       return;
     }
 
     pCrec->Caller_IP    = CUR.IP + 1;
     pCrec->Cur_Count    = 1;
     pCrec->Cur_Restart  = def->start;
     pCrec->Caller_IP    = CUR.IP + 1;
     pCrec->Cur_Count    = 1;
     pCrec->Cur_Restart  = def->start;
+    pCrec->Cur_End      = def->end;
 
     CUR.callTop++;
 
 
     CUR.callTop++;
 
                         def->start );
 
     CUR.step_ins = FALSE;
                         def->start );
 
     CUR.step_ins = FALSE;
+
     return;
 
   Fail:
     return;
 
   Fail:
-    CUR.error = TT_Err_Invalid_Reference;
+    CUR.error = FT_THROW( Invalid_Reference );
   }
 
 
   }
 
 
     if ( !def->active )
       goto Fail;
 
     if ( !def->active )
       goto Fail;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING                                    &&
+         CUR.ignore_x_mode                                   &&
+         ( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 ) )
+      goto Fail;
+    else
+      CUR.sph_in_func_flags = def->sph_fdef_flags;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     /* check stack */
     if ( CUR.callTop >= CUR.callSize )
     {
     /* check stack */
     if ( CUR.callTop >= CUR.callSize )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
       return;
     }
 
       pCrec->Caller_IP    = CUR.IP + 1;
       pCrec->Cur_Count    = (FT_Int)args[0];
       pCrec->Cur_Restart  = def->start;
       pCrec->Caller_IP    = CUR.IP + 1;
       pCrec->Cur_Count    = (FT_Int)args[0];
       pCrec->Cur_Restart  = def->start;
+      pCrec->Cur_End      = def->end;
 
       CUR.callTop++;
 
 
       CUR.callTop++;
 
 
       CUR.step_ins = FALSE;
     }
 
       CUR.step_ins = FALSE;
     }
+
     return;
 
   Fail:
     return;
 
   Fail:
-    CUR.error = TT_Err_Invalid_Reference;
+    CUR.error = FT_THROW( Invalid_Reference );
   }
 
 
   }
 
 
       /* check that there is enough room for a new instruction */
       if ( CUR.numIDefs >= CUR.maxIDefs )
       {
       /* check that there is enough room for a new instruction */
       if ( CUR.numIDefs >= CUR.maxIDefs )
       {
-        CUR.error = TT_Err_Too_Many_Instruction_Defs;
+        CUR.error = FT_THROW( Too_Many_Instruction_Defs );
         return;
       }
       CUR.numIDefs++;
         return;
       }
       CUR.numIDefs++;
     /* opcode must be unsigned 8-bit integer */
     if ( 0 > args[0] || args[0] > 0x00FF )
     {
     /* opcode must be unsigned 8-bit integer */
     if ( 0 > args[0] || args[0] > 0x00FF )
     {
-      CUR.error = TT_Err_Too_Many_Instruction_Defs;
+      CUR.error = FT_THROW( Too_Many_Instruction_Defs );
       return;
     }
 
       return;
     }
 
       {
       case 0x89:   /* IDEF */
       case 0x2C:   /* FDEF */
       {
       case 0x89:   /* IDEF */
       case 0x2C:   /* FDEF */
-        CUR.error = TT_Err_Nested_DEFS;
+        CUR.error = FT_THROW( Nested_DEFS );
         return;
       case 0x2D:   /* ENDF */
         return;
         return;
       case 0x2D:   /* ENDF */
         return;
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
       return;
     }
 
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
       return;
     }
 
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
       return;
     }
 
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
 
     if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
     {
-      CUR.error = TT_Err_Stack_Overflow;
+      CUR.error = FT_THROW( Stack_Overflow );
       return;
     }
 
       return;
     }
 
   /* Opcode range: 0x46-0x47                                               */
   /* Stack:        uint32 --> f26.6                                        */
   /*                                                                       */
   /* Opcode range: 0x46-0x47                                               */
   /* Stack:        uint32 --> f26.6                                        */
   /*                                                                       */
-  /* BULLSHIT: Measures from the original glyph must be taken along the    */
-  /*           dual projection vector!                                     */
+  /* XXX: UNDOCUMENTED: Measures from the original glyph must be taken     */
+  /*      along the dual projection vector!                                */
   /*                                                                       */
   static void
   Ins_GC( INS_ARG )
   /*                                                                       */
   static void
   Ins_GC( INS_ARG )
     if ( BOUNDSL( L, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
     if ( BOUNDSL( L, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-      {
-        CUR.error = TT_Err_Invalid_Reference;
-        return;
-      }
-      else
-        R = 0;
+        CUR.error = FT_THROW( Invalid_Reference );
+      R = 0;
     }
     else
     {
     }
     else
     {
     if ( BOUNDS( L, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
     if ( BOUNDS( L, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
 
     CUR_Func_move( &CUR.zp2, L, args[1] - K );
 
 
     CUR_Func_move( &CUR.zp2, L, args[1] - K );
 
-    /* not part of the specs, but here for safety */
-
+    /* UNDOCUMENTED!  The MS rasterizer does that with */
+    /* twilight points (confirmed by Greg Hitchcock)   */
     if ( CUR.GS.gep2 == 0 )
       CUR.zp2.org[L] = CUR.zp2.cur[L];
   }
     if ( CUR.GS.gep2 == 0 )
       CUR.zp2.org[L] = CUR.zp2.cur[L];
   }
   /* Opcode range: 0x49-0x4A                                               */
   /* Stack:        uint32 uint32 --> f26.6                                 */
   /*                                                                       */
   /* Opcode range: 0x49-0x4A                                               */
   /* Stack:        uint32 uint32 --> f26.6                                 */
   /*                                                                       */
-  /* BULLSHIT: Measure taken in the original glyph must be along the dual  */
-  /*           projection vector.                                          */
+  /* XXX: UNDOCUMENTED: Measure taken in the original glyph must be along  */
+  /*                    the dual projection vector.                        */
   /*                                                                       */
   /*                                                                       */
-  /* Second BULLSHIT: Flag attributes are inverted!                        */
-  /*                  0 => measure distance in original outline            */
-  /*                  1 => measure distance in grid-fitted outline         */
+  /* XXX: UNDOCUMENTED: Flag attributes are inverted!                      */
+  /*                      0 => measure distance in original outline        */
+  /*                      1 => measure distance in grid-fitted outline     */
   /*                                                                       */
   /*                                                                       */
-  /* Third one: `zp0 - zp1', and not `zp2 - zp1!                           */
+  /* XXX: UNDOCUMENTED: `zp0 - zp1', and not `zp2 - zp1!                   */
   /*                                                                       */
   static void
   Ins_MD( INS_ARG )
   /*                                                                       */
   static void
   Ins_MD( INS_ARG )
          BOUNDS( K, CUR.zp1.n_points ) )
     {
       if ( CUR.pedantic_hinting )
          BOUNDS( K, CUR.zp1.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-      {
-        CUR.error = TT_Err_Invalid_Reference;
-        return;
-      }
+        CUR.error = FT_THROW( Invalid_Reference );
       D = 0;
     }
     else
       D = 0;
     }
     else
         D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K );
       else
       {
         D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K );
       else
       {
-        FT_Vector*  vec1 = CUR.zp0.orus + L;
-        FT_Vector*  vec2 = CUR.zp1.orus + K;
+        /* XXX: UNDOCUMENTED: twilight zone special case */
 
 
-
-        if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
+        if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 )
         {
         {
-          /* this should be faster */
+          FT_Vector*  vec1 = CUR.zp0.org + L;
+          FT_Vector*  vec2 = CUR.zp1.org + K;
+
+
           D = CUR_Func_dualproj( vec1, vec2 );
           D = CUR_Func_dualproj( vec1, vec2 );
-          D = TT_MULFIX( D, CUR.metrics.x_scale );
         }
         else
         {
         }
         else
         {
-          FT_Vector  vec;
+          FT_Vector*  vec1 = CUR.zp0.orus + L;
+          FT_Vector*  vec2 = CUR.zp1.orus + K;
+
+
+          if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
+          {
+            /* this should be faster */
+            D = CUR_Func_dualproj( vec1, vec2 );
+            D = FT_MulFix( D, CUR.metrics.x_scale );
+          }
+          else
+          {
+            FT_Vector  vec;
 
 
 
 
-          vec.x = TT_MULFIX( vec1->x - vec2->x, CUR.metrics.x_scale );
-          vec.y = TT_MULFIX( vec1->y - vec2->y, CUR.metrics.y_scale );
+            vec.x = FT_MulFix( vec1->x - vec2->x, CUR.metrics.x_scale );
+            vec.y = FT_MulFix( vec1->y - vec2->y, CUR.metrics.y_scale );
 
 
-          D = CUR_fast_dualproj( &vec );
+            D = CUR_fast_dualproj( &vec );
+          }
         }
       }
     }
 
         }
       }
     }
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    /* Disable Type 2 Vacuform Rounds - e.g. Arial Narrow */
+    if ( SUBPIXEL_HINTING                       &&
+         CUR.ignore_x_mode && FT_ABS( D ) == 64 )
+      D += 1;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     args[0] = D;
   }
 
     args[0] = D;
   }
 
   Ins_SDPVTL( INS_ARG )
   {
     FT_Long    A, B, C;
   Ins_SDPVTL( INS_ARG )
   {
     FT_Long    A, B, C;
-    FT_UShort  p1, p2;   /* was FT_Int in pas type ERROR */
+    FT_UShort  p1, p2;            /* was FT_Int in pas type ERROR */
+    FT_Int     aOpc = CUR.opcode;
 
 
     p1 = (FT_UShort)args[1];
 
 
     p1 = (FT_UShort)args[1];
          BOUNDS( p1, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
          BOUNDS( p1, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
 
       A = v1->x - v2->x;
       B = v1->y - v2->y;
 
       A = v1->x - v2->x;
       B = v1->y - v2->y;
+
+      /* If v1 == v2, SDPVTL behaves the same as */
+      /* SVTCA[X], respectively.                 */
+      /*                                         */
+      /* Confirmed by Greg Hitchcock.            */
+
+      if ( A == 0 && B == 0 )
+      {
+        A    = 0x4000;
+        aOpc = 0;
+      }
     }
 
     }
 
-    if ( ( CUR.opcode & 1 ) != 0 )
+    if ( ( aOpc & 1 ) != 0 )
     {
       C =  B;   /* counter clockwise rotation */
       B =  A;
     {
       C =  B;   /* counter clockwise rotation */
       B =  A;
 
       A = v1->x - v2->x;
       B = v1->y - v2->y;
 
       A = v1->x - v2->x;
       B = v1->y - v2->y;
+
+      if ( A == 0 && B == 0 )
+      {
+        A    = 0x4000;
+        aOpc = 0;
+      }
     }
 
     }
 
-    if ( ( CUR.opcode & 1 ) != 0 )
+    if ( ( aOpc & 1 ) != 0 )
     {
       C =  B;   /* counter clockwise rotation */
       B =  A;
     {
       C =  B;   /* counter clockwise rotation */
       B =  A;
 
     default:
       if ( CUR.pedantic_hinting )
 
     default:
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
 
     default:
       if ( CUR.pedantic_hinting )
 
     default:
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
 
     default:
       if ( CUR.pedantic_hinting )
 
     default:
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
 
     default:
       if ( CUR.pedantic_hinting )
 
     default:
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
     if ( K < 1 || K > 2 )
     {
       if ( CUR.pedantic_hinting )
     if ( K < 1 || K > 2 )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
 
     if ( CUR.top < CUR.GS.loop )
     {
 
     if ( CUR.top < CUR.GS.loop )
     {
-      CUR.error = TT_Err_Too_Few_Arguments;
-      return;
+      if ( CUR.pedantic_hinting )
+        CUR.error = FT_THROW( Too_Few_Arguments );
+      goto Fail;
     }
 
     while ( CUR.GS.loop > 0 )
     }
 
     while ( CUR.GS.loop > 0 )
       {
         if ( CUR.pedantic_hinting )
         {
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
       }
           return;
         }
       }
       CUR.GS.loop--;
     }
 
       CUR.GS.loop--;
     }
 
+  Fail:
     CUR.GS.loop = 1;
     CUR.new_top = CUR.args;
   }
     CUR.GS.loop = 1;
     CUR.new_top = CUR.args;
   }
          BOUNDS( L, CUR.pts.n_points ) )
     {
       if ( CUR.pedantic_hinting )
          BOUNDS( L, CUR.pts.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
          BOUNDS( L, CUR.pts.n_points ) )
     {
       if ( CUR.pedantic_hinting )
          BOUNDS( L, CUR.pts.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
     if ( BOUNDS( p, zp.n_points ) )
     {
       if ( CUR.pedantic_hinting )
     if ( BOUNDS( p, zp.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       *refp = 0;
       return FAILURE;
     }
       *refp = 0;
       return FAILURE;
     }
     else
 #endif
     {
     else
 #endif
     {
-      *x = TT_MULDIV( d,
-                      (FT_Long)CUR.GS.freeVector.x * 0x10000L,
-                      CUR.F_dot_P );
-      *y = TT_MULDIV( d,
-                      (FT_Long)CUR.GS.freeVector.y * 0x10000L,
-                      CUR.F_dot_P );
+      *x = FT_MulDiv( d, (FT_Long)CUR.GS.freeVector.x, CUR.F_dot_P );
+      *y = FT_MulDiv( d, (FT_Long)CUR.GS.freeVector.y, CUR.F_dot_P );
     }
 
     return SUCCESS;
     }
 
     return SUCCESS;
 
     if ( CUR.top < CUR.GS.loop )
     {
 
     if ( CUR.top < CUR.GS.loop )
     {
-      CUR.error = TT_Err_Invalid_Reference;
-      return;
+      if ( CUR.pedantic_hinting )
+        CUR.error = FT_THROW( Invalid_Reference );
+      goto Fail;
     }
 
     if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
     }
 
     if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
       {
         if ( CUR.pedantic_hinting )
         {
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
       }
       else
           return;
         }
       }
       else
-        /* XXX: UNDOCUMENTED! SHP touches the points */
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      /* doesn't follow Cleartype spec but produces better result */
+      if ( SUBPIXEL_HINTING  &&
+           CUR.ignore_x_mode )
+        MOVE_Zp2_Point( point, 0, dy, TRUE );
+      else
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
         MOVE_Zp2_Point( point, dx, dy, TRUE );
 
       CUR.GS.loop--;
     }
 
         MOVE_Zp2_Point( point, dx, dy, TRUE );
 
       CUR.GS.loop--;
     }
 
+  Fail:
     CUR.GS.loop = 1;
     CUR.new_top = CUR.args;
   }
     CUR.GS.loop = 1;
     CUR.new_top = CUR.args;
   }
   /* Opcode range: 0x34-35                                                 */
   /* Stack:        uint32 -->                                              */
   /*                                                                       */
   /* Opcode range: 0x34-35                                                 */
   /* Stack:        uint32 -->                                              */
   /*                                                                       */
+  /* UNDOCUMENTED: According to Greg Hitchcock, there is one (virtual)     */
+  /*               contour in the twilight zone, namely contour number     */
+  /*               zero which includes all points of it.                   */
+  /*                                                                       */
   static void
   Ins_SHC( INS_ARG )
   {
   static void
   Ins_SHC( INS_ARG )
   {
-    TT_GlyphZoneRec zp;
-    FT_UShort       refp;
-    FT_F26Dot6      dx,
-                    dy;
+    TT_GlyphZoneRec  zp;
+    FT_UShort        refp;
+    FT_F26Dot6       dx, dy;
 
 
-    FT_Short        contour;
-    FT_UShort       first_point, last_point, i;
+    FT_Short         contour, bounds;
+    FT_UShort        start, limit, i;
 
 
     contour = (FT_UShort)args[0];
 
 
     contour = (FT_UShort)args[0];
+    bounds  = ( CUR.GS.gep2 == 0 ) ? 1 : CUR.zp2.n_contours;
 
 
-    if ( BOUNDS( contour, CUR.pts.n_contours ) )
+    if ( BOUNDS( contour, bounds ) )
     {
       if ( CUR.pedantic_hinting )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
       return;
 
     if ( contour == 0 )
       return;
 
     if ( contour == 0 )
-      first_point = 0;
+      start = 0;
     else
     else
-      first_point = (FT_UShort)( CUR.pts.contours[contour - 1] + 1 -
-                                 CUR.pts.first_point );
-
-    last_point = (FT_UShort)( CUR.pts.contours[contour] -
-                              CUR.pts.first_point );
+      start = (FT_UShort)( CUR.zp2.contours[contour - 1] + 1 -
+                           CUR.zp2.first_point );
 
 
-    /* XXX: this is probably wrong... at least it prevents memory */
-    /*      corruption when zp2 is the twilight zone              */
-    if ( BOUNDS( last_point, CUR.zp2.n_points ) )
-    {
-      if ( CUR.zp2.n_points > 0 )
-        last_point = (FT_UShort)(CUR.zp2.n_points - 1);
-      else
-        last_point = 0;
-    }
+    /* we use the number of points if in the twilight zone */
+    if ( CUR.GS.gep2 == 0 )
+      limit = CUR.zp2.n_points;
+    else
+      limit = (FT_UShort)( CUR.zp2.contours[contour] -
+                           CUR.zp2.first_point + 1 );
 
 
-    /* XXX: UNDOCUMENTED! SHC touches the points */
-    for ( i = first_point; i <= last_point; i++ )
+    for ( i = start; i < limit; i++ )
     {
       if ( zp.cur != CUR.zp2.cur || refp != i )
         MOVE_Zp2_Point( i, dx, dy, TRUE );
     {
       if ( zp.cur != CUR.zp2.cur || refp != i )
         MOVE_Zp2_Point( i, dx, dy, TRUE );
     FT_F26Dot6       dx,
                      dy;
 
     FT_F26Dot6       dx,
                      dy;
 
-    FT_UShort        last_point, i;
+    FT_UShort        limit, i;
 
 
     if ( BOUNDS( args[0], 2 ) )
     {
       if ( CUR.pedantic_hinting )
 
 
     if ( BOUNDS( args[0], 2 ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
     if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
       return;
 
       return;
     }
 
     if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
       return;
 
-    /* XXX: UNDOCUMENTED! SHZ doesn't move the phantom points.  */
-    /*      Twilight zone has no contours, so use `n_points'.   */
-    /*      Normal zone's `n_points' includes phantoms, so must */
-    /*      use end of last contour.                            */
-    if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 )
-      last_point = (FT_UShort)( CUR.zp2.n_points - 1 );
+    /* XXX: UNDOCUMENTED! SHZ doesn't move the phantom points.     */
+    /*      Twilight zone has no real contours, so use `n_points'. */
+    /*      Normal zone's `n_points' includes phantoms, so must    */
+    /*      use end of last contour.                               */
+    if ( CUR.GS.gep2 == 0 )
+      limit = (FT_UShort)CUR.zp2.n_points;
     else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 )
     else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 )
-    {
-      last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] );
-
-      if ( BOUNDS( last_point, CUR.zp2.n_points ) )
-      {
-        if ( CUR.pedantic_hinting )
-          CUR.error = TT_Err_Invalid_Reference;
-        return;
-      }
-    }
+      limit = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] + 1 );
     else
     else
-      last_point = 0;
+      limit = 0;
 
     /* XXX: UNDOCUMENTED! SHZ doesn't touch the points */
 
     /* XXX: UNDOCUMENTED! SHZ doesn't touch the points */
-    for ( i = 0; i <= last_point; i++ )
+    for ( i = 0; i < limit; i++ )
     {
       if ( zp.cur != CUR.zp2.cur || refp != i )
         MOVE_Zp2_Point( i, dx, dy, FALSE );
     {
       if ( zp.cur != CUR.zp2.cur || refp != i )
         MOVE_Zp2_Point( i, dx, dy, FALSE );
   {
     FT_F26Dot6  dx, dy;
     FT_UShort   point;
   {
     FT_F26Dot6  dx, dy;
     FT_UShort   point;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    FT_Int      B1, B2;
+#endif
 
 
     if ( CUR.top < CUR.GS.loop + 1 )
     {
 
 
     if ( CUR.top < CUR.GS.loop + 1 )
     {
-      CUR.error = TT_Err_Invalid_Reference;
-      return;
+      if ( CUR.pedantic_hinting )
+        CUR.error = FT_THROW( Invalid_Reference );
+      goto Fail;
     }
 
 #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
     }
 
 #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
     {
       if ( CUR.GS.both_x_axis )
       {
     {
       if ( CUR.GS.both_x_axis )
       {
-        dx = TT_MulFix14( (FT_UInt32)args[0], 0x4000 );
+        dx = (FT_UInt32)args[0];
         dy = 0;
       }
       else
       {
         dx = 0;
         dy = 0;
       }
       else
       {
         dx = 0;
-        dy = TT_MulFix14( (FT_UInt32)args[0], 0x4000 );
+        dy = (FT_UInt32)args[0];
       }
     }
     else
       }
     }
     else
       {
         if ( CUR.pedantic_hinting )
         {
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
       }
       else
           return;
         }
       }
       else
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      {
+        /*  If not using ignore_x_mode rendering, allow ZP2 move.          */
+        /*  If inline deltas aren't allowed, skip ZP2 move.                */
+        /*  If using ignore_x_mode rendering, allow ZP2 point move if:     */
+        /*   - freedom vector is y and sph_compatibility_mode is off       */
+        /*   - the glyph is composite and the move is in the Y direction   */
+        /*   - the glyph is specifically set to allow SHPIX moves          */
+        /*   - the move is on a previously Y-touched point                 */
+
+        if ( SUBPIXEL_HINTING  &&
+             CUR.ignore_x_mode )
+        {
+          /* save point for later comparison */
+          if ( CUR.GS.freeVector.y != 0 )
+            B1 = CUR.zp2.cur[point].y;
+          else
+            B1 = CUR.zp2.cur[point].x;
+
+          if ( !CUR.face->sph_compatibility_mode &&
+               CUR.GS.freeVector.y != 0          )
+          {
+            MOVE_Zp2_Point( point, dx, dy, TRUE );
+
+            /* save new point */
+            if ( CUR.GS.freeVector.y != 0 )
+            {
+              B2 = CUR.zp2.cur[point].y;
+
+              /* reverse any disallowed moves */
+              if ( ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&
+                   ( B1 & 63 ) != 0                                          &&
+                   ( B2 & 63 ) != 0                                          &&
+                    B1 != B2                                                 )
+                MOVE_Zp2_Point( point, -dx, -dy, TRUE );
+            }
+          }
+          else if ( CUR.face->sph_compatibility_mode )
+          {
+            if ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
+            {
+              dx = FT_PIX_ROUND( B1 + dx ) - B1;
+              dy = FT_PIX_ROUND( B1 + dy ) - B1;
+            }
+
+            /* skip post-iup deltas */
+            if ( CUR.iup_called                                          &&
+                 ( ( CUR.sph_in_func_flags & SPH_FDEF_INLINE_DELTA_1 ) ||
+                   ( CUR.sph_in_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ) )
+              goto Skip;
+
+            if ( !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) &&
+                  ( ( CUR.is_composite && CUR.GS.freeVector.y != 0 ) ||
+                    ( CUR.zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y )   ||
+                    ( CUR.sph_tweak_flags & SPH_TWEAK_DO_SHPIX )     )   )
+              MOVE_Zp2_Point( point, 0, dy, TRUE );
+
+            /* save new point */
+            if ( CUR.GS.freeVector.y != 0 )
+            {
+              B2 = CUR.zp2.cur[point].y;
+
+              /* reverse any disallowed moves */
+              if ( ( B1 & 63 ) == 0 &&
+                   ( B2 & 63 ) != 0 &&
+                   B1 != B2         )
+                MOVE_Zp2_Point( point, 0, -dy, TRUE );
+            }
+          }
+          else if ( CUR.sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL )
+            MOVE_Zp2_Point( point, dx, dy, TRUE );
+        }
+        else
+          MOVE_Zp2_Point( point, dx, dy, TRUE );
+      }
+
+    Skip:
+
+#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
         MOVE_Zp2_Point( point, dx, dy, TRUE );
 
         MOVE_Zp2_Point( point, dx, dy, TRUE );
 
+#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
       CUR.GS.loop--;
     }
 
       CUR.GS.loop--;
     }
 
+  Fail:
     CUR.GS.loop = 1;
     CUR.new_top = CUR.args;
   }
     CUR.GS.loop = 1;
     CUR.new_top = CUR.args;
   }
     FT_UShort   point;
     FT_F26Dot6  distance;
 
     FT_UShort   point;
     FT_F26Dot6  distance;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    FT_F26Dot6  control_value_cutin = 0; /* pacify compiler */
+
+
+    if ( SUBPIXEL_HINTING )
+    {
+      control_value_cutin = CUR.GS.control_value_cutin;
+
+      if ( CUR.ignore_x_mode                                 &&
+           CUR.GS.freeVector.x != 0                          &&
+           !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
+        control_value_cutin = 0;
+    }
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
 
     point = (FT_UShort)args[0];
 
 
     point = (FT_UShort)args[0];
 
          BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
          BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
-    /* XXX: UNDOCUMENTED! behaviour */
-    if ( CUR.GS.gep1 == 0 )   /* if the point that is to be moved */
-                              /* is in twilight zone              */
+    /* UNDOCUMENTED!  The MS rasterizer does that with */
+    /* twilight points (confirmed by Greg Hitchcock)   */
+    if ( CUR.GS.gep1 == 0 )
     {
       CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0];
       CUR_Func_move_orig( &CUR.zp1, point, args[1] );
     {
       CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0];
       CUR_Func_move_orig( &CUR.zp1, point, args[1] );
     distance = CUR_Func_project( CUR.zp1.cur + point,
                                  CUR.zp0.cur + CUR.GS.rp0 );
 
     distance = CUR_Func_project( CUR.zp1.cur + point,
                                  CUR.zp0.cur + CUR.GS.rp0 );
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    /* subpixel hinting - make MSIRP respect CVT cut-in; */
+    if ( SUBPIXEL_HINTING                                    &&
+         CUR.ignore_x_mode                                   &&
+         CUR.GS.freeVector.x != 0                            &&
+         FT_ABS( distance - args[1] ) >= control_value_cutin )
+      distance = args[1];
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     CUR_Func_move( &CUR.zp1, point, args[1] - distance );
 
     CUR.GS.rp1 = CUR.GS.rp0;
     CUR_Func_move( &CUR.zp1, point, args[1] - distance );
 
     CUR.GS.rp1 = CUR.GS.rp0;
   Ins_MDAP( INS_ARG )
   {
     FT_UShort   point;
   Ins_MDAP( INS_ARG )
   {
     FT_UShort   point;
-    FT_F26Dot6  cur_dist,
-                distance;
+    FT_F26Dot6  cur_dist;
+    FT_F26Dot6  distance;
 
 
     point = (FT_UShort)args[0];
 
 
     point = (FT_UShort)args[0];
     if ( BOUNDS( point, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
     if ( BOUNDS( point, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
-    /* XXX: Is there some undocumented feature while in the */
-    /*      twilight zone? ?                                */
     if ( ( CUR.opcode & 1 ) != 0 )
     {
       cur_dist = CUR_fast_project( &CUR.zp0.cur[point] );
     if ( ( CUR.opcode & 1 ) != 0 )
     {
       cur_dist = CUR_fast_project( &CUR.zp0.cur[point] );
-      distance = CUR_Func_round( cur_dist,
-                                 CUR.tt_metrics.compensations[0] ) - cur_dist;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      if ( SUBPIXEL_HINTING         &&
+           CUR.ignore_x_mode        &&
+           CUR.GS.freeVector.x != 0 )
+        distance = ROUND_None(
+                     cur_dist,
+                     CUR.tt_metrics.compensations[0] ) - cur_dist;
+      else
+#endif
+        distance = CUR_Func_round(
+                     cur_dist,
+                     CUR.tt_metrics.compensations[0] ) - cur_dist;
     }
     else
       distance = 0;
     }
     else
       distance = 0;
   {
     FT_ULong    cvtEntry;
     FT_UShort   point;
   {
     FT_ULong    cvtEntry;
     FT_UShort   point;
-    FT_F26Dot6  distance,
-                org_dist;
+    FT_F26Dot6  distance;
+    FT_F26Dot6  org_dist;
+    FT_F26Dot6  control_value_cutin;
+
 
 
+    control_value_cutin = CUR.GS.control_value_cutin;
+    cvtEntry            = (FT_ULong)args[1];
+    point               = (FT_UShort)args[0];
 
 
-    cvtEntry = (FT_ULong)args[1];
-    point    = (FT_UShort)args[0];
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING                                  &&
+         CUR.ignore_x_mode                                 &&
+         CUR.GS.freeVector.x != 0                          &&
+         CUR.GS.freeVector.y == 0                          &&
+         !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
+      control_value_cutin = 0;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
 
     if ( BOUNDS( point,     CUR.zp0.n_points ) ||
          BOUNDSL( cvtEntry, CUR.cvtSize )      )
     {
       if ( CUR.pedantic_hinting )
 
     if ( BOUNDS( point,     CUR.zp0.n_points ) ||
          BOUNDSL( cvtEntry, CUR.cvtSize )      )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
-      return;
+        CUR.error = FT_THROW( Invalid_Reference );
+      goto Fail;
     }
 
     }
 
-    /* XXX: UNDOCUMENTED!                                */
-    /*                                                   */
-    /* The behaviour of an MIAP instruction is quite     */
-    /* different when used in the twilight zone.         */
-    /*                                                   */
-    /* First, no control value cut-in test is performed  */
-    /* as it would fail anyway.  Second, the original    */
-    /* point, i.e. (org_x,org_y) of zp0.point, is set    */
-    /* to the absolute, unrounded distance found in      */
-    /* the CVT.                                          */
-    /*                                                   */
-    /* This is used in the CVT programs of the Microsoft */
-    /* fonts Arial, Times, etc., in order to re-adjust   */
-    /* some key font heights.  It allows the use of the  */
-    /* IP instruction in the twilight zone, which        */
-    /* otherwise would be `illegal' according to the     */
-    /* specification.                                    */
-    /*                                                   */
-    /* We implement it with a special sequence for the   */
-    /* twilight zone.  This is a bad hack, but it seems  */
-    /* to work.                                          */
+    /* UNDOCUMENTED!                                                      */
+    /*                                                                    */
+    /* The behaviour of an MIAP instruction is quite different when used  */
+    /* in the twilight zone.                                              */
+    /*                                                                    */
+    /* First, no control value cut-in test is performed as it would fail  */
+    /* anyway.  Second, the original point, i.e. (org_x,org_y) of         */
+    /* zp0.point, is set to the absolute, unrounded distance found in the */
+    /* CVT.                                                               */
+    /*                                                                    */
+    /* This is used in the CVT programs of the Microsoft fonts Arial,     */
+    /* Times, etc., in order to re-adjust some key font heights.  It      */
+    /* allows the use of the IP instruction in the twilight zone, which   */
+    /* otherwise would be invalid according to the specification.         */
+    /*                                                                    */
+    /* We implement it with a special sequence for the twilight zone.     */
+    /* This is a bad hack, but it seems to work.                          */
+    /*                                                                    */
+    /* Confirmed by Greg Hitchcock.                                       */
 
     distance = CUR_Func_read_cvt( cvtEntry );
 
     if ( CUR.GS.gep0 == 0 )   /* If in twilight zone */
     {
 
     distance = CUR_Func_read_cvt( cvtEntry );
 
     if ( CUR.GS.gep0 == 0 )   /* If in twilight zone */
     {
-      CUR.zp0.org[point].x = TT_MulFix14( (FT_UInt32)distance, CUR.GS.freeVector.x );
-      CUR.zp0.org[point].y = TT_MulFix14( (FT_UInt32)distance, CUR.GS.freeVector.y ),
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      /* Only adjust if not in sph_compatibility_mode or ignore_x_mode. */
+      /* Determined via experimentation and may be incorrect...         */
+      if ( !SUBPIXEL_HINTING                     ||
+           ( !CUR.ignore_x_mode                ||
+             !CUR.face->sph_compatibility_mode ) )
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+        CUR.zp0.org[point].x = TT_MulFix14( (FT_UInt32)distance,
+                                            CUR.GS.freeVector.x );
+      CUR.zp0.org[point].y = TT_MulFix14( (FT_UInt32)distance,
+                                          CUR.GS.freeVector.y ),
       CUR.zp0.cur[point]   = CUR.zp0.org[point];
     }
       CUR.zp0.cur[point]   = CUR.zp0.org[point];
     }
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING                              &&
+         CUR.ignore_x_mode                             &&
+         ( CUR.sph_tweak_flags & SPH_TWEAK_MIAP_HACK ) &&
+         distance > 0                                  &&
+         CUR.GS.freeVector.y != 0                      )
+      distance = 0;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
 
     org_dist = CUR_fast_project( &CUR.zp0.cur[point] );
 
 
     org_dist = CUR_fast_project( &CUR.zp0.cur[point] );
 
-    if ( ( CUR.opcode & 1 ) != 0 )   /* rounding and control cutin flag */
+    if ( ( CUR.opcode & 1 ) != 0 )   /* rounding and control cut-in flag */
     {
     {
-      if ( FT_ABS( distance - org_dist ) > CUR.GS.control_value_cutin )
+      if ( FT_ABS( distance - org_dist ) > control_value_cutin )
         distance = org_dist;
 
         distance = org_dist;
 
-      distance = CUR_Func_round( distance, CUR.tt_metrics.compensations[0] );
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      if ( SUBPIXEL_HINTING         &&
+           CUR.ignore_x_mode        &&
+           CUR.GS.freeVector.x != 0 )
+        distance = ROUND_None( distance,
+                               CUR.tt_metrics.compensations[0] );
+      else
+#endif
+        distance = CUR_Func_round( distance,
+                                   CUR.tt_metrics.compensations[0] );
     }
 
     CUR_Func_move( &CUR.zp0, point, distance - org_dist );
 
     }
 
     CUR_Func_move( &CUR.zp0, point, distance - org_dist );
 
+  Fail:
     CUR.GS.rp0 = point;
     CUR.GS.rp1 = point;
   }
     CUR.GS.rp0 = point;
     CUR.GS.rp1 = point;
   }
   Ins_MDRP( INS_ARG )
   {
     FT_UShort   point;
   Ins_MDRP( INS_ARG )
   {
     FT_UShort   point;
-    FT_F26Dot6  org_dist, distance;
+    FT_F26Dot6  org_dist, distance, minimum_distance;
+
+
+    minimum_distance = CUR.GS.minimum_distance;
 
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING                                  &&
+         CUR.ignore_x_mode                                 &&
+         CUR.GS.freeVector.x != 0                          &&
+         !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
+      minimum_distance = 0;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
 
     point = (FT_UShort)args[0];
 
 
     point = (FT_UShort)args[0];
 
          BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
          BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
-      return;
+        CUR.error = FT_THROW( Invalid_Reference );
+      goto Fail;
     }
 
     /* XXX: Is there some undocumented feature while in the */
     }
 
     /* XXX: Is there some undocumented feature while in the */
       {
         /* this should be faster */
         org_dist = CUR_Func_dualproj( vec1, vec2 );
       {
         /* this should be faster */
         org_dist = CUR_Func_dualproj( vec1, vec2 );
-        org_dist = TT_MULFIX( org_dist, CUR.metrics.x_scale );
+        org_dist = FT_MulFix( org_dist, CUR.metrics.x_scale );
       }
       else
       {
         FT_Vector  vec;
 
 
       }
       else
       {
         FT_Vector  vec;
 
 
-        vec.x = TT_MULFIX( vec1->x - vec2->x, CUR.metrics.x_scale );
-        vec.y = TT_MULFIX( vec1->y - vec2->y, CUR.metrics.y_scale );
+        vec.x = FT_MulFix( vec1->x - vec2->x, CUR.metrics.x_scale );
+        vec.y = FT_MulFix( vec1->y - vec2->y, CUR.metrics.y_scale );
 
         org_dist = CUR_fast_dualproj( &vec );
       }
 
         org_dist = CUR_fast_dualproj( &vec );
       }
     /* round flag */
 
     if ( ( CUR.opcode & 4 ) != 0 )
     /* round flag */
 
     if ( ( CUR.opcode & 4 ) != 0 )
+    {
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      if ( SUBPIXEL_HINTING         &&
+           CUR.ignore_x_mode        &&
+           CUR.GS.freeVector.x != 0 )
+        distance = ROUND_None(
+                     org_dist,
+                     CUR.tt_metrics.compensations[CUR.opcode & 3] );
+      else
+#endif
       distance = CUR_Func_round(
                    org_dist,
                    CUR.tt_metrics.compensations[CUR.opcode & 3] );
       distance = CUR_Func_round(
                    org_dist,
                    CUR.tt_metrics.compensations[CUR.opcode & 3] );
+    }
     else
       distance = ROUND_None(
                    org_dist,
     else
       distance = ROUND_None(
                    org_dist,
     {
       if ( org_dist >= 0 )
       {
     {
       if ( org_dist >= 0 )
       {
-        if ( distance < CUR.GS.minimum_distance )
-          distance = CUR.GS.minimum_distance;
+        if ( distance < minimum_distance )
+          distance = minimum_distance;
       }
       else
       {
       }
       else
       {
-        if ( distance > -CUR.GS.minimum_distance )
-          distance = -CUR.GS.minimum_distance;
+        if ( distance > -minimum_distance )
+          distance = -minimum_distance;
       }
     }
 
       }
     }
 
 
     CUR_Func_move( &CUR.zp1, point, distance - org_dist );
 
 
     CUR_Func_move( &CUR.zp1, point, distance - org_dist );
 
+  Fail:
     CUR.GS.rp1 = CUR.GS.rp0;
     CUR.GS.rp2 = point;
 
     CUR.GS.rp1 = CUR.GS.rp0;
     CUR.GS.rp2 = point;
 
     FT_F26Dot6  cvt_dist,
                 distance,
                 cur_dist,
     FT_F26Dot6  cvt_dist,
                 distance,
                 cur_dist,
-                org_dist;
-
-
-    point    = (FT_UShort)args[0];
-    cvtEntry = (FT_ULong)( args[1] + 1 );
+                org_dist,
+                control_value_cutin,
+                minimum_distance;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    FT_Int      B1           = 0; /* pacify compiler */
+    FT_Int      B2           = 0;
+    FT_Bool     reverse_move = FALSE;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+
+    minimum_distance    = CUR.GS.minimum_distance;
+    control_value_cutin = CUR.GS.control_value_cutin;
+    point               = (FT_UShort)args[0];
+    cvtEntry            = (FT_ULong)( args[1] + 1 );
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING                                  &&
+         CUR.ignore_x_mode                                 &&
+         CUR.GS.freeVector.x != 0                          &&
+         !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
+      control_value_cutin = minimum_distance = 0;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
 
     /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */
 
 
     /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */
 
          BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
          BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
-      return;
+        CUR.error = FT_THROW( Invalid_Reference );
+      goto Fail;
     }
 
     if ( !cvtEntry )
     }
 
     if ( !cvtEntry )
         cvt_dist = -CUR.GS.single_width_value;
     }
 
         cvt_dist = -CUR.GS.single_width_value;
     }
 
-    /* XXX: UNDOCUMENTED! -- twilight zone */
-
+    /* UNDOCUMENTED!  The MS rasterizer does that with */
+    /* twilight points (confirmed by Greg Hitchcock)   */
     if ( CUR.GS.gep1 == 0 )
     {
       CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x +
                              TT_MulFix14( (FT_UInt32)cvt_dist,
                                           CUR.GS.freeVector.x );
     if ( CUR.GS.gep1 == 0 )
     {
       CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x +
                              TT_MulFix14( (FT_UInt32)cvt_dist,
                                           CUR.GS.freeVector.x );
-
       CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y +
                              TT_MulFix14( (FT_UInt32)cvt_dist,
                                           CUR.GS.freeVector.y );
       CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y +
                              TT_MulFix14( (FT_UInt32)cvt_dist,
                                           CUR.GS.freeVector.y );
-
-      CUR.zp1.cur[point] = CUR.zp0.cur[point];
+      CUR.zp1.cur[point]   = CUR.zp1.org[point];
     }
 
     org_dist = CUR_Func_dualproj( &CUR.zp1.org[point],
     }
 
     org_dist = CUR_Func_dualproj( &CUR.zp1.org[point],
         cvt_dist = -cvt_dist;
     }
 
         cvt_dist = -cvt_dist;
     }
 
-    /* control value cutin and round */
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING                                         &&
+         CUR.ignore_x_mode                                        &&
+         CUR.GS.freeVector.y != 0                                 &&
+         ( CUR.sph_tweak_flags & SPH_TWEAK_TIMES_NEW_ROMAN_HACK ) )
+    {
+      if ( cur_dist < -64 )
+        cvt_dist -= 16;
+      else if ( cur_dist > 64 && cur_dist < 84 )
+        cvt_dist += 32;
+    }
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+    /* control value cut-in and round */
 
     if ( ( CUR.opcode & 4 ) != 0 )
     {
 
     if ( ( CUR.opcode & 4 ) != 0 )
     {
       /*      refer to the same zone.                                  */
 
       if ( CUR.GS.gep0 == CUR.GS.gep1 )
       /*      refer to the same zone.                                  */
 
       if ( CUR.GS.gep0 == CUR.GS.gep1 )
-        if ( FT_ABS( cvt_dist - org_dist ) >= CUR.GS.control_value_cutin )
+      {
+        /* XXX: According to Greg Hitchcock, the following wording is */
+        /*      the right one:                                        */
+        /*                                                            */
+        /*        When the absolute difference between the value in   */
+        /*        the table [CVT] and the measurement directly from   */
+        /*        the outline is _greater_ than the cut_in value, the */
+        /*        outline measurement is used.                        */
+        /*                                                            */
+        /*      This is from `instgly.doc'.  The description in       */
+        /*      `ttinst2.doc', version 1.66, is thus incorrect since  */
+        /*      it implies `>=' instead of `>'.                       */
+
+        if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin )
           cvt_dist = org_dist;
           cvt_dist = org_dist;
+      }
 
       distance = CUR_Func_round(
                    cvt_dist,
                    CUR.tt_metrics.compensations[CUR.opcode & 3] );
     }
     else
 
       distance = CUR_Func_round(
                    cvt_dist,
                    CUR.tt_metrics.compensations[CUR.opcode & 3] );
     }
     else
+    {
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+      /* do cvt cut-in always in MIRP for sph */
+      if ( SUBPIXEL_HINTING           &&
+           CUR.ignore_x_mode          &&
+           CUR.GS.gep0 == CUR.GS.gep1 )
+      {
+        if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin )
+          cvt_dist = org_dist;
+      }
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
       distance = ROUND_None(
                    cvt_dist,
                    CUR.tt_metrics.compensations[CUR.opcode & 3] );
       distance = ROUND_None(
                    cvt_dist,
                    CUR.tt_metrics.compensations[CUR.opcode & 3] );
+    }
 
     /* minimum distance test */
 
 
     /* minimum distance test */
 
     {
       if ( org_dist >= 0 )
       {
     {
       if ( org_dist >= 0 )
       {
-        if ( distance < CUR.GS.minimum_distance )
-          distance = CUR.GS.minimum_distance;
+        if ( distance < minimum_distance )
+          distance = minimum_distance;
       }
       else
       {
       }
       else
       {
-        if ( distance > -CUR.GS.minimum_distance )
-          distance = -CUR.GS.minimum_distance;
+        if ( distance > -minimum_distance )
+          distance = -minimum_distance;
       }
     }
 
       }
     }
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING )
+    {
+      B1 = CUR.zp1.cur[point].y;
+
+      /* Round moves if necessary */
+      if ( CUR.ignore_x_mode                                          &&
+           CUR.GS.freeVector.y != 0                                   &&
+           ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) )
+        distance = FT_PIX_ROUND( B1 + distance - cur_dist ) - B1 + cur_dist;
+
+      if ( CUR.ignore_x_mode                                      &&
+           CUR.GS.freeVector.y != 0                               &&
+           ( CUR.opcode & 16 ) == 0                               &&
+           ( CUR.opcode & 8 ) == 0                                &&
+           ( CUR.sph_tweak_flags & SPH_TWEAK_COURIER_NEW_2_HACK ) )
+        distance += 64;
+    }
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     CUR_Func_move( &CUR.zp1, point, distance - cur_dist );
 
     CUR_Func_move( &CUR.zp1, point, distance - cur_dist );
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING )
+    {
+      B2 = CUR.zp1.cur[point].y;
+
+      /* Reverse move if necessary */
+      if ( CUR.ignore_x_mode )
+      {
+        if ( CUR.face->sph_compatibility_mode                          &&
+             CUR.GS.freeVector.y != 0                                  &&
+             ( B1 & 63 ) == 0                                          &&
+             ( B2 & 63 ) != 0                                          )
+          reverse_move = TRUE;
+
+        if ( ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&
+             CUR.GS.freeVector.y != 0                                  &&
+             ( B2 & 63 ) != 0                                          &&
+             ( B1 & 63 ) != 0                                          )
+          reverse_move = TRUE;
+      }
+
+      if ( reverse_move )
+        CUR_Func_move( &CUR.zp1, point, -( distance - cur_dist ) );
+    }
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+  Fail:
     CUR.GS.rp1 = CUR.GS.rp0;
 
     if ( ( CUR.opcode & 16 ) != 0 )
       CUR.GS.rp0 = point;
 
     CUR.GS.rp1 = CUR.GS.rp0;
 
     if ( ( CUR.opcode & 16 ) != 0 )
       CUR.GS.rp0 = point;
 
-    /* XXX: UNDOCUMENTED! */
     CUR.GS.rp2 = point;
   }
 
     CUR.GS.rp2 = point;
   }
 
     FT_UNUSED_ARG;
 
 
     FT_UNUSED_ARG;
 
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING                                         &&
+         CUR.ignore_x_mode                                        &&
+         CUR.iup_called                                           &&
+         ( CUR.sph_tweak_flags & SPH_TWEAK_NO_ALIGNRP_AFTER_IUP ) )
+    {
+      CUR.error = FT_THROW( Invalid_Reference );
+      goto Fail;
+    }
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     if ( CUR.top < CUR.GS.loop ||
          BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
     if ( CUR.top < CUR.GS.loop ||
          BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
-      return;
+        CUR.error = FT_THROW( Invalid_Reference );
+      goto Fail;
     }
 
     while ( CUR.GS.loop > 0 )
     }
 
     while ( CUR.GS.loop > 0 )
       {
         if ( CUR.pedantic_hinting )
         {
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
       }
           return;
         }
       }
       CUR.GS.loop--;
     }
 
       CUR.GS.loop--;
     }
 
+  Fail:
     CUR.GS.loop = 1;
     CUR.new_top = CUR.args;
   }
     CUR.GS.loop = 1;
     CUR.new_top = CUR.args;
   }
                 a0, a1,
                 b0, b1;
 
                 a0, a1,
                 b0, b1;
 
-    FT_F26Dot6  discriminant;
+    FT_F26Dot6  discriminant, dotproduct;
 
     FT_F26Dot6  dx,  dy,
                 dax, day,
 
     FT_F26Dot6  dx,  dy,
                 dax, day,
          BOUNDS( point, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
          BOUNDS( point, CUR.zp2.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
+    /* Cramer's rule */
+
     dbx = CUR.zp0.cur[b1].x - CUR.zp0.cur[b0].x;
     dby = CUR.zp0.cur[b1].y - CUR.zp0.cur[b0].y;
 
     dbx = CUR.zp0.cur[b1].x - CUR.zp0.cur[b0].x;
     dby = CUR.zp0.cur[b1].y - CUR.zp0.cur[b0].y;
 
 
     CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_BOTH;
 
 
     CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_BOTH;
 
-    discriminant = TT_MULDIV( dax, -dby, 0x40 ) +
-                   TT_MULDIV( day, dbx, 0x40 );
+    discriminant = FT_MulDiv( dax, -dby, 0x40 ) +
+                   FT_MulDiv( day, dbx, 0x40 );
+    dotproduct   = FT_MulDiv( dax, dbx, 0x40 ) +
+                   FT_MulDiv( day, dby, 0x40 );
 
 
-    if ( FT_ABS( discriminant ) >= 0x40 )
+    /* The discriminant above is actually a cross product of vectors     */
+    /* da and db. Together with the dot product, they can be used as     */
+    /* surrogates for sine and cosine of the angle between the vectors.  */
+    /* Indeed,                                                           */
+    /*       dotproduct   = |da||db|cos(angle)                           */
+    /*       discriminant = |da||db|sin(angle)     .                     */
+    /* We use these equations to reject grazing intersections by         */
+    /* thresholding abs(tan(angle)) at 1/19, corresponding to 3 degrees. */
+    if ( 19 * FT_ABS( discriminant ) > FT_ABS( dotproduct ) )
     {
     {
-      val = TT_MULDIV( dx, -dby, 0x40 ) + TT_MULDIV( dy, dbx, 0x40 );
+      val = FT_MulDiv( dx, -dby, 0x40 ) + FT_MulDiv( dy, dbx, 0x40 );
 
 
-      R.x = TT_MULDIV( val, dax, discriminant );
-      R.y = TT_MULDIV( val, day, discriminant );
+      R.x = FT_MulDiv( val, dax, discriminant );
+      R.y = FT_MulDiv( val, day, discriminant );
 
       CUR.zp2.cur[point].x = CUR.zp1.cur[a0].x + R.x;
       CUR.zp2.cur[point].y = CUR.zp1.cur[a0].y + R.y;
 
       CUR.zp2.cur[point].x = CUR.zp1.cur[a0].x + R.x;
       CUR.zp2.cur[point].y = CUR.zp1.cur[a0].y + R.y;
          BOUNDS( p2, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
          BOUNDS( p2, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
 
     if ( CUR.top < CUR.GS.loop )
     {
 
     if ( CUR.top < CUR.GS.loop )
     {
-      CUR.error = TT_Err_Invalid_Reference;
-      return;
+      if ( CUR.pedantic_hinting )
+        CUR.error = FT_THROW( Invalid_Reference );
+      goto Fail;
     }
 
     /*
     }
 
     /*
     if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
     if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
-      return;
+        CUR.error = FT_THROW( Invalid_Reference );
+      goto Fail;
     }
 
     if ( twilight )
     }
 
     if ( twilight )
       if ( twilight )
         old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2],
                                        orus_base );
       if ( twilight )
         old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2],
                                        orus_base );
-      else
+      else if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
         old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2],
                                        orus_base );
         old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2],
                                        orus_base );
+      else
+      {
+        FT_Vector  vec;
+
+
+        vec.x = FT_MulFix( CUR.zp1.orus[CUR.GS.rp2].x - orus_base->x,
+                           CUR.metrics.x_scale );
+        vec.y = FT_MulFix( CUR.zp1.orus[CUR.GS.rp2].y - orus_base->y,
+                           CUR.metrics.y_scale );
+
+        old_range = CUR_fast_dualproj( &vec );
+      }
 
       cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base );
     }
 
       cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base );
     }
       {
         if ( CUR.pedantic_hinting )
         {
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
         continue;
           return;
         }
         continue;
 
       if ( twilight )
         org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base );
 
       if ( twilight )
         org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base );
-      else
+      else if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
         org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base );
         org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base );
+      else
+      {
+        FT_Vector  vec;
+
+
+        vec.x = FT_MulFix( CUR.zp2.orus[point].x - orus_base->x,
+                           CUR.metrics.x_scale );
+        vec.y = FT_MulFix( CUR.zp2.orus[point].y - orus_base->y,
+                           CUR.metrics.y_scale );
+
+        org_dist = CUR_fast_dualproj( &vec );
+      }
 
       cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base );
 
       if ( org_dist )
 
       cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base );
 
       if ( org_dist )
-        new_dist = ( old_range != 0 )
-                     ? TT_MULDIV( org_dist, cur_range, old_range )
-                     : cur_dist;
+      {
+        if ( old_range )
+          new_dist = FT_MulDiv( org_dist, cur_range, old_range );
+        else
+        {
+          /* This is the same as what MS does for the invalid case:  */
+          /*                                                         */
+          /*   delta = (Original_Pt - Original_RP1) -                */
+          /*           (Current_Pt - Current_RP1)                    */
+          /*                                                         */
+          /* In FreeType speak:                                      */
+          /*                                                         */
+          /*   new_dist = cur_dist -                                 */
+          /*              org_dist - cur_dist;                       */
+
+          new_dist = -org_dist;
+        }
+      }
       else
         new_dist = 0;
 
       CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist );
     }
       else
         new_dist = 0;
 
       CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist );
     }
+
+  Fail:
     CUR.GS.loop = 1;
     CUR.new_top = CUR.args;
   }
     CUR.GS.loop = 1;
     CUR.new_top = CUR.args;
   }
     if ( BOUNDS( point, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
     if ( BOUNDS( point, CUR.zp0.n_points ) )
     {
       if ( CUR.pedantic_hinting )
-        CUR.error = TT_Err_Invalid_Reference;
+        CUR.error = FT_THROW( Invalid_Reference );
       return;
     }
 
       return;
     }
 
           if ( !scale_valid )
           {
             scale_valid = 1;
           if ( !scale_valid )
           {
             scale_valid = 1;
-            scale       = TT_MULDIV( org2 + delta2 - ( org1 + delta1 ),
-                                     0x10000L, orus2 - orus1 );
+            scale       = FT_DivFix( org2 + delta2 - ( org1 + delta1 ),
+                                     orus2 - orus1 );
           }
 
           x = ( org1 + delta1 ) +
           }
 
           x = ( org1 + delta1 ) +
-              TT_MULFIX( worker->orus[i].x - orus1, scale );
+              FT_MulFix( worker->orus[i].x - orus1, scale );
         }
         worker->curs[i].x = x;
       }
         }
         worker->curs[i].x = x;
       }
     contour = 0;
     point   = 0;
 
     contour = 0;
     point   = 0;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    if ( SUBPIXEL_HINTING  &&
+         CUR.ignore_x_mode )
+    {
+      CUR.iup_called = TRUE;
+      if ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_IUP )
+        return;
+    }
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     do
     {
       end_point   = CUR.pts.contours[contour] - CUR.pts.first_point;
     do
     {
       end_point   = CUR.pts.contours[contour] - CUR.pts.first_point;
     FT_UShort  A;
     FT_ULong   C;
     FT_Long    B;
     FT_UShort  A;
     FT_ULong   C;
     FT_Long    B;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    FT_UShort  B1, B2;
+
+
+    if ( SUBPIXEL_HINTING                                        &&
+         CUR.ignore_x_mode                                       &&
+         CUR.iup_called                                          &&
+         ( CUR.sph_tweak_flags & SPH_TWEAK_NO_DELTAP_AFTER_IUP ) )
+      goto Fail;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
 
 
 #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
 
 
 #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
 
       if ( CUR.args < n )
       {
 
       if ( CUR.args < n )
       {
-        CUR.error = TT_Err_Too_Few_Arguments;
-        return;
+        if ( CUR.pedantic_hinting )
+          CUR.error = FT_THROW( Too_Few_Arguments );
+        n = CUR.args;
       }
 
       CUR.args -= n;
       }
 
       CUR.args -= n;
     {
       if ( CUR.args < 2 )
       {
     {
       if ( CUR.args < 2 )
       {
-        CUR.error = TT_Err_Too_Few_Arguments;
-        return;
+        if ( CUR.pedantic_hinting )
+          CUR.error = FT_THROW( Too_Few_Arguments );
+        CUR.args = 0;
+        goto Fail;
       }
 
       CUR.args -= 2;
       }
 
       CUR.args -= 2;
             B++;
           B = B * 64 / ( 1L << CUR.GS.delta_shift );
 
             B++;
           B = B * 64 / ( 1L << CUR.GS.delta_shift );
 
-          CUR_Func_move( &CUR.zp0, A, B );
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+          if ( SUBPIXEL_HINTING )
+          {
+            /*
+             *  Allow delta move if
+             *
+             *  - not using ignore_x_mode rendering
+             *  - glyph is specifically set to allow it
+             *  - glyph is composite and freedom vector is not subpixel
+             *    vector
+             */
+            if ( !CUR.ignore_x_mode                                   ||
+                 ( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_DO_DELTAP ) ||
+                 ( CUR.is_composite && CUR.GS.freeVector.y != 0 )     )
+              CUR_Func_move( &CUR.zp0, A, B );
+
+            /* Otherwise apply subpixel hinting and */
+            /* compatibility mode rules             */
+            else if ( CUR.ignore_x_mode )
+            {
+              if ( CUR.GS.freeVector.y != 0 )
+                B1 = CUR.zp0.cur[A].y;
+              else
+                B1 = CUR.zp0.cur[A].x;
+
+#if 0
+              /* Standard Subpixel Hinting: Allow y move.       */
+              /* This messes up dejavu and may not be needed... */
+              if ( !CUR.face->sph_compatibility_mode &&
+                   CUR.GS.freeVector.y != 0          )
+                CUR_Func_move( &CUR.zp0, A, B );
+              else
+#endif /* 0 */
+
+              /* Compatibility Mode: Allow x or y move if point touched in */
+              /* Y direction.                                              */
+              if ( CUR.face->sph_compatibility_mode                      &&
+                   !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) )
+              {
+                /* save the y value of the point now; compare after move */
+                B1 = CUR.zp0.cur[A].y;
+
+                if ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
+                  B = FT_PIX_ROUND( B1 + B ) - B1;
+
+                /* Allow delta move if using sph_compatibility_mode,   */
+                /* IUP has not been called, and point is touched on Y. */
+                if ( !CUR.iup_called                            &&
+                     ( CUR.zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
+                  CUR_Func_move( &CUR.zp0, A, B );
+              }
+
+              B2 = CUR.zp0.cur[A].y;
+
+              /* Reverse this move if it results in a disallowed move */
+              if ( CUR.GS.freeVector.y != 0                           &&
+                   ( ( CUR.face->sph_compatibility_mode           &&
+                       ( B1 & 63 ) == 0                           &&
+                       ( B2 & 63 ) != 0                           ) ||
+                     ( ( CUR.sph_tweak_flags                    &
+                         SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP ) &&
+                       ( B1 & 63 ) != 0                           &&
+                       ( B2 & 63 ) != 0                           ) ) )
+                CUR_Func_move( &CUR.zp0, A, -B );
+            }
+          }
+          else
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+            CUR_Func_move( &CUR.zp0, A, B );
         }
       }
       else
         if ( CUR.pedantic_hinting )
         }
       }
       else
         if ( CUR.pedantic_hinting )
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
     }
 
     }
 
+  Fail:
     CUR.new_top = CUR.args;
   }
 
     CUR.new_top = CUR.args;
   }
 
 
       if ( CUR.args < n )
       {
 
       if ( CUR.args < n )
       {
-        CUR.error = TT_Err_Too_Few_Arguments;
-        return;
+        if ( CUR.pedantic_hinting )
+          CUR.error = FT_THROW( Too_Few_Arguments );
+        n = CUR.args;
       }
 
       CUR.args -= n;
       }
 
       CUR.args -= n;
     {
       if ( CUR.args < 2 )
       {
     {
       if ( CUR.args < 2 )
       {
-        CUR.error = TT_Err_Too_Few_Arguments;
-        return;
+        if ( CUR.pedantic_hinting )
+          CUR.error = FT_THROW( Too_Few_Arguments );
+        CUR.args = 0;
+        goto Fail;
       }
 
       CUR.args -= 2;
       }
 
       CUR.args -= 2;
       {
         if ( CUR.pedantic_hinting )
         {
       {
         if ( CUR.pedantic_hinting )
         {
-          CUR.error = TT_Err_Invalid_Reference;
+          CUR.error = FT_THROW( Invalid_Reference );
           return;
         }
       }
           return;
         }
       }
       }
     }
 
       }
     }
 
+  Fail:
     CUR.new_top = CUR.args;
   }
 
     CUR.new_top = CUR.args;
   }
 
 
     K = 0;
 
 
     K = 0;
 
-    /* We return MS rasterizer version 1.7 for the font scaler. */
-    if ( ( args[0] & 1 ) != 0 )
-      K = 35;
-
-    /* Has the glyph been rotated? */
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    /********************************/
+    /* RASTERIZER VERSION           */
+    /* Selector Bit:  0             */
+    /* Return Bit(s): 0-7           */
+    /*                              */
+    if ( SUBPIXEL_HINTING     &&
+         ( args[0] & 1 ) != 0 &&
+         CUR.ignore_x_mode    )
+    {
+      K = CUR.rasterizer_version;
+      FT_TRACE7(( "Setting rasterizer version %d\n",
+                  CUR.rasterizer_version ));
+    }
+    else
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+      if ( ( args[0] & 1 ) != 0 )
+        K = TT_INTERPRETER_VERSION_35;
+
+    /********************************/
+    /* GLYPH ROTATED                */
+    /* Selector Bit:  1             */
+    /* Return Bit(s): 8             */
+    /*                              */
     if ( ( args[0] & 2 ) != 0 && CUR.tt_metrics.rotated )
       K |= 0x80;
 
     if ( ( args[0] & 2 ) != 0 && CUR.tt_metrics.rotated )
       K |= 0x80;
 
-    /* Has the glyph been stretched? */
+    /********************************/
+    /* GLYPH STRETCHED              */
+    /* Selector Bit:  2             */
+    /* Return Bit(s): 9             */
+    /*                              */
     if ( ( args[0] & 4 ) != 0 && CUR.tt_metrics.stretched )
       K |= 1 << 8;
 
     if ( ( args[0] & 4 ) != 0 && CUR.tt_metrics.stretched )
       K |= 1 << 8;
 
-    /* Are we hinting for grayscale? */
+    /********************************/
+    /* HINTING FOR GRAYSCALE        */
+    /* Selector Bit:  5             */
+    /* Return Bit(s): 12            */
+    /*                              */
     if ( ( args[0] & 32 ) != 0 && CUR.grayscale )
       K |= 1 << 12;
 
     if ( ( args[0] & 32 ) != 0 && CUR.grayscale )
       K |= 1 << 12;
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+    if ( SUBPIXEL_HINTING                                    &&
+         CUR.ignore_x_mode                                   &&
+         CUR.rasterizer_version >= TT_INTERPRETER_VERSION_35 )
+    {
+      /********************************/
+      /* HINTING FOR GRAYSCALE        */
+      /* Selector Bit:  5             */
+      /* Return Bit(s): 12            */
+      /*                              */
+      if ( ( args[0] & 32 ) != 0 && CUR.grayscale_hinting )
+        K |= 1 << 12;
+
+      /********************************/
+      /* HINTING FOR SUBPIXEL         */
+      /* Selector Bit:  6             */
+      /* Return Bit(s): 13            */
+      /*                              */
+      if ( ( args[0] & 64 ) != 0        &&
+           CUR.subpixel_hinting         &&
+           CUR.rasterizer_version >= 37 )
+      {
+        K |= 1 << 13;
+
+        /* the stuff below is irrelevant if subpixel_hinting is not set */
+
+        /********************************/
+        /* COMPATIBLE WIDTHS ENABLED    */
+        /* Selector Bit:  7             */
+        /* Return Bit(s): 14            */
+        /*                              */
+        /* Functionality still needs to be added */
+        if ( ( args[0] & 128 ) != 0 && CUR.compatible_widths )
+          K |= 1 << 14;
+
+        /********************************/
+        /* SYMMETRICAL SMOOTHING        */
+        /* Selector Bit:  8             */
+        /* Return Bit(s): 15            */
+        /*                              */
+        /* Functionality still needs to be added */
+        if ( ( args[0] & 256 ) != 0 && CUR.symmetrical_smoothing )
+          K |= 1 << 15;
+
+        /********************************/
+        /* HINTING FOR BGR?             */
+        /* Selector Bit:  9             */
+        /* Return Bit(s): 16            */
+        /*                              */
+        /* Functionality still needs to be added */
+        if ( ( args[0] & 512 ) != 0 && CUR.bgr )
+          K |= 1 << 16;
+
+        if ( CUR.rasterizer_version >= 38 )
+        {
+          /********************************/
+          /* SUBPIXEL POSITIONED?         */
+          /* Selector Bit:  10            */
+          /* Return Bit(s): 17            */
+          /*                              */
+          /* Functionality still needs to be added */
+          if ( ( args[0] & 1024 ) != 0 && CUR.subpixel_positioned )
+            K |= 1 << 17;
+        }
+      }
+    }
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     args[0] = K;
   }
 
     args[0] = K;
   }
 
 
         if ( CUR.callTop >= CUR.callSize )
         {
 
         if ( CUR.callTop >= CUR.callSize )
         {
-          CUR.error = TT_Err_Stack_Overflow;
+          CUR.error = FT_THROW( Stack_Overflow );
           return;
         }
 
           return;
         }
 
         call->Caller_IP    = CUR.IP + 1;
         call->Cur_Count    = 1;
         call->Cur_Restart  = def->start;
         call->Caller_IP    = CUR.IP + 1;
         call->Cur_Count    = 1;
         call->Cur_Restart  = def->start;
+        call->Cur_End      = def->end;
 
         INS_Goto_CodeRange( def->range, def->start );
 
 
         INS_Goto_CodeRange( def->range, def->start );
 
       }
     }
 
       }
     }
 
-    CUR.error = TT_Err_Invalid_Opcode;
+    CUR.error = FT_THROW( Invalid_Opcode );
   }
 
 
   }
 
 
   FT_EXPORT_DEF( FT_Error )
   TT_RunIns( TT_ExecContext  exc )
   {
   FT_EXPORT_DEF( FT_Error )
   TT_RunIns( TT_ExecContext  exc )
   {
-    FT_Long  ins_counter = 0;  /* executed instructions counter */
+    FT_Long    ins_counter = 0;  /* executed instructions counter */
+    FT_UShort  i;
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    FT_Byte    opcode_pattern[1][2] = {
+                  /* #8 TypeMan Talk Align */
+                  {
+                    0x06, /* SPVTL   */
+                    0x7D, /* RDTG    */
+                  },
+                };
+    FT_UShort  opcode_patterns   = 1;
+    FT_UShort  opcode_pointer[1] = { 0 };
+    FT_UShort  opcode_size[1]    = { 1 };
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
 
 
 #ifdef TT_CONFIG_OPTION_STATIC_RASTER
     cur = *exc;
 #endif
 
 
 
 #ifdef TT_CONFIG_OPTION_STATIC_RASTER
     cur = *exc;
 #endif
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    CUR.iup_called = FALSE;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
     /* set CVT functions */
     CUR.tt_metrics.ratio = 0;
     if ( CUR.metrics.x_ppem != CUR.metrics.y_ppem )
     /* set CVT functions */
     CUR.tt_metrics.ratio = 0;
     if ( CUR.metrics.x_ppem != CUR.metrics.y_ppem )
 
       if ( ( CUR.length = opcode_length[CUR.opcode] ) < 0 )
       {
 
       if ( ( CUR.length = opcode_length[CUR.opcode] ) < 0 )
       {
-        if ( CUR.IP + 1 > CUR.codeSize )
+        if ( CUR.IP + 1 >= CUR.codeSize )
           goto LErrorCodeOverflow_;
 
         CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
           goto LErrorCodeOverflow_;
 
         CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
       /* One can also interpret it as the index of the last argument.    */
       if ( CUR.args < 0 )
       {
       /* One can also interpret it as the index of the last argument.    */
       if ( CUR.args < 0 )
       {
-        CUR.error = TT_Err_Too_Few_Arguments;
-        goto LErrorLabel_;
+        if ( CUR.pedantic_hinting )
+        {
+          CUR.error = FT_THROW( Too_Few_Arguments );
+          goto LErrorLabel_;
+        }
+
+        /* push zeroes onto the stack */
+        for ( i = 0; i < Pop_Push_Count[CUR.opcode] >> 4; i++ )
+          CUR.stack[i] = 0;
+        CUR.args = 0;
       }
 
       CUR.new_top = CUR.args + ( Pop_Push_Count[CUR.opcode] & 15 );
       }
 
       CUR.new_top = CUR.args + ( Pop_Push_Count[CUR.opcode] & 15 );
       /* statement.                                                     */
       if ( CUR.new_top > CUR.stackSize )
       {
       /* statement.                                                     */
       if ( CUR.new_top > CUR.stackSize )
       {
-        CUR.error = TT_Err_Stack_Overflow;
+        CUR.error = FT_THROW( Stack_Overflow );
         goto LErrorLabel_;
       }
 
       CUR.step_ins = TRUE;
         goto LErrorLabel_;
       }
 
       CUR.step_ins = TRUE;
-      CUR.error    = TT_Err_Ok;
+      CUR.error    = FT_Err_Ok;
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+      if ( SUBPIXEL_HINTING )
+      {
+        for ( i = 0; i < opcode_patterns; i++ )
+        {
+          if ( opcode_pointer[i] < opcode_size[i]                 &&
+               CUR.opcode == opcode_pattern[i][opcode_pointer[i]] )
+          {
+            opcode_pointer[i] += 1;
+
+            if ( opcode_pointer[i] == opcode_size[i] )
+            {
+              FT_TRACE7(( "sph: opcode ptrn: %d, %s %s\n",
+                          i,
+                          CUR.face->root.family_name,
+                          CUR.face->root.style_name ));
+
+              switch ( i )
+              {
+              case 0:
+                break;
+              }
+              opcode_pointer[i] = 0;
+            }
+          }
+          else
+            opcode_pointer[i] = 0;
+        }
+      }
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
 
 #ifdef TT_CONFIG_OPTION_INTERPRETER_SWITCH
 
 
 #ifdef TT_CONFIG_OPTION_INTERPRETER_SWITCH
 
         case 0x04:  /* SFvTCA y */
         case 0x05:  /* SFvTCA x */
           {
         case 0x04:  /* SFvTCA y */
         case 0x05:  /* SFvTCA x */
           {
-            FT_Short AA, BB;
+            FT_Short  AA, BB;
 
 
             AA = (FT_Short)( ( opcode & 1 ) << 14 );
 
 
             AA = (FT_Short)( ( opcode & 1 ) << 14 );
           Ins_MDAP( EXEC_ARG_ args );
           break;
 
           Ins_MDAP( EXEC_ARG_ args );
           break;
 
-
         case 0x30:  /* IUP */
         case 0x31:  /* IUP */
           Ins_IUP( EXEC_ARG_ args );
         case 0x30:  /* IUP */
         case 0x31:  /* IUP */
           Ins_IUP( EXEC_ARG_ args );
           break;
 
       Set_Invalid_Ref:
           break;
 
       Set_Invalid_Ref:
-            CUR.error = TT_Err_Invalid_Reference;
+            CUR.error = FT_THROW( Invalid_Reference );
           break;
 
         case 0x43:  /* RS */
           break;
 
         case 0x43:  /* RS */
 
 #endif /* TT_CONFIG_OPTION_INTERPRETER_SWITCH */
 
 
 #endif /* TT_CONFIG_OPTION_INTERPRETER_SWITCH */
 
-      if ( CUR.error != TT_Err_Ok )
+      if ( CUR.error )
       {
         switch ( CUR.error )
         {
       {
         switch ( CUR.error )
         {
-        case TT_Err_Invalid_Opcode: /* looking for redefined instructions */
+          /* looking for redefined instructions */
+        case FT_ERR( Invalid_Opcode ):
           {
             TT_DefRecord*  def   = CUR.IDefs;
             TT_DefRecord*  limit = def + CUR.numIDefs;
           {
             TT_DefRecord*  def   = CUR.IDefs;
             TT_DefRecord*  limit = def + CUR.numIDefs;
 
                 if ( CUR.callTop >= CUR.callSize )
                 {
 
                 if ( CUR.callTop >= CUR.callSize )
                 {
-                  CUR.error = TT_Err_Invalid_Reference;
+                  CUR.error = FT_THROW( Invalid_Reference );
                   goto LErrorLabel_;
                 }
 
                   goto LErrorLabel_;
                 }
 
                 callrec->Caller_IP    = CUR.IP + 1;
                 callrec->Cur_Count    = 1;
                 callrec->Cur_Restart  = def->start;
                 callrec->Caller_IP    = CUR.IP + 1;
                 callrec->Cur_Count    = 1;
                 callrec->Cur_Restart  = def->start;
+                callrec->Cur_End      = def->end;
 
                 if ( INS_Goto_CodeRange( def->range, def->start ) == FAILURE )
                   goto LErrorLabel_;
 
                 if ( INS_Goto_CodeRange( def->range, def->start ) == FAILURE )
                   goto LErrorLabel_;
             }
           }
 
             }
           }
 
-          CUR.error = TT_Err_Invalid_Opcode;
+          CUR.error = FT_THROW( Invalid_Opcode );
           goto LErrorLabel_;
 
 #if 0
           goto LErrorLabel_;
 
 #if 0
       /* increment instruction counter and check if we didn't */
       /* run this program for too long (e.g. infinite loops). */
       if ( ++ins_counter > MAX_RUNNABLE_OPCODES )
       /* increment instruction counter and check if we didn't */
       /* run this program for too long (e.g. infinite loops). */
       if ( ++ins_counter > MAX_RUNNABLE_OPCODES )
-        return TT_Err_Execution_Too_Long;
+        return FT_THROW( Execution_Too_Long );
 
     LSuiteLabel_:
       if ( CUR.IP >= CUR.codeSize )
       {
         if ( CUR.callTop > 0 )
         {
 
     LSuiteLabel_:
       if ( CUR.IP >= CUR.codeSize )
       {
         if ( CUR.callTop > 0 )
         {
-          CUR.error = TT_Err_Code_Overflow;
+          CUR.error = FT_THROW( Code_Overflow );
           goto LErrorLabel_;
         }
         else
           goto LErrorLabel_;
         }
         else
     *exc = cur;
 #endif
 
     *exc = cur;
 #endif
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
 
   LErrorCodeOverflow_:
 
   LErrorCodeOverflow_:
-    CUR.error = TT_Err_Code_Overflow;
+    CUR.error = FT_THROW( Code_Overflow );
 
   LErrorLabel_:
 
 
   LErrorLabel_:
 
     if ( CUR.error && !CUR.instruction_trap )
     {
       FT_TRACE1(( "  The interpreter returned error 0x%x\n", CUR.error ));
     if ( CUR.error && !CUR.instruction_trap )
     {
       FT_TRACE1(( "  The interpreter returned error 0x%x\n", CUR.error ));
-      exc->size->cvt_ready      = FALSE;  
+      exc->size->cvt_ready      = FALSE;
     }
 
     return CUR.error;
     }
 
     return CUR.error;
index c480dfa..69f5011 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType bytecode interpreter (specification).                       */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType bytecode interpreter (specification).                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010 by       */
+/*  Copyright 1996-2007, 2010, 2012-2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -102,10 +102,53 @@ FT_BEGIN_HEADER
     FT_Long  Caller_IP;
     FT_Long  Cur_Count;
     FT_Long  Cur_Restart;
     FT_Long  Caller_IP;
     FT_Long  Cur_Count;
     FT_Long  Cur_Restart;
+    FT_Long  Cur_End;
 
   } TT_CallRec, *TT_CallStack;
 
 
 
   } TT_CallRec, *TT_CallStack;
 
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* These structures define rules used to tweak subpixel hinting for      */
+  /* various fonts.  "", 0, "", NULL value indicates to match any value.   */
+  /*                                                                       */
+
+#define SPH_MAX_NAME_SIZE      32
+#define SPH_MAX_CLASS_MEMBERS  100
+
+  typedef struct  SPH_TweakRule_
+  {
+    const char      family[SPH_MAX_NAME_SIZE];
+    const FT_UInt   ppem;
+    const char      style[SPH_MAX_NAME_SIZE];
+    const FT_ULong  glyph;
+
+  } SPH_TweakRule;
+
+
+  typedef struct  SPH_ScaleRule_
+  {
+    const char      family[SPH_MAX_NAME_SIZE];
+    const FT_UInt   ppem;
+    const char      style[SPH_MAX_NAME_SIZE];
+    const FT_ULong  glyph;
+    const FT_ULong  scale;
+
+  } SPH_ScaleRule;
+
+
+  typedef struct  SPH_Font_Class_
+  {
+    const char  name[SPH_MAX_NAME_SIZE];
+    const char  member[SPH_MAX_CLASS_MEMBERS][SPH_MAX_NAME_SIZE];
+
+  } SPH_Font_Class;
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+
   /*************************************************************************/
   /*                                                                       */
   /* The main structure for the interpreter which collects all necessary   */
   /*************************************************************************/
   /*                                                                       */
   /* The main structure for the interpreter which collects all necessary   */
@@ -217,12 +260,43 @@ FT_BEGIN_HEADER
 
     FT_Bool            grayscale;      /* are we hinting for grayscale? */
 
 
     FT_Bool            grayscale;      /* are we hinting for grayscale? */
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    TT_Round_Func      func_round_sphn;   /* subpixel rounding function */
+
+    FT_Bool            grayscale_hinting; /* Using grayscale hinting?      */
+    FT_Bool            subpixel_hinting;  /* Using subpixel hinting?       */
+    FT_Bool            native_hinting;    /* Using native hinting?         */
+    FT_Bool            ignore_x_mode;     /* Standard rendering mode for   */
+                                          /* subpixel hinting.  On if gray */
+                                          /* or subpixel hinting is on )   */
+
+    /* The following 4 aren't fully implemented but here for MS rasterizer */
+    /* compatibility.                                                      */
+    FT_Bool            compatible_widths;     /* compatible widths?        */
+    FT_Bool            symmetrical_smoothing; /* symmetrical_smoothing?    */
+    FT_Bool            bgr;                   /* bgr instead of rgb?       */
+    FT_Bool            subpixel_positioned;   /* subpixel positioned       */
+                                              /* (DirectWrite ClearType)?  */
+
+    FT_Int             rasterizer_version;    /* MS rasterizer version     */
+
+    FT_Bool            iup_called;            /* IUP called for glyph?     */
+
+    FT_ULong           sph_tweak_flags;       /* flags to control          */
+                                              /* hint tweaks               */
+
+    FT_ULong           sph_in_func_flags;     /* flags to indicate if in   */
+                                              /* special functions         */
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
   } TT_ExecContextRec;
 
 
   extern const TT_GraphicsState  tt_default_graphics_state;
 
 
   } TT_ExecContextRec;
 
 
   extern const TT_GraphicsState  tt_default_graphics_state;
 
 
+#ifdef TT_USE_BYTECODE_INTERPRETER
   FT_LOCAL( FT_Error )
   TT_Goto_CodeRange( TT_ExecContext  exec,
                      FT_Int          range,
   FT_LOCAL( FT_Error )
   TT_Goto_CodeRange( TT_ExecContext  exec,
                      FT_Int          range,
@@ -245,6 +319,7 @@ FT_BEGIN_HEADER
               FT_Long    multiplier,
               void*      _pbuff,
               FT_ULong   new_max );
               FT_Long    multiplier,
               void*      _pbuff,
               FT_ULong   new_max );
+#endif /* TT_USE_BYTECODE_INTERPRETER */
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
@@ -269,6 +344,8 @@ FT_BEGIN_HEADER
   FT_EXPORT( TT_ExecContext )
   TT_New_Context( TT_Driver  driver );
 
   FT_EXPORT( TT_ExecContext )
   TT_New_Context( TT_Driver  driver );
 
+
+#ifdef TT_USE_BYTECODE_INTERPRETER
   FT_LOCAL( FT_Error )
   TT_Done_Context( TT_ExecContext  exec );
 
   FT_LOCAL( FT_Error )
   TT_Done_Context( TT_ExecContext  exec );
 
@@ -284,6 +361,7 @@ FT_BEGIN_HEADER
   FT_LOCAL( FT_Error )
   TT_Run_Context( TT_ExecContext  exec,
                   FT_Bool         debug );
   FT_LOCAL( FT_Error )
   TT_Run_Context( TT_ExecContext  exec,
                   FT_Bool         debug );
+#endif /* TT_USE_BYTECODE_INTERPRETER */
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
index 8fe86ad..7897efa 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    Objects manager (body).                                              */
 /*                                                                         */
 /*                                                                         */
 /*    Objects manager (body).                                              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013                                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -22,6 +21,7 @@
 #include FT_INTERNAL_STREAM_H
 #include FT_TRUETYPE_TAGS_H
 #include FT_INTERNAL_SFNT_H
 #include FT_INTERNAL_STREAM_H
 #include FT_TRUETYPE_TAGS_H
 #include FT_INTERNAL_SFNT_H
+#include FT_TRUETYPE_DRIVER_H
 
 #include "ttgload.h"
 #include "ttpload.h"
 
 #include "ttgload.h"
 #include "ttpload.h"
   tt_get_sfnt_checksum( TT_Face    face,
                         FT_UShort  i )
   {
   tt_get_sfnt_checksum( TT_Face    face,
                         FT_UShort  i )
   {
+#if 0 /* if we believe the written value, use following part. */
     if ( face->dir_tables[i].CheckSum )
       return face->dir_tables[i].CheckSum;
     if ( face->dir_tables[i].CheckSum )
       return face->dir_tables[i].CheckSum;
+#endif
 
 
-    else if ( !face->goto_table )
+    if ( !face->goto_table )
       return 0;
 
       return 0;
 
-    else if ( !face->goto_table( face,
-                                 face->dir_tables[i].Tag,
-                                 face->root.stream,
-                                 NULL ) )
+    if ( face->goto_table( face,
+                           face->dir_tables[i].Tag,
+                           face->root.stream,
+                           NULL ) )
       return 0;
 
     return (FT_ULong)tt_synth_sfnt_checksum( face->root.stream,
       return 0;
 
     return (FT_ULong)tt_synth_sfnt_checksum( face->root.stream,
   tt_check_trickyness_sfnt_ids( TT_Face  face )
   {
 #define TRICK_SFNT_IDS_PER_FACE   3
   tt_check_trickyness_sfnt_ids( TT_Face  face )
   {
 #define TRICK_SFNT_IDS_PER_FACE   3
-#define TRICK_SFNT_IDS_NUM_FACES  5
+#define TRICK_SFNT_IDS_NUM_FACES  17
 
     static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES]
                                        [TRICK_SFNT_IDS_PER_FACE] = {
 
     static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES]
                                        [TRICK_SFNT_IDS_PER_FACE] = {
         { 0xfffbfffc, 0x00000008 }, /* cvt  */
         { 0x0a5a0483, 0x00017c39 }, /* fpgm */
         { 0x70020112, 0x00000008 }  /* prep */
         { 0xfffbfffc, 0x00000008 }, /* cvt  */
         { 0x0a5a0483, 0x00017c39 }, /* fpgm */
         { 0x70020112, 0x00000008 }  /* prep */
+      },
+      { /* NEC fadpop7.ttf */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x40c92555, 0x000000e5 }, /* fpgm */
+        { 0xa39b58e3, 0x0000117c }  /* prep */
+      },
+      { /* NEC fadrei5.ttf */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x33c41652, 0x000000e5 }, /* fpgm */
+        { 0x26d6c52a, 0x00000f6a }  /* prep */
+      },
+      { /* NEC fangot7.ttf */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x6db1651d, 0x0000019d }, /* fpgm */
+        { 0x6c6e4b03, 0x00002492 }  /* prep */
+      },
+      { /* NEC fangyo5.ttf */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x40c92555, 0x000000e5 }, /* fpgm */
+        { 0xde51fad0, 0x0000117c }  /* prep */
+      },
+      { /* NEC fankyo5.ttf */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x85e47664, 0x000000e5 }, /* fpgm */
+        { 0xa6c62831, 0x00001caa }  /* prep */
+      },
+      { /* NEC fanrgo5.ttf */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x2d891cfd, 0x0000019d }, /* fpgm */
+        { 0xa0604633, 0x00001de8 }  /* prep */
+      },
+      { /* NEC fangot5.ttc */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x40aa774c, 0x000001cb }, /* fpgm */
+        { 0x9b5caa96, 0x00001f9a }  /* prep */
+      },
+      { /* NEC fanmin3.ttc */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x0d3de9cb, 0x00000141 }, /* fpgm */
+        { 0xd4127766, 0x00002280 }  /* prep */
+      },
+      { /* NEC FA-Gothic, 1996 */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x4a692698, 0x000001f0 }, /* fpgm */
+        { 0x340d4346, 0x00001fca }  /* prep */
+      },
+      { /* NEC FA-Minchou, 1996 */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0xcd34c604, 0x00000166 }, /* fpgm */
+        { 0x6cf31046, 0x000022b0 }  /* prep */
+      },
+      { /* NEC FA-RoundGothicB, 1996 */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0x5da75315, 0x0000019d }, /* fpgm */
+        { 0x40745a5f, 0x000022e0 }  /* prep */
+      },
+      { /* NEC FA-RoundGothicM, 1996 */
+        { 0x00000000, 0x00000000 }, /* cvt  */
+        { 0xf055fc48, 0x000001c2 }, /* fpgm */
+        { 0x3900ded3, 0x00001e18 }  /* prep */
       }
     };
 
       }
     };
 
-    FT_ULong  checksum;
-    int       num_matched_ids[TRICK_SFNT_IDS_NUM_FACES];
-    int       i, j, k;
+    FT_ULong   checksum;
+    int        num_matched_ids[TRICK_SFNT_IDS_NUM_FACES];
+    FT_Bool    has_cvt, has_fpgm, has_prep;
+    FT_UShort  i;
+    int        j, k;
 
 
     FT_MEM_SET( num_matched_ids, 0,
 
 
     FT_MEM_SET( num_matched_ids, 0,
-                sizeof( int ) * TRICK_SFNT_IDS_NUM_FACES );
+                sizeof ( int ) * TRICK_SFNT_IDS_NUM_FACES );
+    has_cvt  = FALSE;
+    has_fpgm = FALSE;
+    has_prep = FALSE;
 
     for ( i = 0; i < face->num_tables; i++ )
     {
 
     for ( i = 0; i < face->num_tables; i++ )
     {
       {
       case TTAG_cvt:
         k = TRICK_SFNT_ID_cvt;
       {
       case TTAG_cvt:
         k = TRICK_SFNT_ID_cvt;
+        has_cvt  = TRUE;
         break;
 
       case TTAG_fpgm:
         k = TRICK_SFNT_ID_fpgm;
         break;
 
       case TTAG_fpgm:
         k = TRICK_SFNT_ID_fpgm;
+        has_fpgm = TRUE;
         break;
 
       case TTAG_prep:
         k = TRICK_SFNT_ID_prep;
         break;
 
       case TTAG_prep:
         k = TRICK_SFNT_ID_prep;
+        has_prep = TRUE;
         break;
 
       default:
         break;
 
       default:
         }
     }
 
         }
     }
 
+    for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ )
+    {
+      if ( !has_cvt  && !sfnt_id[j][TRICK_SFNT_ID_cvt].Length )
+        num_matched_ids[j] ++;
+      if ( !has_fpgm && !sfnt_id[j][TRICK_SFNT_ID_fpgm].Length )
+        num_matched_ids[j] ++;
+      if ( !has_prep && !sfnt_id[j][TRICK_SFNT_ID_prep].Length )
+        num_matched_ids[j] ++;
+      if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE )
+        return TRUE;
+    }
+
     return FALSE;
   }
 
     return FALSE;
   }
 
     if ( !face )
       return FALSE;
 
     if ( !face )
       return FALSE;
 
-    /* First, check the face name. */
-    if ( face->family_name )
-    {
-      if ( tt_check_trickyness_family( face->family_name ) )
-        return TRUE;
-      else
-        return FALSE;
-    }
+    /* For first, check the face name for quick check. */
+    if ( face->family_name                               &&
+         tt_check_trickyness_family( face->family_name ) )
+      return TRUE;
 
     /* Type42 fonts may lack `name' tables, we thus try to identify */
     /* tricky fonts by checking the checksums of Type42-persistent  */
 
     /* Type42 fonts may lack `name' tables, we thus try to identify */
     /* tricky fonts by checking the checksums of Type42-persistent  */
   }
 
 
   }
 
 
+  /* Check whether `.notdef' is the only glyph in the `loca' table. */
+  static FT_Bool
+  tt_check_single_notdef( FT_Face  ttface )
+  {
+    FT_Bool   result = FALSE;
+
+    TT_Face   face = (TT_Face)ttface;
+    FT_UInt   asize;
+    FT_ULong  i;
+    FT_ULong  glyph_index = 0;
+    FT_UInt   count       = 0;
+
+
+    for( i = 0; i < face->num_locations; i++ )
+    {
+      tt_face_get_location( face, i, &asize );
+      if ( asize > 0 )
+      {
+        count += 1;
+        if ( count > 1 )
+          break;
+        glyph_index = i;
+      }
+    }
+
+    /* Only have a single outline. */
+    if ( count == 1 )
+    {
+      if ( glyph_index == 0 )
+        result = TRUE;
+      else
+      {
+        /* FIXME: Need to test glyphname == .notdef ? */
+        FT_Error error;
+        char buf[8];
+
+
+        error = FT_Get_Glyph_Name( ttface, glyph_index, buf, 8 );
+        if ( !error                                            &&
+             buf[0] == '.' && !ft_strncmp( buf, ".notdef", 8 ) )
+          result = TRUE;
+      }
+    }
+
+    return result;
+  }
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
     TT_Face       face = (TT_Face)ttface;
 
 
     TT_Face       face = (TT_Face)ttface;
 
 
+    FT_TRACE2(( "TTF driver\n" ));
+
     library = ttface->driver->root.library;
     library = ttface->driver->root.library;
-    sfnt    = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
+
+    sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
     if ( !sfnt )
     if ( !sfnt )
-      goto Bad_Format;
+    {
+      FT_ERROR(( "tt_face_init: cannot access `sfnt' module\n" ));
+      error = FT_THROW( Missing_Module );
+      goto Exit;
+    }
 
     /* create input stream from resource */
     if ( FT_STREAM_SEEK( 0 ) )
 
     /* create input stream from resource */
     if ( FT_STREAM_SEEK( 0 ) )
          face->format_tag != 0x00020000L &&    /* CJK fonts for Win 3.1 */
          face->format_tag != TTAG_true   )     /* Mac fonts */
     {
          face->format_tag != 0x00020000L &&    /* CJK fonts for Win 3.1 */
          face->format_tag != TTAG_true   )     /* Mac fonts */
     {
-      FT_TRACE2(( "[not a valid TTF font]\n" ));
+      FT_TRACE2(( "  not a TTF font\n" ));
       goto Bad_Format;
     }
 
       goto Bad_Format;
     }
 
 
     /* If we are performing a simple font format check, exit immediately. */
     if ( face_index < 0 )
 
     /* If we are performing a simple font format check, exit immediately. */
     if ( face_index < 0 )
-      return TT_Err_Ok;
+      return FT_Err_Ok;
 
     /* Load font directory */
     error = sfnt->load_face( stream, face, face_index, num_params, params );
 
     /* Load font directory */
     error = sfnt->load_face( stream, face, face_index, num_params, params );
       if ( !error )
         error = tt_face_load_prep( face, stream );
 
       if ( !error )
         error = tt_face_load_prep( face, stream );
 
+      /* Check the scalable flag based on `loca'. */
+      if ( !ttface->internal->incremental_interface &&
+           ttface->num_fixed_sizes                  &&
+           face->glyph_locations                    &&
+           tt_check_single_notdef( ttface )         )
+      {
+        FT_TRACE5(( "tt_face_init:"
+                    " Only the `.notdef' glyph has an outline.\n"
+                    "             "
+                    " Resetting scalable flag to FALSE.\n" ));
+
+        ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
+      }
+
 #else
 
       if ( !error )
 #else
 
       if ( !error )
       if ( !error )
         error = tt_face_load_prep( face, stream );
 
       if ( !error )
         error = tt_face_load_prep( face, stream );
 
+      /* Check the scalable flag based on `loca'. */
+      if ( ttface->num_fixed_sizes          &&
+           face->glyph_locations            &&
+           tt_check_single_notdef( ttface ) )
+      {
+        FT_TRACE5(( "tt_face_init:"
+                    " Only the `.notdef' glyph has an outline.\n"
+                    "             "
+                    " Resetting scalable flag to FALSE.\n" ));
+
+        ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
+      }
+
 #endif
 
     }
 #endif
 
     }
     return error;
 
   Bad_Format:
     return error;
 
   Bad_Format:
-    error = TT_Err_Unknown_File_Format;
+    error = FT_THROW( Unknown_File_Format );
     goto Exit;
   }
 
     goto Exit;
   }
 
   /*    Run the font program.                                              */
   /*                                                                       */
   /* <Input>                                                               */
   /*    Run the font program.                                              */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    size :: A handle to the size object.                               */
+  /*    size     :: A handle to the size object.                           */
+  /*                                                                       */
+  /*    pedantic :: Set if bytecode execution should be pedantic.          */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
-  tt_size_run_fpgm( TT_Size  size )
+  tt_size_run_fpgm( TT_Size  size,
+                    FT_Bool  pedantic )
   {
     TT_Face         face = (TT_Face)size->root.face;
     TT_ExecContext  exec;
   {
     TT_Face         face = (TT_Face)size->root.face;
     TT_ExecContext  exec;
       exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;
 
     if ( !exec )
       exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;
 
     if ( !exec )
-      return TT_Err_Could_Not_Find_Context;
+      return FT_THROW( Could_Not_Find_Context );
 
     TT_Load_Context( exec, face, size );
 
 
     TT_Load_Context( exec, face, size );
 
-    exec->callTop   = 0;
-    exec->top       = 0;
+    exec->callTop = 0;
+    exec->top     = 0;
 
     exec->period    = 64;
     exec->phase     = 0;
     exec->threshold = 0;
 
     exec->instruction_trap = FALSE;
 
     exec->period    = 64;
     exec->phase     = 0;
     exec->threshold = 0;
 
     exec->instruction_trap = FALSE;
-    exec->F_dot_P = 0x10000L;
+    exec->F_dot_P          = 0x4000L;
+
+    exec->pedantic_hinting = pedantic;
 
     {
       FT_Size_Metrics*  metrics    = &exec->metrics;
 
     {
       FT_Size_Metrics*  metrics    = &exec->metrics;
       }
     }
     else
       }
     }
     else
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
 
     if ( !error )
       TT_Save_Context( exec, size );
 
     if ( !error )
       TT_Save_Context( exec, size );
   /*    Run the control value program.                                     */
   /*                                                                       */
   /* <Input>                                                               */
   /*    Run the control value program.                                     */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    size :: A handle to the size object.                               */
+  /*    size     :: A handle to the size object.                           */
+  /*                                                                       */
+  /*    pedantic :: Set if bytecode execution should be pedantic.          */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
-  tt_size_run_prep( TT_Size  size )
+  tt_size_run_prep( TT_Size  size,
+                    FT_Bool  pedantic )
   {
     TT_Face         face = (TT_Face)size->root.face;
     TT_ExecContext  exec;
   {
     TT_Face         face = (TT_Face)size->root.face;
     TT_ExecContext  exec;
       exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;
 
     if ( !exec )
       exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;
 
     if ( !exec )
-      return TT_Err_Could_Not_Find_Context;
+      return FT_THROW( Could_Not_Find_Context );
 
     TT_Load_Context( exec, face, size );
 
 
     TT_Load_Context( exec, face, size );
 
 
     exec->instruction_trap = FALSE;
 
 
     exec->instruction_trap = FALSE;
 
+    exec->pedantic_hinting = pedantic;
+
     TT_Set_CodeRange( exec,
                       tt_coderange_cvt,
                       face->cvt_program,
     TT_Set_CodeRange( exec,
                       tt_coderange_cvt,
                       face->cvt_program,
       }
     }
     else
       }
     }
     else
-      error = TT_Err_Ok;
+      error = FT_Err_Ok;
+
+    /* UNDOCUMENTED!  The MS rasterizer doesn't allow the following */
+    /* graphics state variables to be modified by the CVT program.  */
+
+    exec->GS.dualVector.x = 0x4000;
+    exec->GS.dualVector.y = 0;
+    exec->GS.projVector.x = 0x4000;
+    exec->GS.projVector.y = 0x0;
+    exec->GS.freeVector.x = 0x4000;
+    exec->GS.freeVector.y = 0x0;
+
+    exec->GS.rp0 = 0;
+    exec->GS.rp1 = 0;
+    exec->GS.rp2 = 0;
+
+    exec->GS.gep0 = 1;
+    exec->GS.gep1 = 1;
+    exec->GS.gep2 = 1;
+
+    exec->GS.loop = 1;
 
     /* save as default graphics state */
     size->GS = exec->GS;
 
     /* save as default graphics state */
     size->GS = exec->GS;
   /* Initialize bytecode-related fields in the size object.       */
   /* We do this only if bytecode interpretation is really needed. */
   static FT_Error
   /* Initialize bytecode-related fields in the size object.       */
   /* We do this only if bytecode interpretation is really needed. */
   static FT_Error
-  tt_size_init_bytecode( FT_Size  ftsize )
+  tt_size_init_bytecode( FT_Size  ftsize,
+                         FT_Bool  pedantic )
   {
     FT_Error   error;
     TT_Size    size = (TT_Size)ftsize;
   {
     FT_Error   error;
     TT_Size    size = (TT_Size)ftsize;
     }
 
     /* Fine, now run the font program! */
     }
 
     /* Fine, now run the font program! */
-    error = tt_size_run_fpgm( size );
+    error = tt_size_run_fpgm( size, pedantic );
 
   Exit:
     if ( error )
 
   Exit:
     if ( error )
 
 
   FT_LOCAL_DEF( FT_Error )
 
 
   FT_LOCAL_DEF( FT_Error )
-  tt_size_ready_bytecode( TT_Size  size )
+  tt_size_ready_bytecode( TT_Size  size,
+                          FT_Bool  pedantic )
   {
   {
-    FT_Error  error = TT_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 
     if ( !size->bytecode_ready )
     {
 
 
     if ( !size->bytecode_ready )
     {
-      error = tt_size_init_bytecode( (FT_Size)size );
+      error = tt_size_init_bytecode( (FT_Size)size, pedantic );
       if ( error )
         goto Exit;
     }
       if ( error )
         goto Exit;
     }
 
       size->GS = tt_default_graphics_state;
 
 
       size->GS = tt_default_graphics_state;
 
-      error = tt_size_run_prep( size );
+      error = tt_size_run_prep( size, pedantic );
       if ( !error )
         size->cvt_ready = 1;
     }
       if ( !error )
         size->cvt_ready = 1;
     }
   tt_size_init( FT_Size  ttsize )           /* TT_Size */
   {
     TT_Size   size  = (TT_Size)ttsize;
   tt_size_init( FT_Size  ttsize )           /* TT_Size */
   {
     TT_Size   size  = (TT_Size)ttsize;
-    FT_Error  error = TT_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
     size->bytecode_ready = 0;
 
 #ifdef TT_USE_BYTECODE_INTERPRETER
     size->bytecode_ready = 0;
   tt_size_reset( TT_Size  size )
   {
     TT_Face           face;
   tt_size_reset( TT_Size  size )
   {
     TT_Face           face;
-    FT_Error          error = TT_Err_Ok;
+    FT_Error          error = FT_Err_Ok;
     FT_Size_Metrics*  metrics;
 
 
     FT_Size_Metrics*  metrics;
 
 
     *metrics = size->root.metrics;
 
     if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 )
     *metrics = size->root.metrics;
 
     if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 )
-      return TT_Err_Invalid_PPem;
+      return FT_THROW( Invalid_PPem );
 
     /* This bit flag, if set, indicates that the ppems must be       */
     /* rounded to integers.  Nearly all TrueType fonts have this bit */
 
     /* This bit flag, if set, indicates that the ppems must be       */
     /* rounded to integers.  Nearly all TrueType fonts have this bit */
       size->ttmetrics.scale   = metrics->x_scale;
       size->ttmetrics.ppem    = metrics->x_ppem;
       size->ttmetrics.x_ratio = 0x10000L;
       size->ttmetrics.scale   = metrics->x_scale;
       size->ttmetrics.ppem    = metrics->x_ppem;
       size->ttmetrics.x_ratio = 0x10000L;
-      size->ttmetrics.y_ratio = FT_MulDiv( metrics->y_ppem,
-                                           0x10000L,
+      size->ttmetrics.y_ratio = FT_DivFix( metrics->y_ppem,
                                            metrics->x_ppem );
     }
     else
     {
       size->ttmetrics.scale   = metrics->y_scale;
       size->ttmetrics.ppem    = metrics->y_ppem;
                                            metrics->x_ppem );
     }
     else
     {
       size->ttmetrics.scale   = metrics->y_scale;
       size->ttmetrics.ppem    = metrics->y_ppem;
-      size->ttmetrics.x_ratio = FT_MulDiv( metrics->x_ppem,
-                                           0x10000L,
+      size->ttmetrics.x_ratio = FT_DivFix( metrics->x_ppem,
                                            metrics->y_ppem );
       size->ttmetrics.y_ratio = 0x10000L;
     }
                                            metrics->y_ppem );
       size->ttmetrics.y_ratio = 0x10000L;
     }
 
 
     if ( !TT_New_Context( driver ) )
 
 
     if ( !TT_New_Context( driver ) )
-      return TT_Err_Could_Not_Find_Context;
+      return FT_THROW( Could_Not_Find_Context );
 
 
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+    driver->interpreter_version = TT_INTERPRETER_VERSION_38;
 #else
 #else
+    driver->interpreter_version = TT_INTERPRETER_VERSION_35;
+#endif
+
+#else /* !TT_USE_BYTECODE_INTERPRETER */
 
     FT_UNUSED( ttdriver );
 
 
     FT_UNUSED( ttdriver );
 
-#endif
+#endif /* !TT_USE_BYTECODE_INTERPRETER */
 
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
index 30c8669..a11dd37 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Objects manager (specification).                                     */
 /*                                                                         */
 /*                                                                         */
 /*    Objects manager (specification).                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/*  Copyright 1996-2009, 2011-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -173,10 +173,13 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  TT_DefRecord_
   {
   /*                                                                       */
   typedef struct  TT_DefRecord_
   {
-    FT_Int   range;      /* in which code range is it located? */
-    FT_Long  start;      /* where does it start?               */
-    FT_UInt  opc;        /* function #, or instruction code    */
-    FT_Bool  active;     /* is it active?                      */
+    FT_Int    range;          /* in which code range is it located?     */
+    FT_Long   start;          /* where does it start?                   */
+    FT_Long   end;            /* where does it end?                     */
+    FT_UInt   opc;            /* function #, or instruction code        */
+    FT_Bool   active;         /* is it active?                          */
+    FT_Bool   inline_delta;   /* is function that defines inline delta? */
+    FT_ULong  sph_fdef_flags; /* flags to identify special functions    */
 
   } TT_DefRecord, *TT_DefArray;
 
 
   } TT_DefRecord, *TT_DefArray;
 
@@ -189,7 +192,7 @@ FT_BEGIN_HEADER
   {
     FT_Fixed    xx, xy;     /* transformation matrix coefficients */
     FT_Fixed    yx, yy;
   {
     FT_Fixed    xx, xy;     /* transformation matrix coefficients */
     FT_Fixed    yx, yy;
-    FT_F26Dot6  ox, oy;     /* offsets        */
+    FT_F26Dot6  ox, oy;     /* offsets                            */
 
   } TT_Transform;
 
 
   } TT_Transform;
 
@@ -344,11 +347,12 @@ FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  TT_DriverRec_
   {
   /*                                                                       */
   typedef struct  TT_DriverRec_
   {
-    FT_DriverRec     root;
+    FT_DriverRec  root;
+
     TT_ExecContext   context;  /* execution context        */
     TT_GlyphZoneRec  zone;     /* glyph loader points zone */
 
     TT_ExecContext   context;  /* execution context        */
     TT_GlyphZoneRec  zone;     /* glyph loader points zone */
 
-    void*            extension_component;
+    FT_UInt  interpreter_version;
 
   } TT_DriverRec;
 
 
   } TT_DriverRec;
 
@@ -390,13 +394,16 @@ FT_BEGIN_HEADER
 #ifdef TT_USE_BYTECODE_INTERPRETER
 
   FT_LOCAL( FT_Error )
 #ifdef TT_USE_BYTECODE_INTERPRETER
 
   FT_LOCAL( FT_Error )
-  tt_size_run_fpgm( TT_Size  size );
+  tt_size_run_fpgm( TT_Size  size,
+                    FT_Bool  pedantic );
 
   FT_LOCAL( FT_Error )
 
   FT_LOCAL( FT_Error )
-  tt_size_run_prep( TT_Size  size );
+  tt_size_run_prep( TT_Size  size,
+                    FT_Bool  pedantic );
 
   FT_LOCAL( FT_Error )
 
   FT_LOCAL( FT_Error )
-  tt_size_ready_bytecode( TT_Size  size );
+  tt_size_ready_bytecode( TT_Size  size,
+                          FT_Bool  pedantic );
 
 #endif /* TT_USE_BYTECODE_INTERPRETER */
 
 
 #endif /* TT_USE_BYTECODE_INTERPRETER */
 
@@ -423,6 +430,10 @@ FT_BEGIN_HEADER
   tt_slot_init( FT_GlyphSlot  slot );
 
 
   tt_slot_init( FT_GlyphSlot  slot );
 
 
+  /* auxiliary */
+#define IS_HINTED( flags )  ( ( flags & FT_LOAD_NO_HINTING ) == 0 )
+
+
 FT_END_HEADER
 
 #endif /* __TTOBJS_H__ */
 FT_END_HEADER
 
 #endif /* __TTOBJS_H__ */
index 5d72574..edefae7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for truetype module. */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for truetype module. */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009, 2010, 2012, 2013 by                                    */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "ttpic.h"
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "ttpic.h"
+#include "tterrors.h"
+
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ttdriver.c */
 
 #ifdef FT_CONFIG_OPTION_PIC
 
   /* forward declaration of PIC init functions from ttdriver.c */
-  FT_Error FT_Create_Class_tt_services( FT_Library, FT_ServiceDescRec**);
-  void FT_Destroy_Class_tt_services( FT_Library, FT_ServiceDescRec*);
-  void FT_Init_Class_tt_service_gx_multi_masters(FT_Service_MultiMastersRec*);
-  void FT_Init_Class_tt_service_truetype_glyf(FT_Service_TTGlyfRec*);
+  FT_Error
+  FT_Create_Class_tt_services( FT_Library           library,
+                               FT_ServiceDescRec**  output_class );
+  void
+  FT_Destroy_Class_tt_services( FT_Library          library,
+                                FT_ServiceDescRec*  clazz );
+  void
+  FT_Init_Class_tt_service_gx_multi_masters(
+    FT_Service_MultiMastersRec*  sv_mm );
+  void
+  FT_Init_Class_tt_service_truetype_glyf(
+    FT_Service_TTGlyfRec*  sv_ttglyf );
+
 
   void
 
   void
-  tt_driver_class_pic_free(  FT_Library library )
+  tt_driver_class_pic_free( FT_Library  library )
   {
   {
-    FT_PIC_Container* pic_container = &library->pic_container;
-    FT_Memory memory = library->memory;
+    FT_PIC_Container*  pic_container = &library->pic_container;
+    FT_Memory          memory        = library->memory;
+
+
     if ( pic_container->truetype )
     {
     if ( pic_container->truetype )
     {
-      TTModulePIC* container = (TTModulePIC*)pic_container->truetype;
-      if(container->tt_services)
-        FT_Destroy_Class_tt_services(library, container->tt_services);
+      TTModulePIC*  container = (TTModulePIC*)pic_container->truetype;
+
+
+      if ( container->tt_services )
+        FT_Destroy_Class_tt_services( library, container->tt_services );
       container->tt_services = NULL;
       FT_FREE( container );
       pic_container->truetype = NULL;
       container->tt_services = NULL;
       FT_FREE( container );
       pic_container->truetype = NULL;
   tt_driver_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
   tt_driver_class_pic_init( FT_Library  library )
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
-    FT_Error           error         = TT_Err_Ok;
-    TTModulePIC*       container;
+    FT_Error           error         = FT_Err_Ok;
+    TTModulePIC*       container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
     /* allocate pointer, clear and set global container pointer */
     FT_Memory          memory        = library->memory;
 
 
     /* allocate pointer, clear and set global container pointer */
-    if ( FT_ALLOC ( container, sizeof ( *container ) ) )
+    if ( FT_ALLOC( container, sizeof ( *container ) ) )
       return error;
       return error;
-    FT_MEM_SET( container, 0, sizeof(*container) );
+    FT_MEM_SET( container, 0, sizeof ( *container ) );
     pic_container->truetype = container;
 
     pic_container->truetype = container;
 
-    /* initialize pointer table - this is how the module usually expects this data */
-    error = FT_Create_Class_tt_services(library, &container->tt_services);
-    if(error) 
+    /* initialize pointer table - this is how the module usually */
+    /* expects this data                                         */
+    error = FT_Create_Class_tt_services( library,
+                                         &container->tt_services );
+    if ( error )
       goto Exit;
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
       goto Exit;
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-    FT_Init_Class_tt_service_gx_multi_masters(&container->tt_service_gx_multi_masters);
+    FT_Init_Class_tt_service_gx_multi_masters(
+      &container->tt_service_gx_multi_masters );
 #endif
 #endif
-    FT_Init_Class_tt_service_truetype_glyf(&container->tt_service_truetype_glyf);
-Exit:
-    if(error)
-      tt_driver_class_pic_free(library);
+    FT_Init_Class_tt_service_truetype_glyf(
+      &container->tt_service_truetype_glyf );
+
+  Exit:
+    if ( error )
+      tt_driver_class_pic_free( library );
     return error;
   }
 
     return error;
   }
 
index 84de0fe..cfb4ee6 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for truetype module. */
 /*                                                                         */
 /*                                                                         */
 /*    The FreeType position independent code services for truetype module. */
 /*                                                                         */
-/*  Copyright 2009 by                                                      */
+/*  Copyright 2009, 2012, 2013 by                                          */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #ifndef __TTPIC_H__
 #define __TTPIC_H__
 
 #ifndef __TTPIC_H__
 #define __TTPIC_H__
 
-  
+
 FT_BEGIN_HEADER
 
 #ifndef FT_CONFIG_OPTION_PIC
 FT_BEGIN_HEADER
 
 #ifndef FT_CONFIG_OPTION_PIC
-#define FT_TT_SERVICES_GET                   tt_services
-#define FT_TT_SERVICE_GX_MULTI_MASTERS_GET   tt_service_gx_multi_masters
-#define FT_TT_SERVICE_TRUETYPE_GLYF_GET      tt_service_truetype_glyf
+
+#define TT_SERVICES_GET                  tt_services
+#define TT_SERVICE_GX_MULTI_MASTERS_GET  tt_service_gx_multi_masters
+#define TT_SERVICE_TRUETYPE_GLYF_GET     tt_service_truetype_glyf
+#define TT_SERVICE_PROPERTIES_GET        tt_service_properties
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 #include FT_MULTIPLE_MASTERS_H
 #include FT_SERVICE_MULTIPLE_MASTERS_H
 #include FT_SERVICE_TRUETYPE_GLYF_H
 
 #else /* FT_CONFIG_OPTION_PIC */
 
 #include FT_MULTIPLE_MASTERS_H
 #include FT_SERVICE_MULTIPLE_MASTERS_H
 #include FT_SERVICE_TRUETYPE_GLYF_H
+#include FT_SERVICE_PROPERTIES_H
+
 
 
-  typedef struct TTModulePIC_
+  typedef struct  TTModulePIC_
   {
   {
-    FT_ServiceDescRec* tt_services;
+    FT_ServiceDescRec*          tt_services;
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-    FT_Service_MultiMastersRec tt_service_gx_multi_masters;
+    FT_Service_MultiMastersRec  tt_service_gx_multi_masters;
 #endif
 #endif
-    FT_Service_TTGlyfRec tt_service_truetype_glyf;
+    FT_Service_TTGlyfRec        tt_service_truetype_glyf;
+    FT_Service_PropertiesRec    tt_service_properties;
+
   } TTModulePIC;
 
   } TTModulePIC;
 
-#define GET_PIC(lib)                         ((TTModulePIC*)((lib)->pic_container.truetype))
-#define FT_TT_SERVICES_GET                   (GET_PIC(library)->tt_services)
-#define FT_TT_SERVICE_GX_MULTI_MASTERS_GET   (GET_PIC(library)->tt_service_gx_multi_masters)
-#define FT_TT_SERVICE_TRUETYPE_GLYF_GET      (GET_PIC(library)->tt_service_truetype_glyf)
+
+#define GET_PIC( lib )                                      \
+          ( (TTModulePIC*)((lib)->pic_container.truetype) )
+#define TT_SERVICES_GET                       \
+          ( GET_PIC( library )->tt_services )
+#define TT_SERVICE_GX_MULTI_MASTERS_GET                       \
+          ( GET_PIC( library )->tt_service_gx_multi_masters )
+#define TT_SERVICE_TRUETYPE_GLYF_GET                       \
+          ( GET_PIC( library )->tt_service_truetype_glyf )
+#define TT_SERVICE_PROPERTIES_GET                       \
+          ( GET_PIC( library )->tt_service_properties )
+
+
+  /* see ttpic.c for the implementation */
+  void
+  tt_driver_class_pic_free( FT_Library  library );
+
+  FT_Error
+  tt_driver_class_pic_init( FT_Library  library );
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
  /* */
 
 
 #endif /* FT_CONFIG_OPTION_PIC */
 
  /* */
 
+
 FT_END_HEADER
 
 #endif /* __TTPIC_H__ */
 FT_END_HEADER
 
 #endif /* __TTPIC_H__ */
index 68a5453..9723a51 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType-specific tables loader (body).                              */
 /*                                                                         */
 /*                                                                         */
 /*    TrueType-specific tables loader (body).                              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */
+/*  Copyright 1996-2002, 2004-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -72,7 +72,7 @@
 
     /* it is possible that a font doesn't have a glyf table at all */
     /* or its size is zero                                         */
 
     /* it is possible that a font doesn't have a glyf table at all */
     /* or its size is zero                                         */
-    if ( error == TT_Err_Table_Missing )
+    if ( FT_ERR_EQ( error, Table_Missing ) )
       face->glyf_len = 0;
     else if ( error )
       goto Exit;
       face->glyf_len = 0;
     else if ( error )
       goto Exit;
@@ -81,7 +81,7 @@
     error = face->goto_table( face, TTAG_loca, stream, &table_len );
     if ( error )
     {
     error = face->goto_table( face, TTAG_loca, stream, &table_len );
     if ( error )
     {
-      error = TT_Err_Locations_Missing;
+      error = FT_THROW( Locations_Missing );
       goto Exit;
     }
 
       goto Exit;
     }
 
@@ -92,7 +92,7 @@
       if ( table_len >= 0x40000L )
       {
         FT_TRACE2(( "table too large\n" ));
       if ( table_len >= 0x40000L )
       {
         FT_TRACE2(( "table too large\n" ));
-        error = TT_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         goto Exit;
       }
       face->num_locations = table_len >> shift;
         goto Exit;
       }
       face->num_locations = table_len >> shift;
       if ( table_len >= 0x20000L )
       {
         FT_TRACE2(( "table too large\n" ));
       if ( table_len >= 0x20000L )
       {
         FT_TRACE2(( "table too large\n" ));
-        error = TT_Err_Invalid_Table;
+        error = FT_THROW( Invalid_Table );
         goto Exit;
       }
       face->num_locations = table_len >> shift;
     }
 
         goto Exit;
       }
       face->num_locations = table_len >> shift;
     }
 
-    if ( face->num_locations != (FT_ULong)face->root.num_glyphs )
+    if ( face->num_locations != (FT_ULong)face->root.num_glyphs + 1 )
     {
       FT_TRACE2(( "glyph count mismatch!  loca: %d, maxp: %d\n",
     {
       FT_TRACE2(( "glyph count mismatch!  loca: %d, maxp: %d\n",
-                  face->num_locations, face->root.num_glyphs ));
+                  face->num_locations - 1, face->root.num_glyphs ));
 
       /* we only handle the case where `maxp' gives a larger value */
 
       /* we only handle the case where `maxp' gives a larger value */
-      if ( face->num_locations < (FT_ULong)face->root.num_glyphs )
+      if ( face->num_locations <= (FT_ULong)face->root.num_glyphs )
       {
       {
-        FT_Long   new_loca_len = (FT_Long)face->root.num_glyphs << shift;
+        FT_Long   new_loca_len =
+                    ( (FT_Long)( face->root.num_glyphs ) + 1 ) << shift;
 
         TT_Table  entry = face->dir_tables;
         TT_Table  limit = entry + face->num_tables;
 
         TT_Table  entry = face->dir_tables;
         TT_Table  limit = entry + face->num_tables;
 
         if ( new_loca_len <= dist )
         {
 
         if ( new_loca_len <= dist )
         {
-          face->num_locations = face->root.num_glyphs;
+          face->num_locations = face->root.num_glyphs + 1;
           table_len           = new_loca_len;
 
           FT_TRACE2(( "adjusting num_locations to %d\n",
           table_len           = new_loca_len;
 
           FT_TRACE2(( "adjusting num_locations to %d\n",
     }
 
     /* Check broken location data */
     }
 
     /* Check broken location data */
-    if ( pos1 >= face->glyf_len )
+    if ( pos1 > face->glyf_len )
     {
       FT_TRACE1(( "tt_face_get_location:"
     {
       FT_TRACE1(( "tt_face_get_location:"
-                 " too large offset=0x%08lx found for gid=0x%04lx,"
-                 " exceeding the end of glyf table (0x%08lx)\n",
-                 pos1, gindex, face->glyf_len ));
+                  " too large offset=0x%08lx found for gid=0x%04lx,"
+                  " exceeding the end of glyf table (0x%08lx)\n",
+                  pos1, gindex, face->glyf_len ));
       *asize = 0;
       return 0;
     }
 
       *asize = 0;
       return 0;
     }
 
-    if ( pos2 >= face->glyf_len )
+    if ( pos2 > face->glyf_len )
     {
       FT_TRACE1(( "tt_face_get_location:"
     {
       FT_TRACE1(( "tt_face_get_location:"
-                 " too large offset=0x%08lx found for gid=0x%04lx,"
-                 " truncate at the end of glyf table (0x%08lx)\n",
-                 pos2, gindex + 1, face->glyf_len ));
+                  " too large offset=0x%08lx found for gid=0x%04lx,"
+                  " truncate at the end of glyf table (0x%08lx)\n",
+                  pos2, gindex + 1, face->glyf_len ));
       pos2 = face->glyf_len;
     }
 
       pos2 = face->glyf_len;
     }
 
 
       face->cvt_size = 0;
       face->cvt      = NULL;
 
       face->cvt_size = 0;
       face->cvt      = NULL;
-      error          = TT_Err_Ok;
+      error          = FT_Err_Ok;
 
       goto Exit;
     }
 
       goto Exit;
     }
     FT_UNUSED( face   );
     FT_UNUSED( stream );
 
     FT_UNUSED( face   );
     FT_UNUSED( stream );
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
 
 #endif
   }
 
 #endif
   }
     {
       face->font_program      = NULL;
       face->font_program_size = 0;
     {
       face->font_program      = NULL;
       face->font_program_size = 0;
-      error                   = TT_Err_Ok;
+      error                   = FT_Err_Ok;
 
       FT_TRACE2(( "is missing\n" ));
     }
 
       FT_TRACE2(( "is missing\n" ));
     }
     FT_UNUSED( face   );
     FT_UNUSED( stream );
 
     FT_UNUSED( face   );
     FT_UNUSED( stream );
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
 
 #endif
   }
 
 #endif
   }
     {
       face->cvt_program      = NULL;
       face->cvt_program_size = 0;
     {
       face->cvt_program      = NULL;
       face->cvt_program_size = 0;
-      error                  = TT_Err_Ok;
+      error                  = FT_Err_Ok;
 
       FT_TRACE2(( "is missing\n" ));
     }
 
       FT_TRACE2(( "is missing\n" ));
     }
     FT_UNUSED( face   );
     FT_UNUSED( stream );
 
     FT_UNUSED( face   );
     FT_UNUSED( stream );
 
-    return TT_Err_Ok;
+    return FT_Err_Ok;
 
 #endif
   }
 
 #endif
   }
     /* this table is optional */
     error = face->goto_table( face, TTAG_hdmx, stream, &table_size );
     if ( error || table_size < 8 )
     /* this table is optional */
     error = face->goto_table( face, TTAG_hdmx, stream, &table_size );
     if ( error || table_size < 8 )
-      return TT_Err_Ok;
+      return FT_Err_Ok;
 
     if ( FT_FRAME_EXTRACT( table_size, face->hdmx_table ) )
       goto Exit;
 
     if ( FT_FRAME_EXTRACT( table_size, face->hdmx_table ) )
       goto Exit;
 
     if ( version != 0 || num_records > 255 || record_size > 0x10001L )
     {
 
     if ( version != 0 || num_records > 255 || record_size > 0x10001L )
     {
-      error = TT_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Fail;
     }
 
       goto Fail;
     }
 
diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttsubpix.c b/reactos/lib/3rdparty/freetype/src/truetype/ttsubpix.c
new file mode 100644 (file)
index 0000000..28470ad
--- /dev/null
@@ -0,0 +1,1011 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ttsubpix.c                                                             */
+/*                                                                         */
+/*    TrueType Subpixel Hinting.                                           */
+/*                                                                         */
+/*  Copyright 2010-2013 by                                                 */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_CALC_H
+#include FT_INTERNAL_STREAM_H
+#include FT_INTERNAL_SFNT_H
+#include FT_TRUETYPE_TAGS_H
+#include FT_OUTLINE_H
+#include FT_TRUETYPE_DRIVER_H
+
+#include "ttsubpix.h"
+
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* These rules affect how the TT Interpreter does hinting, with the      */
+  /* goal of doing subpixel hinting by (in general) ignoring x moves.      */
+  /* Some of these rules are fixes that go above and beyond the            */
+  /* stated techniques in the MS whitepaper on Cleartype, due to           */
+  /* artifacts in many glyphs.  So, these rules make some glyphs render    */
+  /* better than they do in the MS rasterizer.                             */
+  /*                                                                       */
+  /* "" string or 0 int/char indicates to apply to all glyphs.             */
+  /* "-" used as dummy placeholders, but any non-matching string works.    */
+  /*                                                                       */
+  /* Some of this could arguably be implemented in fontconfig, however:    */
+  /*                                                                       */
+  /*  - Fontconfig can't set things on a glyph-by-glyph basis.             */
+  /*  - The tweaks that happen here are very low-level, from an average    */
+  /*    user's point of view and are best implemented in the hinter.       */
+  /*                                                                       */
+  /* The goal is to make the subpixel hinting techniques as generalized    */
+  /* as possible across all fonts to prevent the need for extra rules such */
+  /* as these.                                                             */
+  /*                                                                       */
+  /* The rule structure is designed so that entirely new rules can easily  */
+  /* be added when a new compatibility feature is discovered.              */
+  /*                                                                       */
+  /* The rule structures could also use some enhancement to handle ranges. */
+  /*                                                                       */
+  /*     ****************** WORK IN PROGRESS *******************           */
+  /*                                                                       */
+
+  /* These are `classes' of fonts that can be grouped together and used in */
+  /* rules below.  A blank entry "" is required at the end of these!       */
+#define FAMILY_CLASS_RULES_SIZE  7
+
+  static const SPH_Font_Class FAMILY_CLASS_Rules
+                              [FAMILY_CLASS_RULES_SIZE] =
+  {
+    { "MS Legacy Fonts",
+      { "Aharoni",
+        "Andale Mono",
+        "Andalus",
+        "Angsana New",
+        "AngsanaUPC",
+        "Arabic Transparent",
+        "Arial Black",
+        "Arial Narrow",
+        "Arial Unicode MS",
+        "Arial",
+        "Batang",
+        "Browallia New",
+        "BrowalliaUPC",
+        "Comic Sans MS",
+        "Cordia New",
+        "CordiaUPC",
+        "Courier New",
+        "DFKai-SB",
+        "David Transparent",
+        "David",
+        "DilleniaUPC",
+        "Estrangelo Edessa",
+        "EucrosiaUPC",
+        "FangSong_GB2312",
+        "Fixed Miriam Transparent",
+        "FrankRuehl",
+        "Franklin Gothic Medium",
+        "FreesiaUPC",
+        "Garamond",
+        "Gautami",
+        "Georgia",
+        "Gulim",
+        "Impact",
+        "IrisUPC",
+        "JasmineUPC",
+        "KaiTi_GB2312",
+        "KodchiangUPC",
+        "Latha",
+        "Levenim MT",
+        "LilyUPC",
+        "Lucida Console",
+        "Lucida Sans Unicode",
+        "MS Gothic",
+        "MS Mincho",
+        "MV Boli",
+        "Mangal",
+        "Marlett",
+        "Microsoft Sans Serif",
+        "Mingliu",
+        "Miriam Fixed",
+        "Miriam Transparent",
+        "Miriam",
+        "Narkisim",
+        "Palatino Linotype",
+        "Raavi",
+        "Rod Transparent",
+        "Rod",
+        "Shruti",
+        "SimHei",
+        "Simplified Arabic Fixed",
+        "Simplified Arabic",
+        "Simsun",
+        "Sylfaen",
+        "Symbol",
+        "Tahoma",
+        "Times New Roman",
+        "Traditional Arabic",
+        "Trebuchet MS",
+        "Tunga",
+        "Verdana",
+        "Webdings",
+        "Wingdings",
+        "",
+      },
+    },
+    { "Core MS Legacy Fonts",
+      { "Arial Black",
+        "Arial Narrow",
+        "Arial Unicode MS",
+        "Arial",
+        "Comic Sans MS",
+        "Courier New",
+        "Garamond",
+        "Georgia",
+        "Impact",
+        "Lucida Console",
+        "Lucida Sans Unicode",
+        "Microsoft Sans Serif",
+        "Palatino Linotype",
+        "Tahoma",
+        "Times New Roman",
+        "Trebuchet MS",
+        "Verdana",
+        "",
+      },
+    },
+    { "Apple Legacy Fonts",
+      { "Geneva",
+        "Times",
+        "Monaco",
+        "Century",
+        "Chalkboard",
+        "Lobster",
+        "Century Gothic",
+        "Optima",
+        "Lucida Grande",
+        "Gill Sans",
+        "Baskerville",
+        "Helvetica",
+        "Helvetica Neue",
+        "",
+      },
+    },
+    { "Legacy Sans Fonts",
+      { "Andale Mono",
+        "Arial Unicode MS",
+        "Arial",
+        "Century Gothic",
+        "Comic Sans MS",
+        "Franklin Gothic Medium",
+        "Geneva",
+        "Lucida Console",
+        "Lucida Grande",
+        "Lucida Sans Unicode",
+        "Lucida Sans Typewriter",
+        "Microsoft Sans Serif",
+        "Monaco",
+        "Tahoma",
+        "Trebuchet MS",
+        "Verdana",
+        "",
+      },
+    },
+
+    { "Misc Legacy Fonts",
+      { "Dark Courier", "", }, },
+    { "Verdana Clones",
+      { "DejaVu Sans",
+        "Bitstream Vera Sans", "", }, },
+    { "Verdana and Clones",
+      { "DejaVu Sans",
+        "Bitstream Vera Sans",
+        "Verdana", "", }, },
+  };
+
+
+  /* Define this to force natural (i.e. not bitmap-compatible) widths.     */
+  /* The default leans strongly towards natural widths except for a few    */
+  /* legacy fonts where a selective combination produces nicer results.    */
+/* #define FORCE_NATURAL_WIDTHS   */
+
+
+  /* Define `classes' of styles that can be grouped together and used in   */
+  /* rules below.  A blank entry "" is required at the end of these!       */
+#define STYLE_CLASS_RULES_SIZE  5
+
+  const SPH_Font_Class STYLE_CLASS_Rules
+                       [STYLE_CLASS_RULES_SIZE] =
+  {
+    { "Regular Class",
+      { "Regular",
+        "Book",
+        "Medium",
+        "Roman",
+        "Normal",
+        "",
+      },
+    },
+    { "Regular/Italic Class",
+      { "Regular",
+        "Book",
+        "Medium",
+        "Italic",
+        "Oblique",
+        "Roman",
+        "Normal",
+        "",
+      },
+    },
+    { "Bold/BoldItalic Class",
+      { "Bold",
+        "Bold Italic",
+        "Black",
+        "",
+      },
+    },
+    { "Bold/Italic/BoldItalic Class",
+      { "Bold",
+        "Bold Italic",
+        "Black",
+        "Italic",
+        "Oblique",
+        "",
+      },
+    },
+    { "Regular/Bold Class",
+      { "Regular",
+        "Book",
+        "Medium",
+        "Normal",
+        "Roman",
+        "Bold",
+        "Black",
+        "",
+      },
+    },
+  };
+
+
+  /* Force special legacy fixes for fonts.                                 */
+#define COMPATIBILITY_MODE_RULES_SIZE  1
+
+  const SPH_TweakRule  COMPATIBILITY_MODE_Rules
+                       [COMPATIBILITY_MODE_RULES_SIZE] =
+  {
+    { "-", 0, "", 0 },
+  };
+
+
+  /* Don't do subpixel (ignore_x_mode) hinting; do normal hinting.         */
+#define PIXEL_HINTING_RULES_SIZE  2
+
+  const SPH_TweakRule  PIXEL_HINTING_Rules
+                       [PIXEL_HINTING_RULES_SIZE] =
+  {
+    /* these characters are almost always safe */
+    { "Courier New", 12, "Italic", 'z' },
+    { "Courier New", 11, "Italic", 'z' },
+  };
+
+
+  /* Subpixel hinting ignores SHPIX rules on X.  Force SHPIX for these.    */
+#define DO_SHPIX_RULES_SIZE  1
+
+  const SPH_TweakRule  DO_SHPIX_Rules
+                       [DO_SHPIX_RULES_SIZE] =
+  {
+    { "-", 0, "", 0 },
+  };
+
+
+  /* Skip Y moves that start with a point that is not on a Y pixel         */
+  /* boundary and don't move that point to a Y pixel boundary.             */
+#define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE  4
+
+  const SPH_TweakRule  SKIP_NONPIXEL_Y_MOVES_Rules
+                       [SKIP_NONPIXEL_Y_MOVES_RULES_SIZE] =
+  {
+    /* fix vwxyz thinness*/
+    { "Consolas", 0, "", 0 },
+    /* Fix thin middle stems */
+    { "Core MS Legacy Fonts", 0, "Regular", 0 },
+    /* Cyrillic small letter I */
+    { "Legacy Sans Fonts", 0, "", 0 },
+    /* Fix artifacts with some Regular & Bold */
+    { "Verdana Clones", 0, "", 0 },
+  };
+
+
+#define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE  1
+
+  const SPH_TweakRule  SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions
+                       [SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
+  {
+    /* Fixes < and > */
+    { "Courier New", 0, "Regular", 0 },
+  };
+
+
+  /* Skip Y moves that start with a point that is not on a Y pixel         */
+  /* boundary and don't move that point to a Y pixel boundary.             */
+#define SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE  2
+
+  const SPH_TweakRule  SKIP_NONPIXEL_Y_MOVES_DELTAP_Rules
+                       [SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE] =
+  {
+    /* Maintain thickness of diagonal in 'N' */
+    { "Times New Roman", 0, "Regular/Bold Class", 'N' },
+    { "Georgia", 0, "Regular/Bold Class", 'N' },
+  };
+
+
+  /* Skip Y moves that move a point off a Y pixel boundary.                */
+#define SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE  1
+
+  const SPH_TweakRule  SKIP_OFFPIXEL_Y_MOVES_Rules
+                       [SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE] =
+  {
+    { "-", 0, "", 0 },
+  };
+
+
+#define SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE  1
+
+  const SPH_TweakRule  SKIP_OFFPIXEL_Y_MOVES_Rules_Exceptions
+                       [SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
+  {
+    { "-", 0, "", 0 },
+  };
+
+
+  /* Round moves that don't move a point to a Y pixel boundary.            */
+#define ROUND_NONPIXEL_Y_MOVES_RULES_SIZE  2
+
+  const SPH_TweakRule  ROUND_NONPIXEL_Y_MOVES_Rules
+                       [ROUND_NONPIXEL_Y_MOVES_RULES_SIZE] =
+  {
+    /* Droid font instructions don't snap Y to pixels */
+    { "Droid Sans", 0, "Regular/Italic Class", 0 },
+    { "Droid Sans Mono", 0, "", 0 },
+  };
+
+
+#define ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE  1
+
+  const SPH_TweakRule  ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions
+                       [ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
+  {
+    { "-", 0, "", 0 },
+  };
+
+
+  /* Allow a Direct_Move along X freedom vector if matched.                */
+#define ALLOW_X_DMOVE_RULES_SIZE  1
+
+  const SPH_TweakRule  ALLOW_X_DMOVE_Rules
+                       [ALLOW_X_DMOVE_RULES_SIZE] =
+  {
+    /* Fixes vanishing diagonal in 4 */
+    { "Verdana", 0, "Regular", '4' },
+  };
+
+
+  /* Return MS rasterizer version 35 if matched.                           */
+#define RASTERIZER_35_RULES_SIZE  8
+
+  const SPH_TweakRule  RASTERIZER_35_Rules
+                       [RASTERIZER_35_RULES_SIZE] =
+  {
+    /* This seems to be the only way to make these look good */
+    { "Times New Roman", 0, "Regular", 'i' },
+    { "Times New Roman", 0, "Regular", 'j' },
+    { "Times New Roman", 0, "Regular", 'm' },
+    { "Times New Roman", 0, "Regular", 'r' },
+    { "Times New Roman", 0, "Regular", 'a' },
+    { "Times New Roman", 0, "Regular", 'n' },
+    { "Times New Roman", 0, "Regular", 'p' },
+    { "Times", 0, "", 0 },
+  };
+
+
+  /* Don't round to the subpixel grid.  Round to pixel grid.               */
+#define NORMAL_ROUND_RULES_SIZE  1
+
+  const SPH_TweakRule  NORMAL_ROUND_Rules
+                       [NORMAL_ROUND_RULES_SIZE] =
+  {
+    /* Fix serif thickness for certain ppems */
+    /* Can probably be generalized somehow   */
+    { "Courier New", 0, "", 0 },
+  };
+
+
+  /* Skip IUP instructions if matched.                                     */
+#define SKIP_IUP_RULES_SIZE  1
+
+  const SPH_TweakRule  SKIP_IUP_Rules
+                       [SKIP_IUP_RULES_SIZE] =
+  {
+    { "Arial", 13, "Regular", 'a' },
+  };
+
+
+  /* Skip MIAP Twilight hack if matched.                                   */
+#define MIAP_HACK_RULES_SIZE  1
+
+  const SPH_TweakRule  MIAP_HACK_Rules
+                       [MIAP_HACK_RULES_SIZE] =
+  {
+    { "Geneva", 12, "", 0 },
+  };
+
+
+  /* Skip DELTAP instructions if matched.                                  */
+#define ALWAYS_SKIP_DELTAP_RULES_SIZE  23
+
+  const SPH_TweakRule  ALWAYS_SKIP_DELTAP_Rules
+                       [ALWAYS_SKIP_DELTAP_RULES_SIZE] =
+  {
+    { "Georgia", 0, "Regular", 'k' },
+    /* fix various problems with e in different versions */
+    { "Trebuchet MS", 14, "Regular", 'e' },
+    { "Trebuchet MS", 13, "Regular", 'e' },
+    { "Trebuchet MS", 15, "Regular", 'e' },
+    { "Trebuchet MS", 0, "Italic", 'v' },
+    { "Trebuchet MS", 0, "Italic", 'w' },
+    { "Trebuchet MS", 0, "Regular", 'Y' },
+    { "Arial", 11, "Regular", 's' },
+    /* prevent problems with '3' and others */
+    { "Verdana", 10, "Regular", 0 },
+    { "Verdana", 9, "Regular", 0 },
+    /* Cyrillic small letter short I */
+    { "Legacy Sans Fonts", 0, "", 0x438 },
+    { "Legacy Sans Fonts", 0, "", 0x439 },
+    { "Arial", 10, "Regular", '6' },
+    { "Arial", 0, "Bold/BoldItalic Class", 'a' },
+    /* Make horizontal stems consistent with the rest */
+    { "Arial", 24, "Bold", 'a' },
+    { "Arial", 25, "Bold", 'a' },
+    { "Arial", 24, "Bold", 's' },
+    { "Arial", 25, "Bold", 's' },
+    { "Arial", 34, "Bold", 's' },
+    { "Arial", 35, "Bold", 's' },
+    { "Arial", 36, "Bold", 's' },
+    { "Arial", 25, "Regular", 's' },
+    { "Arial", 26, "Regular", 's' },
+  };
+
+
+  /* Always do DELTAP instructions if matched.                             */
+#define ALWAYS_DO_DELTAP_RULES_SIZE  1
+
+  const SPH_TweakRule  ALWAYS_DO_DELTAP_Rules
+                       [ALWAYS_DO_DELTAP_RULES_SIZE] =
+  {
+    { "-", 0, "", 0 },
+  };
+
+
+  /* Don't allow ALIGNRP after IUP.                                        */
+#define NO_ALIGNRP_AFTER_IUP_RULES_SIZE  1
+
+  static const SPH_TweakRule  NO_ALIGNRP_AFTER_IUP_Rules
+                              [NO_ALIGNRP_AFTER_IUP_RULES_SIZE] =
+  {
+    /* Prevent creation of dents in outline */
+    { "-", 0, "", 0 },
+  };
+
+
+  /* Don't allow DELTAP after IUP.                                         */
+#define NO_DELTAP_AFTER_IUP_RULES_SIZE  1
+
+  static const SPH_TweakRule  NO_DELTAP_AFTER_IUP_Rules
+                              [NO_DELTAP_AFTER_IUP_RULES_SIZE] =
+  {
+    { "-", 0, "", 0 },
+  };
+
+
+  /* Don't allow CALL after IUP.                                           */
+#define NO_CALL_AFTER_IUP_RULES_SIZE  1
+
+  static const SPH_TweakRule  NO_CALL_AFTER_IUP_Rules
+                              [NO_CALL_AFTER_IUP_RULES_SIZE] =
+  {
+    /* Prevent creation of dents in outline */
+    { "-", 0, "", 0 },
+  };
+
+
+  /* De-embolden these glyphs slightly.                                    */
+#define DEEMBOLDEN_RULES_SIZE  9
+
+  static const SPH_TweakRule  DEEMBOLDEN_Rules
+                              [DEEMBOLDEN_RULES_SIZE] =
+  {
+    { "Courier New", 0, "Bold", 'A' },
+    { "Courier New", 0, "Bold", 'W' },
+    { "Courier New", 0, "Bold", 'w' },
+    { "Courier New", 0, "Bold", 'M' },
+    { "Courier New", 0, "Bold", 'X' },
+    { "Courier New", 0, "Bold", 'K' },
+    { "Courier New", 0, "Bold", 'x' },
+    { "Courier New", 0, "Bold", 'z' },
+    { "Courier New", 0, "Bold", 'v' },
+  };
+
+
+  /* Embolden these glyphs slightly.                                       */
+#define EMBOLDEN_RULES_SIZE  2
+
+  static const SPH_TweakRule  EMBOLDEN_Rules
+                              [EMBOLDEN_RULES_SIZE] =
+  {
+    { "Courier New", 0, "Regular", 0 },
+    { "Courier New", 0, "Italic", 0 },
+  };
+
+
+  /* This is a CVT hack that makes thick horizontal stems on 2, 5, 7       */
+  /* similar to Windows XP.                                                */
+#define TIMES_NEW_ROMAN_HACK_RULES_SIZE  12
+
+  static const SPH_TweakRule  TIMES_NEW_ROMAN_HACK_Rules
+                              [TIMES_NEW_ROMAN_HACK_RULES_SIZE] =
+  {
+    { "Times New Roman", 16, "Italic", '2' },
+    { "Times New Roman", 16, "Italic", '5' },
+    { "Times New Roman", 16, "Italic", '7' },
+    { "Times New Roman", 16, "Regular", '2' },
+    { "Times New Roman", 16, "Regular", '5' },
+    { "Times New Roman", 16, "Regular", '7' },
+    { "Times New Roman", 17, "Italic", '2' },
+    { "Times New Roman", 17, "Italic", '5' },
+    { "Times New Roman", 17, "Italic", '7' },
+    { "Times New Roman", 17, "Regular", '2' },
+    { "Times New Roman", 17, "Regular", '5' },
+    { "Times New Roman", 17, "Regular", '7' },
+  };
+
+
+  /* This fudges distance on 2 to get rid of the vanishing stem issue.     */
+  /* A real solution to this is certainly welcome.                         */
+#define COURIER_NEW_2_HACK_RULES_SIZE  15
+
+  static const SPH_TweakRule  COURIER_NEW_2_HACK_Rules
+                              [COURIER_NEW_2_HACK_RULES_SIZE] =
+  {
+    { "Courier New", 10, "Regular", '2' },
+    { "Courier New", 11, "Regular", '2' },
+    { "Courier New", 12, "Regular", '2' },
+    { "Courier New", 13, "Regular", '2' },
+    { "Courier New", 14, "Regular", '2' },
+    { "Courier New", 15, "Regular", '2' },
+    { "Courier New", 16, "Regular", '2' },
+    { "Courier New", 17, "Regular", '2' },
+    { "Courier New", 18, "Regular", '2' },
+    { "Courier New", 19, "Regular", '2' },
+    { "Courier New", 20, "Regular", '2' },
+    { "Courier New", 21, "Regular", '2' },
+    { "Courier New", 22, "Regular", '2' },
+    { "Courier New", 23, "Regular", '2' },
+    { "Courier New", 24, "Regular", '2' },
+  };
+
+
+#ifndef FORCE_NATURAL_WIDTHS
+
+  /* Use compatible widths with these glyphs.  Compatible widths is always */
+  /* on when doing B/W TrueType instructing, but is used selectively here, */
+  /* typically on glyphs with 3 or more vertical stems.                    */
+#define COMPATIBLE_WIDTHS_RULES_SIZE  38
+
+  static const SPH_TweakRule  COMPATIBLE_WIDTHS_Rules
+                              [COMPATIBLE_WIDTHS_RULES_SIZE] =
+  {
+    { "Arial Unicode MS", 12, "Regular Class", 'm' },
+    { "Arial Unicode MS", 14, "Regular Class", 'm' },
+    /* Cyrillic small letter sha */
+    { "Arial", 10, "Regular Class", 0x448 },
+    { "Arial", 11, "Regular Class", 'm' },
+    { "Arial", 12, "Regular Class", 'm' },
+    /* Cyrillic small letter sha */
+    { "Arial", 12, "Regular Class", 0x448 },
+    { "Arial", 13, "Regular Class", 0x448 },
+    { "Arial", 14, "Regular Class", 'm' },
+    /* Cyrillic small letter sha */
+    { "Arial", 14, "Regular Class", 0x448 },
+    { "Arial", 15, "Regular Class", 0x448 },
+    { "Arial", 17, "Regular Class", 'm' },
+    { "DejaVu Sans", 15, "Regular Class", 0 },
+    { "Microsoft Sans Serif", 11, "Regular Class", 0 },
+    { "Microsoft Sans Serif", 12, "Regular Class", 0 },
+    { "Segoe UI", 11, "Regular Class", 0 },
+    { "Monaco", 0, "Regular Class", 0 },
+    { "Segoe UI", 12, "Regular Class", 'm' },
+    { "Segoe UI", 14, "Regular Class", 'm' },
+    { "Tahoma", 11, "Regular Class", 0 },
+    { "Times New Roman", 16, "Regular Class", 'c' },
+    { "Times New Roman", 16, "Regular Class", 'm' },
+    { "Times New Roman", 16, "Regular Class", 'o' },
+    { "Times New Roman", 16, "Regular Class", 'w' },
+    { "Trebuchet MS", 11, "Regular Class", 0 },
+    { "Trebuchet MS", 12, "Regular Class", 0 },
+    { "Trebuchet MS", 14, "Regular Class", 0 },
+    { "Trebuchet MS", 15, "Regular Class", 0 },
+    { "Ubuntu", 12, "Regular Class", 'm' },
+    /* Cyrillic small letter sha */
+    { "Verdana", 10, "Regular Class", 0x448 },
+    { "Verdana", 11, "Regular Class", 0x448 },
+    { "Verdana and Clones", 12, "Regular Class", 'i' },
+    { "Verdana and Clones", 12, "Regular Class", 'j' },
+    { "Verdana and Clones", 12, "Regular Class", 'l' },
+    { "Verdana and Clones", 12, "Regular Class", 'm' },
+    { "Verdana and Clones", 13, "Regular Class", 'i' },
+    { "Verdana and Clones", 13, "Regular Class", 'j' },
+    { "Verdana and Clones", 13, "Regular Class", 'l' },
+    { "Verdana and Clones", 14, "Regular Class", 'm' },
+  };
+
+
+  /* Scaling slightly in the x-direction prior to hinting results in       */
+  /* more visually pleasing glyphs in certain cases.                       */
+  /* This sometimes needs to be coordinated with compatible width rules.   */
+  /* A value of 1000 corresponds to a scaled value of 1.0.                 */
+
+#define X_SCALING_RULES_SIZE  50
+
+  static const SPH_ScaleRule  X_SCALING_Rules[X_SCALING_RULES_SIZE] =
+  {
+    { "DejaVu Sans", 12, "Regular Class", 'm', 950 },
+    { "Verdana and Clones", 12, "Regular Class", 'a', 1100 },
+    { "Verdana and Clones", 13, "Regular Class", 'a', 1050 },
+    { "Arial", 11, "Regular Class", 'm', 975 },
+    { "Arial", 12, "Regular Class", 'm', 1050 },
+    /* Cyrillic small letter el */
+    { "Arial", 13, "Regular Class", 0x43B, 950 },
+    { "Arial", 13, "Regular Class", 'o', 950 },
+    { "Arial", 13, "Regular Class", 'e', 950 },
+    { "Arial", 14, "Regular Class", 'm', 950 },
+    /* Cyrillic small letter el */
+    { "Arial", 15, "Regular Class", 0x43B, 925 },
+    { "Bitstream Vera Sans", 10, "Regular/Italic Class", 0, 1100 },
+    { "Bitstream Vera Sans", 12, "Regular/Italic Class", 0, 1050 },
+    { "Bitstream Vera Sans", 16, "Regular Class", 0, 1050 },
+    { "Bitstream Vera Sans", 9, "Regular/Italic Class", 0, 1050 },
+    { "DejaVu Sans", 12, "Regular Class", 'l', 975 },
+    { "DejaVu Sans", 12, "Regular Class", 'i', 975 },
+    { "DejaVu Sans", 12, "Regular Class", 'j', 975 },
+    { "DejaVu Sans", 13, "Regular Class", 'l', 950 },
+    { "DejaVu Sans", 13, "Regular Class", 'i', 950 },
+    { "DejaVu Sans", 13, "Regular Class", 'j', 950 },
+    { "DejaVu Sans", 10, "Regular/Italic Class", 0, 1100 },
+    { "DejaVu Sans", 12, "Regular/Italic Class", 0, 1050 },
+    { "Georgia", 10, "", 0, 1050 },
+    { "Georgia", 11, "", 0, 1100 },
+    { "Georgia", 12, "", 0, 1025 },
+    { "Georgia", 13, "", 0, 1050 },
+    { "Georgia", 16, "", 0, 1050 },
+    { "Georgia", 17, "", 0, 1030 },
+    { "Liberation Sans", 12, "Regular Class", 'm', 1100 },
+    { "Lucida Grande", 11, "Regular Class", 'm', 1100 },
+    { "Microsoft Sans Serif", 11, "Regular Class", 'm', 950 },
+    { "Microsoft Sans Serif", 12, "Regular Class", 'm', 1050 },
+    { "Segoe UI", 12, "Regular Class", 'H', 1050 },
+    { "Segoe UI", 12, "Regular Class", 'm', 1050 },
+    { "Segoe UI", 14, "Regular Class", 'm', 1050 },
+    { "Tahoma", 11, "Regular Class", 'i', 975 },
+    { "Tahoma", 11, "Regular Class", 'l', 975 },
+    { "Tahoma", 11, "Regular Class", 'j', 900 },
+    { "Tahoma", 11, "Regular Class", 'm', 918 },
+    { "Verdana", 10, "Regular/Italic Class", 0, 1100 },
+    { "Verdana", 12, "Regular Class", 'm', 975 },
+    { "Verdana", 12, "Regular/Italic Class", 0, 1050 },
+    { "Verdana", 13, "Regular/Italic Class", 'i', 950 },
+    { "Verdana", 13, "Regular/Italic Class", 'j', 950 },
+    { "Verdana", 13, "Regular/Italic Class", 'l', 950 },
+    { "Verdana", 16, "Regular Class", 0, 1050 },
+    { "Verdana", 9, "Regular/Italic Class", 0, 1050 },
+    { "Times New Roman", 16, "Regular Class", 'm', 918 },
+    { "Trebuchet MS", 11, "Regular Class", 'm', 800 },
+    { "Trebuchet MS", 12, "Regular Class", 'm', 800 },
+  };
+
+#else
+
+#define COMPATIBLE_WIDTHS_RULES_SIZE  1
+
+  static const SPH_TweakRule  COMPATIBLE_WIDTHS_Rules
+                              [COMPATIBLE_WIDTHS_RULES_SIZE] =
+  {
+    { "-", 0, "", 0 },
+  };
+
+
+#define X_SCALING_RULES_SIZE  1
+
+  static const SPH_ScaleRule  X_SCALING_Rules
+                              [X_SCALING_RULES_SIZE] =
+  {
+    { "-", 0, "", 0, 1000 },
+  };
+
+#endif /* FORCE_NATURAL_WIDTHS */
+
+
+  FT_LOCAL_DEF( FT_Bool )
+  is_member_of_family_class( const FT_String*  detected_font_name,
+                             const FT_String*  rule_font_name )
+  {
+    FT_UInt  i, j;
+
+
+    /* Does font name match rule family? */
+    if ( strcmp( detected_font_name, rule_font_name ) == 0 )
+      return TRUE;
+
+    /* Is font name a wildcard ""? */
+    if ( strcmp( rule_font_name, "" ) == 0 )
+      return TRUE;
+
+    /* Is font name contained in a class list? */
+    for ( i = 0; i < FAMILY_CLASS_RULES_SIZE; i++ )
+    {
+      if ( strcmp( FAMILY_CLASS_Rules[i].name, rule_font_name ) == 0 )
+      {
+        for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )
+        {
+          if ( strcmp( FAMILY_CLASS_Rules[i].member[j], "" ) == 0 )
+            continue;
+          if ( strcmp( FAMILY_CLASS_Rules[i].member[j],
+                       detected_font_name ) == 0 )
+            return TRUE;
+        }
+      }
+    }
+
+    return FALSE;
+  }
+
+
+  FT_LOCAL_DEF( FT_Bool )
+  is_member_of_style_class( const FT_String*  detected_font_style,
+                            const FT_String*  rule_font_style )
+  {
+    FT_UInt  i, j;
+
+
+    /* Does font style match rule style? */
+    if ( strcmp( detected_font_style, rule_font_style ) == 0 )
+      return TRUE;
+
+    /* Is font style a wildcard ""? */
+    if ( strcmp( rule_font_style, "" ) == 0 )
+      return TRUE;
+
+    /* Is font style contained in a class list? */
+    for ( i = 0; i < STYLE_CLASS_RULES_SIZE; i++ )
+    {
+      if ( strcmp( STYLE_CLASS_Rules[i].name, rule_font_style ) == 0 )
+      {
+        for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )
+        {
+          if ( strcmp( STYLE_CLASS_Rules[i].member[j], "" ) == 0 )
+            continue;
+          if ( strcmp( STYLE_CLASS_Rules[i].member[j],
+                       detected_font_style ) == 0 )
+            return TRUE;
+        }
+      }
+    }
+
+    return FALSE;
+  }
+
+
+  FT_LOCAL_DEF( FT_Bool )
+  sph_test_tweak( TT_Face               face,
+                  const FT_String*      family,
+                  FT_UInt               ppem,
+                  const FT_String*      style,
+                  FT_UInt               glyph_index,
+                  const SPH_TweakRule*  rule,
+                  FT_UInt               num_rules )
+  {
+    FT_UInt  i;
+
+
+    /* rule checks may be able to be optimized further */
+    for ( i = 0; i < num_rules; i++ )
+    {
+      if ( family                                                   &&
+           ( is_member_of_family_class ( family, rule[i].family ) ) )
+        if ( rule[i].ppem == 0    ||
+             rule[i].ppem == ppem )
+          if ( style                                             &&
+               is_member_of_style_class ( style, rule[i].style ) )
+            if ( rule[i].glyph == 0                                ||
+                 FT_Get_Char_Index( (FT_Face)face,
+                                    rule[i].glyph ) == glyph_index )
+        return TRUE;
+    }
+
+    return FALSE;
+  }
+
+
+  static FT_UInt
+  scale_test_tweak( TT_Face               face,
+                    const FT_String*      family,
+                    FT_UInt               ppem,
+                    const FT_String*      style,
+                    FT_UInt               glyph_index,
+                    const SPH_ScaleRule*  rule,
+                    FT_UInt               num_rules )
+  {
+    FT_UInt  i;
+
+
+    /* rule checks may be able to be optimized further */
+    for ( i = 0; i < num_rules; i++ )
+    {
+      if ( family                                                   &&
+           ( is_member_of_family_class ( family, rule[i].family ) ) )
+        if ( rule[i].ppem == 0    ||
+             rule[i].ppem == ppem )
+          if ( style                                            &&
+               is_member_of_style_class( style, rule[i].style ) )
+            if ( rule[i].glyph == 0                                ||
+                 FT_Get_Char_Index( (FT_Face)face,
+                                    rule[i].glyph ) == glyph_index )
+        return rule[i].scale;
+    }
+
+    return 1000;
+  }
+
+
+  FT_LOCAL_DEF( FT_UInt )
+  sph_test_tweak_x_scaling( TT_Face           face,
+                            const FT_String*  family,
+                            FT_UInt           ppem,
+                            const FT_String*  style,
+                            FT_UInt           glyph_index )
+  {
+    return scale_test_tweak( face, family, ppem, style, glyph_index,
+                             X_SCALING_Rules, X_SCALING_RULES_SIZE );
+  }
+
+
+#define TWEAK_RULES( x )                                       \
+  if ( sph_test_tweak( face, family, ppem, style, glyph_index, \
+                       x##_Rules, x##_RULES_SIZE ) )           \
+    loader->exec->sph_tweak_flags |= SPH_TWEAK_##x;
+
+#define TWEAK_RULES_EXCEPTIONS( x )                                        \
+  if ( sph_test_tweak( face, family, ppem, style, glyph_index,             \
+                       x##_Rules_Exceptions, x##_RULES_EXCEPTIONS_SIZE ) ) \
+    loader->exec->sph_tweak_flags &= ~SPH_TWEAK_##x;
+
+
+  FT_LOCAL_DEF( void )
+  sph_set_tweaks( TT_Loader  loader,
+                  FT_UInt    glyph_index )
+  {
+    TT_Face     face   = (TT_Face)loader->face;
+    FT_String*  family = face->root.family_name;
+    int         ppem   = loader->size->metrics.x_ppem;
+    FT_String*  style  = face->root.style_name;
+
+
+    /* don't apply rules if style isn't set */
+    if ( !face->root.style_name )
+      return;
+
+#ifdef SPH_DEBUG_MORE_VERBOSE
+    printf( "%s,%d,%s,%c=%d ",
+            family, ppem, style, glyph_index, glyph_index );
+#endif
+
+    TWEAK_RULES( PIXEL_HINTING );
+
+    if ( loader->exec->sph_tweak_flags & SPH_TWEAK_PIXEL_HINTING )
+    {
+      loader->exec->ignore_x_mode = FALSE;
+      return;
+    }
+
+    TWEAK_RULES( ALLOW_X_DMOVE );
+    TWEAK_RULES( ALWAYS_DO_DELTAP );
+    TWEAK_RULES( ALWAYS_SKIP_DELTAP );
+    TWEAK_RULES( DEEMBOLDEN );
+    TWEAK_RULES( DO_SHPIX );
+    TWEAK_RULES( EMBOLDEN );
+    TWEAK_RULES( MIAP_HACK );
+    TWEAK_RULES( NORMAL_ROUND );
+    TWEAK_RULES( NO_ALIGNRP_AFTER_IUP );
+    TWEAK_RULES( NO_CALL_AFTER_IUP );
+    TWEAK_RULES( NO_DELTAP_AFTER_IUP );
+    TWEAK_RULES( RASTERIZER_35 );
+    TWEAK_RULES( SKIP_IUP );
+
+    TWEAK_RULES( SKIP_OFFPIXEL_Y_MOVES );
+    TWEAK_RULES_EXCEPTIONS( SKIP_OFFPIXEL_Y_MOVES );
+
+    TWEAK_RULES( SKIP_NONPIXEL_Y_MOVES_DELTAP );
+
+    TWEAK_RULES( SKIP_NONPIXEL_Y_MOVES );
+    TWEAK_RULES_EXCEPTIONS( SKIP_NONPIXEL_Y_MOVES );
+
+    TWEAK_RULES( ROUND_NONPIXEL_Y_MOVES );
+    TWEAK_RULES_EXCEPTIONS( ROUND_NONPIXEL_Y_MOVES );
+
+    if ( loader->exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 )
+    {
+      if ( loader->exec->rasterizer_version != TT_INTERPRETER_VERSION_35 )
+      {
+        loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35;
+        loader->exec->size->cvt_ready    = FALSE;
+
+        tt_size_ready_bytecode(
+          loader->exec->size,
+          FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );
+      }
+      else
+        loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35;
+    }
+    else
+    {
+      if ( loader->exec->rasterizer_version  !=
+           SPH_OPTION_SET_RASTERIZER_VERSION )
+      {
+        loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
+        loader->exec->size->cvt_ready    = FALSE;
+
+        tt_size_ready_bytecode(
+          loader->exec->size,
+          FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );
+      }
+      else
+        loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
+    }
+
+    if ( IS_HINTED( loader->load_flags ) )
+    {
+      TWEAK_RULES( TIMES_NEW_ROMAN_HACK );
+      TWEAK_RULES( COURIER_NEW_2_HACK );
+    }
+
+    if ( sph_test_tweak( face, family, ppem, style, glyph_index,
+           COMPATIBILITY_MODE_Rules, COMPATIBILITY_MODE_RULES_SIZE ) )
+      loader->exec->face->sph_compatibility_mode = TRUE;
+
+
+    if ( IS_HINTED( loader->load_flags ) )
+    {
+      if ( sph_test_tweak( face, family, ppem, style, glyph_index,
+             COMPATIBLE_WIDTHS_Rules, COMPATIBLE_WIDTHS_RULES_SIZE ) )
+        loader->exec->compatible_widths |= TRUE;
+    }
+  }
+
+#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+  /* ANSI C doesn't like empty source files */
+  typedef int  _tt_subpix_dummy;
+
+#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttsubpix.h b/reactos/lib/3rdparty/freetype/src/truetype/ttsubpix.h
new file mode 100644 (file)
index 0000000..8a54fc7
--- /dev/null
@@ -0,0 +1,110 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ttsubpix.h                                                             */
+/*                                                                         */
+/*    TrueType Subpixel Hinting.                                           */
+/*                                                                         */
+/*  Copyright 2010-2013 by                                                 */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __TTSUBPIX_H__
+#define __TTSUBPIX_H__
+
+#include <ft2build.h>
+#include "ttobjs.h"
+#include "ttinterp.h"
+
+
+FT_BEGIN_HEADER
+
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* ID flags to identify special functions at FDEF and runtime.           */
+  /*                                                                       */
+  /*                                                                       */
+#define SPH_FDEF_INLINE_DELTA_1       0x0000001
+#define SPH_FDEF_INLINE_DELTA_2       0x0000002
+#define SPH_FDEF_DIAGONAL_STROKE      0x0000004
+#define SPH_FDEF_VACUFORM_ROUND_1     0x0000008
+#define SPH_FDEF_TTFAUTOHINT_1        0x0000010
+#define SPH_FDEF_SPACING_1            0x0000020
+#define SPH_FDEF_SPACING_2            0x0000040
+#define SPH_FDEF_TYPEMAN_STROKES      0x0000080
+#define SPH_FDEF_TYPEMAN_DIAGENDCTRL  0x0000100
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* Tweak flags that are set for each glyph by the below rules.           */
+  /*                                                                       */
+  /*                                                                       */
+#define SPH_TWEAK_ALLOW_X_DMOVE                   0x0000001
+#define SPH_TWEAK_ALWAYS_DO_DELTAP                0x0000002
+#define SPH_TWEAK_ALWAYS_SKIP_DELTAP              0x0000004
+#define SPH_TWEAK_COURIER_NEW_2_HACK              0x0000008
+#define SPH_TWEAK_DEEMBOLDEN                      0x0000010
+#define SPH_TWEAK_DO_SHPIX                        0x0000020
+#define SPH_TWEAK_EMBOLDEN                        0x0000040
+#define SPH_TWEAK_MIAP_HACK                       0x0000080
+#define SPH_TWEAK_NORMAL_ROUND                    0x0000100
+#define SPH_TWEAK_NO_ALIGNRP_AFTER_IUP            0x0000200
+#define SPH_TWEAK_NO_CALL_AFTER_IUP               0x0000400
+#define SPH_TWEAK_NO_DELTAP_AFTER_IUP             0x0000800
+#define SPH_TWEAK_PIXEL_HINTING                   0x0001000
+#define SPH_TWEAK_RASTERIZER_35                   0x0002000
+#define SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES          0x0004000
+#define SPH_TWEAK_SKIP_IUP                        0x0008000
+#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES           0x0010000
+#define SPH_TWEAK_SKIP_OFFPIXEL_Y_MOVES           0x0020000
+#define SPH_TWEAK_TIMES_NEW_ROMAN_HACK            0x0040000
+#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP    0x0080000
+
+
+  FT_LOCAL( FT_Bool )
+  sph_test_tweak( TT_Face               face,
+                  const FT_String*      family,
+                  FT_UInt               ppem,
+                  const FT_String*      style,
+                  FT_UInt               glyph_index,
+                  const SPH_TweakRule*  rule,
+                  FT_UInt               num_rules );
+
+  FT_LOCAL( FT_UInt )
+  sph_test_tweak_x_scaling( TT_Face           face,
+                            const FT_String*  family,
+                            FT_UInt           ppem,
+                            const FT_String*  style,
+                            FT_UInt           glyph_index );
+
+  FT_LOCAL( void )
+  sph_set_tweaks( TT_Loader  loader,
+                  FT_UInt    glyph_index );
+
+
+  /* These macros are defined absent a method for setting them */
+#define SPH_OPTION_BITMAP_WIDTHS           FALSE
+#define SPH_OPTION_SET_SUBPIXEL            TRUE
+#define SPH_OPTION_SET_GRAYSCALE           FALSE
+#define SPH_OPTION_SET_COMPATIBLE_WIDTHS   FALSE
+#define SPH_OPTION_SET_RASTERIZER_VERSION  38
+
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+
+FT_END_HEADER
+
+#endif /* __TTSUBPIX_H__ */
+
+/* END */
diff --git a/reactos/lib/3rdparty/freetype/src/type1/Jamfile b/reactos/lib/3rdparty/freetype/src/type1/Jamfile
deleted file mode 100644 (file)
index 8e366ba..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/type1 Jamfile
-#
-# Copyright 2001 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) type1 ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = t1afm t1driver t1objs t1load t1gload t1parse ;
-  }
-  else
-  {
-    _sources = type1 ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/type1 Jamfile
index 780ab33..de9c199 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    AFM support for Type 1 fonts (body).                                 */
 /*                                                                         */
 /*                                                                         */
 /*    AFM support for Type 1 fonts (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2011, 2013 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 #include <ft2build.h>
 #include "t1afm.h"
 
 #include <ft2build.h>
 #include "t1afm.h"
-#include "t1errors.h"
+#include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_POSTSCRIPT_AUX_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_POSTSCRIPT_AUX_H
+#include "t1errors.h"
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
                FT_Stream     stream,
                AFM_FontInfo  fi )
   {
                FT_Stream     stream,
                AFM_FontInfo  fi )
   {
-    FT_Error      error = T1_Err_Ok;
+    FT_Error      error  = FT_Err_Ok;
     FT_Memory     memory = stream->memory;
     FT_Byte*      start;
     FT_Byte*      limit;
     FT_Memory     memory = stream->memory;
     FT_Byte*      start;
     FT_Byte*      limit;
 
     start = (FT_Byte*)stream->cursor;
     limit = (FT_Byte*)stream->limit;
 
     start = (FT_Byte*)stream->cursor;
     limit = (FT_Byte*)stream->limit;
-    p     = start;
 
     /* Figure out how long the width table is.          */
     /* This info is a little-endian short at offset 99. */
     p = start + 99;
     if ( p + 2 > limit )
     {
 
     /* Figure out how long the width table is.          */
     /* This info is a little-endian short at offset 99. */
     p = start + 99;
     if ( p + 2 > limit )
     {
-      error = T1_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
     width_table_length = FT_PEEK_USHORT_LE( p );
       goto Exit;
     }
     width_table_length = FT_PEEK_USHORT_LE( p );
 
     if ( p + 2 > limit )
     {
 
     if ( p + 2 > limit )
     {
-      error = T1_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
     p += 2;
     if ( p + 4 * fi->NumKernPair > limit )
     {
     p += 2;
     if ( p + 4 * fi->NumKernPair > limit )
     {
-      error = T1_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
     FT_Memory      memory  = stream->memory;
     AFM_ParserRec  parser;
     AFM_FontInfo   fi      = NULL;
     FT_Memory      memory  = stream->memory;
     AFM_ParserRec  parser;
     AFM_FontInfo   fi      = NULL;
-    FT_Error       error   = T1_Err_Unknown_File_Format;
+    FT_Error       error   = FT_ERR( Unknown_File_Format );
     T1_Font        t1_font = &( (T1_Face)t1_face )->type1;
 
 
     T1_Font        t1_font = &( (T1_Face)t1_face )->type1;
 
 
     fi->Descender = t1_font->font_bbox.yMin;
 
     psaux = (PSAux_Service)( (T1_Face)t1_face )->psaux;
     fi->Descender = t1_font->font_bbox.yMin;
 
     psaux = (PSAux_Service)( (T1_Face)t1_face )->psaux;
-    if ( psaux && psaux->afm_parser_funcs )
+    if ( psaux->afm_parser_funcs )
     {
       error = psaux->afm_parser_funcs->init( &parser,
                                              stream->memory,
     {
       error = psaux->afm_parser_funcs->init( &parser,
                                              stream->memory,
       }
     }
 
       }
     }
 
-    if ( error == T1_Err_Unknown_File_Format )
+    if ( FT_ERR_EQ( error, Unknown_File_Format ) )
     {
       FT_Byte*  start = stream->cursor;
 
     {
       FT_Byte*  start = stream->cursor;
 
 
 
     if ( !fi )
 
 
     if ( !fi )
-      return T1_Err_Invalid_Argument;
+      return FT_THROW( Invalid_Argument );
 
     for ( i = 0; i < fi->NumTrackKern; i++ )
     {
 
     for ( i = 0; i < fi->NumTrackKern; i++ )
     {
       }
     }
 
       }
     }
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
index 8c398ee..697288d 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 driver interface (body).                                      */
 /*                                                                         */
 /*                                                                         */
 /*    Type 1 driver interface (body).                                      */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2009 by             */
+/*  Copyright 1996-2004, 2006, 2007, 2009, 2011, 2013 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -61,7 +61,7 @@
   {
     FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max );
 
   {
     FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max );
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   t1_get_name_index( T1_Face     face,
                      FT_String*  glyph_name )
   {
   t1_get_name_index( T1_Face     face,
                      FT_String*  glyph_name )
   {
-    FT_Int      i;
-    FT_String*  gname;
+    FT_Int  i;
 
 
     for ( i = 0; i < face->type1.num_glyphs; i++ )
     {
 
 
     for ( i = 0; i < face->type1.num_glyphs; i++ )
     {
-      gname = face->type1.glyph_names[i];
+      FT_String*  gname = face->type1.glyph_names[i];
+
 
       if ( !ft_strcmp( glyph_name, gname ) )
         return (FT_UInt)i;
 
       if ( !ft_strcmp( glyph_name, gname ) )
         return (FT_UInt)i;
   {
     *afont_info = ((T1_Face)face)->type1.font_info;
 
   {
     *afont_info = ((T1_Face)face)->type1.font_info;
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   {
     *afont_extra = ((T1_Face)face)->type1.font_extra;
 
   {
     *afont_extra = ((T1_Face)face)->type1.font_extra;
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   {
     *afont_private = ((T1_Face)face)->type1.private_dict;
 
   {
     *afont_private = ((T1_Face)face)->type1.private_dict;
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
+  }
+
+
+  static FT_Long
+  t1_ps_get_font_value( FT_Face       face,
+                        PS_Dict_Keys  key,
+                        FT_UInt       idx,
+                        void         *value,
+                        FT_Long       value_len )
+  {
+    FT_Long  retval = -1;
+    T1_Face  t1face = (T1_Face)face;
+    T1_Font  type1  = &t1face->type1;
+
+
+    switch ( key )
+    {
+    case PS_DICT_FONT_TYPE:
+      retval = sizeof ( type1->font_type );
+      if ( value && value_len >= retval )
+        *((FT_Byte *)value) = type1->font_type;
+      break;
+
+    case PS_DICT_FONT_MATRIX:
+      if ( idx < sizeof ( type1->font_matrix ) /
+                   sizeof ( type1->font_matrix.xx ) )
+      {
+        FT_Fixed  val = 0;
+
+
+        retval = sizeof ( val );
+        if ( value && value_len >= retval )
+        {
+          switch ( idx )
+          {
+          case 0:
+            val = type1->font_matrix.xx;
+            break;
+          case 1:
+            val = type1->font_matrix.xy;
+            break;
+          case 2:
+            val = type1->font_matrix.yx;
+            break;
+          case 3:
+            val = type1->font_matrix.yy;
+            break;
+          }
+          *((FT_Fixed *)value) = val;
+        }
+      }
+      break;
+
+    case PS_DICT_FONT_BBOX:
+      if ( idx < sizeof ( type1->font_bbox ) /
+                   sizeof ( type1->font_bbox.xMin ) )
+      {
+        FT_Fixed val = 0;
+
+
+        retval = sizeof ( val );
+        if ( value && value_len >= retval )
+        {
+          switch ( idx )
+          {
+          case 0:
+            val = type1->font_bbox.xMin;
+            break;
+          case 1:
+            val = type1->font_bbox.yMin;
+            break;
+          case 2:
+            val = type1->font_bbox.xMax;
+            break;
+          case 3:
+            val = type1->font_bbox.yMax;
+            break;
+          }
+          *((FT_Fixed *)value) = val;
+        }
+      }
+      break;
+
+    case PS_DICT_PAINT_TYPE:
+      retval = sizeof ( type1->paint_type );
+      if ( value && value_len >= retval )
+        *((FT_Byte *)value) = type1->paint_type;
+      break;
+
+    case PS_DICT_FONT_NAME:
+      retval = (FT_Long)( ft_strlen( type1->font_name ) + 1 );
+      if ( value && value_len >= retval )
+        ft_memcpy( value, (void *)( type1->font_name ), retval );
+      break;
+
+    case PS_DICT_UNIQUE_ID:
+      retval = sizeof ( type1->private_dict.unique_id );
+      if ( value && value_len >= retval )
+        *((FT_Int *)value) = type1->private_dict.unique_id;
+      break;
+
+    case PS_DICT_NUM_CHAR_STRINGS:
+      retval = sizeof ( type1->num_glyphs );
+      if ( value && value_len >= retval )
+        *((FT_Int *)value) = type1->num_glyphs;
+      break;
+
+    case PS_DICT_CHAR_STRING_KEY:
+      if ( idx < (FT_UInt)type1->num_glyphs )
+      {
+        retval = (FT_Long)( ft_strlen( type1->glyph_names[idx] ) + 1 );
+        if ( value && value_len >= retval )
+        {
+          ft_memcpy( value, (void *)( type1->glyph_names[idx] ), retval );
+          ((FT_Char *)value)[retval - 1] = (FT_Char)'\0';
+        }
+      }
+      break;
+
+    case PS_DICT_CHAR_STRING:
+      if ( idx < (FT_UInt)type1->num_glyphs )
+      {
+        retval = (FT_Long)( type1->charstrings_len[idx] + 1 );
+        if ( value && value_len >= retval )
+        {
+          ft_memcpy( value, (void *)( type1->charstrings[idx] ),
+                     retval - 1 );
+          ((FT_Char *)value)[retval - 1] = (FT_Char)'\0';
+        }
+      }
+      break;
+
+    case PS_DICT_ENCODING_TYPE:
+      retval = sizeof ( type1->encoding_type );
+      if ( value && value_len >= retval )
+        *((T1_EncodingType *)value) = type1->encoding_type;
+      break;
+
+    case PS_DICT_ENCODING_ENTRY:
+      if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY &&
+           idx < (FT_UInt)type1->encoding.num_chars       )
+      {
+        retval = (FT_Long)( ft_strlen( type1->encoding.char_name[idx] ) + 1 );
+        if ( value && value_len >= retval )
+        {
+          ft_memcpy( value, (void *)( type1->encoding.char_name[idx] ),
+                     retval - 1 );
+          ((FT_Char *)value)[retval - 1] = (FT_Char)'\0';
+        }
+      }
+      break;
+
+    case PS_DICT_NUM_SUBRS:
+      retval = sizeof ( type1->num_subrs );
+      if ( value && value_len >= retval )
+        *((FT_Int *)value) = type1->num_subrs;
+      break;
+
+    case PS_DICT_SUBR:
+      if ( idx < (FT_UInt)type1->num_subrs )
+      {
+        retval = (FT_Long)( type1->subrs_len[idx] + 1 );
+        if ( value && value_len >= retval )
+        {
+          ft_memcpy( value, (void *)( type1->subrs[idx] ), retval - 1 );
+          ((FT_Char *)value)[retval - 1] = (FT_Char)'\0';
+        }
+      }
+      break;
+
+    case PS_DICT_STD_HW:
+      retval = sizeof ( type1->private_dict.standard_width[0] );
+      if ( value && value_len >= retval )
+        *((FT_UShort *)value) = type1->private_dict.standard_width[0];
+      break;
+
+    case PS_DICT_STD_VW:
+      retval = sizeof ( type1->private_dict.standard_height[0] );
+      if ( value && value_len >= retval )
+        *((FT_UShort *)value) = type1->private_dict.standard_height[0];
+      break;
+
+    case PS_DICT_NUM_BLUE_VALUES:
+      retval = sizeof ( type1->private_dict.num_blue_values );
+      if ( value && value_len >= retval )
+        *((FT_Byte *)value) = type1->private_dict.num_blue_values;
+      break;
+
+    case PS_DICT_BLUE_VALUE:
+      if ( idx < type1->private_dict.num_blue_values )
+      {
+        retval = sizeof ( type1->private_dict.blue_values[idx] );
+        if ( value && value_len >= retval )
+          *((FT_Short *)value) = type1->private_dict.blue_values[idx];
+      }
+      break;
+
+    case PS_DICT_BLUE_SCALE:
+      retval = sizeof ( type1->private_dict.blue_scale );
+      if ( value && value_len >= retval )
+        *((FT_Fixed *)value) = type1->private_dict.blue_scale;
+      break;
+
+    case PS_DICT_BLUE_FUZZ:
+      retval = sizeof ( type1->private_dict.blue_fuzz );
+      if ( value && value_len >= retval )
+        *((FT_Int *)value) = type1->private_dict.blue_fuzz;
+      break;
+
+    case PS_DICT_BLUE_SHIFT:
+      retval = sizeof ( type1->private_dict.blue_shift );
+      if ( value && value_len >= retval )
+        *((FT_Int *)value) = type1->private_dict.blue_shift;
+      break;
+
+    case PS_DICT_NUM_OTHER_BLUES:
+      retval = sizeof ( type1->private_dict.num_other_blues );
+      if ( value && value_len >= retval )
+        *((FT_Byte *)value) = type1->private_dict.num_other_blues;
+      break;
+
+    case PS_DICT_OTHER_BLUE:
+      if ( idx < type1->private_dict.num_other_blues )
+      {
+        retval = sizeof ( type1->private_dict.other_blues[idx] );
+        if ( value && value_len >= retval )
+          *((FT_Short *)value) = type1->private_dict.other_blues[idx];
+      }
+      break;
+
+    case PS_DICT_NUM_FAMILY_BLUES:
+      retval = sizeof ( type1->private_dict.num_family_blues );
+      if ( value && value_len >= retval )
+        *((FT_Byte *)value) = type1->private_dict.num_family_blues;
+      break;
+
+    case PS_DICT_FAMILY_BLUE:
+      if ( idx < type1->private_dict.num_family_blues )
+      {
+        retval = sizeof ( type1->private_dict.family_blues[idx] );
+        if ( value && value_len >= retval )
+          *((FT_Short *)value) = type1->private_dict.family_blues[idx];
+      }
+      break;
+
+    case PS_DICT_NUM_FAMILY_OTHER_BLUES:
+      retval = sizeof ( type1->private_dict.num_family_other_blues );
+      if ( value && value_len >= retval )
+        *((FT_Byte *)value) = type1->private_dict.num_family_other_blues;
+      break;
+
+    case PS_DICT_FAMILY_OTHER_BLUE:
+      if ( idx < type1->private_dict.num_family_other_blues )
+      {
+        retval = sizeof ( type1->private_dict.family_other_blues[idx] );
+        if ( value && value_len >= retval )
+          *((FT_Short *)value) = type1->private_dict.family_other_blues[idx];
+      }
+      break;
+
+    case PS_DICT_NUM_STEM_SNAP_H:
+      retval = sizeof ( type1->private_dict.num_snap_widths );
+      if ( value && value_len >= retval )
+        *((FT_Byte *)value) = type1->private_dict.num_snap_widths;
+      break;
+
+    case PS_DICT_STEM_SNAP_H:
+      if ( idx < type1->private_dict.num_snap_widths )
+      {
+        retval = sizeof ( type1->private_dict.snap_widths[idx] );
+        if ( value && value_len >= retval )
+          *((FT_Short *)value) = type1->private_dict.snap_widths[idx];
+      }
+      break;
+
+    case PS_DICT_NUM_STEM_SNAP_V:
+      retval = sizeof ( type1->private_dict.num_snap_heights );
+      if ( value && value_len >= retval )
+        *((FT_Byte *)value) = type1->private_dict.num_snap_heights;
+      break;
+
+    case PS_DICT_STEM_SNAP_V:
+      if ( idx < type1->private_dict.num_snap_heights )
+      {
+        retval = sizeof ( type1->private_dict.snap_heights[idx] );
+        if ( value && value_len >= retval )
+          *((FT_Short *)value) = type1->private_dict.snap_heights[idx];
+      }
+      break;
+
+    case PS_DICT_RND_STEM_UP:
+      retval = sizeof ( type1->private_dict.round_stem_up );
+      if ( value && value_len >= retval )
+        *((FT_Bool *)value) = type1->private_dict.round_stem_up;
+      break;
+
+    case PS_DICT_FORCE_BOLD:
+      retval = sizeof ( type1->private_dict.force_bold );
+      if ( value && value_len >= retval )
+        *((FT_Bool *)value) = type1->private_dict.force_bold;
+      break;
+
+    case PS_DICT_MIN_FEATURE:
+      if ( idx < sizeof ( type1->private_dict.min_feature ) /
+                   sizeof ( type1->private_dict.min_feature[0] ) )
+      {
+        retval = sizeof ( type1->private_dict.min_feature[idx] );
+        if ( value && value_len >= retval )
+          *((FT_Short *)value) = type1->private_dict.min_feature[idx];
+      }
+      break;
+
+    case PS_DICT_LEN_IV:
+      retval = sizeof ( type1->private_dict.lenIV );
+      if ( value && value_len >= retval )
+        *((FT_Int *)value) = type1->private_dict.lenIV;
+      break;
+
+    case PS_DICT_PASSWORD:
+      retval = sizeof ( type1->private_dict.password );
+      if ( value && value_len >= retval )
+        *((FT_Long *)value) = type1->private_dict.password;
+      break;
+
+    case PS_DICT_LANGUAGE_GROUP:
+      retval = sizeof ( type1->private_dict.language_group );
+      if ( value && value_len >= retval )
+        *((FT_Long *)value) = type1->private_dict.language_group;
+      break;
+
+    case PS_DICT_IS_FIXED_PITCH:
+      retval = sizeof ( type1->font_info.is_fixed_pitch );
+      if ( value && value_len >= retval )
+        *((FT_Bool *)value) = type1->font_info.is_fixed_pitch;
+      break;
+
+    case PS_DICT_UNDERLINE_POSITION:
+      retval = sizeof ( type1->font_info.underline_position );
+      if ( value && value_len >= retval )
+        *((FT_Short *)value) = type1->font_info.underline_position;
+      break;
+
+    case PS_DICT_UNDERLINE_THICKNESS:
+      retval = sizeof ( type1->font_info.underline_thickness );
+      if ( value && value_len >= retval )
+        *((FT_UShort *)value) = type1->font_info.underline_thickness;
+      break;
+
+    case PS_DICT_FS_TYPE:
+      retval = sizeof ( type1->font_extra.fs_type );
+      if ( value && value_len >= retval )
+        *((FT_UShort *)value) = type1->font_extra.fs_type;
+      break;
+
+    case PS_DICT_VERSION:
+      retval = (FT_Long)( ft_strlen( type1->font_info.version ) + 1 );
+      if ( value && value_len >= retval )
+        ft_memcpy( value, (void *)( type1->font_info.version ), retval );
+      break;
+
+    case PS_DICT_NOTICE:
+      retval = (FT_Long)( ft_strlen( type1->font_info.notice ) + 1 );
+      if ( value && value_len >= retval )
+        ft_memcpy( value, (void *)( type1->font_info.notice ), retval );
+      break;
+
+    case PS_DICT_FULL_NAME:
+      retval = (FT_Long)( ft_strlen( type1->font_info.full_name ) + 1 );
+      if ( value && value_len >= retval )
+        ft_memcpy( value, (void *)( type1->font_info.full_name ), retval );
+      break;
+
+    case PS_DICT_FAMILY_NAME:
+      retval = (FT_Long)( ft_strlen( type1->font_info.family_name ) + 1 );
+      if ( value && value_len >= retval )
+        ft_memcpy( value, (void *)( type1->font_info.family_name ), retval );
+      break;
+
+    case PS_DICT_WEIGHT:
+      retval = (FT_Long)( ft_strlen( type1->font_info.weight ) + 1 );
+      if ( value && value_len >= retval )
+        ft_memcpy( value, (void *)( type1->font_info.weight ), retval );
+      break;
+
+    case PS_DICT_ITALIC_ANGLE:
+      retval = sizeof ( type1->font_info.italic_angle );
+      if ( value && value_len >= retval )
+        *((FT_Long *)value) = type1->font_info.italic_angle;
+      break;
+
+    default:
+      break;
+    }
+
+    return retval;
   }
 
 
   }
 
 
     (PS_GetFontExtraFunc)  t1_ps_get_font_extra,
     (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names,
     (PS_GetFontPrivateFunc)t1_ps_get_font_private,
     (PS_GetFontExtraFunc)  t1_ps_get_font_extra,
     (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names,
     (PS_GetFontPrivateFunc)t1_ps_get_font_private,
+    (PS_GetFontValueFunc)  t1_ps_get_font_value,
   };
 
 
   };
 
 
   };
 
 
   };
 
 
-  static FT_Module_Interface
-  Get_Interface( FT_Driver         driver,
+  FT_CALLBACK_DEF( FT_Module_Interface )
+  Get_Interface( FT_Module         module,
                  const FT_String*  t1_interface )
   {
                  const FT_String*  t1_interface )
   {
-    FT_UNUSED( driver );
+    FT_UNUSED( module );
 
     return ft_service_list_lookup( t1_services, t1_interface );
   }
 
     return ft_service_list_lookup( t1_services, t1_interface );
   }
   /*    They can be implemented by format-specific interfaces.             */
   /*                                                                       */
   static FT_Error
   /*    They can be implemented by format-specific interfaces.             */
   /*                                                                       */
   static FT_Error
-  Get_Kerning( T1_Face     face,
+  Get_Kerning( FT_Face     t1face,        /* T1_Face */
                FT_UInt     left_glyph,
                FT_UInt     right_glyph,
                FT_Vector*  kerning )
   {
                FT_UInt     left_glyph,
                FT_UInt     right_glyph,
                FT_Vector*  kerning )
   {
+    T1_Face  face = (T1_Face)t1face;
+
+
     kerning->x = 0;
     kerning->y = 0;
 
     kerning->x = 0;
     kerning->y = 0;
 
                       right_glyph,
                       kerning );
 
                       right_glyph,
                       kerning );
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
       FT_MODULE_DRIVER_SCALABLE   |
       FT_MODULE_DRIVER_HAS_HINTER,
 
       FT_MODULE_DRIVER_SCALABLE   |
       FT_MODULE_DRIVER_HAS_HINTER,
 
-      sizeof( FT_DriverRec ),
+      sizeof ( FT_DriverRec ),
 
       "type1",
       0x10000L,
 
       "type1",
       0x10000L,
 
       0,   /* format interface */
 
 
       0,   /* format interface */
 
-      (FT_Module_Constructor)T1_Driver_Init,
-      (FT_Module_Destructor) T1_Driver_Done,
-      (FT_Module_Requester)  Get_Interface,
+      T1_Driver_Init,
+      T1_Driver_Done,
+      Get_Interface,
     },
 
     },
 
-    sizeof( T1_FaceRec ),
-    sizeof( T1_SizeRec ),
-    sizeof( T1_GlyphSlotRec ),
+    sizeof ( T1_FaceRec ),
+    sizeof ( T1_SizeRec ),
+    sizeof ( T1_GlyphSlotRec ),
 
 
-    (FT_Face_InitFunc)        T1_Face_Init,
-    (FT_Face_DoneFunc)        T1_Face_Done,
-    (FT_Size_InitFunc)        T1_Size_Init,
-    (FT_Size_DoneFunc)        T1_Size_Done,
-    (FT_Slot_InitFunc)        T1_GlyphSlot_Init,
-    (FT_Slot_DoneFunc)        T1_GlyphSlot_Done,
+    T1_Face_Init,
+    T1_Face_Done,
+    T1_Size_Init,
+    T1_Size_Done,
+    T1_GlyphSlot_Init,
+    T1_GlyphSlot_Done,
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    ft_stub_set_char_sizes,
-    ft_stub_set_pixel_sizes,
-#endif
-    (FT_Slot_LoadFunc)        T1_Load_Glyph,
+    T1_Load_Glyph,
 
 #ifdef T1_CONFIG_OPTION_NO_AFM
 
 #ifdef T1_CONFIG_OPTION_NO_AFM
-    (FT_Face_GetKerningFunc)  0,
-    (FT_Face_AttachFunc)      0,
+    0,                     /* FT_Face_GetKerningFunc */
+    0,                     /* FT_Face_AttachFunc     */
 #else
 #else
-    (FT_Face_GetKerningFunc)  Get_Kerning,
-    (FT_Face_AttachFunc)      T1_Read_Metrics,
+    Get_Kerning,
+    T1_Read_Metrics,
 #endif
 #endif
-    (FT_Face_GetAdvancesFunc) T1_Get_Advances,
-    (FT_Size_RequestFunc)     T1_Size_Request,
-    (FT_Size_SelectFunc)      0
+    T1_Get_Advances,
+    T1_Size_Request,
+    0                      /* FT_Size_SelectFunc     */
   };
 
 
   };
 
 
index 9fecbeb..639cd4a 100644 (file)
@@ -28,7 +28,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
-#endif 
+#endif
 
 
   FT_EXPORT_VAR( const FT_Driver_ClassRec )  t1_driver_class;
 
 
   FT_EXPORT_VAR( const FT_Driver_ClassRec )  t1_driver_class;
index 81221c3..8740530 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 error codes (specification only).                             */
 /*                                                                         */
 /*                                                                         */
 /*    Type 1 error codes (specification only).                             */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,6 +29,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  T1_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Type1
 
 #define FT_ERR_PREFIX  T1_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Type1
 
index f3fad4f..23478d1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 Glyph Loader (body).                                          */
 /*                                                                         */
 /*                                                                         */
 /*    Type 1 Glyph Loader (body).                                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by */
+/*  Copyright 1996-2006, 2008-2010, 2013 by                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -61,7 +61,7 @@
   {
     T1_Face   face  = (T1_Face)decoder->builder.face;
     T1_Font   type1 = &face->type1;
   {
     T1_Face   face  = (T1_Face)decoder->builder.face;
     T1_Font   type1 = &face->type1;
-    FT_Error  error = T1_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     FT_Incremental_InterfaceRec *inc =
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
     FT_Incremental_InterfaceRec *inc =
 
     psaux->t1_decoder_funcs->done( &decoder );
 
 
     psaux->t1_decoder_funcs->done( &decoder );
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   FT_LOCAL_DEF( FT_Error )
   }
 
 
   FT_LOCAL_DEF( FT_Error )
-  T1_Get_Advances( T1_Face    face,
+  T1_Get_Advances( FT_Face    t1face,        /* T1_Face */
                    FT_UInt    first,
                    FT_UInt    count,
                    FT_UInt    first,
                    FT_UInt    count,
-                   FT_ULong   load_flags,
+                   FT_Int32   load_flags,
                    FT_Fixed*  advances )
   {
                    FT_Fixed*  advances )
   {
+    T1_Face        face  = (T1_Face)t1face;
     T1_DecoderRec  decoder;
     T1_Font        type1 = &face->type1;
     PSAux_Service  psaux = (PSAux_Service)face->psaux;
     T1_DecoderRec  decoder;
     T1_Font        type1 = &face->type1;
     PSAux_Service  psaux = (PSAux_Service)face->psaux;
       for ( nn = 0; nn < count; nn++ )
         advances[nn] = 0;
 
       for ( nn = 0; nn < count; nn++ )
         advances[nn] = 0;
 
-      return T1_Err_Ok;
+      return FT_Err_Ok;
     }
 
     error = psaux->t1_decoder_funcs->init( &decoder,
     }
 
     error = psaux->t1_decoder_funcs->init( &decoder,
         advances[nn] = 0;
     }
 
         advances[nn] = 0;
     }
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   FT_LOCAL_DEF( FT_Error )
   }
 
 
   FT_LOCAL_DEF( FT_Error )
-  T1_Load_Glyph( T1_GlyphSlot  glyph,
-                 T1_Size       size,
+  T1_Load_Glyph( FT_GlyphSlot  t1glyph,          /* T1_GlyphSlot */
+                 FT_Size       t1size,           /* T1_Size      */
                  FT_UInt       glyph_index,
                  FT_Int32      load_flags )
   {
                  FT_UInt       glyph_index,
                  FT_Int32      load_flags )
   {
+    T1_GlyphSlot            glyph = (T1_GlyphSlot)t1glyph;
     FT_Error                error;
     T1_DecoderRec           decoder;
     FT_Error                error;
     T1_DecoderRec           decoder;
-    T1_Face                 face = (T1_Face)glyph->root.face;
+    T1_Face                 face = (T1_Face)t1glyph->face;
     FT_Bool                 hinting;
     T1_Font                 type1         = &face->type1;
     PSAux_Service           psaux         = (PSAux_Service)face->psaux;
     FT_Bool                 hinting;
     T1_Font                 type1         = &face->type1;
     PSAux_Service           psaux         = (PSAux_Service)face->psaux;
     if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
     {
     if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
     {
-      error = T1_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
     if ( load_flags & FT_LOAD_NO_RECURSE )
       load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
 
     if ( load_flags & FT_LOAD_NO_RECURSE )
       load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
 
-    if ( size )
+    if ( t1size )
     {
     {
-      glyph->x_scale = size->root.metrics.x_scale;
-      glyph->y_scale = size->root.metrics.y_scale;
+      glyph->x_scale = t1size->metrics.x_scale;
+      glyph->y_scale = t1size->metrics.y_scale;
     }
     else
     {
     }
     else
     {
       glyph->y_scale = 0x10000L;
     }
 
       glyph->y_scale = 0x10000L;
     }
 
-    glyph->root.outline.n_points   = 0;
-    glyph->root.outline.n_contours = 0;
+    t1glyph->outline.n_points   = 0;
+    t1glyph->outline.n_contours = 0;
 
     hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 &&
                        ( load_flags & FT_LOAD_NO_HINTING ) == 0 );
 
 
     hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 &&
                        ( load_flags & FT_LOAD_NO_HINTING ) == 0 );
 
-    glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
+    t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;
 
     error = decoder_funcs->init( &decoder,
 
     error = decoder_funcs->init( &decoder,
-                                 (FT_Face)face,
-                                 (FT_Size)size,
-                                 (FT_GlyphSlot)glyph,
+                                 t1glyph->face,
+                                 t1size,
+                                 t1glyph,
                                  (FT_Byte**)type1->glyph_names,
                                  face->blend,
                                  FT_BOOL( hinting ),
                                  (FT_Byte**)type1->glyph_names,
                                  face->blend,
                                  FT_BOOL( hinting ),
     /* bearing the yMax                                    */
     if ( !error )
     {
     /* bearing the yMax                                    */
     if ( !error )
     {
-      glyph->root.outline.flags &= FT_OUTLINE_OWNER;
-      glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL;
+      t1glyph->outline.flags &= FT_OUTLINE_OWNER;
+      t1glyph->outline.flags |= FT_OUTLINE_REVERSE_FILL;
 
       /* for composite glyphs, return only left side bearing and */
       /* advance width                                           */
       if ( load_flags & FT_LOAD_NO_RECURSE )
       {
 
       /* for composite glyphs, return only left side bearing and */
       /* advance width                                           */
       if ( load_flags & FT_LOAD_NO_RECURSE )
       {
-        FT_Slot_Internal  internal = glyph->root.internal;
+        FT_Slot_Internal  internal = t1glyph->internal;
 
 
 
 
-        glyph->root.metrics.horiBearingX =
+        t1glyph->metrics.horiBearingX =
           FIXED_TO_INT( decoder.builder.left_bearing.x );
           FIXED_TO_INT( decoder.builder.left_bearing.x );
-        glyph->root.metrics.horiAdvance  =
+        t1glyph->metrics.horiAdvance  =
           FIXED_TO_INT( decoder.builder.advance.x );
 
         internal->glyph_matrix      = font_matrix;
           FIXED_TO_INT( decoder.builder.advance.x );
 
         internal->glyph_matrix      = font_matrix;
       else
       {
         FT_BBox            cbox;
       else
       {
         FT_BBox            cbox;
-        FT_Glyph_Metrics*  metrics = &glyph->root.metrics;
+        FT_Glyph_Metrics*  metrics = &t1glyph->metrics;
         FT_Vector          advance;
 
 
         /* copy the _unscaled_ advance width */
         metrics->horiAdvance =
           FIXED_TO_INT( decoder.builder.advance.x );
         FT_Vector          advance;
 
 
         /* copy the _unscaled_ advance width */
         metrics->horiAdvance =
           FIXED_TO_INT( decoder.builder.advance.x );
-        glyph->root.linearHoriAdvance =
+        t1glyph->linearHoriAdvance =
           FIXED_TO_INT( decoder.builder.advance.x );
           FIXED_TO_INT( decoder.builder.advance.x );
-        glyph->root.internal->glyph_transformed = 0;
+        t1glyph->internal->glyph_transformed = 0;
 
 
-        if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) 
+        if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
         {
           /* make up vertical ones */
           metrics->vertAdvance = ( face->type1.font_bbox.yMax -
                                    face->type1.font_bbox.yMin ) >> 16;
         {
           /* make up vertical ones */
           metrics->vertAdvance = ( face->type1.font_bbox.yMax -
                                    face->type1.font_bbox.yMin ) >> 16;
-          glyph->root.linearVertAdvance = metrics->vertAdvance;
+          t1glyph->linearVertAdvance = metrics->vertAdvance;
         }
         else
         {
           metrics->vertAdvance =
             FIXED_TO_INT( decoder.builder.advance.y );
         }
         else
         {
           metrics->vertAdvance =
             FIXED_TO_INT( decoder.builder.advance.y );
-          glyph->root.linearVertAdvance =
+          t1glyph->linearVertAdvance =
             FIXED_TO_INT( decoder.builder.advance.y );
         }
 
             FIXED_TO_INT( decoder.builder.advance.y );
         }
 
-        glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
+        t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;
 
 
-        if ( size && size->root.metrics.y_ppem < 24 )
-          glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION;
+        if ( t1size && t1size->metrics.y_ppem < 24 )
+          t1glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
 
 #if 1
         /* apply the font matrix, if any */
         if ( font_matrix.xx != 0x10000L || font_matrix.yy != font_matrix.xx ||
              font_matrix.xy != 0        || font_matrix.yx != 0              )
 
 #if 1
         /* apply the font matrix, if any */
         if ( font_matrix.xx != 0x10000L || font_matrix.yy != font_matrix.xx ||
              font_matrix.xy != 0        || font_matrix.yx != 0              )
-          FT_Outline_Transform( &glyph->root.outline, &font_matrix );
+          FT_Outline_Transform( &t1glyph->outline, &font_matrix );
 
         if ( font_offset.x || font_offset.y )
 
         if ( font_offset.x || font_offset.y )
-          FT_Outline_Translate( &glyph->root.outline,
+          FT_Outline_Translate( &t1glyph->outline,
                                 font_offset.x,
                                 font_offset.y );
 
                                 font_offset.x,
                                 font_offset.y );
 
         }
 
         /* compute the other metrics */
         }
 
         /* compute the other metrics */
-        FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
+        FT_Outline_Get_CBox( &t1glyph->outline, &cbox );
 
         metrics->width  = cbox.xMax - cbox.xMin;
         metrics->height = cbox.yMax - cbox.yMin;
 
         metrics->width  = cbox.xMax - cbox.xMin;
         metrics->height = cbox.yMax - cbox.yMin;
         metrics->horiBearingX = cbox.xMin;
         metrics->horiBearingY = cbox.yMax;
 
         metrics->horiBearingX = cbox.xMin;
         metrics->horiBearingY = cbox.yMax;
 
-        if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) 
+        if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
         {
           /* make up vertical ones */
           ft_synthesize_vertical_metrics( metrics,
         {
           /* make up vertical ones */
           ft_synthesize_vertical_metrics( metrics,
 
       /* Set control data to the glyph charstrings.  Note that this is */
       /* _not_ zero-terminated.                                        */
 
       /* Set control data to the glyph charstrings.  Note that this is */
       /* _not_ zero-terminated.                                        */
-      glyph->root.control_data = (FT_Byte*)glyph_data.pointer;
-      glyph->root.control_len  = glyph_data.length;
+      t1glyph->control_data = (FT_Byte*)glyph_data.pointer;
+      t1glyph->control_len  = glyph_data.length;
     }
 
 
     }
 
 
 
       /* Set the control data to null - it is no longer available if   */
       /* loaded incrementally.                                         */
 
       /* Set the control data to null - it is no longer available if   */
       /* loaded incrementally.                                         */
-      glyph->root.control_data = 0;
-      glyph->root.control_len  = 0;
+      t1glyph->control_data = 0;
+      t1glyph->control_len  = 0;
     }
 #endif
 
     }
 #endif
 
index 100df06..0bdea3a 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 Glyph Loader (specification).                                 */
 /*                                                                         */
 /*                                                                         */
 /*    Type 1 Glyph Loader (specification).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2008 by                               */
+/*  Copyright 1996-2001, 2002, 2003, 2008, 2011 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -32,15 +32,15 @@ FT_BEGIN_HEADER
                           FT_Pos*  max_advance );
 
   FT_LOCAL( FT_Error )
                           FT_Pos*  max_advance );
 
   FT_LOCAL( FT_Error )
-  T1_Get_Advances( T1_Face    face,
+  T1_Get_Advances( FT_Face    face,
                    FT_UInt    first,
                    FT_UInt    count,
                    FT_UInt    first,
                    FT_UInt    count,
-                   FT_ULong   load_flags,
+                   FT_Int32   load_flags,
                    FT_Fixed*  advances );
 
   FT_LOCAL( FT_Error )
                    FT_Fixed*  advances );
 
   FT_LOCAL( FT_Error )
-  T1_Load_Glyph( T1_GlyphSlot  glyph,
-                 T1_Size       size,
+  T1_Load_Glyph( FT_GlyphSlot  glyph,
+                 FT_Size       size,
                  FT_UInt       glyph_index,
                  FT_Int32      load_flags );
 
                  FT_UInt       glyph_index,
                  FT_Int32      load_flags );
 
index c9b6c1d..1c834a1 100644 (file)
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    Type 1 font loader (body).                                           */
 /*                                                                         */
 /*                                                                         */
 /*    Type 1 font loader (body).                                           */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2013 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 #include "t1errors.h"
 
 
 #include "t1errors.h"
 
 
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+#define IS_INCREMENTAL  (FT_Bool)( face->root.internal->incremental_interface != 0 )
+#else
+#define IS_INCREMENTAL  0
+#endif
+
+
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
   {
     PS_Blend   blend;
     FT_Memory  memory = face->root.memory;
   {
     PS_Blend   blend;
     FT_Memory  memory = face->root.memory;
-    FT_Error   error  = T1_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
 
 
     blend = face->blend;
 
 
     blend = face->blend;
 
         /* allocate the blend `private' and `font_info' dictionaries */
         if ( FT_NEW_ARRAY( blend->font_infos[1], num_designs     ) ||
 
         /* allocate the blend `private' and `font_info' dictionaries */
         if ( FT_NEW_ARRAY( blend->font_infos[1], num_designs     ) ||
-             FT_NEW_ARRAY( blend->privates[1], num_designs       ) ||
-             FT_NEW_ARRAY( blend->bboxes[1], num_designs         ) ||
+             FT_NEW_ARRAY( blend->privates  [1], num_designs     ) ||
+             FT_NEW_ARRAY( blend->bboxes    [1], num_designs     ) ||
              FT_NEW_ARRAY( blend->weight_vector, num_designs * 2 ) )
           goto Exit;
 
              FT_NEW_ARRAY( blend->weight_vector, num_designs * 2 ) )
           goto Exit;
 
 
         for ( nn = 2; nn <= num_designs; nn++ )
         {
 
         for ( nn = 2; nn <= num_designs; nn++ )
         {
-          blend->privates[nn]   = blend->privates  [nn - 1] + 1;
           blend->font_infos[nn] = blend->font_infos[nn - 1] + 1;
           blend->font_infos[nn] = blend->font_infos[nn - 1] + 1;
-          blend->bboxes[nn]     = blend->bboxes    [nn - 1] + 1;
+          blend->privates  [nn] = blend->privates  [nn - 1] + 1;
+          blend->bboxes    [nn] = blend->bboxes    [nn - 1] + 1;
         }
 
         }
 
-        blend->num_designs   = num_designs;
+        blend->num_designs = num_designs;
       }
       else if ( blend->num_designs != num_designs )
         goto Fail;
       }
       else if ( blend->num_designs != num_designs )
         goto Fail;
     return error;
 
   Fail:
     return error;
 
   Fail:
-    error = T1_Err_Invalid_File_Format;
+    error = FT_THROW( Invalid_File_Format );
     goto Exit;
   }
 
     goto Exit;
   }
 
     FT_Error  error;
 
 
     FT_Error  error;
 
 
-    error = T1_Err_Invalid_Argument;
+    error = FT_THROW( Invalid_Argument );
 
     if ( blend )
     {
 
     if ( blend )
     {
         axis->maximum = map->design_points[map->num_points - 1];
       }
 
         axis->maximum = map->design_points[map->num_points - 1];
       }
 
-      error = T1_Err_Ok;
+      error = FT_Err_Ok;
     }
 
     return error;
     }
 
     return error;
     for ( j = 1; j < axismap->num_points; ++j )
     {
       if ( ncv <= axismap->blend_points[j] )
     for ( j = 1; j < axismap->num_points; ++j )
     {
       if ( ncv <= axismap->blend_points[j] )
-      {
-        FT_Fixed  t = FT_MulDiv( ncv - axismap->blend_points[j - 1],
-                                 0x10000L,
-                                 axismap->blend_points[j] -
-                                   axismap->blend_points[j - 1] );
-
         return INT_TO_FIXED( axismap->design_points[j - 1] ) +
         return INT_TO_FIXED( axismap->design_points[j - 1] ) +
-                 FT_MulDiv( t,
-                            axismap->design_points[j] -
-                              axismap->design_points[j - 1],
-                            1L );
-      }
+               ( axismap->design_points[j] - axismap->design_points[j - 1] ) *
+               FT_DivFix( ncv - axismap->blend_points[j - 1],
+                          axismap->blend_points[j] -
+                            axismap->blend_points[j - 1] );
     }
 
     return INT_TO_FIXED( axismap->design_points[axismap->num_points - 1] );
     }
 
     return INT_TO_FIXED( axismap->design_points[axismap->num_points - 1] );
                  FT_MM_Var*  *master )
   {
     FT_Memory        memory = face->root.memory;
                  FT_MM_Var*  *master )
   {
     FT_Memory        memory = face->root.memory;
-    FT_MM_Var       *mmvar;
+    FT_MM_Var       *mmvar = NULL;
     FT_Multi_Master  mmaster;
     FT_Error         error;
     FT_UInt          i;
     FT_Multi_Master  mmaster;
     FT_Error         error;
     FT_UInt          i;
 
     mmvar->num_axis        = mmaster.num_axis;
     mmvar->num_designs     = mmaster.num_designs;
 
     mmvar->num_axis        = mmaster.num_axis;
     mmvar->num_designs     = mmaster.num_designs;
-    mmvar->num_namedstyles = (FT_UInt)-1;                /* Does not apply */
+    mmvar->num_namedstyles = ~0U;                        /* Does not apply */
     mmvar->axis            = (FT_Var_Axis*)&mmvar[1];
                                       /* Point to axes after MM_Var struct */
     mmvar->namedstyle      = NULL;
     mmvar->axis            = (FT_Var_Axis*)&mmvar[1];
                                       /* Point to axes after MM_Var struct */
     mmvar->namedstyle      = NULL;
       mmvar->axis[i].def     = ( mmvar->axis[i].minimum +
                                    mmvar->axis[i].maximum ) / 2;
                             /* Does not apply.  But this value is in range */
       mmvar->axis[i].def     = ( mmvar->axis[i].minimum +
                                    mmvar->axis[i].maximum ) / 2;
                             /* Does not apply.  But this value is in range */
-      mmvar->axis[i].strid   = (FT_UInt)-1;    /* Does not apply */
-      mmvar->axis[i].tag     = (FT_ULong)-1;   /* Does not apply */
+      mmvar->axis[i].strid   = ~0U;                      /* Does not apply */
+      mmvar->axis[i].tag     = ~0U;                      /* Does not apply */
 
       if ( ft_strcmp( mmvar->axis[i].name, "Weight" ) == 0 )
         mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'g', 'h', 't' );
 
       if ( ft_strcmp( mmvar->axis[i].name, "Weight" ) == 0 )
         mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'g', 'h', 't' );
     FT_UInt   n, m;
 
 
     FT_UInt   n, m;
 
 
-    error = T1_Err_Invalid_Argument;
+    error = FT_ERR( Invalid_Argument );
 
     if ( blend && blend->num_axis == num_coords )
     {
       /* recompute the weight vector from the blend coordinates */
 
     if ( blend && blend->num_axis == num_coords )
     {
       /* recompute the weight vector from the blend coordinates */
-      error = T1_Err_Ok;
+      error = FT_Err_Ok;
 
       for ( n = 0; n < blend->num_designs; n++ )
       {
 
       for ( n = 0; n < blend->num_designs; n++ )
       {
 
           /* get current blend axis position */
           factor = coords[m];
 
           /* get current blend axis position */
           factor = coords[m];
-          if ( factor < 0 )        factor = 0;
-          if ( factor > 0x10000L ) factor = 0x10000L;
+          if ( factor < 0 )
+            factor = 0;
+          if ( factor > 0x10000L )
+            factor = 0x10000L;
 
           if ( ( n & ( 1 << m ) ) == 0 )
             factor = 0x10000L - factor;
 
           if ( ( n & ( 1 << m ) ) == 0 )
             factor = 0x10000L - factor;
         blend->weight_vector[n] = result;
       }
 
         blend->weight_vector[n] = result;
       }
 
-      error = T1_Err_Ok;
+      error = FT_Err_Ok;
     }
 
     return error;
     }
 
     return error;
     FT_UInt   n, p;
 
 
     FT_UInt   n, p;
 
 
-    error = T1_Err_Invalid_Argument;
+    error = FT_ERR( Invalid_Argument );
     if ( blend && blend->num_axis == num_coords )
     {
       /* compute the blend coordinates through the blend design map */
     if ( blend && blend->num_axis == num_coords )
     {
       /* compute the blend coordinates through the blend design map */
      FT_Error  error;
 
 
      FT_Error  error;
 
 
-     error = T1_Err_Invalid_Argument;
+     error = FT_ERR( Invalid_Argument );
      if ( num_coords <= 4 && num_coords > 0 )
      {
        for ( i = 0; i < num_coords; ++i )
      if ( num_coords <= 4 && num_coords > 0 )
      {
        for ( i = 0; i < num_coords; ++i )
       /* release design pos table */
       FT_FREE( blend->design_pos[0] );
       for ( n = 1; n < num_designs; n++ )
       /* release design pos table */
       FT_FREE( blend->design_pos[0] );
       for ( n = 1; n < num_designs; n++ )
-        blend->design_pos[n] = 0;
+        blend->design_pos[n] = NULL;
 
       /* release blend `private' and `font info' dictionaries */
       FT_FREE( blend->privates[1] );
 
       /* release blend `private' and `font info' dictionaries */
       FT_FREE( blend->privates[1] );
 
       for ( n = 0; n < num_designs; n++ )
       {
 
       for ( n = 0; n < num_designs; n++ )
       {
-        blend->privates  [n] = 0;
-        blend->font_infos[n] = 0;
-        blend->bboxes    [n] = 0;
+        blend->privates  [n] = NULL;
+        blend->font_infos[n] = NULL;
+        blend->bboxes    [n] = NULL;
       }
 
       /* release weight vectors */
       FT_FREE( blend->weight_vector );
       }
 
       /* release weight vectors */
       FT_FREE( blend->weight_vector );
-      blend->default_weight_vector = 0;
+      blend->default_weight_vector = NULL;
 
       /* release axis names */
       for ( n = 0; n < num_axis; n++ )
 
       /* release axis names */
       for ( n = 0; n < num_axis; n++ )
   {
     T1_TokenRec  axis_tokens[T1_MAX_MM_AXIS];
     FT_Int       n, num_axis;
   {
     T1_TokenRec  axis_tokens[T1_MAX_MM_AXIS];
     FT_Int       n, num_axis;
-    FT_Error     error = T1_Err_Ok;
+    FT_Error     error = FT_Err_Ok;
     PS_Blend     blend;
     FT_Memory    memory;
 
     PS_Blend     blend;
     FT_Memory    memory;
 
                      T1_MAX_MM_AXIS, &num_axis );
     if ( num_axis < 0 )
     {
                      T1_MAX_MM_AXIS, &num_axis );
     if ( num_axis < 0 )
     {
-      error = T1_Err_Ignore;
+      error = FT_ERR( Ignore );
       goto Exit;
     }
     if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS )
     {
       FT_ERROR(( "parse_blend_axis_types: incorrect number of axes: %d\n",
                  num_axis ));
       goto Exit;
     }
     if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS )
     {
       FT_ERROR(( "parse_blend_axis_types: incorrect number of axes: %d\n",
                  num_axis ));
-      error = T1_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
       len = token->limit - token->start;
       if ( len == 0 )
       {
       len = token->limit - token->start;
       if ( len == 0 )
       {
-        error = T1_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
-      if ( FT_ALLOC( blend->axis_names[n], len + 1 ) )
+      if ( FT_ALLOC( blend->axis_names[n], (FT_Long)( len + 1 ) ) )
         goto Exit;
 
       name = (FT_Byte*)blend->axis_names[n];
       FT_MEM_COPY( name, token->start, len );
         goto Exit;
 
       name = (FT_Byte*)blend->axis_names[n];
       FT_MEM_COPY( name, token->start, len );
-      name[len] = 0;
+      name[len] = '\0';
     }
 
   Exit:
     }
 
   Exit:
     FT_Int       num_axis;
     T1_Parser    parser = &loader->parser;
 
     FT_Int       num_axis;
     T1_Parser    parser = &loader->parser;
 
-    FT_Error     error = T1_Err_Ok;
+    FT_Error     error = FT_Err_Ok;
     PS_Blend     blend;
 
 
     PS_Blend     blend;
 
 
                      T1_MAX_MM_DESIGNS, &num_designs );
     if ( num_designs < 0 )
     {
                      T1_MAX_MM_DESIGNS, &num_designs );
     if ( num_designs < 0 )
     {
-      error = T1_Err_Ignore;
+      error = FT_ERR( Ignore );
       goto Exit;
     }
     if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS )
       goto Exit;
     }
     if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS )
       FT_ERROR(( "parse_blend_design_positions:"
                  " incorrect number of designs: %d\n",
                  num_designs ));
       FT_ERROR(( "parse_blend_design_positions:"
                  " incorrect number of designs: %d\n",
                  num_designs ));
-      error = T1_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
             FT_ERROR(( "parse_blend_design_positions:"
                        " invalid number of axes: %d\n",
                        n_axis ));
             FT_ERROR(( "parse_blend_design_positions:"
                        " invalid number of axes: %d\n",
                        n_axis ));
-            error = T1_Err_Invalid_File_Format;
+            error = FT_THROW( Invalid_File_Format );
             goto Exit;
           }
 
             goto Exit;
           }
 
         else if ( n_axis != num_axis )
         {
           FT_ERROR(( "parse_blend_design_positions: incorrect table\n" ));
         else if ( n_axis != num_axis )
         {
           FT_ERROR(( "parse_blend_design_positions: incorrect table\n" ));
-          error = T1_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Exit;
         }
 
           goto Exit;
         }
 
   parse_blend_design_map( T1_Face    face,
                           T1_Loader  loader )
   {
   parse_blend_design_map( T1_Face    face,
                           T1_Loader  loader )
   {
-    FT_Error     error  = T1_Err_Ok;
+    FT_Error     error  = FT_Err_Ok;
     T1_Parser    parser = &loader->parser;
     PS_Blend     blend;
     T1_TokenRec  axis_tokens[T1_MAX_MM_AXIS];
     T1_Parser    parser = &loader->parser;
     PS_Blend     blend;
     T1_TokenRec  axis_tokens[T1_MAX_MM_AXIS];
                      T1_MAX_MM_AXIS, &num_axis );
     if ( num_axis < 0 )
     {
                      T1_MAX_MM_AXIS, &num_axis );
     if ( num_axis < 0 )
     {
-      error = T1_Err_Ignore;
+      error = FT_ERR( Ignore );
       goto Exit;
     }
     if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS )
     {
       FT_ERROR(( "parse_blend_design_map: incorrect number of axes: %d\n",
                  num_axis ));
       goto Exit;
     }
     if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS )
     {
       FT_ERROR(( "parse_blend_design_map: incorrect number of axes: %d\n",
                  num_axis ));
-      error = T1_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
       if ( num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS )
       {
         FT_ERROR(( "parse_blend_design_map: incorrect table\n" ));
       if ( num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS )
       {
         FT_ERROR(( "parse_blend_design_map: incorrect table\n" ));
-        error = T1_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
   {
     T1_TokenRec  design_tokens[T1_MAX_MM_DESIGNS];
     FT_Int       num_designs;
   {
     T1_TokenRec  design_tokens[T1_MAX_MM_DESIGNS];
     FT_Int       num_designs;
-    FT_Error     error  = T1_Err_Ok;
+    FT_Error     error  = FT_Err_Ok;
     T1_Parser    parser = &loader->parser;
     PS_Blend     blend  = face->blend;
     T1_Token     token;
     T1_Parser    parser = &loader->parser;
     PS_Blend     blend  = face->blend;
     T1_Token     token;
                      T1_MAX_MM_DESIGNS, &num_designs );
     if ( num_designs < 0 )
     {
                      T1_MAX_MM_DESIGNS, &num_designs );
     if ( num_designs < 0 )
     {
-      error = T1_Err_Ignore;
+      error = FT_ERR( Ignore );
       goto Exit;
     }
     if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS )
       goto Exit;
     }
     if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS )
       FT_ERROR(( "parse_weight_vector:"
                  " incorrect number of designs: %d\n",
                  num_designs ));
       FT_ERROR(( "parse_weight_vector:"
                  " incorrect number of designs: %d\n",
                  num_designs ));
-      error = T1_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
                  " /BlendDesignPosition and /WeightVector have\n"
                  "                    "
                  " different number of elements\n" ));
                  " /BlendDesignPosition and /WeightVector have\n"
                  "                    "
                  " different number of elements\n" ));
-      error = T1_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
   }
 
 
   }
 
 
-#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */
+#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */
 
 
 
 
 
 
     PS_Blend  blend = face->blend;
 
 
     PS_Blend  blend = face->blend;
 
 
+    if ( blend && blend->num_designs == 0 )
+      blend = NULL;
+
     /* if the keyword has a dedicated callback, call it */
     if ( field->type == T1_FIELD_TYPE_CALLBACK )
     {
     /* if the keyword has a dedicated callback, call it */
     if ( field->type == T1_FIELD_TYPE_CALLBACK )
     {
       max_objects  = 0;
     }
 
       max_objects  = 0;
     }
 
-    if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
-         field->type == T1_FIELD_TYPE_FIXED_ARRAY   )
-      error = T1_Load_Field_Table( &loader->parser, field,
-                                   objects, max_objects, 0 );
+    if ( *objects )
+    {
+      if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
+           field->type == T1_FIELD_TYPE_FIXED_ARRAY   )
+        error = T1_Load_Field_Table( &loader->parser, field,
+                                     objects, max_objects, 0 );
+      else
+        error = T1_Load_Field( &loader->parser, field,
+                               objects, max_objects, 0 );
+    }
     else
     else
-      error = T1_Load_Field( &loader->parser, field,
-                             objects, max_objects, 0 );
+    {
+      FT_TRACE1(( "t1_load_keyword: ignoring keyword `%s'"
+                  " which is not valid at this point\n"
+                  "                 (probably due to missing keywords)\n",
+                 field->ident ));
+      error = FT_Err_Ok;
+    }
 
   Exit:
     return error;
 
   Exit:
     return error;
   static int
   read_binary_data( T1_Parser  parser,
                     FT_Long*   size,
   static int
   read_binary_data( T1_Parser  parser,
                     FT_Long*   size,
-                    FT_Byte**  base )
+                    FT_Byte**  base,
+                    FT_Bool    incremental )
   {
     FT_Byte*  cur;
     FT_Byte*  limit = parser->root.limit;
   {
     FT_Byte*  cur;
     FT_Byte*  limit = parser->root.limit;
       }
     }
 
       }
     }
 
-    FT_ERROR(( "read_binary_data: invalid size field\n" ));
-    parser->root.error = T1_Err_Invalid_File_Format;
+    if( !incremental )
+    {
+      FT_ERROR(( "read_binary_data: invalid size field\n" ));
+      parser->root.error = FT_THROW( Invalid_File_Format );
+    }
+
     return 0;
   }
 
     return 0;
   }
 
   /* and `/CharStrings' dictionaries.                                */
 
   static void
   /* and `/CharStrings' dictionaries.                                */
 
   static void
-  parse_font_matrix( T1_Face    face,
-                     T1_Loader  loader )
+  t1_parse_font_matrix( T1_Face    face,
+                        T1_Loader  loader )
   {
     T1_Parser   parser = &loader->parser;
     FT_Matrix*  matrix = &face->type1.font_matrix;
   {
     T1_Parser   parser = &loader->parser;
     FT_Matrix*  matrix = &face->type1.font_matrix;
 
     if ( result < 0 )
     {
 
     if ( result < 0 )
     {
-      parser->root.error = T1_Err_Invalid_File_Format;
+      parser->root.error = FT_THROW( Invalid_File_Format );
       return;
     }
 
       return;
     }
 
 
     if ( temp_scale == 0 )
     {
 
     if ( temp_scale == 0 )
     {
-      FT_ERROR(( "parse_font_matrix: invalid font matrix\n" ));
-      parser->root.error = T1_Err_Invalid_File_Format;
+      FT_ERROR(( "t1_parse_font_matrix: invalid font matrix\n" ));
+      parser->root.error = FT_THROW( Invalid_File_Format );
       return;
     }
 
       return;
     }
 
     /* 1000 / temp_scale, because temp_scale was already multiplied by   */
     /* 1000 (in t1_tofixed, from psobjs.c).                              */
 
     /* 1000 / temp_scale, because temp_scale was already multiplied by   */
     /* 1000 (in t1_tofixed, from psobjs.c).                              */
 
-    root->units_per_EM = (FT_UShort)( FT_DivFix( 1000 * 0x10000L,
-                                                 temp_scale ) >> 16 );
+    root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
 
     /* we need to scale the values by 1.0/temp_scale */
     if ( temp_scale != 0x10000L )
 
     /* we need to scale the values by 1.0/temp_scale */
     if ( temp_scale != 0x10000L )
     if ( cur >= limit )
     {
       FT_ERROR(( "parse_encoding: out of bounds\n" ));
     if ( cur >= limit )
     {
       FT_ERROR(( "parse_encoding: out of bounds\n" ));
-      parser->root.error = T1_Err_Invalid_File_Format;
+      parser->root.error = FT_THROW( Invalid_File_Format );
       return;
     }
 
       return;
     }
 
 
           cur = parser->root.cursor;
 
 
           cur = parser->root.cursor;
 
-          if ( *cur == '/' && cur + 2 < limit && n < count )
+          if ( cur + 2 < limit && *cur == '/' && n < count )
           {
             FT_PtrDist  len;
 
           {
             FT_PtrDist  len;
 
 
             parser->root.cursor = cur;
             T1_Skip_PS_Token( parser );
 
             parser->root.cursor = cur;
             T1_Skip_PS_Token( parser );
+            if ( parser->root.cursor >= limit )
+              return;
             if ( parser->root.error )
               return;
 
             if ( parser->root.error )
               return;
 
             /* specification (it might be an encoding for a CID type1  */
             /* font, however), so we conclude that this font is NOT a  */
             /* type1 font.                                             */
             /* specification (it might be an encoding for a CID type1  */
             /* font, however), so we conclude that this font is NOT a  */
             /* type1 font.                                             */
-            parser->root.error = FT_Err_Unknown_File_Format;
+            parser->root.error = FT_THROW( Unknown_File_Format );
             return;
           }
         }
             return;
           }
         }
         face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1;
 
       else
         face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1;
 
       else
-        parser->root.error = T1_Err_Ignore;
+        parser->root.error = FT_ERR( Ignore );
     }
   }
 
     }
   }
 
       T1_Skip_Spaces  ( parser );
       if ( parser->root.cursor >= parser->root.limit ||
            *parser->root.cursor != ']'               )
       T1_Skip_Spaces  ( parser );
       if ( parser->root.cursor >= parser->root.limit ||
            *parser->root.cursor != ']'               )
-        parser->root.error = T1_Err_Invalid_File_Format;
+        parser->root.error = FT_THROW( Invalid_File_Format );
       return;
     }
 
       return;
     }
 
       FT_Byte*  base;
 
 
       FT_Byte*  base;
 
 
-      /* If the next token isn't `dup' we are done. */
-      if ( ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 )
+      /* If we are out of data, or if the next token isn't `dup', */
+      /* we are done.                                             */
+      if ( parser->root.cursor + 4 >= parser->root.limit          ||
+          ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 )
         break;
 
       T1_Skip_PS_Token( parser );       /* `dup' */
 
       idx = T1_ToInt( parser );
 
         break;
 
       T1_Skip_PS_Token( parser );       /* `dup' */
 
       idx = T1_ToInt( parser );
 
-      if ( !read_binary_data( parser, &size, &base ) )
+      if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )
         return;
 
       /* The binary string is followed by one token, e.g. `NP' */
         return;
 
       /* The binary string is followed by one token, e.g. `NP' */
         return;
       T1_Skip_Spaces  ( parser );
 
         return;
       T1_Skip_Spaces  ( parser );
 
-      if ( ft_strncmp( (char*)parser->root.cursor, "put", 3 ) == 0 )
+      if ( parser->root.cursor + 4 < parser->root.limit            &&
+           ft_strncmp( (char*)parser->root.cursor, "put", 3 ) == 0 )
       {
         T1_Skip_PS_Token( parser ); /* skip `put' */
         T1_Skip_Spaces  ( parser );
       {
         T1_Skip_PS_Token( parser ); /* skip `put' */
         T1_Skip_Spaces  ( parser );
         /* least contain a `return'), but we support them anyway       */
         if ( size < face->type1.private_dict.lenIV )
         {
         /* least contain a `return'), but we support them anyway       */
         if ( size < face->type1.private_dict.lenIV )
         {
-          error = T1_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
 
           goto Fail;
         }
 
 
 
     num_glyphs = (FT_Int)T1_ToInt( parser );
 
 
     num_glyphs = (FT_Int)T1_ToInt( parser );
+    if ( num_glyphs < 0 )
+    {
+      error = FT_THROW( Invalid_File_Format );
+      goto Fail;
+    }
+
     /* some fonts like Optima-Oblique not only define the /CharStrings */
     /* array but access it also                                        */
     if ( num_glyphs == 0 || parser->root.error )
     /* some fonts like Optima-Oblique not only define the /CharStrings */
     /* array but access it also                                        */
     if ( num_glyphs == 0 || parser->root.error )
 
         if ( cur + 1 >= limit )
         {
 
         if ( cur + 1 >= limit )
         {
-          error = T1_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
 
         cur++;                              /* skip `/' */
         len = parser->root.cursor - cur;
 
           goto Fail;
         }
 
         cur++;                              /* skip `/' */
         len = parser->root.cursor - cur;
 
-        if ( !read_binary_data( parser, &size, &base ) )
+        if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )
           return;
 
         /* for some non-standard fonts like `Optima' which provides */
           return;
 
         /* for some non-standard fonts like `Optima' which provides */
 
           if ( size <= face->type1.private_dict.lenIV )
           {
 
           if ( size <= face->type1.private_dict.lenIV )
           {
-            error = T1_Err_Invalid_File_Format;
+            error = FT_THROW( Invalid_File_Format );
             goto Fail;
           }
 
             goto Fail;
           }
 
 #include "t1tokens.h"
 
     /* now add the special functions... */
 #include "t1tokens.h"
 
     /* now add the special functions... */
-    T1_FIELD_CALLBACK( "FontMatrix",           parse_font_matrix,
+    T1_FIELD_CALLBACK( "FontMatrix",           t1_parse_font_matrix,
                        T1_FIELD_DICT_FONTDICT )
     T1_FIELD_CALLBACK( "Encoding",             parse_encoding,
                        T1_FIELD_DICT_FONTDICT )
                        T1_FIELD_DICT_FONTDICT )
     T1_FIELD_CALLBACK( "Encoding",             parse_encoding,
                        T1_FIELD_DICT_FONTDICT )
 
     parser->root.cursor = base;
     parser->root.limit  = base + size;
 
     parser->root.cursor = base;
     parser->root.limit  = base + size;
-    parser->root.error  = T1_Err_Ok;
+    parser->root.error  = FT_Err_Ok;
 
     limit = parser->root.limit;
 
 
     limit = parser->root.limit;
 
 
 
         parser->root.cursor = start_binary;
 
 
         parser->root.cursor = start_binary;
-        if ( !read_binary_data( parser, &s, &b ) )
-          return T1_Err_Invalid_File_Format;
+        if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) )
+          return FT_THROW( Invalid_File_Format );
         have_integer = 0;
       }
 
         have_integer = 0;
       }
 
 
 
         parser->root.cursor = start_binary;
 
 
         parser->root.cursor = start_binary;
-        if ( !read_binary_data( parser, &s, &b ) )
-          return T1_Err_Invalid_File_Format;
+        if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) )
+          return FT_THROW( Invalid_File_Format );
         have_integer = 0;
       }
 
         have_integer = 0;
       }
 
 
               if ( !( dict & keyword->dict ) )
               {
 
               if ( !( dict & keyword->dict ) )
               {
-                FT_TRACE1(( "parse_dict: found %s but ignoring it "
-                            "since it is in the wrong dictionary\n",
+                FT_TRACE1(( "parse_dict: found `%s' but ignoring it"
+                            " since it is in the wrong dictionary\n",
                             keyword->ident ));
                 break;
               }
                             keyword->ident ));
                 break;
               }
                 parser->root.error = t1_load_keyword( face,
                                                       loader,
                                                       keyword );
                 parser->root.error = t1_load_keyword( face,
                                                       loader,
                                                       keyword );
-                if ( parser->root.error != T1_Err_Ok )
+                if ( parser->root.error != FT_Err_Ok )
                 {
                 {
-                  if ( FT_ERROR_BASE( parser->root.error ) == FT_Err_Ignore )
-                    parser->root.error = T1_Err_Ok;
+                  if ( FT_ERR_EQ( parser->root.error, Ignore ) )
+                    parser->root.error = FT_Err_Ok;
                   else
                     return parser->root.error;
                 }
                   else
                     return parser->root.error;
                 }
         }
       }
     }
         }
       }
     }
+    else
+      face->len_buildchar = 0;
 
 
-#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */
+#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */
 
     /* now, propagate the subrs, charstrings, and glyphnames tables */
     /* to the Type1 data                                            */
 
     /* now, propagate the subrs, charstrings, and glyphnames tables */
     /* to the Type1 data                                            */
       type1->subrs_len   = loader.subrs.lengths;
     }
 
       type1->subrs_len   = loader.subrs.lengths;
     }
 
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
-    if ( !face->root.internal->incremental_interface )
-#endif
+    if ( !IS_INCREMENTAL )
       if ( !loader.charstrings.init )
       {
         FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face\n" ));
       if ( !loader.charstrings.init )
       {
         FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face\n" ));
-        error = T1_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
       }
 
     loader.charstrings.init  = 0;
       }
 
     loader.charstrings.init  = 0;
index 5863210..837b791 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 objects manager (body).                                       */
 /*                                                                         */
 /*                                                                         */
 /*    Type 1 objects manager (body).                                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/*  Copyright 1996-2009, 2011, 2013 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
 
   FT_LOCAL_DEF( void )
 
 
   FT_LOCAL_DEF( void )
-  T1_Size_Done( T1_Size  size )
+  T1_Size_Done( FT_Size  t1size )          /* T1_Size */
   {
   {
+    T1_Size  size = (T1_Size)t1size;
+
+
     if ( size->root.internal )
     {
       PSH_Globals_Funcs  funcs;
     if ( size->root.internal )
     {
       PSH_Globals_Funcs  funcs;
 
 
   FT_LOCAL_DEF( FT_Error )
 
 
   FT_LOCAL_DEF( FT_Error )
-  T1_Size_Init( T1_Size  size )
+  T1_Size_Init( FT_Size  t1size )      /* T1_Size */
   {
   {
-    FT_Error           error = T1_Err_Ok;
+    T1_Size            size  = (T1_Size)t1size;
+    FT_Error           error = FT_Err_Ok;
     PSH_Globals_Funcs  funcs = T1_Size_Get_Globals_Funcs( size );
 
 
     PSH_Globals_Funcs  funcs = T1_Size_Get_Globals_Funcs( size );
 
 
 
 
   FT_LOCAL_DEF( FT_Error )
 
 
   FT_LOCAL_DEF( FT_Error )
-  T1_Size_Request( T1_Size          size,
+  T1_Size_Request( FT_Size          t1size,     /* T1_Size */
                    FT_Size_Request  req )
   {
                    FT_Size_Request  req )
   {
+    T1_Size            size  = (T1_Size)t1size;
     PSH_Globals_Funcs  funcs = T1_Size_Get_Globals_Funcs( size );
 
 
     PSH_Globals_Funcs  funcs = T1_Size_Get_Globals_Funcs( size );
 
 
                         size->root.metrics.y_scale,
                         0, 0 );
 
                         size->root.metrics.y_scale,
                         0, 0 );
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   /*************************************************************************/
 
   FT_LOCAL_DEF( void )
   /*************************************************************************/
 
   FT_LOCAL_DEF( void )
-  T1_GlyphSlot_Done( T1_GlyphSlot  slot )
+  T1_GlyphSlot_Done( FT_GlyphSlot  slot )
   {
   {
-    slot->root.internal->glyph_hints = 0;
+    slot->internal->glyph_hints = 0;
   }
 
 
   FT_LOCAL_DEF( FT_Error )
   }
 
 
   FT_LOCAL_DEF( FT_Error )
-  T1_GlyphSlot_Init( T1_GlyphSlot  slot )
+  T1_GlyphSlot_Init( FT_GlyphSlot  slot )
   {
     T1_Face           face;
     PSHinter_Service  pshinter;
 
 
   {
     T1_Face           face;
     PSHinter_Service  pshinter;
 
 
-    face     = (T1_Face)slot->root.face;
+    face     = (T1_Face)slot->face;
     pshinter = (PSHinter_Service)face->pshinter;
 
     if ( pshinter )
     pshinter = (PSHinter_Service)face->pshinter;
 
     if ( pshinter )
       FT_Module  module;
 
 
       FT_Module  module;
 
 
-      module = FT_Get_Module( slot->root.face->driver->root.library, "pshinter" );
-      if (module)
+      module = FT_Get_Module( slot->face->driver->root.library,
+                              "pshinter" );
+      if ( module )
       {
         T1_Hints_Funcs  funcs;
 
       {
         T1_Hints_Funcs  funcs;
 
+
         funcs = pshinter->get_t1_funcs( module );
         funcs = pshinter->get_t1_funcs( module );
-        slot->root.internal->glyph_hints = (void*)funcs;
+        slot->internal->glyph_hints = (void*)funcs;
       }
     }
       }
     }
+
     return 0;
   }
 
     return 0;
   }
 
   /*    face :: A typeless pointer to the face object to destroy.          */
   /*                                                                       */
   FT_LOCAL_DEF( void )
   /*    face :: A typeless pointer to the face object to destroy.          */
   /*                                                                       */
   FT_LOCAL_DEF( void )
-  T1_Face_Done( T1_Face  face )
+  T1_Face_Done( FT_Face  t1face )         /* T1_Face */
   {
   {
+    T1_Face    face = (T1_Face)t1face;
     FT_Memory  memory;
     T1_Font    type1;
 
     FT_Memory  memory;
     T1_Font    type1;
 
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   T1_Face_Init( FT_Stream      stream,
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   T1_Face_Init( FT_Stream      stream,
-                T1_Face        face,
+                FT_Face        t1face,          /* T1_Face */
                 FT_Int         face_index,
                 FT_Int         num_params,
                 FT_Parameter*  params )
   {
                 FT_Int         face_index,
                 FT_Int         num_params,
                 FT_Parameter*  params )
   {
+    T1_Face             face = (T1_Face)t1face;
     FT_Error            error;
     FT_Service_PsCMaps  psnames;
     PSAux_Service       psaux;
     FT_Error            error;
     FT_Service_PsCMaps  psnames;
     PSAux_Service       psaux;
     face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
                                            "psaux" );
     psaux = (PSAux_Service)face->psaux;
     face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
                                            "psaux" );
     psaux = (PSAux_Service)face->psaux;
+    if ( !psaux )
+    {
+      FT_ERROR(( "T1_Face_Init: cannot access `psaux' module\n" ));
+      error = FT_THROW( Missing_Module );
+      goto Exit;
+    }
 
     face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
                                               "pshinter" );
 
 
     face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
                                               "pshinter" );
 
+    FT_TRACE2(( "Type 1 driver\n" ));
+
     /* open the tokenizer; this will also check the font format */
     error = T1_Open_Face( face );
     if ( error )
     /* open the tokenizer; this will also check the font format */
     error = T1_Open_Face( face );
     if ( error )
     if ( face_index > 0 )
     {
       FT_ERROR(( "T1_Face_Init: invalid face index\n" ));
     if ( face_index > 0 )
     {
       FT_ERROR(( "T1_Face_Init: invalid face index\n" ));
-      error = T1_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
       root->bbox.xMax = ( type1->font_bbox.xMax + 0xFFFF ) >> 16;
       root->bbox.yMax = ( type1->font_bbox.yMax + 0xFFFF ) >> 16;
 
       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. */
+      /* Set units_per_EM if we didn't set it in t1_parse_font_matrix. */
       if ( !root->units_per_EM )
         root->units_per_EM = 1000;
 
       if ( !root->units_per_EM )
         root->units_per_EM = 1000;
 
         if ( !error )
           root->max_advance_width = (FT_Short)FIXED_TO_INT( max_advance );
         else
         if ( !error )
           root->max_advance_width = (FT_Short)FIXED_TO_INT( max_advance );
         else
-          error = T1_Err_Ok;   /* clear error */
+          error = FT_Err_Ok;   /* clear error */
       }
 
       root->max_advance_height = root->height;
       }
 
       root->max_advance_height = root->height;
       FT_Face  root = &face->root;
 
 
       FT_Face  root = &face->root;
 
 
-      if ( psnames && psaux )
+      if ( psnames )
       {
         FT_CharMapRec    charmap;
         T1_CMap_Classes  cmap_classes = psaux->t1_cmap_classes;
       {
         FT_CharMapRec    charmap;
         T1_CMap_Classes  cmap_classes = psaux->t1_cmap_classes;
         charmap.encoding    = FT_ENCODING_UNICODE;
 
         error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
         charmap.encoding    = FT_ENCODING_UNICODE;
 
         error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
-        if ( error && FT_Err_No_Unicode_Glyph_Name != error )
+        if ( error                                      &&
+             FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
           goto Exit;
         error = FT_Err_Ok;
 
           goto Exit;
         error = FT_Err_Ok;
 
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
-  T1_Driver_Init( T1_Driver  driver )
+  T1_Driver_Init( FT_Module  driver )
   {
     FT_UNUSED( driver );
 
   {
     FT_UNUSED( driver );
 
-    return T1_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   /*    driver :: A handle to the target Type 1 driver.                    */
   /*                                                                       */
   FT_LOCAL_DEF( void )
   /*    driver :: A handle to the target Type 1 driver.                    */
   /*                                                                       */
   FT_LOCAL_DEF( void )
-  T1_Driver_Done( T1_Driver  driver )
+  T1_Driver_Done( FT_Module  driver )
   {
     FT_UNUSED( driver );
   }
   {
     FT_UNUSED( driver );
   }
index e5e9029..54ccbb9 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 objects manager (specification).                              */
 /*                                                                         */
 /*                                                                         */
 /*    Type 1 objects manager (specification).                              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2006 by                                     */
+/*  Copyright 1996-2001, 2002, 2006, 2011 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -34,17 +34,6 @@ FT_BEGIN_HEADER
   typedef struct T1_Glyph_Hints_  T1_Glyph_Hints;
 
 
   typedef struct T1_Glyph_Hints_  T1_Glyph_Hints;
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Type>                                                                */
-  /*    T1_Driver                                                          */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A handle to a Type 1 driver object.                                */
-  /*                                                                       */
-  typedef struct T1_DriverRec_   *T1_Driver;
-
-
   /*************************************************************************/
   /*                                                                       */
   /* <Type>                                                                */
   /*************************************************************************/
   /*                                                                       */
   /* <Type>                                                                */
@@ -106,14 +95,14 @@ FT_BEGIN_HEADER
 
 
   FT_LOCAL( void )
 
 
   FT_LOCAL( void )
-  T1_Size_Done( T1_Size  size );
+  T1_Size_Done( FT_Size  size );
 
   FT_LOCAL( FT_Error )
 
   FT_LOCAL( FT_Error )
-  T1_Size_Request( T1_Size          size,
+  T1_Size_Request( FT_Size          size,
                    FT_Size_Request  req );
 
   FT_LOCAL( FT_Error )
                    FT_Size_Request  req );
 
   FT_LOCAL( FT_Error )
-  T1_Size_Init( T1_Size  size );
+  T1_Size_Init( FT_Size  size );
 
 
   /*************************************************************************/
 
 
   /*************************************************************************/
@@ -142,25 +131,25 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( FT_Error )
   T1_Face_Init( FT_Stream      stream,
 
   FT_LOCAL( FT_Error )
   T1_Face_Init( FT_Stream      stream,
-                T1_Face        face,
+                FT_Face        face,
                 FT_Int         face_index,
                 FT_Int         num_params,
                 FT_Parameter*  params );
 
   FT_LOCAL( void )
                 FT_Int         face_index,
                 FT_Int         num_params,
                 FT_Parameter*  params );
 
   FT_LOCAL( void )
-  T1_Face_Done( T1_Face  face );
+  T1_Face_Done( FT_Face  face );
 
   FT_LOCAL( FT_Error )
 
   FT_LOCAL( FT_Error )
-  T1_GlyphSlot_Init( T1_GlyphSlot  slot );
+  T1_GlyphSlot_Init( FT_GlyphSlot  slot );
 
   FT_LOCAL( void )
 
   FT_LOCAL( void )
-  T1_GlyphSlot_Done( T1_GlyphSlot  slot );
+  T1_GlyphSlot_Done( FT_GlyphSlot  slot );
 
   FT_LOCAL( FT_Error )
 
   FT_LOCAL( FT_Error )
-  T1_Driver_Init( T1_Driver  driver );
+  T1_Driver_Init( FT_Module  driver );
 
   FT_LOCAL( void )
 
   FT_LOCAL( void )
-  T1_Driver_Done( T1_Driver  driver );
+  T1_Driver_Done( FT_Module  driver );
 
 
 FT_END_HEADER
 
 
 FT_END_HEADER
index 2a76227..106e4e7 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 parser (body).                                                */
 /*                                                                         */
 /*                                                                         */
 /*    Type 1 parser (body).                                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009 by             */
+/*  Copyright 1996-2005, 2008, 2009, 2012, 2013 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
     if ( !FT_FRAME_ENTER( header_length ) )
     {
 
     if ( !FT_FRAME_ENTER( header_length ) )
     {
-      error = T1_Err_Ok;
+      error = FT_Err_Ok;
 
       if ( ft_memcmp( stream->cursor, header_string, header_length ) != 0 )
 
       if ( ft_memcmp( stream->cursor, header_string, header_length ) != 0 )
-        error = T1_Err_Unknown_File_Format;
+        error = FT_THROW( Unknown_File_Format );
 
       FT_FRAME_EXIT();
     }
 
       FT_FRAME_EXIT();
     }
     error = check_type1_format( stream, "%!PS-AdobeFont", 14 );
     if ( error )
     {
     error = check_type1_format( stream, "%!PS-AdobeFont", 14 );
     if ( error )
     {
-      if ( error != T1_Err_Unknown_File_Format )
+      if ( FT_ERR_NEQ( error, Unknown_File_Format ) )
         goto Exit;
 
       error = check_type1_format( stream, "%!FontType", 10 );
       if ( error )
       {
         goto Exit;
 
       error = check_type1_format( stream, "%!FontType", 10 );
       if ( error )
       {
-        FT_TRACE2(( "[not a Type1 font]\n" ));
+        FT_TRACE2(( "  not a Type 1 font\n" ));
         goto Exit;
       }
     }
         goto Exit;
       }
     }
   {
     FT_Stream  stream = parser->stream;
     FT_Memory  memory = parser->root.memory;
   {
     FT_Stream  stream = parser->stream;
     FT_Memory  memory = parser->root.memory;
-    FT_Error   error  = T1_Err_Ok;
+    FT_Error   error  = FT_Err_Ok;
     FT_ULong   size;
 
 
     FT_ULong   size;
 
 
       {
         FT_ERROR(( "T1_Get_Private_Dict:"
                    " invalid private dictionary section\n" ));
       {
         FT_ERROR(( "T1_Get_Private_Dict:"
                    " invalid private dictionary section\n" ));
-        error = T1_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Fail;
       }
 
         goto Fail;
       }
 
         error = read_pfb_tag( stream, &tag, &size );
         if ( error || tag != 0x8002U )
         {
         error = read_pfb_tag( stream, &tag, &size );
         if ( error || tag != 0x8002U )
         {
-          error = T1_Err_Ok;
+          error = FT_Err_Ok;
           break;
         }
 
           break;
         }
 
       {
         c = cur[0];
         if ( c == 'e' && cur + 9 < limit )  /* 9 = 5 letters for `eexec' + */
       {
         c = cur[0];
         if ( c == 'e' && cur + 9 < limit )  /* 9 = 5 letters for `eexec' + */
-                                            /* newline + 4 chars           */
+                                            /* whitespace + 4 chars        */
         {
           if ( cur[1] == 'e' &&
                cur[2] == 'x' &&
         {
           if ( cur[1] == 'e' &&
                cur[2] == 'x' &&
         {
           FT_ERROR(( "T1_Get_Private_Dict:"
                      " could not find `eexec' keyword\n" ));
         {
           FT_ERROR(( "T1_Get_Private_Dict:"
                      " could not find `eexec' keyword\n" ));
-          error = T1_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Exit;
         }
       }
           goto Exit;
         }
       }
       /* or string (as e.g. in u003043t.gsf from ghostscript)       */
 
       parser->root.cursor = parser->base_dict;
       /* or string (as e.g. in u003043t.gsf from ghostscript)       */
 
       parser->root.cursor = parser->base_dict;
-      parser->root.limit  = cur + 9;
+      /* set limit to `eexec' + whitespace + 4 characters */
+      parser->root.limit  = cur + 10;
 
       cur   = parser->root.cursor;
       limit = parser->root.limit;
 
       cur   = parser->root.cursor;
       limit = parser->root.limit;
       parser->root.limit = parser->base_dict + parser->base_len;
 
       T1_Skip_PS_Token( parser );
       parser->root.limit = parser->base_dict + parser->base_len;
 
       T1_Skip_PS_Token( parser );
-      cur = parser->root.cursor;
+      cur   = parser->root.cursor;
+      limit = parser->root.limit;
 
       /* according to the Type1 spec, the first cipher byte must not be  */
       /* an ASCII whitespace character code (blank, tab, carriage return */
 
       /* according to the Type1 spec, the first cipher byte must not be  */
       /* an ASCII whitespace character code (blank, tab, carriage return */
       /* characters...  So skip now all whitespace character codes.      */
       while ( cur < limit       &&
               ( *cur == ' '  ||
       /* characters...  So skip now all whitespace character codes.      */
       while ( cur < limit       &&
               ( *cur == ' '  ||
-                *cur == '\t' || 
+                *cur == '\t' ||
                 *cur == '\r' ||
                 *cur == '\n' ) )
         ++cur;
                 *cur == '\r' ||
                 *cur == '\n' ) )
         ++cur;
       {
         FT_ERROR(( "T1_Get_Private_Dict:"
                    " `eexec' not properly terminated\n" ));
       {
         FT_ERROR(( "T1_Get_Private_Dict:"
                    " `eexec' not properly terminated\n" ));
-        error = T1_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
-      size = parser->base_len - ( cur - parser->base_dict );
+      size = (FT_ULong)( parser->base_len - ( cur - parser->base_dict ) );
 
       if ( parser->in_memory )
       {
 
       if ( parser->in_memory )
       {
       /* now determine whether the private dictionary is encoded in binary */
       /* or hexadecimal ASCII format -- decode it accordingly              */
 
       /* now determine whether the private dictionary is encoded in binary */
       /* or hexadecimal ASCII format -- decode it accordingly              */
 
-      /* we need to access the next 4 bytes (after the final \r following */
-      /* the `eexec' keyword); if they all are hexadecimal digits, then   */
-      /* we have a case of ASCII storage                                  */
+      /* we need to access the next 4 bytes (after the final whitespace */
+      /* following the `eexec' keyword); if they all are hexadecimal    */
+      /* digits, then we have a case of ASCII storage                   */
 
 
-      if ( ft_isxdigit( cur[0] ) && ft_isxdigit( cur[1] ) &&
+      if ( cur + 3 < limit                                &&
+           ft_isxdigit( cur[0] ) && ft_isxdigit( cur[1] ) &&
            ft_isxdigit( cur[2] ) && ft_isxdigit( cur[3] ) )
       {
         /* ASCII hexadecimal encoding */
            ft_isxdigit( cur[2] ) && ft_isxdigit( cur[3] ) )
       {
         /* ASCII hexadecimal encoding */
     /* we now decrypt the encoded binary private dictionary */
     psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U );
 
     /* we now decrypt the encoded binary private dictionary */
     psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U );
 
+    if ( parser->private_len < 4 )
+    {
+      FT_ERROR(( "T1_Get_Private_Dict:"
+                 " invalid private dictionary section\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Fail;
+    }
+
     /* replace the four random bytes at the beginning with whitespace */
     parser->private_dict[0] = ' ';
     parser->private_dict[1] = ' ';
     /* replace the four random bytes at the beginning with whitespace */
     parser->private_dict[0] = ' ';
     parser->private_dict[1] = ' ';
index 2d692f0..e37276b 100644 (file)
@@ -96,7 +96,7 @@
                        T1_FIELD_DICT_PRIVATE )
   T1_FIELD_BOOL      ( "ForceBold",        force_bold,
                        T1_FIELD_DICT_PRIVATE )
                        T1_FIELD_DICT_PRIVATE )
   T1_FIELD_BOOL      ( "ForceBold",        force_bold,
                        T1_FIELD_DICT_PRIVATE )
-                         
+
 
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  T1_FontRec
 
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  T1_FontRec
diff --git a/reactos/lib/3rdparty/freetype/src/type42/Jamfile b/reactos/lib/3rdparty/freetype/src/type42/Jamfile
deleted file mode 100644 (file)
index 00371d5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/type42 Jamfile
-#
-# Copyright 2002 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) type42 ;
-
-{
-  local  _sources ;
-
-  if $(FT2_MULTI)
-  {
-    _sources = t42objs t42parse t42drivr ;
-  }
-  else
-  {
-    _sources = type42 ;
-  }
-
-  Library  $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/type42 Jamfile
index 820c679..3ad1bde 100644 (file)
@@ -4,7 +4,8 @@
 /*                                                                         */
 /*    High-level Type 42 driver interface (body).                          */
 /*                                                                         */
 /*                                                                         */
 /*    High-level Type 42 driver interface (body).                          */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2006, 2007, 2009 by Roberto Alameda.       */
+/*  Copyright 2002-2004, 2006, 2007, 2009, 2011, 2013 by                   */
+/*  Roberto Alameda.                                                       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
@@ -63,7 +64,7 @@
   {
     FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max );
 
   {
     FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max );
 
-    return T42_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   t42_get_name_index( T42_Face    face,
                       FT_String*  glyph_name )
   {
   t42_get_name_index( T42_Face    face,
                       FT_String*  glyph_name )
   {
-    FT_Int      i;
-    FT_String*  gname;
+    FT_Int  i;
 
 
     for ( i = 0; i < face->type1.num_glyphs; i++ )
     {
 
 
     for ( i = 0; i < face->type1.num_glyphs; i++ )
     {
-      gname = face->type1.glyph_names[i];
+      FT_String*  gname = face->type1.glyph_names[i];
+
 
       if ( glyph_name[0] == gname[0] && !ft_strcmp( glyph_name, gname ) )
         return (FT_UInt)ft_atol( (const char *)face->type1.charstrings[i] );
 
       if ( glyph_name[0] == gname[0] && !ft_strcmp( glyph_name, gname ) )
         return (FT_UInt)ft_atol( (const char *)face->type1.charstrings[i] );
   {
     *afont_info = ((T42_Face)face)->type1.font_info;
 
   {
     *afont_info = ((T42_Face)face)->type1.font_info;
 
-    return T42_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   {
     *afont_extra = ((T42_Face)face)->type1.font_extra;
 
   {
     *afont_extra = ((T42_Face)face)->type1.font_extra;
 
-    return T42_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
   {
     *afont_private = ((T42_Face)face)->type1.private_dict;
 
   {
     *afont_private = ((T42_Face)face)->type1.private_dict;
 
-    return T42_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   static const FT_Service_PsInfoRec  t42_service_ps_info =
   {
     (PS_GetFontInfoFunc)   t42_ps_get_font_info,
   }
 
 
   static const FT_Service_PsInfoRec  t42_service_ps_info =
   {
     (PS_GetFontInfoFunc)   t42_ps_get_font_info,
-    (PS_GetFontExtraFunc)   t42_ps_get_font_extra,
+    (PS_GetFontExtraFunc)  t42_ps_get_font_extra,
     (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names,
     (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names,
-    (PS_GetFontPrivateFunc)t42_ps_get_font_private
+    (PS_GetFontPrivateFunc)t42_ps_get_font_private,
+    (PS_GetFontValueFunc)  NULL             /* not implemented */
   };
 
 
   };
 
 
   };
 
 
   };
 
 
-  static FT_Module_Interface
-  T42_Get_Interface( FT_Driver         driver,
+  FT_CALLBACK_DEF( FT_Module_Interface )
+  T42_Get_Interface( FT_Module         module,
                      const FT_String*  t42_interface )
   {
                      const FT_String*  t42_interface )
   {
-    FT_UNUSED( driver );
+    FT_UNUSED( module );
 
     return ft_service_list_lookup( t42_services, t42_interface );
   }
 
     return ft_service_list_lookup( t42_services, t42_interface );
   }
 
       0,    /* format interface */
 
 
       0,    /* format interface */
 
-      (FT_Module_Constructor)T42_Driver_Init,
-      (FT_Module_Destructor) T42_Driver_Done,
-      (FT_Module_Requester)  T42_Get_Interface,
+      T42_Driver_Init,
+      T42_Driver_Done,
+      T42_Get_Interface,
     },
 
     sizeof ( T42_FaceRec ),
     sizeof ( T42_SizeRec ),
     sizeof ( T42_GlyphSlotRec ),
 
     },
 
     sizeof ( T42_FaceRec ),
     sizeof ( T42_SizeRec ),
     sizeof ( T42_GlyphSlotRec ),
 
-    (FT_Face_InitFunc)        T42_Face_Init,
-    (FT_Face_DoneFunc)        T42_Face_Done,
-    (FT_Size_InitFunc)        T42_Size_Init,
-    (FT_Size_DoneFunc)        T42_Size_Done,
-    (FT_Slot_InitFunc)        T42_GlyphSlot_Init,
-    (FT_Slot_DoneFunc)        T42_GlyphSlot_Done,
+    T42_Face_Init,
+    T42_Face_Done,
+    T42_Size_Init,
+    T42_Size_Done,
+    T42_GlyphSlot_Init,
+    T42_GlyphSlot_Done,
 
 
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    ft_stub_set_char_sizes,
-    ft_stub_set_pixel_sizes,
-#endif
-    (FT_Slot_LoadFunc)        T42_GlyphSlot_Load,
+    T42_GlyphSlot_Load,
 
 
-    (FT_Face_GetKerningFunc)  0,
-    (FT_Face_AttachFunc)      0,
+    0,                 /* FT_Face_GetKerningFunc  */
+    0,                 /* FT_Face_AttachFunc      */
 
 
-    (FT_Face_GetAdvancesFunc) 0,
-    (FT_Size_RequestFunc)     T42_Size_Request,
-    (FT_Size_SelectFunc)      T42_Size_Select
+    0,                 /* FT_Face_GetAdvancesFunc */
+    T42_Size_Request,
+    T42_Size_Select
   };
 
 
   };
 
 
index 4717e46..9a1e97e 100644 (file)
@@ -27,7 +27,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
-#endif 
+#endif
 
 
   FT_EXPORT_VAR( const FT_Driver_ClassRec )  t42_driver_class;
 
 
   FT_EXPORT_VAR( const FT_Driver_ClassRec )  t42_driver_class;
index b230910..217ae8b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 error codes (specification only).                            */
 /*                                                                         */
 /*                                                                         */
 /*    Type 42 error codes (specification only).                            */
 /*                                                                         */
-/*  Copyright 2002, 2003 by                                                */
+/*  Copyright 2002, 2003, 2012 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,6 +29,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  T42_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Type42
 
 #define FT_ERR_PREFIX  T42_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Type42
 
index a5e0ee5..18e2c0b 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 objects manager (body).                                      */
 /*                                                                         */
 /*                                                                         */
 /*    Type 42 objects manager (body).                                      */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009               */
+/*  Copyright 2002-2009, 2011, 2013                                        */
 /*  by Roberto Alameda.                                                    */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  by Roberto Alameda.                                                    */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -21,7 +21,7 @@
 #include "t42error.h"
 #include FT_INTERNAL_DEBUG_H
 #include FT_LIST_H
 #include "t42error.h"
 #include FT_INTERNAL_DEBUG_H
 #include FT_LIST_H
-#include FT_TRUETYPE_IDS_H 
+#include FT_TRUETYPE_IDS_H
 
 
 #undef  FT_COMPONENT
 
 
 #undef  FT_COMPONENT
@@ -61,7 +61,9 @@
 
     if ( type1->font_type != 42 )
     {
 
     if ( type1->font_type != 42 )
     {
-      error = T42_Err_Unknown_File_Format;
+      FT_ERROR(( "T42_Open_Face: cannot handle FontType %d\n",
+                 type1->font_type ));
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
@@ -72,7 +74,7 @@
     if ( !loader.charstrings.init )
     {
       FT_ERROR(( "T42_Open_Face: no charstrings array in face\n" ));
     if ( !loader.charstrings.init )
     {
       FT_ERROR(( "T42_Open_Face: no charstrings array in face\n" ));
-      error = T42_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
     }
 
     loader.charstrings.init  = 0;
     }
 
     loader.charstrings.init  = 0;
@@ -91,7 +93,6 @@
     if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
     {
       FT_Int    charcode, idx, min_char, max_char;
     if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
     {
       FT_Int    charcode, idx, min_char, max_char;
-      FT_Byte*  char_name;
       FT_Byte*  glyph_name;
 
 
       FT_Byte*  glyph_name;
 
 
       charcode = 0;
       for ( ; charcode < loader.encoding_table.max_elems; charcode++ )
       {
       charcode = 0;
       for ( ; charcode < loader.encoding_table.max_elems; charcode++ )
       {
+        FT_Byte*  char_name;
+
+
         type1->encoding.char_index[charcode] = 0;
         type1->encoding.char_name [charcode] = (char *)".notdef";
 
         type1->encoding.char_index[charcode] = 0;
         type1->encoding.char_name [charcode] = (char *)".notdef";
 
 
   FT_LOCAL_DEF( FT_Error )
   T42_Face_Init( FT_Stream      stream,
 
   FT_LOCAL_DEF( FT_Error )
   T42_Face_Init( FT_Stream      stream,
-                 T42_Face       face,
+                 FT_Face        t42face,       /* T42_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
+    T42_Face            face  = (T42_Face)t42face;
     FT_Error            error;
     FT_Service_PsCMaps  psnames;
     PSAux_Service       psaux;
     FT_Error            error;
     FT_Service_PsCMaps  psnames;
     PSAux_Service       psaux;
     face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
                                            "psaux" );
     psaux = (PSAux_Service)face->psaux;
     face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
                                            "psaux" );
     psaux = (PSAux_Service)face->psaux;
+    if ( !psaux )
+    {
+      FT_ERROR(( "T42_Face_Init: cannot access `psaux' module\n" ));
+      error = FT_THROW( Missing_Module );
+      goto Exit;
+    }
+
+    FT_TRACE2(( "Type 42 driver\n" ));
 
     /* open the tokenizer, this will also check the font format */
     error = T42_Open_Face( face );
 
     /* open the tokenizer, this will also check the font format */
     error = T42_Open_Face( face );
     if ( face_index > 0 )
     {
       FT_ERROR(( "T42_Face_Init: invalid face index\n" ));
     if ( face_index > 0 )
     {
       FT_ERROR(( "T42_Face_Init: invalid face index\n" ));
-      error = T42_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
       root->face_flags |= FT_FACE_FLAG_VERTICAL;
 
     {
       root->face_flags |= FT_FACE_FLAG_VERTICAL;
 
     {
-      if ( psnames && psaux )
+      if ( psnames )
       {
         FT_CharMapRec    charmap;
         T1_CMap_Classes  cmap_classes = psaux->t1_cmap_classes;
       {
         FT_CharMapRec    charmap;
         T1_CMap_Classes  cmap_classes = psaux->t1_cmap_classes;
         charmap.encoding    = FT_ENCODING_UNICODE;
 
         error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
         charmap.encoding    = FT_ENCODING_UNICODE;
 
         error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
-        if ( error && FT_Err_No_Unicode_Glyph_Name != error )
+        if ( error                                      &&
+             FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
           goto Exit;
         error = FT_Err_Ok;
 
           goto Exit;
         error = FT_Err_Ok;
 
 
 
   FT_LOCAL_DEF( void )
 
 
   FT_LOCAL_DEF( void )
-  T42_Face_Done( T42_Face  face )
+  T42_Face_Done( FT_Face  t42face )
   {
   {
+    T42_Face     face = (T42_Face)t42face;
     T1_Font      type1;
     PS_FontInfo  info;
     FT_Memory    memory;
     T1_Font      type1;
     PS_FontInfo  info;
     FT_Memory    memory;
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
-  T42_Driver_Init( T42_Driver  driver )
+  T42_Driver_Init( FT_Module  module )        /* T42_Driver */
   {
   {
-    FT_Module  ttmodule;
+    T42_Driver  driver = (T42_Driver)module;
+    FT_Module   ttmodule;
 
 
 
 
-    ttmodule = FT_Get_Module( FT_MODULE(driver)->library, "truetype" );
+    ttmodule = FT_Get_Module( module->library, "truetype" );
+    if ( !ttmodule )
+    {
+      FT_ERROR(( "T42_Driver_Init: cannot access `truetype' module\n" ));
+      return FT_THROW( Missing_Module );
+    }
+
     driver->ttclazz = (FT_Driver_Class)ttmodule->clazz;
 
     driver->ttclazz = (FT_Driver_Class)ttmodule->clazz;
 
-    return T42_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   FT_LOCAL_DEF( void )
   }
 
 
   FT_LOCAL_DEF( void )
-  T42_Driver_Done( T42_Driver  driver )
+  T42_Driver_Done( FT_Module  module )
   {
   {
-    FT_UNUSED( driver );
+    FT_UNUSED( module );
   }
 
 
   FT_LOCAL_DEF( FT_Error )
   }
 
 
   FT_LOCAL_DEF( FT_Error )
-  T42_Size_Init( T42_Size  size )
+  T42_Size_Init( FT_Size  size )         /* T42_Size */
   {
   {
-    FT_Face   face = size->root.face;
+    T42_Size  t42size = (T42_Size)size;
+    FT_Face   face    = size->face;
     T42_Face  t42face = (T42_Face)face;
     FT_Size   ttsize;
     T42_Face  t42face = (T42_Face)face;
     FT_Size   ttsize;
-    FT_Error  error   = T42_Err_Ok;
+    FT_Error  error   = FT_Err_Ok;
 
 
     error = FT_New_Size( t42face->ttf_face, &ttsize );
 
 
     error = FT_New_Size( t42face->ttf_face, &ttsize );
-    size->ttsize = ttsize;
+    t42size->ttsize = ttsize;
 
     FT_Activate_Size( ttsize );
 
 
     FT_Activate_Size( ttsize );
 
 
 
   FT_LOCAL_DEF( FT_Error )
 
 
   FT_LOCAL_DEF( FT_Error )
-  T42_Size_Request( T42_Size         size,
+  T42_Size_Request( FT_Size          t42size,      /* T42_Size */
                     FT_Size_Request  req )
   {
                     FT_Size_Request  req )
   {
-    T42_Face  face = (T42_Face)size->root.face;
+    T42_Size  size = (T42_Size)t42size;
+    T42_Face  face = (T42_Face)t42size->face;
     FT_Error  error;
 
 
     FT_Error  error;
 
 
 
     error = FT_Request_Size( face->ttf_face, req );
     if ( !error )
 
     error = FT_Request_Size( face->ttf_face, req );
     if ( !error )
-      ( (FT_Size)size )->metrics = face->ttf_face->size->metrics;
+      t42size->metrics = face->ttf_face->size->metrics;
 
     return error;
   }
 
 
   FT_LOCAL_DEF( FT_Error )
 
     return error;
   }
 
 
   FT_LOCAL_DEF( FT_Error )
-  T42_Size_Select( T42_Size  size,
+  T42_Size_Select( FT_Size   t42size,         /* T42_Size */
                    FT_ULong  strike_index )
   {
                    FT_ULong  strike_index )
   {
-    T42_Face  face = (T42_Face)size->root.face;
+    T42_Size  size = (T42_Size)t42size;
+    T42_Face  face = (T42_Face)t42size->face;
     FT_Error  error;
 
 
     FT_Error  error;
 
 
 
     error = FT_Select_Size( face->ttf_face, (FT_Int)strike_index );
     if ( !error )
 
     error = FT_Select_Size( face->ttf_face, (FT_Int)strike_index );
     if ( !error )
-      ( (FT_Size)size )->metrics = face->ttf_face->size->metrics;
+      t42size->metrics = face->ttf_face->size->metrics;
 
     return error;
 
 
     return error;
 
 
 
   FT_LOCAL_DEF( void )
 
 
   FT_LOCAL_DEF( void )
-  T42_Size_Done( T42_Size  size )
+  T42_Size_Done( FT_Size  t42size )             /* T42_Size */
   {
   {
-    FT_Face      face    = size->root.face;
+    T42_Size     size    = (T42_Size)t42size;
+    FT_Face      face    = t42size->face;
     T42_Face     t42face = (T42_Face)face;
     FT_ListNode  node;
 
     T42_Face     t42face = (T42_Face)face;
     FT_ListNode  node;
 
 
 
   FT_LOCAL_DEF( FT_Error )
 
 
   FT_LOCAL_DEF( FT_Error )
-  T42_GlyphSlot_Init( T42_GlyphSlot  slot )
+  T42_GlyphSlot_Init( FT_GlyphSlot  t42slot )        /* T42_GlyphSlot */
   {
   {
-    FT_Face       face    = slot->root.face;
-    T42_Face      t42face = (T42_Face)face;
-    FT_GlyphSlot  ttslot;
-    FT_Error      error   = T42_Err_Ok;
+    T42_GlyphSlot  slot    = (T42_GlyphSlot)t42slot;
+    FT_Face        face    = t42slot->face;
+    T42_Face       t42face = (T42_Face)face;
+    FT_GlyphSlot   ttslot;
+    FT_Error       error   = FT_Err_Ok;
 
 
     if ( face->glyph == NULL )
 
 
     if ( face->glyph == NULL )
 
 
   FT_LOCAL_DEF( void )
 
 
   FT_LOCAL_DEF( void )
-  T42_GlyphSlot_Done( T42_GlyphSlot slot )
+  T42_GlyphSlot_Done( FT_GlyphSlot  t42slot )       /* T42_GlyphSlot */
   {
   {
+    T42_GlyphSlot  slot = (T42_GlyphSlot)t42slot;
+
+
     FT_Done_GlyphSlot( slot->ttslot );
   }
 
     FT_Done_GlyphSlot( slot->ttslot );
   }
 
index 289dedc..02d1325 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 objects manager (specification).                             */
 /*                                                                         */
 /*                                                                         */
 /*    Type 42 objects manager (specification).                             */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2006, 2007 by Roberto Alameda.                   */
+/*  Copyright 2002, 2003, 2006, 2007, 2011 by Roberto Alameda.             */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
@@ -65,36 +65,36 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( FT_Error )
   T42_Face_Init( FT_Stream      stream,
 
   FT_LOCAL( FT_Error )
   T42_Face_Init( FT_Stream      stream,
-                 T42_Face       face,
+                 FT_Face        face,
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params );
 
 
   FT_LOCAL( void )
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params );
 
 
   FT_LOCAL( void )
-  T42_Face_Done( T42_Face  face );
+  T42_Face_Done( FT_Face  face );
 
 
   FT_LOCAL( FT_Error )
 
 
   FT_LOCAL( FT_Error )
-  T42_Size_Init( T42_Size  size );
+  T42_Size_Init( FT_Size  size );
 
 
   FT_LOCAL( FT_Error )
 
 
   FT_LOCAL( FT_Error )
-  T42_Size_Request( T42_Size         size,
+  T42_Size_Request( FT_Size          size,
                     FT_Size_Request  req );
 
 
   FT_LOCAL( FT_Error )
                     FT_Size_Request  req );
 
 
   FT_LOCAL( FT_Error )
-  T42_Size_Select( T42_Size  size,
+  T42_Size_Select( FT_Size   size,
                    FT_ULong  strike_index );
 
 
   FT_LOCAL( void )
                    FT_ULong  strike_index );
 
 
   FT_LOCAL( void )
-  T42_Size_Done( T42_Size  size );
+  T42_Size_Done( FT_Size  size );
 
 
   FT_LOCAL( FT_Error )
 
 
   FT_LOCAL( FT_Error )
-  T42_GlyphSlot_Init( T42_GlyphSlot  slot );
+  T42_GlyphSlot_Init( FT_GlyphSlot  slot );
 
 
   FT_LOCAL( FT_Error )
 
 
   FT_LOCAL( FT_Error )
@@ -104,14 +104,14 @@ FT_BEGIN_HEADER
                       FT_Int32      load_flags );
 
   FT_LOCAL( void )
                       FT_Int32      load_flags );
 
   FT_LOCAL( void )
-  T42_GlyphSlot_Done( T42_GlyphSlot slot );
+  T42_GlyphSlot_Done( FT_GlyphSlot  slot );
 
 
   FT_LOCAL( FT_Error )
 
 
   FT_LOCAL( FT_Error )
-  T42_Driver_Init( T42_Driver  driver );
+  T42_Driver_Init( FT_Module  module );
 
   FT_LOCAL( void )
 
   FT_LOCAL( void )
-  T42_Driver_Done( T42_Driver  driver );
+  T42_Driver_Done( FT_Module  module );
 
  /* */
 
 
  /* */
 
index 5774269..3cdd8a1 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 font parser (body).                                          */
 /*                                                                         */
 /*                                                                         */
 /*    Type 42 font parser (body).                                          */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by      */
+/*  Copyright 2002-2013 by                                                 */
 /*  Roberto Alameda.                                                       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  Roberto Alameda.                                                       */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
                    FT_Memory      memory,
                    PSAux_Service  psaux )
   {
                    FT_Memory      memory,
                    PSAux_Service  psaux )
   {
-    FT_Error  error = T42_Err_Ok;
+    FT_Error  error = FT_Err_Ok;
     FT_Long   size;
 
 
     FT_Long   size;
 
 
 
     if ( ft_memcmp( stream->cursor, "%!PS-TrueTypeFont", 17 ) != 0 )
     {
 
     if ( ft_memcmp( stream->cursor, "%!PS-TrueTypeFont", 17 ) != 0 )
     {
-      FT_TRACE2(( "not a Type42 font\n" ));
-      error = T42_Err_Unknown_File_Format;
+      FT_TRACE2(( "  not a Type42 font\n" ));
+      error = FT_THROW( Unknown_File_Format );
     }
 
     FT_FRAME_EXIT();
     }
 
     FT_FRAME_EXIT();
     /* 1000 / temp_scale, because temp_scale was already multiplied by   */
     /* 1000 (in t1_tofixed, from psobjs.c).                              */
 
     /* 1000 / temp_scale, because temp_scale was already multiplied by   */
     /* 1000 (in t1_tofixed, from psobjs.c).                              */
 
-    root->units_per_EM = (FT_UShort)( FT_DivFix( 1000 * 0x10000L,
-                                                 temp_scale ) >> 16 );
+    root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
 
     /* we need to scale the values by 1.0/temp_scale */
     if ( temp_scale != 0x10000L )
 
     /* we need to scale the values by 1.0/temp_scale */
     if ( temp_scale != 0x10000L )
     if ( cur >= limit )
     {
       FT_ERROR(( "t42_parse_encoding: out of bounds\n" ));
     if ( cur >= limit )
     {
       FT_ERROR(( "t42_parse_encoding: out of bounds\n" ));
-      parser->root.error = T42_Err_Invalid_File_Format;
+      parser->root.error = FT_THROW( Invalid_File_Format );
       return;
     }
 
       return;
     }
 
       else
       {
         FT_ERROR(( "t42_parse_encoding: invalid token\n" ));
       else
       {
         FT_ERROR(( "t42_parse_encoding: invalid token\n" ));
-        parser->root.error = T42_Err_Invalid_File_Format;
+        parser->root.error = FT_THROW( Invalid_File_Format );
       }
     }
   }
       }
     }
   }
     if ( parser->root.cursor >= limit || *parser->root.cursor++ != '[' )
     {
       FT_ERROR(( "t42_parse_sfnts: can't find begin of sfnts vector\n" ));
     if ( parser->root.cursor >= limit || *parser->root.cursor++ != '[' )
     {
       FT_ERROR(( "t42_parse_sfnts: can't find begin of sfnts vector\n" ));
-      error = T42_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Fail;
     }
 
       goto Fail;
     }
 
         {
           FT_ERROR(( "t42_parse_sfnts: "
                      "can't handle mixed binary and hex strings\n" ));
         {
           FT_ERROR(( "t42_parse_sfnts: "
                      "can't handle mixed binary and hex strings\n" ));
-          error = T42_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
 
           goto Fail;
         }
 
         if ( string_size < 0 )
         {
           FT_ERROR(( "t42_parse_sfnts: invalid string size\n" ));
         if ( string_size < 0 )
         {
           FT_ERROR(( "t42_parse_sfnts: invalid string size\n" ));
-          error = T42_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
 
           goto Fail;
         }
 
         if ( limit - parser->root.cursor < string_size )
         {
           FT_ERROR(( "t42_parse_sfnts: too many binary data\n" ));
         if ( limit - parser->root.cursor < string_size )
         {
           FT_ERROR(( "t42_parse_sfnts: too many binary data\n" ));
-          error = T42_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
         else
           goto Fail;
         }
         else
       if ( !string_buf )
       {
         FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
       if ( !string_buf )
       {
         FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
-        error = T42_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Fail;
       }
 
         goto Fail;
       }
 
-      /* A string can have a trailing zero byte for padding.  Ignore it. */
-      if ( string_buf[string_size - 1] == 0 && ( string_size % 2 == 1 ) )
+      /* A string can have a trailing zero (odd) byte for padding. */
+      /* Ignore it.                                                */
+      if ( ( string_size & 1 ) && string_buf[string_size - 1] == 0 )
         string_size--;
 
       if ( !string_size )
       {
         FT_ERROR(( "t42_parse_sfnts: invalid string\n" ));
         string_size--;
 
       if ( !string_size )
       {
         FT_ERROR(( "t42_parse_sfnts: invalid string\n" ));
-        error = T42_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Fail;
       }
 
         goto Fail;
       }
 
           if ( count >= ttf_size )
           {
             FT_ERROR(( "t42_parse_sfnts: too many binary data\n" ));
           if ( count >= ttf_size )
           {
             FT_ERROR(( "t42_parse_sfnts: too many binary data\n" ));
-            error = T42_Err_Invalid_File_Format;
+            error = FT_THROW( Invalid_File_Format );
             goto Fail;
           }
           face->ttf_data[count++] = string_buf[n];
             goto Fail;
           }
           face->ttf_data[count++] = string_buf[n];
     }
 
     /* if control reaches this point, the format was not valid */
     }
 
     /* if control reaches this point, the format was not valid */
-    error = T42_Err_Invalid_File_Format;
+    error = FT_THROW( Invalid_File_Format );
 
   Fail:
     parser->root.error = error;
 
   Fail:
     parser->root.error = error;
     if ( parser->root.cursor >= limit )
     {
       FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
     if ( parser->root.cursor >= limit )
     {
       FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
-      error = T42_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Fail;
     }
 
       goto Fail;
     }
 
     else
     {
       FT_ERROR(( "t42_parse_charstrings: invalid token\n" ));
     else
     {
       FT_ERROR(( "t42_parse_charstrings: invalid token\n" ));
-      error = T42_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Fail;
     }
 
     if ( parser->root.cursor >= limit )
     {
       FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
       goto Fail;
     }
 
     if ( parser->root.cursor >= limit )
     {
       FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
-      error = T42_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Fail;
     }
 
       goto Fail;
     }
 
         if ( cur + 1 >= limit )
         {
           FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
         if ( cur + 1 >= limit )
         {
           FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
-          error = T42_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
 
           goto Fail;
         }
 
         if ( parser->root.cursor >= limit )
         {
           FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
         if ( parser->root.cursor >= limit )
         {
           FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
-          error = T42_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Fail;
         }
 
           goto Fail;
         }
 
     if ( !notdef_found )
     {
       FT_ERROR(( "t42_parse_charstrings: no /.notdef glyph\n" ));
     if ( !notdef_found )
     {
       FT_ERROR(( "t42_parse_charstrings: no /.notdef glyph\n" ));
-      error = T42_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Fail;
     }
 
       goto Fail;
     }
 
 
     parser->root.cursor = base;
     parser->root.limit  = base + size;
 
     parser->root.cursor = base;
     parser->root.limit  = base + size;
-    parser->root.error  = T42_Err_Ok;
+    parser->root.error  = FT_Err_Ok;
 
     limit = parser->root.limit;
 
 
     limit = parser->root.limit;
 
diff --git a/reactos/lib/3rdparty/freetype/src/winfonts/Jamfile b/reactos/lib/3rdparty/freetype/src/winfonts/Jamfile
deleted file mode 100644 (file)
index 71cf567..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# FreeType 2 src/winfonts Jamfile
-#
-# Copyright 2001 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used, modified,
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-SubDir  FT2_TOP $(FT2_SRC_DIR) winfonts ;
-
-Library  $(FT2_LIB) : winfnt.c ;
-
-# end of src/winfonts Jamfile
index ea80909..463ba77 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Win FNT/FON error codes (specification only).                        */
 /*                                                                         */
 /*                                                                         */
 /*    Win FNT/FON error codes (specification only).                        */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2012 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,6 +30,7 @@
 
 #undef __FTERRORS_H__
 
 
 #undef __FTERRORS_H__
 
+#undef  FT_ERR_PREFIX
 #define FT_ERR_PREFIX  FNT_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Winfonts
 
 #define FT_ERR_PREFIX  FNT_Err_
 #define FT_ERR_BASE    FT_Mod_Err_Winfonts
 
index ee17d16..e8055c0 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType font driver for Windows FNT/FON files                       */
 /*                                                                         */
 /*                                                                         */
 /*    FreeType font driver for Windows FNT/FON files                       */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010 by */
+/*  Copyright 1996-2004, 2006-2013 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*  Copyright 2003 Huw D M Davies for Codeweavers                          */
 /*  Copyright 2007 Dmitry Timoshkov for Codeweavers                        */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*  Copyright 2003 Huw D M Davies for Codeweavers                          */
 /*  Copyright 2007 Dmitry Timoshkov for Codeweavers                        */
@@ -23,7 +23,7 @@
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_OBJECTS_H
-#include FT_TRUETYPE_IDS_H 
+#include FT_TRUETYPE_IDS_H
 
 #include "winfnt.h"
 #include "fnterrs.h"
 
 #include "winfnt.h"
 #include "fnterrs.h"
     if ( header->version != 0x200 &&
          header->version != 0x300 )
     {
     if ( header->version != 0x200 &&
          header->version != 0x300 )
     {
-      FT_TRACE2(( "[not a valid FNT file]\n" ));
-      error = FNT_Err_Unknown_File_Format;
+      FT_TRACE2(( "  not a Windows FNT file\n" ));
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
 
     if ( header->file_size < size )
     {
 
     if ( header->file_size < size )
     {
-      FT_TRACE2(( "[not a valid FNT file]\n" ));
-      error = FNT_Err_Unknown_File_Format;
+      FT_TRACE2(( "  not a Windows FNT file\n" ));
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
     if ( header->file_type & 1 )
     {
       FT_TRACE2(( "[can't handle vector FNT fonts]\n" ));
     if ( header->file_type & 1 )
     {
       FT_TRACE2(( "[can't handle vector FNT fonts]\n" ));
-      error = FNT_Err_Unknown_File_Format;
+      error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
          FT_STREAM_READ_FIELDS( winmz_header_fields, &mz_header ) )
       goto Exit;
 
          FT_STREAM_READ_FIELDS( winmz_header_fields, &mz_header ) )
       goto Exit;
 
-    error = FNT_Err_Unknown_File_Format;
+    error = FT_ERR( Unknown_File_Format );
     if ( mz_header.magic == WINFNT_MZ_MAGIC )
     {
       /* yes, now look for an NE header in the file */
     if ( mz_header.magic == WINFNT_MZ_MAGIC )
     {
       /* yes, now look for an NE header in the file */
            FT_STREAM_READ_FIELDS( winne_header_fields, &ne_header ) )
         goto Exit;
 
            FT_STREAM_READ_FIELDS( winne_header_fields, &ne_header ) )
         goto Exit;
 
-      error = FNT_Err_Unknown_File_Format;
+      error = FT_ERR( Unknown_File_Format );
       if ( ne_header.magic == WINFNT_NE_MAGIC )
       {
         /* good, now look into the resource table for each FNT resource */
       if ( ne_header.magic == WINFNT_NE_MAGIC )
       {
         /* good, now look into the resource table for each FNT resource */
         if ( !font_count || !font_offset )
         {
           FT_TRACE2(( "this file doesn't contain any FNT resources\n" ));
         if ( !font_count || !font_offset )
         {
           FT_TRACE2(( "this file doesn't contain any FNT resources\n" ));
-          error = FNT_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Exit;
         }
 
           goto Exit;
         }
 
         if ( font_count * 118UL > stream->size )
         {
           FT_TRACE2(( "invalid number of faces\n" ));
         if ( font_count * 118UL > stream->size )
         {
           FT_TRACE2(( "invalid number of faces\n" ));
-          error = FNT_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Exit;
         }
 
           goto Exit;
         }
 
 
         if ( face_index >= font_count )
         {
 
         if ( face_index >= font_count )
         {
-          error = FNT_Err_Invalid_Argument;
+          error = FT_THROW( Invalid_Argument );
           goto Exit;
         }
         else if ( face_index < 0 )
           goto Exit;
         }
         else if ( face_index < 0 )
              pe32_header.magic32 != 0x10b                                    )
         {
           FT_TRACE2(( "this file has an invalid PE header\n" ));
              pe32_header.magic32 != 0x10b                                    )
         {
           FT_TRACE2(( "this file has an invalid PE header\n" ));
-          error = FNT_Err_Invalid_File_Format;
+          error = FT_THROW( Invalid_File_Format );
           goto Exit;
         }
 
           goto Exit;
         }
 
         }
 
         FT_TRACE2(( "this file doesn't contain any resources\n" ));
         }
 
         FT_TRACE2(( "this file doesn't contain any resources\n" ));
-        error = FNT_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
 
       Found_rsrc_section:
         goto Exit;
 
       Found_rsrc_section:
 
           if ( !(dir_entry1.offset & 0x80000000UL ) /* DataIsDirectory */ )
           {
 
           if ( !(dir_entry1.offset & 0x80000000UL ) /* DataIsDirectory */ )
           {
-            error = FNT_Err_Invalid_File_Format;
+            error = FT_THROW( Invalid_File_Format );
             goto Exit;
           }
 
             goto Exit;
           }
 
 
             if ( !(dir_entry2.offset & 0x80000000UL ) /* DataIsDirectory */ )
             {
 
             if ( !(dir_entry2.offset & 0x80000000UL ) /* DataIsDirectory */ )
             {
-              error = FNT_Err_Invalid_File_Format;
+              error = FT_THROW( Invalid_File_Format );
               goto Exit;
             }
 
               goto Exit;
             }
 
 
               if ( dir_entry2.offset & 0x80000000UL /* DataIsDirectory */ )
               {
 
               if ( dir_entry2.offset & 0x80000000UL /* DataIsDirectory */ )
               {
-                error = FNT_Err_Invalid_File_Format;
+                error = FT_THROW( Invalid_File_Format );
                 goto Exit;
               }
 
                 goto Exit;
               }
 
       if ( !face->root.num_faces )
       {
         FT_TRACE2(( "this file doesn't contain any RT_FONT resources\n" ));
       if ( !face->root.num_faces )
       {
         FT_TRACE2(( "this file doesn't contain any RT_FONT resources\n" ));
-        error = FNT_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
       if ( face_index >= face->root.num_faces )
       {
         goto Exit;
       }
 
       if ( face_index >= face->root.num_faces )
       {
-        error = FNT_Err_Invalid_Argument;
+        error = FT_THROW( Invalid_Argument );
         goto Exit;
       }
     }
         goto Exit;
       }
     }
 
 
   static void
 
 
   static void
-  FNT_Face_Done( FNT_Face  face )
+  FNT_Face_Done( FT_Face  fntface )       /* FNT_Face */
   {
   {
+    FNT_Face   face = (FNT_Face)fntface;
     FT_Memory  memory;
 
 
     FT_Memory  memory;
 
 
 
     fnt_font_done( face );
 
 
     fnt_font_done( face );
 
-    FT_FREE( face->root.available_sizes );
-    face->root.num_fixed_sizes = 0;
+    FT_FREE( fntface->available_sizes );
+    fntface->num_fixed_sizes = 0;
   }
 
 
   static FT_Error
   FNT_Face_Init( FT_Stream      stream,
   }
 
 
   static FT_Error
   FNT_Face_Init( FT_Stream      stream,
-                 FNT_Face       face,
+                 FT_Face        fntface,        /* FNT_Face */
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
                  FT_Int         face_index,
                  FT_Int         num_params,
                  FT_Parameter*  params )
   {
+    FNT_Face   face   = (FNT_Face)fntface;
     FT_Error   error;
     FT_Memory  memory = FT_FACE_MEMORY( face );
 
     FT_Error   error;
     FT_Memory  memory = FT_FACE_MEMORY( face );
 
     FT_UNUSED( params );
 
 
     FT_UNUSED( params );
 
 
+    FT_TRACE2(( "Windows FNT driver\n" ));
+
     /* try to load font from a DLL */
     error = fnt_face_get_dll_font( face, face_index );
     if ( !error && face_index < 0 )
       goto Exit;
 
     /* try to load font from a DLL */
     error = fnt_face_get_dll_font( face, face_index );
     if ( !error && face_index < 0 )
       goto Exit;
 
-    if ( error == FNT_Err_Unknown_File_Format )
+    if ( FT_ERR_EQ( error, Unknown_File_Format ) )
     {
       /* this didn't work; try to load a single FNT font */
       FNT_Font  font;
     {
       /* this didn't work; try to load a single FNT font */
       FNT_Font  font;
       if ( FT_NEW( face->font ) )
         goto Exit;
 
       if ( FT_NEW( face->font ) )
         goto Exit;
 
-      face->root.num_faces = 1;
+      fntface->num_faces = 1;
 
       font           = face->font;
       font->offset   = 0;
 
       font           = face->font;
       font->offset   = 0;
       if ( !error )
       {
         if ( face_index > 0 )
       if ( !error )
       {
         if ( face_index > 0 )
-          error = FNT_Err_Invalid_Argument;
+          error = FT_THROW( Invalid_Argument );
         else if ( face_index < 0 )
           goto Exit;
       }
         else if ( face_index < 0 )
           goto Exit;
       }
           root->charmap = root->charmaps[0];
       }
 
           root->charmap = root->charmaps[0];
       }
 
-      /* setup remaining flags */
+      /* set up remaining flags */
+
+      if ( font->header.last_char < font->header.first_char )
+      {
+        FT_TRACE2(( "invalid number of glyphs\n" ));
+        error = FT_THROW( Invalid_File_Format );
+        goto Fail;
+      }
 
       /* reserve one slot for the .notdef glyph at index 0 */
       root->num_glyphs = font->header.last_char -
 
       /* reserve one slot for the .notdef glyph at index 0 */
       root->num_glyphs = font->header.last_char -
       if ( font->header.face_name_offset >= font->header.file_size )
       {
         FT_TRACE2(( "invalid family name offset\n" ));
       if ( font->header.face_name_offset >= font->header.file_size )
       {
         FT_TRACE2(( "invalid family name offset\n" ));
-        error = FNT_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Fail;
       }
       family_size = font->header.file_size - font->header.face_name_offset;
         goto Fail;
       }
       family_size = font->header.file_size - font->header.face_name_offset;
     goto Exit;
 
   Fail:
     goto Exit;
 
   Fail:
-    FNT_Face_Done( face );
+    FNT_Face_Done( fntface );
 
   Exit:
     return error;
 
   Exit:
     return error;
 
 
   static FT_Error
 
 
   static FT_Error
-  FNT_Size_Select( FT_Size  size )
+  FNT_Size_Select( FT_Size   size,
+                   FT_ULong  strike_index )
   {
     FNT_Face          face   = (FNT_Face)size->face;
     FT_WinFNT_Header  header = &face->font->header;
 
   {
     FNT_Face          face   = (FNT_Face)size->face;
     FT_WinFNT_Header  header = &face->font->header;
 
+    FT_UNUSED( strike_index );
+
 
     FT_Select_Metrics( size->face, 0 );
 
 
     FT_Select_Metrics( size->face, 0 );
 
                                    header->ascent ) * 64;
     size->metrics.max_advance = header->max_width * 64;
 
                                    header->ascent ) * 64;
     size->metrics.max_advance = header->max_width * 64;
 
-    return FNT_Err_Ok;
+    return FT_Err_Ok;
   }
 
 
   }
 
 
     FNT_Face          face    = (FNT_Face)size->face;
     FT_WinFNT_Header  header  = &face->font->header;
     FT_Bitmap_Size*   bsize   = size->face->available_sizes;
     FNT_Face          face    = (FNT_Face)size->face;
     FT_WinFNT_Header  header  = &face->font->header;
     FT_Bitmap_Size*   bsize   = size->face->available_sizes;
-    FT_Error          error   = FNT_Err_Invalid_Pixel_Size;
+    FT_Error          error   = FT_ERR( Invalid_Pixel_Size );
     FT_Long           height;
 
 
     FT_Long           height;
 
 
     {
     case FT_SIZE_REQUEST_TYPE_NOMINAL:
       if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )
     {
     case FT_SIZE_REQUEST_TYPE_NOMINAL:
       if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )
-        error = FNT_Err_Ok;
+        error = FT_Err_Ok;
       break;
 
     case FT_SIZE_REQUEST_TYPE_REAL_DIM:
       if ( height == header->pixel_height )
       break;
 
     case FT_SIZE_REQUEST_TYPE_REAL_DIM:
       if ( height == header->pixel_height )
-        error = FNT_Err_Ok;
+        error = FT_Err_Ok;
       break;
 
     default:
       break;
 
     default:
-      error = FNT_Err_Unimplemented_Feature;
+      error = FT_THROW( Unimplemented_Feature );
       break;
     }
 
     if ( error )
       return error;
     else
       break;
     }
 
     if ( error )
       return error;
     else
-      return FNT_Size_Select( size );
+      return FNT_Size_Select( size, 0 );
   }
 
 
   }
 
 
   {
     FNT_Face    face   = (FNT_Face)FT_SIZE_FACE( size );
     FNT_Font    font;
   {
     FNT_Face    face   = (FNT_Face)FT_SIZE_FACE( size );
     FNT_Font    font;
-    FT_Error    error  = FNT_Err_Ok;
+    FT_Error    error  = FT_Err_Ok;
     FT_Byte*    p;
     FT_Int      len;
     FT_Bitmap*  bitmap = &slot->bitmap;
     FT_Byte*    p;
     FT_Int      len;
     FT_Bitmap*  bitmap = &slot->bitmap;
 
     if ( !face )
     {
 
     if ( !face )
     {
-      error = FNT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
     if ( !font ||
          glyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) )
     {
     if ( !font ||
          glyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) )
     {
-      error = FNT_Err_Invalid_Argument;
+      error = FT_THROW( Invalid_Argument );
       goto Exit;
     }
 
       goto Exit;
     }
 
     if ( offset >= font->header.file_size )
     {
       FT_TRACE2(( "invalid FNT offset\n" ));
     if ( offset >= font->header.file_size )
     {
       FT_TRACE2(( "invalid FNT offset\n" ));
-      error = FNT_Err_Invalid_File_Format;
+      error = FT_THROW( Invalid_File_Format );
       goto Exit;
     }
 
       goto Exit;
     }
 
       if ( offset + pitch * bitmap->rows >= font->header.file_size )
       {
         FT_TRACE2(( "invalid bitmap width\n" ));
       if ( offset + pitch * bitmap->rows >= font->header.file_size )
       {
         FT_TRACE2(( "invalid bitmap width\n" ));
-        error = FNT_Err_Invalid_File_Format;
+        error = FT_THROW( Invalid_File_Format );
         goto Exit;
       }
 
         goto Exit;
       }
 
 
 
   static FT_Module_Interface
 
 
   static FT_Module_Interface
-  winfnt_get_service( FT_Driver         driver,
+  winfnt_get_service( FT_Module         module,
                       const FT_String*  service_id )
   {
                       const FT_String*  service_id )
   {
-    FT_UNUSED( driver );
+    FT_UNUSED( module );
 
     return ft_service_list_lookup( winfnt_services, service_id );
   }
 
     return ft_service_list_lookup( winfnt_services, service_id );
   }
 
       0,
 
 
       0,
 
-      (FT_Module_Constructor)0,
-      (FT_Module_Destructor) 0,
-      (FT_Module_Requester)  winfnt_get_service
+      0,                  /* FT_Module_Constructor */
+      0,                  /* FT_Module_Destructor  */
+      winfnt_get_service
     },
 
     },
 
-    sizeof( FNT_FaceRec ),
-    sizeof( FT_SizeRec ),
-    sizeof( FT_GlyphSlotRec ),
-
-    (FT_Face_InitFunc)        FNT_Face_Init,
-    (FT_Face_DoneFunc)        FNT_Face_Done,
-    (FT_Size_InitFunc)        0,
-    (FT_Size_DoneFunc)        0,
-    (FT_Slot_InitFunc)        0,
-    (FT_Slot_DoneFunc)        0,
-
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-    ft_stub_set_char_sizes,
-    ft_stub_set_pixel_sizes,
-#endif
-    (FT_Slot_LoadFunc)        FNT_Load_Glyph,
-
-    (FT_Face_GetKerningFunc)  0,
-    (FT_Face_AttachFunc)      0,
-    (FT_Face_GetAdvancesFunc) 0,
-
-    (FT_Size_RequestFunc)     FNT_Size_Request,
-    (FT_Size_SelectFunc)      FNT_Size_Select
+    sizeof ( FNT_FaceRec ),
+    sizeof ( FT_SizeRec ),
+    sizeof ( FT_GlyphSlotRec ),
+
+    FNT_Face_Init,
+    FNT_Face_Done,
+    0,                    /* FT_Size_InitFunc */
+    0,                    /* FT_Size_DoneFunc */
+    0,                    /* FT_Slot_InitFunc */
+    0,                    /* FT_Slot_DoneFunc */
+
+    FNT_Load_Glyph,
+
+    0,                    /* FT_Face_GetKerningFunc  */
+    0,                    /* FT_Face_AttachFunc      */
+    0,                    /* FT_Face_GetAdvancesFunc */
+
+    FNT_Size_Request,
+    FNT_Size_Select
   };
 
 
   };
 
 
index 70a9086..b7a8073 100644 (file)
@@ -30,7 +30,7 @@ FT_BEGIN_HEADER
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
 
 #ifdef FT_CONFIG_OPTION_PIC
 #error "this module does not support PIC yet"
-#endif 
+#endif
 
   typedef struct  WinMZ_HeaderRec_
   {
 
   typedef struct  WinMZ_HeaderRec_
   {
diff --git a/reactos/lib/3rdparty/freetype/version.sed b/reactos/lib/3rdparty/freetype/version.sed
deleted file mode 100644 (file)
index c281ff5..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /usr/bin/sed -nf
-
-s/^#define  *FREETYPE_MAJOR  *\([^ ][^ ]*\).*$/freetype_major="\1" ;/p
-s/^#define  *FREETYPE_MINOR  *\([^ ][^ ]*\).*$/freetype_minor=".\1" ;/p
-s/^#define  *FREETYPE_PATCH  *\([^ ][^ ]*\).*$/freetype_patch=".\1" ;/p
index 2d73e92..db4e19e 100644 (file)
@@ -18,8 +18,8 @@ Latest Version: 1.1
 Website: http://www.geocities.com/dborca/opengl/tc.html
 
 Title: FreeType
 Website: http://www.geocities.com/dborca/opengl/tc.html
 
 Title: FreeType
-Used Version: 2.4.4
-Latest Version: 2.4.4
+Used Version: 2.5.0
+Latest Version: 2.5.0
 Website: http://www.freetype.org
 
 Title: Mesa3D
 Website: http://www.freetype.org
 
 Title: Mesa3D
index d0ac420..1b8d20e 100644 (file)
@@ -9,6 +9,7 @@ add_library(ftfd SHARED
     glyph.c
     rosglue.c
     sprintf.c
     glyph.c
     rosglue.c
     sprintf.c
+    freetype.rc
     ${CMAKE_CURRENT_BINARY_DIR}/ftfd.def)
 
 set_entrypoint(ftfd FtfdEnableDriver 12)
     ${CMAKE_CURRENT_BINARY_DIR}/ftfd.def)
 
 set_entrypoint(ftfd FtfdEnableDriver 12)
index 74642b0..0de1a04 100644 (file)
-LIBRARY ftfd.dll
+LIBRARY 
 EXPORTS
 EXPORTS
+  FT_Activate_Size
+  FT_Add_Default_Modules
+  FT_Add_Module
+  FT_Angle_Diff
+  FT_Atan2
+  FT_Attach_File
+  FT_Attach_Stream
   FT_Bitmap_Convert
   FT_Bitmap_Convert
+  FT_Bitmap_Copy
   FT_Bitmap_Done
   FT_Bitmap_Done
+  FT_Bitmap_Embolden
   FT_Bitmap_New
   FT_Bitmap_New
+  FT_CeilFix
+  FT_ClassicKern_Free
+  FT_ClassicKern_Validate
+  FT_Cos
+  FT_DivFix
   FT_Done_Face
   FT_Done_Face
+  FT_Done_FreeType
   FT_Done_Glyph
   FT_Done_Glyph
+  FT_Done_Library
+  FT_Done_Size
+  FT_Face_CheckTrueTypePatents
+  FT_Face_SetUnpatentedHinting
+  FT_FloorFix
+  FT_Get_CMap_Format
+  FT_Get_CMap_Language_ID
   FT_Get_Char_Index
   FT_Get_Char_Index
+  FT_Get_Charmap_Index
   FT_Get_First_Char
   FT_Get_Glyph
   FT_Get_First_Char
   FT_Get_Glyph
+  FT_Get_Glyph_Name
   FT_Get_Kerning
   FT_Get_Kerning
+  FT_Get_MM_Var
+  FT_Get_Module
+  FT_Get_Multi_Master
+  FT_Get_Name_Index
   FT_Get_Next_Char
   FT_Get_Next_Char
+  FT_Get_PFR_Advance
+  FT_Get_PFR_Kerning
+  FT_Get_PFR_Metrics
   FT_Get_PS_Font_Info
   FT_Get_PS_Font_Info
+  FT_Get_PS_Font_Private
+  FT_Get_Postscript_Name
+  FT_Get_Renderer
+  FT_Get_Sfnt_Name
+  FT_Get_Sfnt_Name_Count
   FT_Get_Sfnt_Table
   FT_Get_Sfnt_Table
+  FT_Get_SubGlyph_Info
+  FT_Get_Track_Kerning
+  FT_Get_TrueType_Engine_Type
   FT_Get_WinFNT_Header
   FT_Get_WinFNT_Header
+  FT_GlyphSlot_Embolden
+  FT_GlyphSlot_Oblique
+  FT_GlyphSlot_Own_Bitmap
+  FT_Glyph_Copy
+  FT_Glyph_Get_CBox
+  FT_Glyph_Stroke
+  FT_Glyph_StrokeBorder
   FT_Glyph_To_Bitmap
   FT_Glyph_To_Bitmap
+  FT_Glyph_Transform
+  FT_Has_PS_Glyph_Names
   FT_Init_FreeType
   FT_Init_FreeType
+  FT_Library_Version
+  FT_List_Add
+  FT_List_Finalize
+  FT_List_Find
+  FT_List_Insert
+  FT_List_Iterate
+  FT_List_Remove
+  FT_List_Up
+  FT_Load_Char
   FT_Load_Glyph
   FT_Load_Sfnt_Table
   FT_Load_Glyph
   FT_Load_Sfnt_Table
+  FT_Matrix_Invert
   FT_Matrix_Multiply
   FT_Matrix_Multiply
+  FT_MulDiv
   FT_MulFix
   FT_MulFix
+  FT_New_Face
+  FT_New_Library
   FT_New_Memory_Face
   FT_New_Memory_Face
+  FT_New_Size
+  FT_OpenType_Free
+  FT_OpenType_Validate
+  FT_Open_Face
+  FT_Outline_Check
+  FT_Outline_Copy
+  FT_Outline_Decompose
+  FT_Outline_Done
+  FT_Outline_Done_Internal
+  FT_Outline_Embolden
+  FT_Outline_GetInsideBorder
+  FT_Outline_GetOutsideBorder
+  FT_Outline_Get_BBox
   FT_Outline_Get_Bitmap
   FT_Outline_Get_Bitmap
+  FT_Outline_Get_CBox
+  FT_Outline_Get_Orientation
+  FT_Outline_New
+  FT_Outline_New_Internal
+  FT_Outline_Render
+  FT_Outline_Reverse
   FT_Outline_Transform
   FT_Outline_Translate
   FT_Outline_Transform
   FT_Outline_Translate
+  FT_Remove_Module
+  FT_Render_Glyph
+  FT_Request_Size
+  FT_RoundFix
+  FT_Select_Charmap
+  FT_Select_Size
+  FT_Set_Char_Size
   FT_Set_Charmap
   FT_Set_Charmap
+  FT_Set_Debug_Hook
+  FT_Set_MM_Blend_Coordinates
+  FT_Set_MM_Design_Coordinates
   FT_Set_Pixel_Sizes
   FT_Set_Pixel_Sizes
+  FT_Set_Renderer
+  FT_Set_Transform
+  FT_Set_Var_Blend_Coordinates
+  FT_Set_Var_Design_Coordinates
+  FT_Sfnt_Table_Info
+  FT_Sin
+  FT_Stream_OpenGzip
+  FT_Stream_OpenLZW
+  FT_Stroker_BeginSubPath
+  FT_Stroker_ConicTo
+  FT_Stroker_CubicTo
+  FT_Stroker_Done
+  FT_Stroker_EndSubPath
+  FT_Stroker_Export
+  FT_Stroker_ExportBorder
+  FT_Stroker_GetBorderCounts
+  FT_Stroker_GetCounts
+  FT_Stroker_LineTo
+  FT_Stroker_New
+  FT_Stroker_ParseOutline
+  FT_Stroker_Rewind
+  FT_Stroker_Set
+  FT_Tan
+  FT_TrueTypeGX_Free
+  FT_TrueTypeGX_Validate
+  FT_Vector_From_Polar
+  FT_Vector_Length
+  FT_Vector_Polarize
+  FT_Vector_Rotate
   FT_Vector_Transform
   FT_Vector_Unit
   FT_Vector_Transform
   FT_Vector_Unit
-  FT_Set_Transform
index 00ec67f..f37ab32 100644 (file)
@@ -3,6 +3,6 @@
 #define REACTOS_STR_INTERNAL_NAME      "freetype\0"
 #define REACTOS_STR_ORIGINAL_FILENAME  "freetype.dll\0"
 #define REACTOS_STR_COMPANY_NAME       "ReactOS Development Team/FreeType Team\0"
 #define REACTOS_STR_INTERNAL_NAME      "freetype\0"
 #define REACTOS_STR_ORIGINAL_FILENAME  "freetype.dll\0"
 #define REACTOS_STR_COMPANY_NAME       "ReactOS Development Team/FreeType Team\0"
-#define REACTOS_STR_LEGAL_COPYRIGHT    "Copyright 1998-2007 ReactOS Team\0"
-#define REACTOS_STR_ORIGINAL_COPYRIGHT "Copyright 1996-2007 FreeType Team\0"
+#define REACTOS_STR_LEGAL_COPYRIGHT    "Copyright 1998-2011 ReactOS Team\0"
+#define REACTOS_STR_ORIGINAL_COPYRIGHT "Copyright 1996-2013 FreeType Team\0"
 #include <reactos/version.rc>
 #include <reactos/version.rc>
index a6a4674..f4178ef 100644 (file)
-
- @ cdecl FT_Bitmap_Convert()
- @ cdecl FT_Bitmap_Done()
- @ cdecl FT_Bitmap_New()
- @ cdecl FT_Done_Face()
- @ cdecl FT_Done_Glyph()
- @ cdecl FT_Get_Char_Index()
- @ cdecl FT_Get_First_Char()
- @ cdecl FT_Get_Glyph()
- @ cdecl FT_Get_Kerning()
- @ cdecl FT_Get_Next_Char()
- @ cdecl FT_Get_PS_Font_Info()
- @ cdecl FT_Get_Sfnt_Table()
- @ cdecl FT_Get_WinFNT_Header()
- @ cdecl FT_Glyph_To_Bitmap()
- @ cdecl FT_Init_FreeType()
- @ cdecl FT_Load_Glyph()
- @ cdecl FT_Load_Sfnt_Table()
- @ cdecl FT_Matrix_Multiply()
- @ cdecl FT_MulFix()
- @ cdecl FT_New_Memory_Face()
- @ cdecl FT_Outline_Get_Bitmap()
- @ cdecl FT_Outline_Transform()
- @ cdecl FT_Outline_Translate()
- @ cdecl FT_Set_Charmap()
- @ cdecl FT_Set_Pixel_Sizes()
- @ cdecl FT_Vector_Transform()
- @ cdecl FT_Vector_Unit()
- @ cdecl FT_Set_Transform()
+  @ cdecl FT_Activate_Size ()
+  @ cdecl FT_Add_Default_Modules ()
+  @ cdecl FT_Add_Module ()
+  @ cdecl FT_Angle_Diff ()
+  @ cdecl FT_Atan2 ()
+  @ cdecl FT_Attach_File ()
+  @ cdecl FT_Attach_Stream ()
+  @ cdecl FT_Bitmap_Convert ()
+  @ cdecl FT_Bitmap_Copy ()
+  @ cdecl FT_Bitmap_Done ()
+  @ cdecl FT_Bitmap_Embolden ()
+  @ cdecl FT_Bitmap_New ()
+  @ cdecl FT_CeilFix ()
+  @ cdecl FT_ClassicKern_Free ()
+  @ cdecl FT_ClassicKern_Validate ()
+  @ cdecl FT_Cos ()
+  @ cdecl FT_DivFix ()
+  @ cdecl FT_Done_Face ()
+  @ cdecl FT_Done_FreeType ()
+  @ cdecl FT_Done_Glyph ()
+  @ cdecl FT_Done_Library ()
+  @ cdecl FT_Done_Size ()
+  @ cdecl FT_Face_CheckTrueTypePatents ()
+  @ cdecl FT_Face_SetUnpatentedHinting ()
+  @ cdecl FT_FloorFix ()
+  @ cdecl FT_Get_CMap_Format ()
+  @ cdecl FT_Get_CMap_Language_ID ()
+  @ cdecl FT_Get_Char_Index ()
+  @ cdecl FT_Get_Charmap_Index ()
+  @ cdecl FT_Get_First_Char ()
+  @ cdecl FT_Get_Glyph ()
+  @ cdecl FT_Get_Glyph_Name ()
+  @ cdecl FT_Get_Kerning ()
+  @ cdecl FT_Get_MM_Var ()
+  @ cdecl FT_Get_Module ()
+  @ cdecl FT_Get_Multi_Master ()
+  @ cdecl FT_Get_Name_Index ()
+  @ cdecl FT_Get_Next_Char ()
+  @ cdecl FT_Get_PFR_Advance ()
+  @ cdecl FT_Get_PFR_Kerning ()
+  @ cdecl FT_Get_PFR_Metrics ()
+  @ cdecl FT_Get_PS_Font_Info ()
+  @ cdecl FT_Get_PS_Font_Private ()
+  @ cdecl FT_Get_Postscript_Name ()
+  @ cdecl FT_Get_Renderer ()
+  @ cdecl FT_Get_Sfnt_Name ()
+  @ cdecl FT_Get_Sfnt_Name_Count ()
+  @ cdecl FT_Get_Sfnt_Table ()
+  @ cdecl FT_Get_SubGlyph_Info ()
+  @ cdecl FT_Get_Track_Kerning ()
+  @ cdecl FT_Get_TrueType_Engine_Type ()
+  @ cdecl FT_Get_WinFNT_Header ()
+  @ cdecl FT_GlyphSlot_Embolden ()
+  @ cdecl FT_GlyphSlot_Oblique ()
+  @ cdecl FT_GlyphSlot_Own_Bitmap ()
+  @ cdecl FT_Glyph_Copy ()
+  @ cdecl FT_Glyph_Get_CBox ()
+  @ cdecl FT_Glyph_Stroke ()
+  @ cdecl FT_Glyph_StrokeBorder ()
+  @ cdecl FT_Glyph_To_Bitmap ()
+  @ cdecl FT_Glyph_Transform ()
+  @ cdecl FT_Has_PS_Glyph_Names ()
+  @ cdecl FT_Init_FreeType ()
+  @ cdecl FT_Library_Version ()
+  @ cdecl FT_List_Add ()
+  @ cdecl FT_List_Finalize ()
+  @ cdecl FT_List_Find ()
+  @ cdecl FT_List_Insert ()
+  @ cdecl FT_List_Iterate ()
+  @ cdecl FT_List_Remove ()
+  @ cdecl FT_List_Up ()
+  @ cdecl FT_Load_Char ()
+  @ cdecl FT_Load_Glyph ()
+  @ cdecl FT_Load_Sfnt_Table ()
+  @ cdecl FT_Matrix_Invert ()
+  @ cdecl FT_Matrix_Multiply ()
+  @ cdecl FT_MulDiv ()
+  @ cdecl FT_MulFix ()
+  @ cdecl FT_New_Face ()
+  @ cdecl FT_New_Library ()
+  @ cdecl FT_New_Memory_Face ()
+  @ cdecl FT_New_Size ()
+  @ cdecl FT_OpenType_Free ()
+  @ cdecl FT_OpenType_Validate ()
+  @ cdecl FT_Open_Face ()
+  @ cdecl FT_Outline_Check ()
+  @ cdecl FT_Outline_Copy ()
+  @ cdecl FT_Outline_Decompose ()
+  @ cdecl FT_Outline_Done ()
+  @ cdecl FT_Outline_Done_Internal ()
+  @ cdecl FT_Outline_Embolden ()
+  @ cdecl FT_Outline_GetInsideBorder ()
+  @ cdecl FT_Outline_GetOutsideBorder ()
+  @ cdecl FT_Outline_Get_BBox ()
+  @ cdecl FT_Outline_Get_Bitmap ()
+  @ cdecl FT_Outline_Get_CBox ()
+  @ cdecl FT_Outline_Get_Orientation ()
+  @ cdecl FT_Outline_New ()
+  @ cdecl FT_Outline_New_Internal ()
+  @ cdecl FT_Outline_Render ()
+  @ cdecl FT_Outline_Reverse ()
+  @ cdecl FT_Outline_Transform ()
+  @ cdecl FT_Outline_Translate ()
+  @ cdecl FT_Remove_Module ()
+  @ cdecl FT_Render_Glyph ()
+  @ cdecl FT_Request_Size ()
+  @ cdecl FT_RoundFix ()
+  @ cdecl FT_Select_Charmap ()
+  @ cdecl FT_Select_Size ()
+  @ cdecl FT_Set_Char_Size ()
+  @ cdecl FT_Set_Charmap ()
+  @ cdecl FT_Set_Debug_Hook ()
+  @ cdecl FT_Set_MM_Blend_Coordinates ()
+  @ cdecl FT_Set_MM_Design_Coordinates ()
+  @ cdecl FT_Set_Pixel_Sizes ()
+  @ cdecl FT_Set_Renderer ()
+  @ cdecl FT_Set_Transform ()
+  @ cdecl FT_Set_Var_Blend_Coordinates ()
+  @ cdecl FT_Set_Var_Design_Coordinates ()
+  @ cdecl FT_Sfnt_Table_Info ()
+  @ cdecl FT_Sin ()
+  @ cdecl FT_Stream_OpenGzip ()
+  @ cdecl FT_Stream_OpenLZW ()
+  @ cdecl FT_Stroker_BeginSubPath ()
+  @ cdecl FT_Stroker_ConicTo ()
+  @ cdecl FT_Stroker_CubicTo ()
+  @ cdecl FT_Stroker_Done ()
+  @ cdecl FT_Stroker_EndSubPath ()
+  @ cdecl FT_Stroker_Export ()
+  @ cdecl FT_Stroker_ExportBorder ()
+  @ cdecl FT_Stroker_GetBorderCounts ()
+  @ cdecl FT_Stroker_GetCounts ()
+  @ cdecl FT_Stroker_LineTo ()
+  @ cdecl FT_Stroker_New ()
+  @ cdecl FT_Stroker_ParseOutline ()
+  @ cdecl FT_Stroker_Rewind ()
+  @ cdecl FT_Stroker_Set ()
+  @ cdecl FT_Tan ()
+  @ cdecl FT_TrueTypeGX_Free ()
+  @ cdecl FT_TrueTypeGX_Validate ()
+  @ cdecl FT_Vector_From_Polar ()
+  @ cdecl FT_Vector_Length ()
+  @ cdecl FT_Vector_Polarize ()
+  @ cdecl FT_Vector_Rotate ()
+  @ cdecl FT_Vector_Transform ()
+  @ cdecl FT_Vector_Unit ()
\ No newline at end of file